Skip to content

Instantly share code, notes, and snippets.

@nakov
Created December 17, 2020 16:07
Show Gist options
  • Save nakov/ad49e167c91033e43ba70b720acfd719 to your computer and use it in GitHub Desktop.
Save nakov/ad49e167c91033e43ba70b720acfd719 to your computer and use it in GitHub Desktop.
ffmpeg --> multiple output transcoding with a single command and hardware accelaration
ffmpeg.exe -hwaccel cuvid -hwaccel_output_format cuda -c:v h264_cuvid -i input.mp4 -c:v h264_nvenc -vf scale_cuda=w=-1:h=1080:interp_algo=bilinear -r 30 -g 60 -rc vbr -cq 34 -c:a aac -b:a 192k -y sample-1080p.mp4 -c:v h264_nvenc -vf scale_cuda=w=-1:h=720:interp_algo=bilinear -r 30 -g 60 -rc vbr -multipass fullres -cq 34 -c:a aac -b:a 128k -y sample-720p.mp4 -c:v h264_nvenc -vf scale_cuda=w=-1:h=480:interp_algo=bilinear -r 25 -g 50 -rc vbr -multipass fullres -cq 32 -c:a aac -b:a 96k -y sample-480p.mp4 -c:v h264_nvenc -vf scale_cuda=w=-1:h=360:interp_algo=bilinear -r 24 -g 48 -rc vbr -multipass fullres -cq 37 -c:a aac -b:a 64k -y sample-360p.mp4 -c:v h264_nvenc -vf scale_cuda=w=-1:h=240:interp_algo=bilinear -r 15 -g 30 -rc vbr -multipass fullres -cq 32 -c:a aac -b:a 48k -y sample-240p.mp4
The above command transcodes mkv input video from 1080p to mp4 streamable video 1080p, 720p, 480p, 360p and 240p (5 output bitrates)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment