Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1776 closed defect (invalid)

ffprobe shows PAR as SAR

Reported by: henry Owned by:
Priority: normal Component: ffprobe
Version: unspecified Keywords: aspect
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: yes

Description

Summary of the bug:
use ffprobe to show souce file info , seems it doesn't show PAR (instead of SAR) .
How to reproduce:

% ffprobe   -i 12.mp4
ffprobe version 0.10.2 Copyright (c) 2007-2012 the FFmpeg developers
  built on Mar 20 2012 04:34:50 with gcc 4.4.6 20110731 (Red Hat 4.4.6-3)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --enable-runtime-cpudetect --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-pthreads --enable-x11grab --enable-vdpau --disable-avisynth --enable-frei0r --enable-libopencv --enable-libdc1394 --enable-libdirac --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --disable-stripping
  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '12.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: isommp423gp5
    creation_time   : 2012-09-23 02:49:14
  Duration: 00:00:21.03, start: 0.000000, bitrate: 288 kb/s
    Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 24000 Hz, stereo, s16, 63 kb/s
    Metadata:
      creation_time   : 2012-09-23 02:49:14
      handler_name    : GPAC ISO Audio Handler
    Stream #0:1(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 160x120 [SAR 1:1 DAR 4:3], 224 kb/s, 23.97 fps, 23.97 tbr, 2397 tbn, 47.94 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler

Attachments (1)

12.mp4 (741.9 KB ) - added by henry 12 years ago.

Download all attachments as: .zip

Change History (8)

by henry, 12 years ago

Attachment: 12.mp4 added

in reply to:  description comment:1 by henry, 12 years ago

but ffmpeg will show [PAR:xx,DAR:xx] , see:

ffmpeg version 0.8.7, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jan 16 2012 15:16:29 with gcc 4.4.5 20101112 (Red Hat 4.4.5-2)
  configuration: --prefix=/usr/local/enctools --enable-postproc --enable-avfilter --enable-
libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-libmp3lame --
disable-shared --enable-libx264 --enable-pthreads --enable-libfaac --enable-nonfree --
enable-gpl --enable-libgsm --enable-libnut --enable-libspeex --enable-libtheora --enable-
libvorbis --enable-libopenjpeg --enable-libxvid --enable-bzlib --enable-libschroedinger --
enable-zlib --enable-small --disable-network --disable-debug --extra-cflags=-I/usr/local/enctools/include --extra-ldflags=-L/usr/local/enctools/lib
  libavutil    51.  9. 1 / 51.  9. 1
  libavcodec   53.  8. 0 / 53.  8. 0
  libavformat  53.  5. 0 / 53.  5. 0
  libavdevice  53.  1. 1 / 53.  1. 1
  libavfilter   2. 23. 0 /  2. 23. 0
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0

Seems stream 1 codec frame rate differs from container frame rate: 47.94 (2397/50) -> 23.97 (2397/100)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '12.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: isommp423gp5
    creation_time   : 2012-09-23 02:49:14
  Duration: 00:00:21.03, start: 0.000000, bitrate: 288 kb/s
    Stream #0.0(eng): Audio: aac, 24000 Hz, stereo, s16, 63 kb/s
    Metadata:
      creation_time   : 2012-09-23 02:49:14
    Stream #0.1(eng): Video: h264, yuv420p, 160x120 [PAR 1:1 DAR 4:3], 224 kb/s, 23.97 fps, 23.97 tbr, 2397 tbn, 47.94 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
At least one output file must be specified

comment:2 by Stefano Sabatini, 12 years ago

Analyzed by developer: set
Resolution: invalid
Status: newclosed

Hi,

latest FFmpeg favors "SAR" over "PAR", you're using versions of ffmpeg/ffprobe belonging to different releases, so that explains the inconsistency.

comment:3 by henry, 12 years ago

Resolution: invalid
Status: closedreopened

