VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. Member
    Join Date
    Dec 2011
    Location
    Paris, FR
    Search PM
    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 ?
    Quote Quote  
  2. Member
    Join Date
    Dec 2011
    Location
    Paris, FR
    Search PM
    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.
    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".
    %vf% is the videofilter used to expand the video and to incrust a text for the 2 first seconds of the vid :
    for example, to expand from a 4:3 vid it is
    Code:
    scale=540:576,pad=720:576:(ow-iw)/2:0:black
    and to add text, I append to the videofilter : (add a , at the beginning to separate from the previous filter )
    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"
    I have create a single PHP script that do all the process for me :
    - 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)
    Quote Quote  
  3. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    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
    Quote Quote  
  4. Member
    Join Date
    Dec 2011
    Location
    Paris, FR
    Search PM
    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...
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!