Re: [FFmpeg-devel] [PATCH] avformat/movenc: correct ImageDescription depth for v210 v410

2017-11-17 Thread Michael Niedermayer
On Thu, Nov 16, 2017 at 06:27:38PM -0500, Dave Rice wrote:
> 
> > On Nov 16, 2017, at 6:08 PM, Carl Eugen Hoyos  wrote:
> > 
> > 2017-11-16 17:54 GMT+01:00 Dave Rice :
> > 
> >> +if (track->mode == MODE_MOV && track->par->codec_id == 
> >> AV_CODEC_ID_V410)
> >> +avio_wb16(pb, 0x18);
> >> +else if (track->mode == MODE_MOV && track->par->codec_id == 
> >> AV_CODEC_ID_V210)
> >> +avio_wb16(pb, 0x18);
> > 
> > It appears you can merge the two cases.
> 
> The patch is updated with merged cases below.
> 
> > Or maybe patch bits_per_coded_sample in the encoder…
> 
> 
> With Apple’s TN2162 there doesn’t appear to be a reliable relationship 
> between the bits_per_coded_sample and what the ImageDescription depth value 
> should be for the uncompressed yuv formats. TN2162 simply lists what the 
> depth value should be and this patch corrects the few instances, where 
> ffmpeg’s behavior doesn’t correlate to what TN2162 defines.
> 
> 
> From cfa5b2cd959154f2896a9557d9ca2ed2d2d3834e Mon Sep 17 00:00:00 2001
> From: Dave Rice 
> Date: Thu, 16 Nov 2017 11:53:32 -0500
> Subject: [PATCH 2/2] avformat/movenc: correct ImageDescription depth for v210
>  v410

please add a fate test
LGTM if its tested

thx
[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Does the universe only have a finite lifespan? No, its going to go on
forever, its just that you wont like living in it. -- Hiranya Peiri


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/movenc: correct ImageDescription depth for v210 v410

2017-11-16 Thread Dave Rice

> On Nov 16, 2017, at 6:08 PM, Carl Eugen Hoyos  wrote:
> 
> 2017-11-16 17:54 GMT+01:00 Dave Rice :
> 
>> +if (track->mode == MODE_MOV && track->par->codec_id == AV_CODEC_ID_V410)
>> +avio_wb16(pb, 0x18);
>> +else if (track->mode == MODE_MOV && track->par->codec_id == 
>> AV_CODEC_ID_V210)
>> +avio_wb16(pb, 0x18);
> 
> It appears you can merge the two cases.

The patch is updated with merged cases below.

> Or maybe patch bits_per_coded_sample in the encoder…


With Apple’s TN2162 there doesn’t appear to be a reliable relationship between 
the bits_per_coded_sample and what the ImageDescription depth value should be 
for the uncompressed yuv formats. TN2162 simply lists what the depth value 
should be and this patch corrects the few instances, where ffmpeg’s behavior 
doesn’t correlate to what TN2162 defines.


From cfa5b2cd959154f2896a9557d9ca2ed2d2d3834e Mon Sep 17 00:00:00 2001
From: Dave Rice 
Date: Thu, 16 Nov 2017 11:53:32 -0500
Subject: [PATCH 2/2] avformat/movenc: correct ImageDescription depth for v210
 v410

Per
https://developer.apple.com/library/content/technotes/tn2162/_index.html
.
---
 libavformat/movenc.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 98fcc7a44b..d9d3c2bf1e 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1896,7 +1896,10 @@ static int mov_write_video_tag(AVIOContext *pb, 
MOVMuxContext *mov, MOVTrack *tr
 avio_w8(pb, strlen(compressor_name));
 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 |
   (track->par->format == AV_PIX_FMT_GRAY8 ? 0x20 : 0));
 else
-- 
2.15.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/movenc: correct ImageDescription depth for v210 v410

2017-11-16 Thread Carl Eugen Hoyos
2017-11-16 17:54 GMT+01:00 Dave Rice :

> +if (track->mode == MODE_MOV && track->par->codec_id == AV_CODEC_ID_V410)
> +avio_wb16(pb, 0x18);
> +else if (track->mode == MODE_MOV && track->par->codec_id == 
> AV_CODEC_ID_V210)
> +avio_wb16(pb, 0x18);

It appears you can merge the two cases.

Or maybe patch bits_per_coded_sample in the encoder...

Thank you, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel