2

I'm creating a video from a stream with the help of FFMPEG and I also use FFPROBE to gather information for use on a status page like resolution, codecs et cetera.

When FFProbe parses my video for information, I get a resolution value of 544x576 (almost a square!), but an aspect ratio of 16:9.

These values are consistent on both the input stream and my saved video.

When I watch the video in the standard HTML5 Player, VLC or FFPLAY however, I get a video with the proportions of 16:9 and a resolution (measured using an image editing program) of 1024x576 that does look native and not stretched in any way.

Even if I re-encode the video using slightly different codecs, this incorrect resolution value persists, even though every player I use displays it correctly.

This is slightly inconvenient because I am relying on getting the correct resolution value from the video for further processing.

I'm also using a recent FFMPEG+FFPROBE version that was compiled on the 15th of July.

Is this a bug within FFMPEG or is there anything I'm doing wrong?

Used command lines:

FFMPEG:

ffmpeg -i source -loglevel debug -vcodec copy -acodec copy -bsf:a aac_adtstoasc -movflags +faststart -t 360 -y video.mp4

FFPROBE (I parse the output of this directly and save the values):

ffprobe -i source -show_format -show_streams 

FFProbe output:

width=544
height=576
coded_width=544
coded_height=576
has_b_frames=2
sample_aspect_ratio=32:17
display_aspect_ratio=16:9

I can see that the sample aspect ratio is different from the display aspect ratio, but how come the video looks proper in 16:9 when it's supposedly encoded at a near square resolution?

Boehmi
  • 951
  • 3
  • 9
  • 20
  • What PAR value is ffmpeg/ffprobe showing when processing the video? Is the source anamorphic? – user3770489 Jul 24 '15 at 12:29
  • 2
    @user3770489 has the answer; the pixel aspect ratio (PAR) isn't 1:1. See [here](http://stackoverflow.com/questions/4422387/get-aspect-ratio-of-video-from-ffmpeg) to find help determining DAR/PAR values. – Teque5 Jul 24 '15 at 15:42
  • It seems that the Sample Aspect Ratio is the cause of this as it apparently stretches the video by its ratio. The input is showing SAR 32:17 DAR 16:9, just like the finished video. Is there a good way to calculate the changed width and/or height after the SAR stretches the original resolution to 16:9? – Boehmi Jul 27 '15 at 07:42

0 Answers0