[MPlayer-users] mpeg2->divx

Jason Lunz j at falooley.org
Thu Oct 18 18:58:04 CEST 2001

arpi at thot.banki.hu said:
> now, my question: how to handle these when converting to fixed-fps format
> like divx avi files? i can imagine duplicating flagged frames, but mpeg2
> allows half frame times too (displaying a flagged frame for 2.5 * frame
> time). maybe if i duplicate fps and duplicate each non-flagged frame?
> or non-integer frame times are only in interlaced files, which are
> de-interlaced first?

Have you looked at the new algorithm in transcode? transcode 0.5.0-pre5
has this in the changelog:

- new option "-M mode" that controls the processing of program
  streams handled by "tcdemux". 

  mode=0: pass-through, do not mess with the stream, switch off
	  any synchronization/demuxing process. 
  mode=1: (default mode) Synchronize video and audio by inspecting
	  PTS/DTS time stamps of audio and video and dump to stdout
	  depending on the selected payload.
	  Preferred mode for PAL VOB streams and DVDs.
  mode=2: new very experimental (=alpha) NTSC VOB stream synchronization 
	  feature. This mode generates synchronization information for 
	  transcode by analyzing the frame display time. As a result, 
	  a strict frame rate will be enforced, which matches the audio and
	  has to be provided by the user with option "-f".
	  Do not expect this mode to work!!!!! Use chapter mode for DVD's
	  for testing. Occasional encoding lock-ups still have to be resolved. 

The -pre6 version adds this:

- hidden debug mode "-q 128" for interested users prints out some 
  information on the synchronization process with option "-M 2":
  Displayed are:
  (1) total stream frame number (as encoded in the stream) 
  (2) current MPEG sequence number
  (3) total number of frames dropped (<0) or cloned (>0) so far
  (4) current AV sync delay with respect to provided "-f" frame rate
  (5) current PTS based frame rate / provided fps ratio  
  (6) current MPEG sequence header PTS 

  What can you expect: 
  If your provided frame rate "-f" is OK, the calculated fps ratio (5)
  should go to 1 and the total number of frames dropped/cloned should stay 
  constant at some point. The AV sync delay will always be close to 0, 
  if the algorithm can adjust within its given limits, e.g., a sequence
  can only drop every second frame. Play around by varying "-f".
  You will find that PAL program streams are "encoded" at a constant
  frame display time of 0.04 seconds, correspoding to 25 fps.
  Note for NTSC "users": In order to obtain relaiable results, decode well 
  into the actal movie, since trailer and list of cast may be encoded
  at different speeds. Example: "Highlander I".

and in -pre7:

- changes in the frame drop/clone decision alogorithm "-M 2" to prevent 
  small amplitude fluctuations of +1/-1 frames to be corrected. 
  Some people reported jerky playback.

The upcoming -pre8 has even more changes to the NTSC vob -M2 mode.
Looking at what he's done might give you some ideas.


More information about the MPlayer-users mailing list