[FFmpeg-trac] #6068(avformat:new): -allow_raw_vfw 1 creates invalid Matroska
FFmpeg
trac at avcodec.org
Sun Jan 8 21:37:08 EET 2017
#6068: -allow_raw_vfw 1 creates invalid Matroska
--------------------------------------+----------------------------------
Reporter: dericed | Owner:
Type: defect | Status: new
Priority: normal | Component: avformat
Version: git-master | Keywords: matroska
Blocked By: | Blocking:
Reproduced by developer: 0 | Analyzed by developer: 0
--------------------------------------+----------------------------------
Summary of the bug:
using -allow_raw_vfw creates a Matroska track with two CodecID Elements,
when >1 CodecID within a track is invalid.
How to reproduce:
Writing rawvideo into Matroska fails with a suggestion to use
-allow_raw_vfw 1.
{{{
ffmpeg -f lavfi -i testsrc -vframes 1 -c:v rawvideo -y tmcd.mkv
ffmpeg version git-2016-12-28-49abd5d Copyright (c) 2000-2016 the FFmpeg
developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-49abd5d --enable-
shared --enable-pthreads --enable-gpl --enable-version3 --enable-
hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-
ldflags= --enable-chromaprint --enable-ffplay --enable-libcaca --enable-
libfreetype --enable-libmp3lame --enable-libopus --enable-libtesseract
--enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid
--enable-opencl --disable-lzma --enable-vda
libavutil 55. 43.100 / 55. 43.100
libavcodec 57. 70.100 / 57. 70.100
libavformat 57. 61.100 / 57. 61.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 68.100 / 6. 68.100
libavresample 3. 2. 0 / 3. 2. 0
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.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
Output #0, matroska, to 'mkv.mkv':
Metadata:
encoder : Lavf57.61.100
Stream #0:0: Video: rawvideo, rgb24, 320x240 [SAR 1:1 DAR 4:3],
q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc
Metadata:
encoder : Lavc57.70.100 rawvideo
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))
Press [q] to stop, [?] for help
[matroska @ 0x7ff222004800] Raw RGB is not supported Natively in Matroska,
you can use AVI or NUT or
If you would like to store it anyway using VFW mode, enable allow_raw_vfw
(-allow_raw_vfw 1)
av_interleaved_write_frame(): Invalid argument
Error writing trailer of mkv.mkv: Invalid argumentframe= 1 fps=0.0
q=-0.0 Lsize= 0kB time=00:00:00.00 bitrate=3096.0kbits/s
speed=0.885x
video:225kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown
}}}
Adding -allow_raw_vfw 1 as suggested:
{{{
ffmpeg -f lavfi -i testsrc -vframes 1 -c:v rawvideo -allow_raw_vfw 1 -y
mkv.mkv
ffmpeg version git-2016-12-28-49abd5d Copyright (c) 2000-2016 the FFmpeg
developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-49abd5d --enable-
shared --enable-pthreads --enable-gpl --enable-version3 --enable-
hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-
ldflags= --enable-chromaprint --enable-ffplay --enable-libcaca --enable-
libfreetype --enable-libmp3lame --enable-libopus --enable-libtesseract
--enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid
--enable-opencl --disable-lzma --enable-vda
libavutil 55. 43.100 / 55. 43.100
libavcodec 57. 70.100 / 57. 70.100
libavformat 57. 61.100 / 57. 61.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 68.100 / 6. 68.100
libavresample 3. 2. 0 / 3. 2. 0
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.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
Output #0, matroska, to 'mkv.mkv':
Metadata:
encoder : Lavf57.61.100
Stream #0:0: Video: rawvideo, rgb24, 320x240 [SAR 1:1 DAR 4:3],
q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc
Metadata:
encoder : Lavc57.70.100 rawvideo
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))
Press [q] to stop, [?] for help
[matroska @ 0x7ffb92006000] codec rawvideo is not supported by this format
frame= 1 fps=0.0 q=-0.0 Lsize= 226kB time=00:00:00.00
bitrate=1849664.0kbits/s speed=0.621x
video:225kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.350694%
}}}
Assess with mkvalidator:
mkvalidator mkv.mkv
{{{
ERR202: Unique element 'CodecID' in TrackEntry at 393 found more than once
at 446
ERR202: Unique element 'CodecID' in TrackEntry at 393 found more than once
at 446
....... file created with Lavf57.61.100 / Lavf57.61.100
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/6068>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list