FFmpeg on NVidia Docker

I want to use FFmpeg from an NVidia Docker over EC2 AWS machine, and I have some issues.

  1. I tried using nvencinfo and nvdecinfo in order to get the supported formats, and found that the g3 machine only supported HW decoding for videos using the nv12 format. Do other machines support other, more common formats? If not, is there some kind of best practice for converting videos to this format, and how much of a performance improvement can we expect HW decoding to provide here (if at all)?
  2. I want to use FFmpeg 4 or newer, which comes as an apt package only on Ubuntu 19.04 or higher - version 18.04 and older have version 3 of FFmpeg. I've tried and failed to update the NVidia Docker to Ubuntu 19.04 - is this supported, or can I expect support for that version any time soon?

On PC with NVIDIA desktop GPU, ffmpeg with hardware acceleration is enabled through video codec sdk. Please check the website for more detail:

Hi Dane,
The page doesn’t explain how to use the libavcodec options in order to prefer/force HW decoding.

Could you share which NVIDIA GPUs are in EC2 AWS machine? Somehow I don’t get any information in online search. Would be great if you can share the information. In general, video codec sdk should work on all NVIDIA desktop GPUs.

The GPU is a Tesla M60.

I’m sorry if I wasn’t clear.
When encoding video, it’s clear how to force HW acceleration - you just choose a HW accelerated codec (h264_nvenc, in this case). But when decoding, the preferred behavior is to let FFmpeg choose the codec, and it seems like it doesn’t choose a HW accelerated codec by default.
Is the suggested behavior to manually check whether the file can be decoded using a HW accelerated codec and in these situations, force FFmpeg to use h264_cuvid?