BT.709 -color_primaries -color_trc -colorspace ?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

BT.709 -color_primaries -color_trc -colorspace ?

Mark Filipak
"Lions!" "And tigers!" "And bears!" "Oh, My!" -- The Wizard of Oz.

I did search for answers, but this subject is apparently too esoteric.

1, Do I need to explicitly specify BT.709 for an encoder or does ffmpeg default to it?

2, Should I specify '-color_primaries' or '-color_trc' or '-colorspace'?

Codec documentation (https://ffmpeg.org/ffmpeg-codecs.html) references to 'bt709' [1]
-color_primaries 0
-color_trc 0
-colorspace 1
[1] The integers I use assume that the documentation lists are ascending from zero.

Aside from the integer assigned, what's the difference between the '-color_primaries' & '-color_trc'
& '-colorspace' directives?

As you can see below, the transcode 'Output' status doesn't say what it defaults to.

Thanks,
Mark.


Input #0, mpegts, from 'IN.M2TS':
   Duration: 00:51:03.85, start: 600.000000, bitrate: 29370 kb/s
   Program 1
     Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p(tv, bt709, progressive),
1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Output #0, matroska, to 'OUT.MKV':
   Metadata:
     encoder         : Lavf58.31.104
     Stream #0:0: Video: hevc (libx265), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 59.94 fps,
1k tbn, 59.94 tbc
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: BT.709 -color_primaries -color_trc -colorspace ?

Paul B Mahol
On 3/30/20, Mark Filipak <[hidden email]> wrote:
> "Lions!" "And tigers!" "And bears!" "Oh, My!" -- The Wizard of Oz.
>

Please spare us from more such pointless threads.

Thanks!

> I did search for answers, but this subject is apparently too esoteric.
>
> 1, Do I need to explicitly specify BT.709 for an encoder or does ffmpeg
> default to it?
>
> 2, Should I specify '-color_primaries' or '-color_trc' or '-colorspace'?
>
> Codec documentation (https://ffmpeg.org/ffmpeg-codecs.html) references to
> 'bt709' [1]
> -color_primaries 0
> -color_trc 0
> -colorspace 1
> [1] The integers I use assume that the documentation lists are ascending
> from zero.
>
> Aside from the integer assigned, what's the difference between the
> '-color_primaries' & '-color_trc'
> & '-colorspace' directives?
>
> As you can see below, the transcode 'Output' status doesn't say what it
> defaults to.
>
> Thanks,
> Mark.
>
>
> Input #0, mpegts, from 'IN.M2TS':
>    Duration: 00:51:03.85, start: 600.000000, bitrate: 29370 kb/s
>    Program 1
>      Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448),
> yuv420p(tv, bt709, progressive),
> 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
> Output #0, matroska, to 'OUT.MKV':
>    Metadata:
>      encoder         : Lavf58.31.104
>      Stream #0:0: Video: hevc (libx265), yuv420p, 1920x1080 [SAR 1:1 DAR
> 16:9], q=2-31, 59.94 fps,
> 1k tbn, 59.94 tbc
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: BT.709 -color_primaries -color_trc -colorspace ?

Mark Filipak
On 03/30/2020 04:46 AM, Paul B Mahol wrote:
> On 3/30/20, Mark Filipak <[hidden email]> wrote:
>> "Lions!" "And tigers!" "And bears!" "Oh, My!" -- The Wizard of Oz.
>>
>
> Please spare us from more such pointless threads.

You do have a delete key, don't you?
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: BT.709 -color_primaries -color_trc -colorspace ?

FFmpeg-users mailing list
In reply to this post by Paul B Mahol
On Monday, 30 March 2020, 09:46:22 BST, Paul B Mahol <[hidden email]> wrote: 

> Please spare us from more such pointless threads.

Well, I guess that's been pretty much the overall attitude to issues with the colour handling in ffmpeg for years.

P
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: BT.709 -color_primaries -color_trc -colorspace ?

Carl Zwanzig
On 3/30/2020 2:24 AM, Phil Rhodes via ffmpeg-user wrote:
> On Monday, 30 March 2020, 09:46:22 BST, Paul B Mahol<[hidden email]>  wrote:
>> Please spare us from more such pointless threads.

> Well, I guess that's been pretty much the overall attitude to issues with
> the colour handling in ffmpeg for years.
And certainly a pointless answer.

I mean, really, this simply reinforces the reputation of the list of being
unreasonably terse or dismissive in answering actual questions. Not everyone
has a ready build environment, and many questions don't seem to need one.
Not everyone has studied the code and often isn't in a position to do that.

Paul- _why_ is that a pointless question? It seems rather rational and
specific. (Or just delete the email thread completely.)

z!
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: BT.709 -color_primaries -color_trc -colorspace ?

kumowoon1025
In reply to this post by Mark Filipak
Hi,

> I did search for answers, but this subject is apparently too esoteric.
>
> 1, Do I need to explicitly specify BT.709 for an encoder or does ffmpeg default to it?

It would depend on your target format, and I don’t think ffmpeg makes any assumptions as for defaults. the encoder might do that, or not.

I am pretty sure most encoders just indicate the colorspace of the content in the video parameters, they don’t do any conversions or anything, so it’s inferred by the consumer from the context and/or content.


> 2, Should I specify '-color_primaries' or '-color_trc' or '-colorspace'?
>
> Codec documentation (https://ffmpeg.org/ffmpeg-codecs.html) references to 'bt709' [1]
> -color_primaries 0
> -color_trc 0
> -colorspace 1
> [1] The integers I use assume that the documentation lists are ascending from zero.

You shouldn’t make that assumption… In this case apparently they mirror ISO 23001-8, and it looks like bt709 is 1 for all three.
If you are going to specify BT.709 I think specifying colorspace would suffice, otherwise if the encoder took some random combination and went with it, you’d have a pretty unusual color model .


> Aside from the integer assigned, what's the difference between the '-color_primaries' & '-color_trc' & '-colorspace' directives?

-color_primaries is for indicating the color primaries of the source. They used to be called phosphors, basically what is considered to be the primary colors in the colorspace.

The trc in -color_trc stands for transfer characteristics. It chooses the characteristic response, i guess kind of like how much of an increase in brightness a certain increase in signal voltage corresponds to. They were represented by gamma functions since CRTs, there are ones that are very different and not just a simple gamma function now (e.g. 2084, HLG, etc)

Colorspace I would say specifies the other two, or at least limits them to a few alternatives based on ntsc or pal. I think -colorspace 709 precludes the need to set primaries and trc but I could be wrong.


> As you can see below, the transcode 'Output' status doesn't say what it defaults to.

Yeah, from that I’m thinking neither libx265 nor ffmpeg has any defaults. Left to be inferred by the decoder.

Regards,
Ted Park

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".