ffmpeg Changing Video Levels

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

ffmpeg Changing Video Levels

FFmpeg-users mailing list
Is there a way for ffmpeg to encode video without altering the video levels?
I know about full- (0 - 255) and limited- (16 - 235) range video. I am working on a C program to modify video levels, using ffmpeg to read video frames into my program and to write them out. No matter what I do, ffmpeg modifies the output video levels to either 16 - 235 or 0 - 255 and this defeats what I'm trying to do. Is there any way to defeat this behavior in ffmpeg?

Ideally I would like to have an encoded video file with levels in a range other than 16 -235 or 0 - 255.
Thank 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: ffmpeg Changing Video Levels

Carl Eugen Hoyos-2
Am Mi., 1. Jan. 2020 um 23:48 Uhr schrieb Chris via ffmpeg-user
<[hidden email]>:

> Is there a way for ffmpeg to encode video without altering the video levels?
> I know about full- (0 - 255) and limited- (16 - 235) range video. I am working
> on a C program to modify video levels, using ffmpeg to read video frames
> into my program and to write them out. No matter what I do, ffmpeg modifies
> the output video levels to either 16 - 235 or 0 - 255 and this defeats what I'm
> trying to do. Is there any way to defeat this behavior in ffmpeg?

If you want to use the libraries, there is another mailing list for
your question:
https://ffmpeg.org/contact.html#MailingLists

If you can reproduce your issue with ffmpeg (the command line utility) please
provide the command line together with the complete, uncut console output
so we have a chance to understand your issue.

Carl Eugen

PS: FFmpeg's v210 encoder surprisingly limits the video levels, if you
want to change this, you have to edit the FFmpeg source code.
_______________________________________________
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: ffmpeg Changing Video Levels

FFmpeg-users mailing list

"FFmpeg's v210 encoder surprisingly limits the video levels, if you
want to change this, you have to edit the FFmpeg source code."
 
 Thanks for the direct answer. That makes ffmpeg useless for my purposes.
It would be nice if ffmpeg had an option to defeat this behavior. i.e. "unity gain".

_______________________________________________
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: ffmpeg Changing Video Levels

Carl Eugen Hoyos-2
Am Do., 2. Jan. 2020 um 00:38 Uhr schrieb Chris via ffmpeg-user
<[hidden email]>:
>
> > "FFmpeg's v210 encoder surprisingly limits the video levels, if you
> > want to change this, you have to edit the FFmpeg source code."
> >
>  Thanks for the direct answer. That makes ffmpeg useless for my purposes.

Could you elaborate?

Please fix your quoting, Carl Eugen
_______________________________________________
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: ffmpeg Changing Video Levels

FFmpeg-users mailing list
In reply to this post by FFmpeg-users mailing list
>  Thanks for the direct answer. That makes ffmpeg useless for my purposes.

>  Could you elaborate?



We already have:



out_range=full  and out_range=tv



Why not have out_range=unity which does not alter the video levels at all?



I am trying to make video levels compliant with EBU R 103 which is RGB in the range 5 - 246.

I have written a C program to do this which uses ffmpeg to import and export video frames but ffmpeg makes this impossible when it overrides the video levels my program sets.



Alternatively you could have out_range=r103. The risk here is that EBU could change the values at some point in the future.



https://tech.ebu.ch/docs/r/r103.pdf



I am reluctant to delve into the source code - it's very complicated!

_______________________________________________
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: ffmpeg Changing Video Levels

Carl Zwanzig
On 1/1/2020 6:52 PM, Chris via ffmpeg-user wrote:

> I am trying to make video levels compliant with EBU R 103 which is RGB in the range 5 - 246.

> Alternatively you could have out_range=r103. The risk here is that EBU
> could change the values at some point in the future.
Of course, but any standard organization can, too.


This really sounds like a missing feature of the encoder; might be a simple
addition for someone familiar with those modules (which I am not).

Later,

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: ffmpeg Changing Video Levels

FFmpeg-users mailing list
Ideally I would like to have both: out_range=unity  and out_range=r103.
This would be the most flexible.
_______________________________________________
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: ffmpeg Changing Video Levels

Carl Eugen Hoyos-2
In reply to this post by FFmpeg-users mailing list
Am Do., 2. Jan. 2020 um 03:53 Uhr schrieb Chris via ffmpeg-user
<[hidden email]>:

> I am reluctant to delve into the source code - it's very complicated!

It's not exactly complicated to remove a few "av_clip()" from the
v210 encoder.

Carl Eugen
_______________________________________________
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: ffmpeg Changing Video Levels

FFmpeg-users mailing list
 

> It's not exactly complicated to remove a few "av_clip()" from the
> v210 encoder.

 Where do I look? Which file?
_______________________________________________
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".