[FFmpeg-user] ffmpeg with x264 codec - Aspect ratio doesn't follow input
lists at keynet-technology.com
Wed May 25 09:00:00 CEST 2016
I have a number of MPEG2 TS DVB recordings that have aspect ratio changes - e.g. older films or 4:3 programmes that have 16:9 continuity, trailers, adverts etc.
I want to transcode to H264 using ffmpeg (3.02), but the output aspect ratio does not follow the source when using the H264 codec.
But the aspect ratio does follow when using the xvid/mp4 codec.
I need x264 not mp4.
The problem is that (I think) the container DAR or SAR stays at 16:9 all the way through but the stream SAR or DAR doesn't follow the source for whatever reason
Is there a way to make x264 output follow the source aspect ratio at the stream level ?
Failing example :
ffmpeg -y -i 00001.ts -map 0:0 -map 0:1 -map 0:3 -c:v libx264 -preset veryfast -profile:v high -level 4.0 -crf 20 -flags +loop -flags +ilme -vf yadif=0:-1:0 -c:a:0 aac -b:a:0 128k -c:s copy -f mpegts file-1.ts
(same if I take out the profile and deinterlace settings)
Working example (but large file and not so good quality, even if I could use it):
ffmpeg -y -i 00001.ts -map 0:0 -map 0:1 -map 0:3 -c:v libxvid -q:v 3 -c:a:0 aac -b:a:0 128k -c:s copy -f mpegts file-1.ts
If I add -vf setdar=dar=4/3, I can force the x264 version to be 4/3 but then all parts of the recording are always 4/3 which is also wrong.
Behaviour is the same on VLC player, ffplay, and Kodi.
Appreciate any pointers
More information about the ffmpeg-user