VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. Hello,

    I have a source video mpeg4 9000kb/s

    I try different convertion with ffmpeg 0.11.x (build of 7 sep 2012), but I wonder if there is a bug or for libx264 ffmpeg ignores the options.

    Indeed, with this command
    ffmpeg -i "2012-03 01Praha.MP4" -acodec copy -vcodec wmv2 -q:v 8 out.avi
    The dos shell outputs q=8, also if I use video codec h263p.

    Now, the same command, but with video codec libx264, viz
    ffmpeg -i "2012-03 01Praha.MP4" -acodec copy -vcodec libx264 -q:v 8 out.avi
    The shell outputs q=29

    So does ffmpeg discard the quality option with video codec libx264 or libschroedinger ?

    Well, there is a workaround with -b:v options, but I just want to understand.
    ffmpeg -i "2012-03 01Praha.MP4" -acodec copy -vcodec libx264 -b:v 823K outVB.avi
    P.S.
    ffmpeg -h encoder=libx264
    does not give a clue for that
    Last edited by feelart; 19th Sep 2012 at 05:00.
    Quote Quote  
  2. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by feelart View Post
    So does ffmpeg discard the quality option with video codec libx264 ?
    Hi
    q:v is not used with FFmpeg x264.
    crf is used instead.
    Range 0-69
    crf 0 is lossless.
    crf 69 is worst.

    Also use a preset...
    ultrafast
    superfast
    veryfast
    faster
    fast
    medium
    slow
    slower
    veryslow

    (veryslow makes smallest file size, ultrafast makes largest file size)

    Not good to use avi with x264.
    mp4 or mkv is preferred.


    Code:
    ffmpeg -i "2012-03 01Praha.MP4" -c:v libx264 -crf 23 -preset medium -c:a copy output.mp4
    Use "-t 60" to make a 60 second sample.
    Then change "crf" and "preset" values to suit.

    Code:
    ffmpeg -i "2012-03 01Praha.MP4" -t 60 -c:v libx264 -crf 23 -preset medium -c:a copy output.mp4
    There are some different ways to use FFmpeg x264, more information is here ---> http://ffmpeg.org/ffmpeg.html#libx264
    Quote Quote  
  3. Member
    Join Date
    Feb 2008
    Location
    United States
    Search Comp PM
    The lower the CRF, the higher the bitrate, higher quality. The higher the CRF, the lower the bitrate, lower quality. The presets specify encoding speed and to some extent quality, not file size. CRF / bitrate value used determines file size.
    Quote Quote  
  4. RE: http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide

    Thanks I made some test and I wonder the difference between -b:v and -cfr
    It seems that there are equal at equivalent bit rate & same preset.

    I tried the following on my Core5 2450M (2.5GHz) with the 64bits ffmpeg version:
    ffmpeg -i "2012-03 01Praha.MP4" -c:v libx264 -crf 30 -preset veryslow -c:a copy ox264_veryslow30.mp4
    encoding time 15min30 (492kps)

    ffmpeg -i "2012-03 01Praha.MP4" -c:v libx264 -crf 30 -preset ultrafast -c:a copy ox264_ultrafast30.mp4
    encoding time 30 sec (1290 kbps)

    ffmpeg -i "2012-03 01Praha.MP4" -c:v libx264 -b:v 1290k -c:a copy ox264_bv1290.mp4
    encoding time 3min56

    ffmpeg -i "2012-03 01Praha.MP4" -c:v libx264 -b:v 1290k -preset ultrafast -c:a copy ox264_bv1290ultrafast.mp4
    encoding time 30sec
    ox264_bv1290ultrafast and ox264_ultrafast30 are about the same size and visualy the same, while ox264_bv1290 is also about the same size, but visually better.

    Source : 243Mb, HD Ready, mpeg4 9000kb/s, 3min46
    Output file size:
    38.754.204 ox264_bv1290.mp4
    38.830.130 ox264_bv1290ultrafast.mp4
    38.420.954 ox264_ultrafast30.mp4
    15.925.175 ox264_veryslow30.mp4

    P.S. Regarding preset, no preset -> medium preset, indeed,
    ffmpeg -i "2012-03 01Praha.MP4" -c:v libx264 -b:v 1290k -c:a copy ox264_bv1290.mp4
    is MD5 equivalent to
    ffmpeg -i "2012-03 01Praha.MP4" -c:v libx264 -b:v 1290k -preset medium -c:a copy ox264_bv1290Medium.mp4
    Last edited by feelart; 20th Sep 2012 at 03:12.
    Quote Quote  



Similar Threads

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