Merge pull request #371 from SuslikV/lossless-color-format

Use non-subsampled color format for lossless encoding with the h264 encoder
This commit is contained in:
Jonathan Thomas
2020-09-10 17:40:14 -05:00
committed by GitHub
2 changed files with 5 additions and 0 deletions

View File

@@ -438,6 +438,7 @@ void FFmpegWriter::SetOption(StreamType stream, std::string name, std::string va
av_opt_set_int(c->priv_data, "qp", std::min(std::stoi(value), 51), 0); // 0-51
if (std::stoi(value) == 0) {
av_opt_set(c->priv_data, "preset", "veryslow", 0);
c->pix_fmt = PIX_FMT_YUV444P; // no chroma subsampling
}
break;
case AV_CODEC_ID_HEVC :
@@ -498,6 +499,7 @@ void FFmpegWriter::SetOption(StreamType stream, std::string name, std::string va
av_opt_set_int(c->priv_data, "crf", std::min(std::stoi(value), 51), 0); // 0-51
if (std::stoi(value) == 0) {
av_opt_set(c->priv_data, "preset", "veryslow", 0);
c->pix_fmt = PIX_FMT_YUV444P; // no chroma subsampling
}
break;
case AV_CODEC_ID_HEVC :