according to http://en.wikipedia.org/wiki/Pixel_aspect_ratio : PAR = DAR/SAR
so for first " Stream #0:1(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 160x120 [SAR 1:1 DAR 4:3], 224 kb/s, 23.97 fps, 23.97 tbr, 2397 tbn, 47.94 tbc"
SAR=1:1 , and PAR=(4:3)/(1:1)=4:3
for second Stream #0.1(eng): Video: h264, yuv420p, 160x120 [PAR 1:1 DAR 4:3], 224 kb/s, 23.97 fps, 23.97 tbr, 2397 tbn, 47.94 tbc
PAR=1:1 , and SAR=DAR/PAR=(4:3)/(1:1)=4:3
though i use different version ffprobe/ffmpeg, but i get different PAR and SAR value , which value i can trust or which version i can trust ?

Last edited 12 years ago by henry (previous) (diff)

in reply to:  3 comment:4 by Stefano Sabatini, 12 years ago

Resolution: invalid
Status: reopenedclosed

Replying to henry:

according to http://en.wikipedia.org/wiki/Pixel_aspect_ratio : PAR = DAR/SAR
so for first " Stream #0:1(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 160x120 [SAR 1:1 DAR 4:3], 224 kb/s, 23.97 fps, 23.97 tbr, 2397 tbn, 47.94 tbc"
SAR=1:1 , and PAR=(4:3)/(1:1)=4:3
for second Stream #0.1(eng): Video: h264, yuv420p, 160x120 [PAR 1:1 DAR 4:3], 224 kb/s, 23.97 fps, 23.97 tbr, 2397 tbn, 47.94 tbc
PAR=1:1 , and SAR=DAR/PAR=(4:3)/(1:1)=4:3

though i use different version ffprobe/ffmpeg, but i get different PAR and SAR value , which value i can trust or which version i can trust ?

No, for FFmpeg:
Sample Aspect Ratio (SAR) == Pixel Aspect Ratio (PAR) (same thing with different names)
Display Aspect Ratio (DAR) = SAR * w / h

Last edited 12 years ago by Stefano Sabatini (previous) (diff)

comment:5 by henry, 12 years ago

got it , also if that means

  1. for ffprobe , PAR == SAR ?
  2. in ffproble, always only show [SAR XX:xx , DAR X:xx] , nerver show [PAR xx:xx DAR XX:XX] ?
  3. in ffmpeg, always only show [PAR XX:xx , DAR X:xx] , nerver show [SAR xx:xx DAR XX:XX] ?

in reply to:  5 comment:6 by Stefano Sabatini, 12 years ago

Replying to henry:

got it , also if that means

  1. for ffprobe , PAR == SAR ?
  2. in ffproble, always only show [SAR XX:xx , DAR X:xx] , nerver show [PAR xx:xx DAR XX:XX] ?
  3. in ffmpeg, always only show [PAR XX:xx , DAR X:xx] , nerver show [SAR xx:xx DAR XX:XX] ?

No. Previuosly, FFmpeg was using "PAR" in place of "SAR" all over the place, at some point we decided to switch to SAR, see commit:

commit fdd130a2131912133c72b5ff532726784aaa70a2
Author: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Date:   Wed Jul 27 10:35:08 2011 +0200

    prefer "SAR" over "PAR" in av_dump_format()
    
    "SAR" (Sample Aspect Ratio) is globally preferred over "PAR" (Pixel
    Aspect Ratio), although the two terms share the same semantics.
    
    For example the corresponding AVStream field is called
    sample_aspect_ratio, and libavfilter has a filter named setsar.
    
    Therefore prefer the term "SAR" over "PAR" in the
    libavformat/utils.c:dump_stream_format() and avcodec_string() output
    for avoiding confusion.

The ffprobe/ffmpeg inconsistency you observed is due to the use of different releases.

comment:7 by Carl Eugen Hoyos, 12 years ago

Keywords: aspect added; ffprobe PAR SAR removed
Note: See TracTickets for help on using tickets.