[MEncoder-users] Correcting a mis-captured video

Tim Mann tim at tim-mann.org
Tue Feb 18 07:58:13 CET 2014

Hi, folks. I am trying to solve a problem for a friend, and trying to
figure out whether I can use mplayer/mencoder to do it -- or use
something else available on Linux to do it, for that matter.

My friend has some old home movies that were recorded at 18 fps. She
took them to a service that captures movies and records them to DVD.
The service played the movies at 24 fps while capturing them, so they
came out with the motion too fast and the audio too high-pitched.

If I play the .VOB files from the DVD with the following command, they
play with apparently the right speed and audio pitch:

mplayer -af scaletempo=speed=both -speed 0.75 VTS_01_1.VOB

I am now trying to figure out if there is a way to re-encode to DVD at
the corrected speed. So far I am not guessing the right command line
to mencoder -- if there is one. This is the closest I've gotten so
far, based on rather blindly gluing together the above mplayer options
with suggested mencoder options for producing DVD-compliant mpgs from

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
  -vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 \
  -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\
keyint=18:vstrict=0:acodec=ac3:abitrate=192:aspect=4/3 -ofps 30000/1001 \
  -o /tmp/test.mpg VTS_01_1.VOB -af scaletempo=speed=both -speed 0.75

This produces an .mpg file where the audio plays correctly, but the
video is still too fast. There are also a ton of messages about
duplicate frames and invalid timestamps. (See below.)

I did some reading in the documentation and tried a few more things
after that, but nothing worked. Any suggestions? Things I already
tried included adding the option -fps 40000/1001 and adding
filmdint=io=3:4 in the -vf chain.

(BTW, as the next step after I get this somewhat working: I realize
that the file I already have was converted by the service from 24 to
30 fps, so to get the best looking results it might be necessary to
deinterlace it to get the original frames back, and then do an 18 ->
30 conversion. Maybe pulldown followed by filmdint=io=3:5 would be the
right idea...??)

Output from the above command:

MEncoder svn r34540 (Ubuntu), built with gcc-4.7 (C) 2000-2012 MPlayer Team
success: format: 0  data: 0x0 - 0x3e83d800
libavformat version 53.21.1 (external)
Mismatching header version 53.19.0
MPEG-PS file format detected.
VIDEO:  MPEG2  720x480  (aspect 2)  29.970 fps  8500.0 kbps (1062.5 kbyte/s)
[V] filefmt:2  fourcc:0x10000002  size:720x480  fps:29.970  ftime:=0.0334
Requested audio codec family [mpg123] (afm=mpg123) not available.
Enable it at compilation.
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
AUDIO: 48000 Hz, 2 ch, floatle, 224.0 kbit/7.29% (ratio: 28000->384000)
Selected audio codec: [ffmp2float] afm: ffmpeg (FFmpeg MPEG layer-1
and layer-2 audio)
PACKET SIZE: 2048 bytes, deltascr: 43885
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [harddup]
Opening video filter: [scale w=720 h=480]
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2)
[ac3 @ 0x7f4c7f47a300]channel_layout not specified
[ac3 @ 0x7f4c7f47a300]No channel layout specified. The encoder will
guess the layout, but it might be incorrect.
Limiting audio preload to 0.4s.
Increasing audio density to 4.
Unsupported PixelFormat 61
Unsupported PixelFormat 53
Unsupported PixelFormat 81
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
[swscaler @ 0x7f4c7ff56640]using unscaled yuv420p -> yuv420p special converter
videocodec: libavcodec (720x480 fourcc=3267706d [mpg2])
Pos:   0.0s      1f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
Writing header...
INITV: 0.200, 0.167, fps: 29.970

1 duplicate frame(s)!
[mpeg2video @ 0x7f4c7f47a300]Error, Invalid timestamp=1, last=1
Pos:   0.0s      2f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.003 [0:0]

1 duplicate frame(s)!
[mpeg2video @ 0x7f4c7f47a300]Error, Invalid timestamp=3, last=4
Pos:   0.3s      5f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.010 [0:0]

More information about the MEncoder-users mailing list