[FFmpeg-user] Question about handling / unwanted changes of SAR in ffmpeg

Uwe Freese uwe.freese at gmx.de
Tue Dec 25 21:54:57 EET 2018


Hello,

I'm confused about how ffmpeg handles the SAR (sample aspect ratio) and 
changes it. Maybe someone can explain why this happens:

I've a video from TV with original size 720x576 pixels (PAL), which 
shall be shown as 16:9 aspect ratio.

The SAR of the input video is correctly shown as 64:45 (resulting in 
720*64 / 576*45 = 46080 / 25920 = 16 / 9 display aspect ratio).

When I crop black borders and encode this video using x264 codec and mkv 
format, ffprobe shows about the result:

     Stream #0:0: Video: h264 (High), yuv420p(progressive), 688x560 [SAR 
64:45 DAR 2752:1575], SAR 172:121 DAR 7396:4235, 50 fps, 50 tbr, 1k tbn, 
100 tbc (default)

What does SAR (and DAR) mean in the brackets compared to the second SAR 
172:121, which is slightly different?
Why isn't the second one also telling the same SAR 64:45 (which would be 
the correct one)?

It gets stranger when I convert the video a second time using "ffmpeg -i 
video_encode_x264.mkv test.mkv". ffmpeg seems to use the second (wrong) 
SAR and shows:

     Output:
     Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 
688x560 [SAR 172:121 DAR 7396:4235], q=-1--1, 50 fps, 1k tbn, 50 tbc 
(default)

Why is ffmpeg now using the second (wrong) SAR?

Regards,
Uwe



More information about the ffmpeg-user mailing list