[FFmpeg-user] gain the highest quality with H264 at a certain bit rate

chronek chronek at interia.eu
Mon Mar 27 18:52:02 EEST 2017


So you set own x264opts then you use preset slow what rewrite x264opts..

If you reencode h264 with downsacale try with minimal settings like:


ffmpeg -y -i in.mp4 -vf 
pp=va/ha,scale=1280:720:flags=spline+full_chroma_inp+full_chroma_int+accurate_rnd+bitexact,setsar=1 
-an -c:v libx264 -preset veryslow -b:v 2048k -pass 1 /dev/null

ffmpeg -y -i in.mp4 -vf 
pp=va/ha,scale=1280:720:flags=spline+full_chroma_inp+full_chroma_int+accurate_rnd+bitexact,setsar=1 
-c:a aac -b:a 128k -c:v libx264 -preset veryslow -b:v 2048k -pass 2 out.mp4


Btw. i found that sometimes better is using crf than constant bitrate 
(use something like -crf 22 instead with single pass) you could 
unsharp=7:7:0.5:7:7:0.5 before scale and if you compile ffmpeg try with 
-fno-fast-math


W dniu 2017-03-27 o 14:21, negin tebyani pisze:
> I have encoded my videos using ffmpeg and H264, and this is my ffmpeg
> command (2 pass encoding):
>
> ffmpeg -y -i Edited\ Clips/arsenalVScristalPalas.mp4 -movflags faststart
> -c:v libx264 -x264opts
> 'keyint=300:min-keyint=25:8x8dct:sliced-threads=0:subq=6' -deblock 0:0
> -flags +loop -preset slow -tune zerolatency -b:v 2048k -maxrate 2048k
> -bufsize 3000k -vf "scale=-1280:720" -pass 1 -acodec libmp3lame -b:a 128k
> -coder 1 -me_range 16 -sc_threshold 42 -bf 10 -qmin 0 -qmax 51 -trellis 2
>



More information about the ffmpeg-user mailing list