Opened 6 months ago

#6276 new defect

h264_vaapi & nvenc do not preserve aspect ratio changes

Reported by: Tom_B Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords: vaapi nvenc aspect ratio
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

ffmpeg output:

ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers

built with gcc 6.3.1 (GCC) 20170109
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-netcdf --enable-shared --enable-version3 --enable-x11grab
libavutil 55. 34.101 / 55. 34.101
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.101 / 57. 56.101
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libavresample 3. 1. 0 / 3. 1. 0
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100

Command:

ffmpeg -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -i input.ts -y -g 30 -vf 'format=nv12,hwupload' -c:v h264_vaapi -qp 20 -sn out.ts

The input file is available at https://r.je/tmp/input.ts (apologies this is a 900mb file) with a change in aspect ratio from 16:9 to 4:3 at 3:28

When using h264_vaapi as the codec, it doens't maintain the aspect ratio change, however the aspect ratio change is maintained if using libx264

Using libx264, the aspect change is copied into the output file.

Note: The same bug happens when using h264_nvenc.

Change History (0)

Note: See TracTickets for help on using tickets.