Hi all.
I have a MP4 video (shooted with my cellphone, sample here : http://dl.free.fr/nZfX9N1J2).
Video stream is MPEG-4 Visual ; Bit rate mode :Variable ; Frame rate mode : Variable ; Duration : 15s 924ms
Audio stream is AAC ; Bit rate mode : Constant ; Duration : 16s 0ms
(You can see that the video stream is shorter than the audio stream).
The file play perfectly with mplayer without any a/v issue.
I want to convert this video to a DVD-PAL MPEG file (720x576@25fps). I tried a lot of combination with MENCODER, and I failed to produce a correct video. Dependinf of the parameters in the command line, I got almost all combination of A/V desync : faster video (5s duration), longer video (19s instead of 16) etc...
I browse the mencoder mailing list and a lot of forum, but i coulnd find any solution to convert a variable framerate video.
I want to use mencoder instead of ffmepg because I want to hard include subtitle in the video (ffmepg do not have option to include subtitle in the video stream).
Any suggestion ?
+ Reply to Thread
Results 1 to 4 of 4
-
-
After a lot of tests, my result is that mencoder is not good for converting variable framerate MP4 files to MPEG. It always results an audio delay, so I use ffmpeg instead.
Concerning the subtitles, in fact I only need to hard-incrust a small text in the first seconds of the video (it is the date/time of footage), and the "drawtext" video filter of ffmpeg can be used.
Also, the input videos have different aspect/ratio (16:9, 4:3, 5:4, 1.222... depending of the source) so I have to use the size/crop filter to expand the video to 720:576 (pal dvd).
Here the command line I use :
Code:ffmpeg y -i INPUT.MP4 -target pal-dvd -ac 2 -sample_fmt flt -ab 192k -aspect 16:9 -shortest -vf %vf% OUTPUT.MPG
Note1 : It create a 720x576 mpeg with stereo AC3 audio @192kbps.
%vf% is the videofilter used to expand the video and to incrust a text for the 2 first seconds of the vid :
Note2 : I do not use the "-sameq" params, because it slow down the conversion to 4/5 fps. When testing my conversion chain, I add "-b 1000 -t 3" to speed up the process in a kind of "preview mode".
for example, to expand from a 4:3 vid it isCode:scale=540:576,pad=720:576:(ow-iw)/2:0:black
Code:,drawtext="fontfile=arial.ttf:text='2011-31-12 12\:34':y=h-line_h-60:x='60-1024*gt(t,2)':fontsize=50:fontcolor=white:shadowx=2"
- it scans a folder for all MP4/3GP video
- convert them to pal-dvd MPEG file, add black borders (vert or horz) depending of the aspect ratio and the video size
- merge all this mpeg clip into a single mpeg file (by using mencoder) -
This is a bit late as you've already found a solution with ffmpeg. But did you try adding 'harddup' to the end of the mencoder filter chain?
http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-vcd-dvd.html#menc-feat-vcd-dvd-a-v-sync -
Thanks for your help, but "harddup" do not help : for variable framerate video, I still have A/V desync.
I tried harddup, mc 0, mc 3, nodrop etc...
Similar Threads
-
Using mencoder to join mpeg video result in a/v out of sync.
By Jemore in forum EditingReplies: 3Last Post: 18th Jan 2012, 02:02 -
Audio out of Sync on webserver encode using mencoder
By misterio in forum Video ConversionReplies: 2Last Post: 28th Nov 2008, 01:20 -
mencoder encode setting
By VirtualDoobMon in forum Video ConversionReplies: 1Last Post: 12th Apr 2008, 00:01 -
Low framerate after BD encode
By h41cyon in forum Blu-ray RippingReplies: 3Last Post: 24th Mar 2008, 00:34 -
Can't encode file with audio with Mencoder
By ApplePro in forum Video ConversionReplies: 8Last Post: 12th Feb 2008, 06:38