[FFmpeg-user] Matroska encode specifies SAR/DAR when no aspect ratio info is present in source .mov

Kieran O Leary kieran.o.leary at gmail.com
Wed Jul 13 11:17:28 EEST 2016


Hi,

I only noticed this when it was flagged in the new framemd5 output
that includes SAR values.

A .mov source with no SAR/DAR information (listed as #sar 0: 0/1) in
the framemd5, has specific SAR information when remuxed as mkv (#sar
0: 1/1). Obviously these values are also available via ffmpeg -i
input.

It is almost certainly better for the SAR to be declared, but I'm just
wondering why this is happening. Is this is something that ffmpeg is
adding by default,  or is there something in the Matroska spec that
requires  aspect ratio information to be declared?

My input file was created with testsrc, but I've seen no SAR/DAR info
in several real world .mov files(Avid Media Composer doesn't write
pasp atoms in recent versions)


Input followed by output:

ffmpeg -i v210.mov

ffmpeg version git-2016-06-21-9204a84 Copyright (c) 2000-2016 the
FFmpeg developers

  built with Apple LLVM version 7.3.0 (clang-703.0.31)

  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD
--enable-shared --enable-pthreads --enable-gpl --enable-version3
--enable-hardcoded-tables --enable-avresample --cc=clang
--host-cflags= --host-ldflags= --enable-opencl --enable-libx264
--enable-libmp3lame --enable-libxvid --enable-libfreetype
--enable-ffplay --disable-lzma --enable-libopenjpeg
--disable-decoder=jpeg2000
--extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5
--enable-vda

  libavutil      55. 24.100 / 55. 24.100

  libavcodec     57. 46.100 / 57. 46.100

  libavformat    57. 38.102 / 57. 38.102

  libavdevice    57.  0.101 / 57.  0.101

  libavfilter     6. 46.102 /  6. 46.102

  libavresample   3.  0.  0 /  3.  0.  0

  libswscale      4.  1.100 /  4.  1.100

  libswresample   2.  1.100 /  2.  1.100

  libpostproc    54.  0.100 / 54.  0.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'v210.mov':

  Metadata:

    major_brand     : qt

    minor_version   : 512

    compatible_brands: qt

    encoder         : Lavf57.38.102

  Duration: 00:00:01.00, start: 0.000000, bitrate: 43014 kb/s

    Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le,
320x240, 43008 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)

    Metadata:

      handler_name    : DataHandler

      encoder         : Lavc57.46.100 v210

At least one output file must be specified




output matroska file - produced with ffmpeg -i v210.mov -c copy v210.mkv

ffmpeg -i /Volumes/Stardom/kieran_tests/bug/v210.mov -c copy
/Volumes/Stardom/kieran_tests/bug/v210.mkv

ffmpeg version git-2016-06-21-9204a84 Copyright (c) 2000-2016 the
FFmpeg developers

  built with Apple LLVM version 7.3.0 (clang-703.0.31)

  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD
--enable-shared --enable-pthreads --enable-gpl --enable-version3
--enable-hardcoded-tables --enable-avresample --cc=clang
--host-cflags= --host-ldflags= --enable-opencl --enable-libx264
--enable-libmp3lame --enable-libxvid --enable-libfreetype
--enable-ffplay --disable-lzma --enable-libopenjpeg
--disable-decoder=jpeg2000
--extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5
--enable-vda

  libavutil      55. 24.100 / 55. 24.100

  libavcodec     57. 46.100 / 57. 46.100

  libavformat    57. 38.102 / 57. 38.102

  libavdevice    57.  0.101 / 57.  0.101

  libavfilter     6. 46.102 /  6. 46.102

  libavresample   3.  0.  0 /  3.  0.  0

  libswscale      4.  1.100 /  4.  1.100

  libswresample   2.  1.100 /  2.  1.100

  libpostproc    54.  0.100 / 54.  0.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'/Volumes/Stardom/kieran_tests/bug/v210.mov':

  Metadata:

    major_brand     : qt

    minor_version   : 512

    compatible_brands: qt

    encoder         : Lavf57.38.102

  Duration: 00:00:01.00, start: 0.000000, bitrate: 43014 kb/s

    Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le,
320x240, 43008 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)

    Metadata:

      handler_name    : DataHandler

      encoder         : Lavc57.46.100 v210

[matroska @ 0x7f86aa811200] Using AVStream.codec to pass codec
parameters to muxers is deprecated, use AVStream.codecpar instead.

Output #0, matroska, to '/Volumes/Stardom/kieran_tests/bug/v210.mkv':

  Metadata:

    major_brand     : qt

    minor_version   : 512

    compatible_brands: qt

    encoder         : Lavf57.38.102

    Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le,
320x240, q=2-31, 43008 kb/s, 25 fps, 25 tbr, 1k tbn, 12800 tbc
(default)

    Metadata:

      handler_name    : DataHandler

      encoder         : Lavc57.46.100 v210

Stream mapping:

  Stream #0:0 -> #0:0 (copy)

Press [q] to stop, [?] for help

frame=   25 fps=0.0 q=-1.0 Lsize=    5252kB time=00:00:00.96
bitrate=44769.2kbits/s speed= 254x

video:5250kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.035398%




ffmpeg -i v210.mkv

ffmpeg version git-2016-06-21-9204a84 Copyright (c) 2000-2016 the
FFmpeg developers

  built with Apple LLVM version 7.3.0 (clang-703.0.31)

  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD
--enable-shared --enable-pthreads --enable-gpl --enable-version3
--enable-hardcoded-tables --enable-avresample --cc=clang
--host-cflags= --host-ldflags= --enable-opencl --enable-libx264
--enable-libmp3lame --enable-libxvid --enable-libfreetype
--enable-ffplay --disable-lzma --enable-libopenjpeg
--disable-decoder=jpeg2000
--extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5
--enable-vda

  libavutil      55. 24.100 / 55. 24.100

  libavcodec     57. 46.100 / 57. 46.100

  libavformat    57. 38.102 / 57. 38.102

  libavdevice    57.  0.101 / 57.  0.101

  libavfilter     6. 46.102 /  6. 46.102

  libavresample   3.  0.  0 /  3.  0.  0

  libswscale      4.  1.100 /  4.  1.100

  libswresample   2.  1.100 /  2.  1.100

  libpostproc    54.  0.100 / 54.  0.100

Input #0, matroska,webm, from 'v210.mkv':

  Metadata:

    COMPATIBLE_BRANDS: qt

    MAJOR_BRAND     : qt

    MINOR_VERSION   : 512

    ENCODER         : Lavf57.38.102

  Duration: 00:00:01.00, start: 0.000000, bitrate: 43023 kb/s

    Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le,
320x240, SAR 1:1 DAR 4:3, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)

    Metadata:

      HANDLER_NAME    : DataHandler

      ENCODER         : Lavc57.46.100 v210

      DURATION        : 00:00:01.000000000

At least one output file must be specified


Best,

Kieran.


More information about the ffmpeg-user mailing list