Metadata disappears when hevc_nvenc is used in ffmpeg (Estimated to be overwrite with null value.)

When using h264_cuvid and hevc_nvenc through ffmpeg on my server, the metadata of the files that come out of the encoding output is lost.
There was no such thing in h264_nvenc. Also, the libx265 encoding result has metadata.

The ffmpeg command I used is as follows.

ffmpeg -v debug -vsync 0 -hwaccel cuvid -hwaccel_device 2 -c:v h264_cuvid \
-i ./intputfile.mp4 -map_metadata 0 -map_metadata 0:s:0 -map_metadata:s:v 0:s:v -map_metadata:s:a 0:s:a \
-map 0:v -vf hwdownload,format=nv12,format=yuv420p,scale=iw*2:ih*2 \
-c:v nvenc_hevc -preset slow -rc vbr_hq -pix_fmt yuv420p -b:v 5M -maxrate:v 8M -gpu 2 \
-map 0:a -c:a copy \
-color_range tv -colorspace bt709 -color_trc bt709 -color_primaries bt709 \

Refer to the image below for property information on the generated file.

  • In the image in the link, the left pane is a playable h264_nvenc encoding deliverable file.
  • In the image in the link, the right pane is a non-replayable hevc_nvenc encoding deliverable file.
  • Program available for play: VLC
  • Unable to play: Ubuntu 18.04 Base Video Player, Samsung Smart TV (h264_nvenc and libx265 encoded deliverables files can be played).
  • Please refer to the image below for an error message displayed in the Player when it is not possible to play. (This is the default video player for ubuntu 18.04.)

I added ‘-f matroska’ option to the command written above and made a result.(The result file extension has also been changed to “mkv”)
Unusually, metadata exists in the process in which images are made as follows:

However, at the end of encoding, this metadata disappears again. (It looks exactly like the first image in the right pane.)

The path to which this information was obtained was identified by right-clicking the file in Ubuntu (18.04) to the category “Properties” - “video/audio”.
Can you tell me why this is happening?
If not, please advise me where I should look.


CUDA : 10.2
Video SDK Version (Nvenc version) : 9.1
GPU : GeForce GTX 1080 Ti
Driver Version: 440.33.01