Opened 12 years ago

Closed 12 years ago

#1568 closed defect (fixed)

ffprobe: SAR / DAR values not mapped in JSON output when input file gets transcoded to WEBM

Reported by: Chris Owned by: stefano
Priority: normal Component: ffprobe
Version: unspecified Keywords: json, webm, transcoding, ffprobe
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
If a input video source is transcoded to WEBM, the SAR & DAR values are not mapped in the JSON output (using '-print_format json -show_streams') even though they are available as header information.

As you can see from the output below, the video stream ('Stream #0:0: Video:') line contains the SAR and DAR values ('SAR 1:1 DAR 427:181') but they are not visible in the corresponding JSON output.

How to reproduce:

% ffprobe -print_format json -show_streams cinemascope-sample.webm
ffprobe version N-41991-g87df986 Copyright (c) 2007-2012 the FFmpeg developers
  built on Jun 28 2012 12:21:41 with gcc 4.4.3
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-libvpx --enable-pthreads --enable-libmp3lame --enable-libaacplus --enable-libopencore-amrnb --enable-libopencore-amrwb
  libavutil      51. 63.100 / 51. 63.100
  libavcodec     54. 29.101 / 54. 29.101
  libavformat    54. 11.100 / 54. 11.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     3.  0.100 /  3.  0.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, matroska,webm, from 'cinemascope-sample.webm':
  Metadata:
    creation_time   : 2010-03-23 13:46:00
  Duration: 00:00:18.81, start: 0.000000, bitrate: 982 kb/s
    Stream #0:0: Video: vp8, yuv420p, 854x362, SAR 1:1 DAR 427:181, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
{
    "streams": [
        {
            "index": 0,
            "codec_name": "vp8",
            "codec_long_name": "On2 VP8",
            "codec_type": "video",
            "codec_time_base": "1/1000",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "width": 854,
            "height": 362,
            "has_b_frames": 0,
            "pix_fmt": "yuv420p",
            "level": -99,
            "r_frame_rate": "24000/1001",
            "avg_frame_rate": "24000/1001",
            "time_base": "1/1000",
            "start_time": "0.000000"
        }
    ]
}

Expected output would be:

% ffprobe -print_format json -show_streams cinemascope-sample.webm
ffprobe version N-41991-g87df986 Copyright (c) 2007-2012 the FFmpeg developers
  built on Jun 28 2012 12:21:41 with gcc 4.4.3
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-libvpx --enable-pthreads --enable-libmp3lame --enable-libaacplus --enable-libopencore-amrnb --enable-libopencore-amrwb
  libavutil      51. 63.100 / 51. 63.100
  libavcodec     54. 29.101 / 54. 29.101
  libavformat    54. 11.100 / 54. 11.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     3.  0.100 /  3.  0.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, matroska,webm, from 'cinemascope-sample.webm':
  Metadata:
    creation_time   : 2010-03-23 13:46:00
  Duration: 00:00:18.81, start: 0.000000, bitrate: 982 kb/s
    Stream #0:0: Video: vp8, yuv420p, 854x362, SAR 1:1 DAR 427:181, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
{
    "streams": [
        {
            "index": 0,
            "codec_name": "vp8",
            "codec_long_name": "On2 VP8",
            "codec_type": "video",
            "codec_time_base": "1/1000",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "width": 854,
            "height": 362,
            "has_b_frames": 0,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "427:181",
            "pix_fmt": "yuv420p",
            "level": -99,
            "r_frame_rate": "24000/1001",
            "avg_frame_rate": "24000/1001",
            "time_base": "1/1000",
            "start_time": "0.000000"
        }
    ]
}

Attachments (1)

cinemascope-sample.webm (2.2 MB ) - added by Chris 12 years ago.
sample WEBM file having SAR/DAR values set

Change History (3)

by Chris, 12 years ago

Attachment: cinemascope-sample.webm added

sample WEBM file having SAR/DAR values set

comment:1 by Stefano Sabatini, 12 years ago

Reproduced by developer: set
Status: newopen

comment:2 by Stefano Sabatini, 12 years ago

Resolution: fixed
Status: openclosed

Should be fixed in:

commit 10b44f493276021824d4072ea83391ac4c4cff58
Author: Stefano Sabatini <stefasab@gmail.com>
Date:   Tue Jul 24 09:43:02 2012 +0200

    ffprobe: use av_guess_sample_aspect_ratio() for guessing the aspect ratio
    
    This is consistent with what av_dump_format() does.
    
    In particular, fix trac ticket #1568.

Thanks for reporting.

Note: See TracTickets for help on using tickets.