I need to convert some video files from h.265 to h.264 with Nvidia hardware

I have a decent Nvidia graphics card, capable of h.265 and h.264 encoding and decoding in hardware, running on a Ubuntu installation. I have a whole bunch of video files that I need to convert from h.265 to h.264 (note: yes, I need to downconvert them). Could someone give me an ffmpeg command to convert these, using hardware for all the decoding and encoding?

Hi marcnbarrett_gmail_com,
I think you’re asking the question in the wrong forum, as this is about the Plex Media Servers and its derivatives, not about using ffmpeg. Therefore, the people here are likely not specialists.
I do work with ffmpeg every now and then, but I don’t have NVENC (just an AMD gpu) and therefore couldn’t test your specific setup.
I’ll just combine what google said for ffmpeg and
-batch convert linux
-nvenc encode
-h264 encode
which gives me this command
for i in *.mp4; do ffmpeg -i "$i" -c:v h264_nvenc "../h264/${i%.*}.mp4"; done
Note that:
ffmpeg has to be properly compiled to use your gpu
you have to be in the same directory as your video file collection,
all files to be converted have to end with .mp4,
you have a directory named h264 one directory level up,
it might only work if in a .sh script and
I did not test it.

Good luck,
Super4Jet

I appreciate the reply. That would use hardware acceleration for the encoding, but not the decoding.

Ah eh yes? But you’re not playing the video, you’re just re-encoding them? Then this is correct. Afaik it should automatically decode the video on the gpu level, can’t imagine the cpu decoding the video and sending uncompressed frames over to the gpu.
Uncrompressed video is so insanely big that it is likely the graphics card will take care of that. It’s like a zip archive you want to recompress as 7z, you wouldn’t unzip all of it on your phone, transfer it to your computer and then rezip it, that sort of defies the logic of zips. You would send the zip directly…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.