From f4fda7d14094fbee8c0ca6ea0bbf62e085045048 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Mon, 22 Aug 2016 11:50:49 +0200 Subject: [PATCH 1/2] OutputFile: copy color parameters when add a new video stream Use case: MOV files with full/video range. --- src/AvTranscoder/file/OutputFile.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/AvTranscoder/file/OutputFile.cpp b/src/AvTranscoder/file/OutputFile.cpp index ab838c37..72042db5 100644 --- a/src/AvTranscoder/file/OutputFile.cpp +++ b/src/AvTranscoder/file/OutputFile.cpp @@ -42,6 +42,12 @@ IOutputStream& OutputFile::addVideoStream(const VideoCodec& videoDesc) stream.codec->level = videoDesc.getAVCodecContext().level; stream.codec->field_order = videoDesc.getAVCodecContext().field_order; + stream.codec->colorspace = videoDesc.getAVCodecContext().colorspace; + stream.codec->color_primaries = videoDesc.getAVCodecContext().color_primaries; + stream.codec->color_range = videoDesc.getAVCodecContext().color_range; + stream.codec->color_trc = videoDesc.getAVCodecContext().color_trc; + stream.codec->chroma_sample_location = videoDesc.getAVCodecContext().chroma_sample_location; + setOutputStream(stream, videoDesc); // need to set the time_base on the AVCodecContext and the AVStream From 3078fab52c3a7c20ae67f67cd8d3d26751457f9d Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Mon, 22 Aug 2016 12:59:15 +0200 Subject: [PATCH 2/2] VideoProperty: updated color range returned in case of AVCOL_RANGE_MPEG * "Limited" corresponds to the FFmpeg vocabulary. It corresponds to the "video" range. * Added comment. --- src/AvTranscoder/properties/VideoProperties.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AvTranscoder/properties/VideoProperties.cpp b/src/AvTranscoder/properties/VideoProperties.cpp index 533742df..99b3bde2 100644 --- a/src/AvTranscoder/properties/VideoProperties.cpp +++ b/src/AvTranscoder/properties/VideoProperties.cpp @@ -173,9 +173,9 @@ std::string VideoProperties::getColorRange() const case AVCOL_RANGE_UNSPECIFIED: return "unspecified"; case AVCOL_RANGE_MPEG: - return "Head"; + return "Limited"; //< legal TV range: 16-235 with 8bits case AVCOL_RANGE_JPEG: - return "Full"; + return "Full"; // full range: 0-255 with 8bits case AVCOL_RANGE_NB: return "Not ABI"; default: