]> git.sesse.net Git - nageru/commitdiff
Switch to Matroska for Futatabi's output video stream, as it is much better at preser...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 4 Dec 2018 23:41:21 +0000 (00:41 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 4 Dec 2018 23:41:21 +0000 (00:41 +0100)
futatabi/video_stream.cpp

index 6fb8c5c400589a93fc811823421b499c12a8b7cf..1957d8410d7a514618a9e51ad345ee933724d9ee 100644 (file)
@@ -238,7 +238,12 @@ VideoStream::~VideoStream() {}
 void VideoStream::start()
 {
        AVFormatContext *avctx = avformat_alloc_context();
-       avctx->oformat = av_guess_format("nut", nullptr, nullptr);
+
+       // We use Matroska, because it's pretty much the only mux where FFmpeg
+       // allows writing chroma location to override JFIF's default center placement.
+       // (Note that at the time of writing, however, FFmpeg does not correctly
+       // _read_ this information!)
+       avctx->oformat = av_guess_format("matroska", nullptr, nullptr);
 
        uint8_t *buf = (uint8_t *)av_malloc(MUX_BUFFER_SIZE);
        avctx->pb = avio_alloc_context(buf, MUX_BUFFER_SIZE, 1, this, nullptr, nullptr, nullptr);