[FFmpeg-trac] #6119(avcodec:new): h264_nvenc encoder sets wrong DAR if image size is 720x576

FFmpeg trac at avcodec.org
Thu Feb 2 02:27:42 EET 2017

#6119: h264_nvenc encoder sets wrong DAR if image size is 720x576
             Reporter:               |                     Type:  defect
  user20170202                       |                 Priority:  normal
               Status:  new          |                  Version:
            Component:  avcodec      |  unspecified
             Keywords:  nvenc        |               Blocked By:
  aspect                             |  Reproduced by developer:  0
             Blocking:               |
Analyzed by developer:  0            |
 Summary of the bug:
 Whenever encoding a video using the h264_nvenc encoder, and the output
 image size is 720x576, and the DAR is specified by the "-aspect" argument,
 the stream DAR is wrong whereas the container DAR is correct.

 Tested with versions 3.2, 3.2.2 and build 20170130-cba4f0e-win64-shared
 (all downloaded from https://ffmpeg.zeranoe.com)

 How to reproduce:
 ffmpeg -i d:\in.mpg -vf scale=720x576 -aspect 16:9 -c:v h264_nvenc

 Using out.mp4 as the input file for ffprobe shows:
 Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 720x576
 [SAR 2816:2025 DAR 704:405], 1963 kb/s, SAR 64:45 DAR 16:9, 25 fps, 25
 tbr, 12800 tbn, 50 tbc (default)

 As you can see: The DAR in square brackets (704:405) is wrong. The latter
 DAR in the line is correct.

 - I do not provide a source video because this happens with any source
 video independent from image size and input DAR.
 - Replacing h264_nvenc by libx264 does not show this problem.
 - Using any other target video size does not show this problem. Only
 exactly 720x576.
 - Using the video filters "setdar" or "setsar" show the same problem as
 using the "-aspect" argument

 My first report, hoping I provided all information required. Thanks for
 analyzing this issue.

Ticket URL: <https://trac.ffmpeg.org/ticket/6119>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list