From: Steinar H. Gunderson Date: Tue, 4 Dec 2018 23:41:21 +0000 (+0100) Subject: Switch to Matroska for Futatabi's output video stream, as it is much better at preser... X-Git-Tag: 1.8.0~53 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=1832a337468b13b513d3e77c32cca6207764bd23 Switch to Matroska for Futatabi's output video stream, as it is much better at preserving Y'CbCr details. --- 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);