[FFmpeg-cvslog] avformat/movenc: respect color_range when encoding dnxhd.

Mark Boorer git at videolan.org
Wed Jul 9 00:45:15 CEST 2014


ffmpeg | branch: master | Mark Boorer <markboo99 at gmail.com> | Tue Jul  8 22:09:57 2014 +0100| [352756ecae8f8868ff756ad3da098c29ce2276f1] | committer: Michael Niedermayer

avformat/movenc: respect color_range when encoding dnxhd.

Set the ACLR atom appropriately for legal / full range.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=352756ecae8f8868ff756ad3da098c29ce2276f1
---

 libavformat/movenc.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 919ae58..7e737b0 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -807,7 +807,11 @@ static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
     ffio_wfourcc(pb, "ACLR");
     ffio_wfourcc(pb, "ACLR");
     ffio_wfourcc(pb, "0001");
-    avio_wb32(pb, 2); /* yuv range: full 1 / normal 2 */
+    if (track->enc->color_range == AVCOL_RANGE_MPEG) { /* Legal range (16-235) */
+        avio_wb32(pb, 1); /* Corresponds to 709 in official encoder */
+    } else { /* Full range (0-255) */
+        avio_wb32(pb, 2); /* Corresponds to RGB in official encoder */
+    }
     avio_wb32(pb, 0); /* unknown */
 
     avio_wb32(pb, 24); /* size */



More information about the ffmpeg-cvslog mailing list