Some problems when compiling FFMPEG with Nvidia Cuda support on Jetson TX2.

I have a very surgent problem to ask you for help and the problem is showed as following:
I am trying to compile FFMPEG with Nvidia Cuda support on jetson TX2 by following the tutorial

git clone -b master
cd FFmpeg
./configure --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64

When I try to configure ffmpeg, it says:
ERROR: cuda requested, but not all dependencies are satisfied: ffnvcodec

Then I found someone in the Internet who gives the possible solution:
git clone
cd nv-codec-headers
sudo make install

I follow this and I tried to recompile the ffmpeg as first, but I get the same error.
Then I declare the PKG_CONFIG_PATH pointing to the path where ffnvcodec.pc is located when running configure for FFmpeg,but I get the the error as belew.

I want to konw that if FFMpeg support is not supported by TX2. If TX2 support FFMpeg,then how can I solve this problem.
I would appreciate it so much if someone can help as soon as possible!

ffmpeg with hardware acceleration is not supported in default release. A forum user has shared his implementation:

You may give it a try.