Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why FFmpeg print SAR instead of PAR?

If my knowledge is correct, SAR (Storage Aspect Ratio) is the ratio of pixel dimensions. For example, a 640 × 480 video has a SAR of 640/480 = 4:3.

Whereas PAR (Pixel Aspect Ratio) is ratio of pixel height and width, and most of modern videos have square PAR (1:1).

But when I tried to check it with ffmpeg -i I got square SAR instead of square PAR for all test videos.

Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1758 kb/s, 24.99 fps, 25 tbr, 25 tbn, 50 tbc
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 540x360  [SAR 1:1 DAR 3:2], 386 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p,  450x360 [SAR 1:1 DAR 5:4], 328 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc

Is it ffmpeg bug or my mistake?

like image 893
Nelson Tatius Avatar asked Sep 18 '13 16:09

Nelson Tatius


People also ask

What is SAR and dar in FFmpeg?

SAR (Sample Aspect Ratio) is the same as PAR (Pixel Aspect Ratio). These two terms are used interchangeably. They mean the ratio between the width and the height of individual pixels. In contrast, DAR (Display Aspect ratio) is the ratio between the width and the height of the full image.

What is SAR in video?

video Video aspect ratios Sample aspect ratio (SAR) This stretching factor is applied to the picture in order to bring it to the correct aspect ratio for display. This is the sample aspect ratio or SAR. The stretching factor is often expressed as a ratio of two integers. You calculate it as SAR = PAR / DAR.


2 Answers

SAR (Sample Aspect Ratio) is the same as PAR (Pixel Aspect Ratio).

These two terms are used interchangeably. They mean the ratio between the width and the height of individual pixels.

In contrast, DAR (Display Aspect ratio) is the ratio between the width and the height of the full image. enter image description here


Notes:

SAR - All modern devices have it 1:1; old devices — mainly from the analogic-numeric transition era — used non-square pixels.

DAR - examples: For SVGA it is 4:3, for QWXGA it is 16:9.

like image 89
MarianD Avatar answered Sep 30 '22 18:09

MarianD


As it turned out, ffmpeg uses different notations

  • SAR for Sample Aspect Ratio
  • DAR for Display Aspect Ratio
like image 30
Nelson Tatius Avatar answered Sep 30 '22 18:09

Nelson Tatius