h264_nvenc encoder sets wrong DAR if image size is 720x576
|Reported by:||user20170202||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
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 d:\out.mp4
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.