Opened 14 months ago

Closed 5 months ago

#5852 closed defect (fixed)

ProRes Color range tags not working

Reported by: RuudKaag Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: prores, color range
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Hi guys,

I've run in to some problems while trying to convert ProRes? 4444XQ to any form ProRes? 422.

Summary of the bug:

The ProRes? 4444XQ files i get from Autodesk Flame contains bt709 color space, color transfer and color primaries tags.
When i encode it to any ProRes? 422 format those values are specified as unknown and N/A
(Similar issue goes for sample aspect ratio and display aspect ratio in the video filter by the way
But not my immediate concern)

The issue is that our Source ProRes? contains data levels.
I want to get my ProRes? 422 to display legal range as the encoded file is scaled to legal.
But for some reason the ProRes? 422 produced with ffmpeg seems to display as data levels.
I've encoded the file using Adobe Media encoder as well and the waveforms of both ProRes? 422's are identical but display different colors in Quicktime 7, 10 and Telestream Switch.

(I know some people will say that i should not rely on Quicktime but the thing is most (if not all) of our clients are.)

Plus the ProRes? 422 encoded in Media Encoder displays the image just fine in all players mentioned above.
I'm guessing this has to do with the color tags not coming thru.

Perhaps i'm just looking in the wrong direction to fix this issue but if anyone has anything on the matter please let me know.

I've attached the Source file, ffmpeg log and the ffprobe logs of both source and encoded ffmpeg and Media Encoder ProRes422 on the following link:

ftp://ffmpeg:c684!temp@ftp.theambassadors.nl

How to reproduce:

% ffmpeg -i input -y -c:v prores -profile:v 1 -pix_fmt yuv422p10le -vf scale=1920x1080,setsar=1/1,setdar=16/9 -colorspace bt709 -color_primaries bt709 -color_trc bt709 output
ffmpeg version 3.1.3

If there are any questions or if i left some specific details out, please let me know.

Thanks in advance,

Ruud Kaag
Media Manager
Ambassadors Studio

Attachments (1)

ARIB_STD-B28_FULLRANGE_BT709_Test_Sequence_ProRess422LT_from-ffmpeg_20160919_Log.txt (60.9 KB) - added by RuudKaag 14 months ago.
ffmpeg log

Download all attachments as: .zip

Change History (21)

comment:1 Changed 14 months ago by cehoyos

  • Component changed from ffmpeg to avcodec

Is this an issue with the decoder or the encoder?

comment:2 Changed 14 months ago by RuudKaag

Hi cehoyos,

Sorry, i'm not sure.
As far as i can tell the source file is read properly and when i create a H264 mp4 from the source file with the color tags it works just fine.
So i'm guessing its the Encoder.

This is my first time posting so apologies for my lack of knowledge and poor description on the issue.

comment:3 Changed 14 months ago by cehoyos

Does it work better with -c:v prores_ks?

comment:4 Changed 14 months ago by RuudKaag

I Just ran the string with prores_ks, unfortunately the result is exactly the same as the regular prores decoder.

comment:5 Changed 14 months ago by richardpl

What happens if you use -c:v prores_ks as encoder ?

comment:6 Changed 14 months ago by RuudKaag

Nothing different than the regular prores when i look at the log and the eventual result.
I've been trying to fix/get a grip of this issue in prores for over 3 months now so there's not a lot of options left that i haven't tried.
My guess is that the issue lies somewhere in the source code of the encoder, not recognising the options and filters i'm using in my string.

comment:7 Changed 14 months ago by richardpl

Please provide input sample you use.

comment:8 Changed 14 months ago by RuudKaag

I've put the sample and the ffprobe result of both the source, ffmpeg prores and media encoder prores in the following ftp link.

ftp://ffmpeg:c684!temp@ftp.theambassadors.nl/

comment:9 Changed 14 months ago by richardpl

comment:10 Changed 14 months ago by RuudKaag

I'm sorry,

The source file should be there now.

ftp://ffmpeg:c684!temp@ftp.theambassadors.nl/Source

comment:11 Changed 14 months ago by richardpl

Problem is that somehow your -color* options are ignored and always unspecified, 2 value is stored in bitstream.

comment:12 Changed 14 months ago by RuudKaag

I figured as much.
Same goes for video filters like set_sar and set_dar.
Could it be that the options and filters are just not being passed thru to the prores encoder or something?
I'm not sure what that value is or does, i'm a complete noob in programming and stuff like this sorry for that.

Last edited 14 months ago by RuudKaag (previous) (diff)

comment:13 Changed 14 months ago by richardpl

Workaround is to add -movflags +write_colr before output.

comment:14 follow-ups: Changed 14 months ago by RuudKaag

Thanks richardpl!
Works like a charm.
I don't suppose there's a similar solution for the sample aspect ratio en display aspect ratio is there? 0:-)

comment:15 in reply to: ↑ 14 Changed 14 months ago by cehoyos

Replying to RuudKaag:

I don't suppose there's a similar solution for the sample aspect ratio en display aspect ratio is there? 0:-)

Please elaborate (ideally on the user mailing list)!

comment:16 in reply to: ↑ 14 Changed 14 months ago by richardpl

Replying to RuudKaag:

I don't suppose there's a similar solution for the sample aspect ratio en display aspect ratio is there? 0:-)

For some reason mov muxer does not write sample aspect ratio if nominator and denominator are same. So only way to fix this is to patch muxer.

comment:17 Changed 14 months ago by richardpl

Mov muxer should now write sar, even if it is 1/1, so if you use setsar=1/1 it should now be recognized, similar applies to dar.

Last edited 14 months ago by richardpl (previous) (diff)

comment:18 Changed 14 months ago by RuudKaag

Hey Richrard,

Thanks a lot.
Where can i find the patched version?
(I've always used the static builds...) I think i can figure out compiling it my self, i hope :-D.

But once again thanks a lot for your help!

comment:19 Changed 14 months ago by richardpl

It is in latest master.

comment:20 Changed 5 months ago by richardpl

  • Resolution set to fixed
  • Status changed from new to closed

If there ever was an issue, it is fixed in latest master.

Note: See TracTickets for help on using tickets.