Commit 1e5f9234 authored by Dave Rice's avatar Dave Rice Committed by Michael Niedermayer

avformat/movenc: correct ImageDescription for uncompressed ycbcr

Per
https://developer.apple.com/library/content/technotes/tn2162/_index.htmlSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 77b6e3ee
...@@ -1832,6 +1832,13 @@ static int mov_write_video_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *tr ...@@ -1832,6 +1832,13 @@ static int mov_write_video_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *tr
char compressor_name[32] = { 0 }; char compressor_name[32] = { 0 };
int avid = 0; int avid = 0;
int uncompressed_ycbcr = ((track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->par->format == AV_PIX_FMT_UYVY422)
|| (track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->par->format == AV_PIX_FMT_YUYV422)
|| track->par->codec_id == AV_CODEC_ID_V308
|| track->par->codec_id == AV_CODEC_ID_V408
|| track->par->codec_id == AV_CODEC_ID_V410
|| track->par->codec_id == AV_CODEC_ID_V210);
avio_wb32(pb, 0); /* size */ avio_wb32(pb, 0); /* size */
if (mov->encryption_scheme != MOV_ENC_NONE) { if (mov->encryption_scheme != MOV_ENC_NONE) {
ffio_wfourcc(pb, "encv"); ffio_wfourcc(pb, "encv");
...@@ -1842,11 +1849,15 @@ static int mov_write_video_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *tr ...@@ -1842,11 +1849,15 @@ static int mov_write_video_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *tr
avio_wb16(pb, 0); /* Reserved */ avio_wb16(pb, 0); /* Reserved */
avio_wb16(pb, 1); /* Data-reference index */ avio_wb16(pb, 1); /* Data-reference index */
if (uncompressed_ycbcr) {
avio_wb16(pb, 2); /* Codec stream version */
} else {
avio_wb16(pb, 0); /* Codec stream version */ avio_wb16(pb, 0); /* Codec stream version */
}
avio_wb16(pb, 0); /* Codec stream revision (=0) */ avio_wb16(pb, 0); /* Codec stream revision (=0) */
if (track->mode == MODE_MOV) { if (track->mode == MODE_MOV) {
ffio_wfourcc(pb, "FFMP"); /* Vendor */ ffio_wfourcc(pb, "FFMP"); /* Vendor */
if (track->par->codec_id == AV_CODEC_ID_RAWVIDEO) { if (track->par->codec_id == AV_CODEC_ID_RAWVIDEO || uncompressed_ycbcr) {
avio_wb32(pb, 0); /* Temporal Quality */ avio_wb32(pb, 0); /* Temporal Quality */
avio_wb32(pb, 0x400); /* Spatial Quality = lossless*/ avio_wb32(pb, 0x400); /* Spatial Quality = lossless*/
} else { } else {
...@@ -1870,7 +1881,10 @@ static int mov_write_video_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *tr ...@@ -1870,7 +1881,10 @@ static int mov_write_video_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *tr
avio_w8(pb, strlen(compressor_name)); avio_w8(pb, strlen(compressor_name));
avio_write(pb, compressor_name, 31); avio_write(pb, compressor_name, 31);
if (track->mode == MODE_MOV && track->par->bits_per_coded_sample) if (track->mode == MODE_MOV &&
(track->par->codec_id == AV_CODEC_ID_V410 || track->par->codec_id == AV_CODEC_ID_V210))
avio_wb16(pb, 0x18);
else if (track->mode == MODE_MOV && track->par->bits_per_coded_sample)
avio_wb16(pb, track->par->bits_per_coded_sample | avio_wb16(pb, track->par->bits_per_coded_sample |
(track->par->format == AV_PIX_FMT_GRAY8 ? 0x20 : 0)); (track->par->format == AV_PIX_FMT_GRAY8 ? 0x20 : 0));
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment