Exemple #1
0
def play(fnames, framerate=12):
    info = SWFInfo()
    info.framerate = framerate
    movie = MovieContainer(info)
    for fname in fnames:
        print 'Reading:', fname
        if fname.endswith('.swf'):
            # vnc2swf file
            movie.parse_vnc2swf(fname)
        elif fname.endswith('.vnc'):
            # vncrec file
            movie.parse_vncrec(fname)
    player = PygameMoviePlayer(movie)
    player.play()
    return
Exemple #2
0
def play(moviefiles, info, debug=0):
  movie = MovieContainer(info)
  for fname in moviefiles:
    if fname.endswith('.swf'):
      # vnc2swf file
      movie.parse_vnc2swf(fname, True, debug=debug)
    elif fname.endswith('.flv'):
      # flv file
      movie.parse_flv(fname, True, debug=debug)
    elif fname.endswith('.vnc'):
      # vncrec file
      movie.parse_vncrec(fname, debug=debug)
    else:
      raise ValueError('unsupported format: %r' % fname)
    info.filename = os.path.basename(fname)
  PygameMoviePlayer(movie, debug=debug).play()
  return
Exemple #3
0
def reorganize(info, moviefiles,
               range_str='-', step=1,
               is_video=False, kfinterval=0, 
               mp3seek=True, mp3skip=0):
  movie = MovieContainer(info)
  if is_video:
    stream = SWFVideoStream(info)
  else:
    stream = SWFShapeStream(info)
  for fname in moviefiles:
    if fname.endswith('.swf'):
      # vnc2swf file
      movie.parse_vnc2swf(fname, True)
    elif fname.endswith('.vnc'):
      # vncrec file
      movie.parse_vncrec(fname)
  r = range2list(range_str, 0, movie.nframes-1, step)
  if movie.info.mp3:
    movie.info.mp3.set_initial_skip(mp3skip)
  builder = MovieBuilder(movie, stream, mp3seek=mp3seek, kfinterval=kfinterval)
  builder.build(r)
  info.generate_html()
  return