Subject: [Cellar] Matroska Format Version 4 / Version 2

From: Kieran O Leary <[email-masked]>
Date: Thu, 22 Mar 2018 20:09:37 +0000

Hi,

I am wondering about the format_version value that mediainfo produces.

 mediainfo out.mkv |grep -i format
Format                                   : Matroska
Format version                           : Version 4 / Version 2
Format                                   : FFV1
Format version                           : Version 3.4

What does the Version 4/2 refer to?

When looking into the trace output, I found these values:
mediainfo --Details=1 out.mkv |grep -i version
0000C  EBMLVersion - 1 (0x1) (4 bytes)
00010  EBMLReadVersion - 1 (0x1) (4 bytes)
00027  DocTypeVersion - 4 (0x4) (4 bytes)
0002B  DocTypeReadVersion - 2 (0x2) (4 bytes)
001FB        version:                         3 (0x00000003)
001FC        micro_version:                   4 (0x00000004)

Is it possibly referring to the DocTypeVersion being 4, and the
DocTypeReadVersion being 2? Which, from my reading of the specs, means
that software supporting Matroska version 2 is enough the play back
the file, though there may be features present that require a reading
application to support version 4?

Any help would be greatly appreciated.

Just in case,here's how I produced out.mkv:
 ffmpeg -f lavfi -i  testsrc -c:v ffv1 -level 3 -t 1 out.mkv
ffmpeg version N-90339-ged1a750 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
  configuration: --prefix=/home/kieranjol/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/kieranjol/ffmpeg_build/include
--extra-ldflags=-L/home/kieranjol/ffmpeg_build/lib
--extra-libs='-lpthread -lm' --bindir=/home/kieranjol/bin --enable-gpl
--enable-libass --enable-libfdk-aac --enable-libfreetype
--enable-libmp3lame --enable-libopus --enable-libtheora
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265
--enable-nonfree --enable-libopenjpeg
  libavutil      56. 10.100 / 56. 10.100
  libavcodec     58. 14.100 / 58. 14.100
  libavformat    58. 10.100 / 58. 10.100
  libavdevice    58.  2.100 / 58.  2.100
  libavfilter     7. 13.100 /  7. 13.100
  libswscale      5.  0.102 /  5.  0.102
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
Input #0, lavfi, from 'testsrc':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24,
320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
File 'out.mkv' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> ffv1 (native))
Press [q] to stop, [?] for help
Output #0, matroska, to 'out.mkv':
  Metadata:
    encoder         : Lavf58.10.100
    Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), bgr0, 320x240 [SAR
1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.14.100 ffv1
frame=   25 fps=0.0 q=-0.0 Lsize=     123kB time=00:00:00.96
bitrate=1049.9kbits/s speed=15.5x
video:122kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.853259%

Best,

Kieran O'Leary
Irish Film Institute.

---

From: Dave Rice <[email-masked]>
Date: Tue, 27 Mar 2018 09:37:32 -0400

> On Mar 22, 2018, at 4:09 PM, Kieran O Leary <[email-masked]> wrote:
> 
> Hi,
> 

That’s correct. See the first and last lines highlighted here: https://github.com/MediaArea/MediaInfoLib/blob/d8fd88a1c282d1c09388c55ee0b46029e7330690/Source/MediaInfo/Multiple/File_Mk.cpp#L2063-L2076 <https://github.com/MediaArea/MediaInfoLib/blob/d8fd88a1c282d1c09388c55ee0b46029e7330690/Source/MediaInfo/Multiple/File_Mk.cpp#L2063-L2076>.
Dave Rice