FFmpegでのBDAV向けh.264の例

 備忘用メモ。音声までは再エンコードしない(動画に比べて容量が大したことがない)。音ズレするならdecimateしないで30pにするのも手か。

ソースが1920x1080 pxの場合

ffmpeg -i in.ts -vf bwdif=0:-1:1,decimate,removelogo=logo.png -acodec copy -async 1000 -pix_fmt yuv420p -vcodec libx264 -tune film -x264opts "nal-hrd=vbr:aud:colorprim=bt709:transfer=bt709:colormatrix=bt709:sar=1/1:weightp=0:b-pyramid=strict:slices=4:bframes=3:keyint=24:vbv-maxrate=40000:vbv-bufsize=30000:ref=4:level=4.1" out.m2ts

ソースが1440x1080 pxで画面アスペクト比が16:9の場合

ffmpeg -i in.ts -vf bwdif=0:-1:1,decimate,removelogo=logo.png -acodec copy -async 1000 -pix_fmt yuv420p -vcodec libx264 -tune film -x264opts "nal-hrd=vbr:aud:colorprim=bt709:transfer=bt709:colormatrix=bt709:sar=4/3:weightp=0:b-pyramid=strict:slices=4:bframes=3:keyint=24:vbv-maxrate=40000:vbv-bufsize=30000:ref=4:level=4.1" out.m2ts

ソースがSDの場合

 画面アスペクト比が16:9だとSARが32/27になり、最大refが6になる。

ffmpeg -i in.ts -vf bwdif=0:-1:1,decimate,removelogo=logo.png -acodec copy -async 1000 -pix_fmt yuv420p -vcodec libx264 -tune animation -x264opts "nal-hrd=vbr:aud:colorprim=bt709:transfer=bt709:colormatrix=bt709:sar=32/27:weightp=0:b-pyramid=strict:slices=4:bframes=3:keyint=24:vbv-maxrate=40000:vbv-bufsize=30000:ref=6:level=4.1" out.ts