Using ffmpeg on Jetson encode from avi to mp4

I want to use Jetson GPU to help ffmpeg encord.
reference this GitHub - jocover/jetson-ffmpeg: ffmpeg support on jetson nano

But I met unknown encorder ‘h264_nvmpi’ while using this command, Anybody can help? Thanks a lot.
ffmpeg -i input_file -c:v h264_nvmpi <output.mp4>

You need to install ffmpeg with hardware acceleration. You can either build it yourself or use prebuilt deb packages from here: Hardware decoding in mpv player - #6 by Lissanro (scroll down until you see “ffmpeg with nvmpi” section then copy and paste into a terminal a block of commands to download and install ffmpeg with nvmpi).

For achieving the best performance, use nvmpi not only for encoding but for decoding too (nvmpi supports HW decoding of h264, hevc, vp9, vp8, mpeg2 and mpeg4), for example:

ffmpeg -c:v hevc_nvmpi -i input.mp4 -c:v h264_nvmpi output.mp4 # Decode input.mp4 with HEVC and encode it to H264

You can use jtop to verify that you are using NVDEC and NVENC while decoding/encoding with ffmpeg.

Thank @Lissanro for providing guidance.

1 Like

@Lissanro Thanks for the help. But I could not use wget for having that zip file. I got Connetion fused by using these commands,
wget http://Dragon.Studio/2021/02/ffmpeg-3.4.8-nvmpi-nvv4l2dec.zip &&
unzip -n ffmpeg-3.4.8-nvmpi-nvv4l2dec.zip &&
sudo apt -y --allow-change-held-packages --allow-downgrades install ./ffmpeg-nvmpi-nvv4l2dec/*.deb &&
sudo apt-mark hold $(find ffmpeg-nvmpi-nvv4l2dec | grep deb | xargs -n1 basename | cut -d_ -f1)

My virtual server was under maintenance at the time (it was offline for about 12 hours today). Normally it is up 24/7. Please try again, it should work now.