[FFmpeg-devel] [PATCH] matroskaenc: Warning message when RAWVIDEO have unsupported colour space.

Vitaly _Vi Shukela vi0oss at gmail.com
Fri Feb 13 13:34:23 CET 2015

Show warning if the resulting file is expected to be unplayable.
The warning also has a hint about NUT format which support more pixel
formats for rawvideo data.

The file is muxed anyway, as it can be useful for some special tools.

Signed-off-by: Vitaly _Vi Shukela <vi0oss at gmail.com>
 libavformat/matroskaenc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index e8e8da0..41a71ae 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -963,6 +963,10 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
         if (codec->codec_id == AV_CODEC_ID_RAWVIDEO) {
             uint32_t color_space = av_le2ne32(codec->codec_tag);
+            if (!color_space) {
+                av_log(s, AV_LOG_ERROR, "Warning: putting raw video in this colour space to Matroska is not suppoerted\n"
+                                        "The resulting file will be unplayable. Consider NUT format instead.\n");
+            }
             put_ebml_binary(pb, MATROSKA_ID_VIDEOCOLORSPACE, &color_space, sizeof(color_space));

More information about the ffmpeg-devel mailing list