I have an old i7-2700K, an old ASUS GTX 760 and last ffmpeg version ffmpeg-n4.4-latest-win64-gpl-4.4.zip from BtbN
I want to transcoding a h.265 mkv file (1920x1080) to h.264 (downresizing to 444x250).
I want to use:
-
CPU (Sandy Bridge supports h.265 encoding/decoding also via Quick Sync Video) for decoding and
-
GPU for encoding (since my GPU card does not support h.265 format)
On developer.nvidia.com site I find only this hint for Mixing CPU and GPU processing:
ffmpeg -vsync 0 -c:v h264_cuvid -i input.264 -vf "fade,hwupload_cuda,scale_npp=1280:720" -c:v h264_nvenc output.264
What’s the right command for my problem?
Thanks
For source with h.265 10 bit :
ffmpeg -y -hwaccel qsv -c:v hevc_qsv -i input.mkv -vf “hwdownload,format=p010le” -s 444x250 -c:a copy -c:v h264_nvenc -pix_fmt nv12 -preset medium -tune ull -multipass fullres -rc-lookahead 32 -rc vbr -cq 29 -zerolatency 1 output.mkv
For source with h.265 8 bit :
ffmpeg -y -hwaccel qsv -c:v hevc_qsv -i input.mkv -vf “hwdownload,format=nv12” -s 444x250 -c:a copy -c:v h264_nvenc -preset medium -tune ull -multipass fullres -rc-lookahead 32 -rc vbr -cq 29 -zerolatency 1 output.mkv
You welcome .
- It’s important if you mix between Quick Sync Video & nvidia .
You can do cpu & gpu, decode and scale and encod without -vf , like this :
For source with h.265 10 bit :
ffmpeg -i input.mkv -s 444x250 -c:a copy -c:v h264_nvenc -pix_fmt yuv420p -preset p7 -tune ull -multipass fullres -rc_lookahead 32 -rc vbr -cq 29 -zerolatency 1 -gpu 0 output.mkv
For source with h.265 8 bit or h.264 :
ffmpeg -i input.mkv -s 444x250 -c:a copy -c:v h264_nvenc -preset p7 -tune ull -multipass fullres -rc_lookahead 32 -rc vbr -cq 29 -zerolatency 1 -gpu 0 output.mkv
If you want full gpu cuda decode and scale and encod :
For source with h.265 10 bit :
ffmpeg -y -hwaccel cuda -hwaccel_output_format cuda -hwaccel_device cuda -i input.mkv -filter_complex scale_cuda=1280:-2,hwdownload,format=p010le,format=nv12,hwupload -sn -c:a copy -c:v h264_nvenc -preset p7 -tune 1 -multipass fullres -rc-lookahead 32 -rc vbr -cq 30 -zerolatency 1 output.mkv
For source with h.265 8 bit or h.264 :
ffmpeg -y -hwaccel cuda -hwaccel_output_format cuda -hwaccel_device cuda -i input.mkv -filter_complex “scale_cuda=1280:-2,hwdownload,format=nv12” -sn -c:a copy -c:v h264_nvenc -preset p7 -tune 1 -multipass fullres -rc-lookahead 32 -rc vbr -cq 30 -zerolatency 1 output.mkv
- -tune ull = -tune 3
You can change it (1,2,3) or name it like 1=hq
- As explained in this link, GK104 does not support H.265 , so I think you can use it only with h.264, sorry for that.
Nvidia NVENC - Wikipedia
You still can use Quick Sync Video :
ffmpeg -y -c:v hevc_qsv -i input.mkv -s 444x250 -sn -c:a copy -c:v h264_qsv -pix_fmt yuv420p -zerolatency 1 output.mkv
or
ffmpeg -i input.mkv -s 444x250 -sn -c:a copy -c:v h264_qsv -pix_fmt yuv420p -zerolatency 1 output.mkv
-
You welcome ^_^ , I hope you will be able to do upgrade to your hardware so you can enjoy the great performance Nvidia GPU HWACCEL Transcode .
-
Here some examples
git.ffmpeg.org Git - ffmpeg.git/search