输出运行时间、内存等信息
mac 开栈
g++ a.cpp -o a -Wl,-stack_size,0x10000000/bin/time -f "%M KB\nUser %Us\nElapsed %es"
# or simpler
/bin/time -vH.265 重新编码
# to add audio: -c:a copy instead of -an
# crf defaults to 28
# AVX512 offers marginal speedup, veryfast ~15% speedup
# SMT offers substantial speedup. Don't bind cores.
# Speed on AMD Zen5 9900X: 4K30p 44fps
ffmpeg -i $input -c:v libx265 -x265-params asm=avx512 -preset fast -crf 29 -tag:v hvc1 -an $output新版:
ffmpeg -y -i $INPUT \
-map 0:v:0 -map 0:a? \
-vf "setparams=range=tv:color_primaries=bt709:color_trc=bt709:colorspace=bt709,format=yuv420p" \
-c:v libx265 -preset medium -crf 21 \
-profile:v main -tag:v hvc1 \
-x265-params "colorprim=bt709:transfer=bt709:colormatrix=bt709:range=limited:chromaloc=0:repeat-headers=1:aud=1:keyint=60:min-keyint=1:asm=avx512" \
-color_primaries bt709 -color_trc bt709 -colorspace bt709 -color_range tv \
-c:a copy \
-movflags +faststart \
$OUTPUT