Skip to content

Instantly share code, notes, and snippets.

@kiyoon
Created December 30, 2019 00:39
Show Gist options
  • Save kiyoon/6629408c68cb5539b819514b7adff5eb to your computer and use it in GitHub Desktop.
Save kiyoon/6629408c68cb5539b819514b7adff5eb to your computer and use it in GitHub Desktop.
Compress a video file (specifically produced from Canon M50) using ffmpeg and NVIDIA hardware acceleration. Note that if colour settings are not specified, some players may use a limited colour range and display wrong colour.
ffmpeg -hwaccel cuvid -c:v h264_cuvid -i <input.MP4> -c:v h264_nvenc -rc:v vbr_hq -cq:v 19 -b:v 10000k -maxrate:v 20000k -profile:v high -color_range pc -colorspace bt709 -color_trc bt709 -color_primaries bt709 -c:a copy <output.mp4>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment