[FFmpeg-user] New options -preset and -tune for x264 encoding

Klaus Kudielka klaus.kudielka at gmx.net
Sun Apr 24 15:10:09 CEST 2011


On Sun, Apr 24, 2011 at 09:41:38PM +0930, Rodney Baker wrote:
> 
> Use -profile high -level 4.0 and it should set the parameters correctly.

Unfortunately not. Look at the libx264 output below.
It complains that DPB size > level limit, but does not correct the number of reference frames (ref=8).

Looking at x264/encoder/set.c, this is the behaviour of x264_validate_levels, as it is.
Specifying -level only validates the level, but does not enforce it.

/opt/ffmpeg/bin/ffmpeg -i in.m2ts -threads 0 -map 0.0 -vcodec libx264 -b 8000k -maxrate 12000k -bufsize 25000k -preset slower -tune film -profile high -level 4.1 -pass 2 -map 0.1 -acodec ac3 -ac 2 -ab 192k -alang eng -sn -f matroska -y out.mkv -map 0.5 -acodec ac3 -ac 2 -ab 192k -alang ger -newaudio
FFmpeg version UNKNOWN, Copyright (c) 2000-2011 the FFmpeg developers
  built on Apr 23 2011 14:07:36 with gcc 4.4.3
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-pthreads --prefix=/opt/ffmpeg --extra-cflags=-I/opt/x264/include --extra-ldflags=-L/opt/x264/lib
  libavutil    51.  0. 0 / 51.  0. 0
  libavcodec   53.  1. 0 / 53.  1. 0
  libavformat  53.  0. 1 / 53.  0. 1
  libavdevice  53.  0. 0 / 53.  0. 0
  libavfilter   2.  0. 0 /  2.  0. 0
  libswscale    0. 13. 0 /  0. 13. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, mpegts, from 'in.m2ts':
  Duration: 02:28:51.67, start: 11.650667, bitrate: 22336 kb/s
  Program 1 
    Stream #0.0[0x1011]: Video: vc1 (Advanced), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 23.98 tbc

[[...audio & subtitle streams...]]

[buffer @ 0x2ee3f20] w:1920 h:1080 pixfmt:yuv420p
[libx264 @ 0x2ec40a0] using SAR=1/1
[libx264 @ 0x2ec40a0] DPB size (8 frames, 25067520 bytes) > level limit (4 frames, 12582912 bytes)
[libx264 @ 0x2ec40a0] using cpu capabilities: MMX2 SSE2Fast FastShuffle SSEMisalign LZCNT
[libx264 @ 0x2ec40a0] profile High, level 4.1
[libx264 @ 0x2ec40a0] 264 - core 114 - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=1 ref=8 deblock=1:-1:-1 analyse=0x3:0x133 me=umh subme=9 psy=1 psy_rd=1.00:0.15 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-3 threads=6 sliced_threads=0 nr=0 decimate=1 interlaced=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=2pass mbtree=1 bitrate=8000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 cplxblur=20.0 qblur=0.5 vbv_maxrate=12000 vbv_bufsize=25000 nal_hrd=none ip_ratio=1.40 aq=1:1.00




More information about the ffmpeg-user mailing list