From 1832a337468b13b513d3e77c32cca6207764bd23 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 5 Dec 2018 00:41:21 +0100 Subject: [PATCH] Switch to Matroska for Futatabi's output video stream, as it is much better at preserving Y'CbCr details. --- futatabi/video_stream.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/futatabi/video_stream.cpp b/futatabi/video_stream.cpp index 6fb8c5c..1957d84 100644 --- a/futatabi/video_stream.cpp +++ b/futatabi/video_stream.cpp @@ -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); -- 2.39.2