This ffmpeg script is using flags to optimize performance, hardware acceleration, quality and file size. I believe that these settings produce a highly optimized & balanced video with great visual clarity, while staying quite small in file size.
I have also added some flags like -g 30 -strict_gop 1 -forced-idr 1
, which will make sure that the output video has regular I(DR) frames for improved scrubbing.
This is useful when you are running a media server like Jellyfin or Plex, so you are able to start a decode stream more reliably (without having to backtrace to the last I-frame as much)
replace the
<input>
and<output>
with your respective in- and outputpath/to/file
s.