a -vf for broadcast safe
I was wondering if there is a means to ensure that a file is transcoded as 'broadcast safe' input a unCompressed yuv avi and get a second Uncompressed yuv avi or mov and it would be 'broadcast safe'. I wish for the functionality of the broadcast safe effect available withing final cut 6. I do not find anything in the documentation. I wonder if Hald CLUT would be of any utility. thanks jim s
Jim Shupert <jshupert <at> pps-inc.com> writes:
I was wondering if there is a means to ensure that a file is transcoded as 'broadcast safe'
Please define what "broadcast safe" means. Carl Eugen
On 11 February 2014 20:08, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
Jim Shupert <jshupert <at> pps-inc.com> writes:
I was wondering if there is a means to ensure that a file is transcoded as 'broadcast safe'
Please define what "broadcast safe" means.
Carl Eugen
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Broadcast safe means that the Y' luma levels are within the ranges defined by the broadcasters. Jim, I was looking for a solution for this as well. Take a look at this thread. http://thread.gmane.org/gmane.comp.video.ffmpeg.user/50178/focus=50180 I'd love to have your input on the matter. -- 42
Rio Kierkels <riokierkels <at> gmail.com> writes:
Jim Shupert <jshupert <at> pps-inc.com> writes:
I was wondering if there is a means to ensure that a file is transcoded as 'broadcast safe'
Broadcast safe means that the Y' luma levels are within the ranges defined by the broadcasters.
Does this mean arbitrary ranges? Arbitrary ranges are not supported by FFmpeg and I don't think it would be easy to support them. Or does this mean either 16-235 or 0-255? Both are supported by FFmpeg, if it does not work correctly for you, please provide the problematic command line together with the complete, uncut console output (here). Carl Eugen
On 2/11/2014 2:08 PM, Carl Eugen Hoyos wrote:
Jim Shupert <jshupert <at> pps-inc.com> writes:
I was wondering if there is a means to ensure that a file is transcoded as 'broadcast safe' Please define what "broadcast safe" means.
I realize this is wish list territory ........ by broadcast safe i mean http://en.wikipedia.org/wiki/Broadcast-safe and the functionality I wish to be able to replicate via something like "-vf bradcast_safe" what i ( humbely ) imagine is a 2 pass effort that 'takes a look' at the file submitted and then adjusts to " broadcast safe - maybe in a heavy handed way I wish for the functionality that one can get from dropping the FCP broadcast safe filter on a clip. http://documentation.apple.com/en/finalcutpro/usermanual/index.html#chapter=... <snip> from that page Using the Broadcast Safe FilterThe Broadcast Safe filter provides a quick way to reduce luma and chroma levels that exceed the broadcast limits for NTSC, PAL, and HD video. </snip> and 'zingo' the video is ' color corrected' bringing it into broadcast safe If all this seems pie in the sky -- forgive me. I am but a humble video artist trying to make my way in the world. Yall are the smart ones! thank you for your time & attention. best regards jim S
Jim Shupert <jshupert <at> pps-inc.com> writes:
by broadcast safe i mean http://en.wikipedia.org/wiki/Broadcast-safe
This looks like a page dedicated to analogue video to me (something that FFmpeg by definition cannot support). But it actually doesn't matter: I suggest you encode whatever you find realistic enough with FFmpeg and if the output isn't what you (or actually: the broadcaster) expects, you tell us (ie command line, complete, uncut console output, point to the input sample and explain what's wrong). I am not really convinced a filter is the right solution (although it may not be very difficult to implement): If FFmpeg does not confirm to what you ask it to do, it is a bug anyway and should probably not be fixed with a filter... Carl Eugen
I suggest you
encode whatever you find realistic enough with FFmpeg and if the output isn't what you (or actually: the broadcaster) expects, you tell us (ie command line, complete, uncut console output, point to the input sample and explain what's wrong).
That's exactly what Rio did a week ago and you told him off for it. P
On Tue, Feb 11, 2014 at 7:27 PM, Jim Shupert <jshupert@pps-inc.com> wrote:
I was wondering if there is a means to ensure that a file is transcoded as 'broadcast safe'
input a unCompressed yuv avi and get a second Uncompressed yuv avi or mov and it would be 'broadcast safe'.
I wish for the functionality of the broadcast safe effect available withing final cut 6.
I do not find anything in the documentation.
The short answer unfortunately is "no". I think the difficulty here is not to write a filter that makes the levels of the output conform to something like EBU R 103 (tech.ebu.ch/docs/r/r103.pdf, this is what European broadcasters usually use as a standard) but one that does not screw up the picture by introducing visible artifacts. If someone found a publicly available paper with an algorithm that fulfills these requirements, I guess it would be easier to get this done.
Jim Shupert <jshupert <at> pps-inc.com> writes:
input a unCompressed yuv avi and get a second Uncompressed yuv avi or mov and it would be 'broadcast safe'.
Rereading your original post: Could you provide an uncompressed yuv avi that needs the filter you have in mind? (One frame is probably enough.) Carl Eugen
On Feb 12, 2014, at 4:43 AM, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
Jim Shupert <jshupert <at> pps-inc.com> writes:
input a unCompressed yuv avi and get a second Uncompressed yuv avi or mov and it would be 'broadcast safe'.
Rereading your original post: Could you provide an uncompressed yuv avi that needs the filter you have in mind? (One frame is probably enough.)
Responding late, as I find myself in need of this filter as well. A sample that needs the filter can be generated via: ffmpeg -f lavfi -i color=gray:s=256x256 -vf format=yuv444p,geq=lum=X,scale=out_range=tv -vframes 1 -pix_fmt yuv444p -c:v rawvideo -y needsbroadcastsafe.nut ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers built with Apple LLVM version 7.0.2 (clang-700.1.81) configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libfaac --enable-libass --enable-ffplay --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 Input #0, lavfi, from 'color=gray:s=256x256': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 256x256 [SAR 1:1 DAR 1:1], 25 tbr, 25 tbn, 25 tbc Output #0, nut, to 'needsbroadcastsafe.nut': Metadata: encoder : Lavf56.40.101 Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p, 256x256 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 25 fps, 51200 tbn, 25 tbc Metadata: encoder : Lavc56.60.100 rawvideo Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native)) Press [q] to stop, [?] for help frame= 1 fps=0.0 q=-0.0 Lsize= 192kB time=00:00:00.04 bitrate=39382.2kbits/s video:192kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.154114% The result of `ffmpeg -i needsbroadcastsafe.nut -vf broadcastsafe nowbroadcastsafe.nut` would result in the output containing luma values only between 16-235 inclusively (8 bit) and 16-240 for chroma planes. Dave Rice
On Dec 30, 2015, at 12:51 PM, Dave Rice <dave@dericed.com> wrote:
On Feb 12, 2014, at 4:43 AM, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
Jim Shupert <jshupert <at> pps-inc.com> writes:
input a unCompressed yuv avi and get a second Uncompressed yuv avi or mov and it would be 'broadcast safe'.
Rereading your original post: Could you provide an uncompressed yuv avi that needs the filter you have in mind? (One frame is probably enough.)
Responding late, as I find myself in need of this filter as well.
A sample that needs the filter can be generated via:
ffmpeg -f lavfi -i color=gray:s=256x256 -vf format=yuv444p,geq=lum=X,scale=out_range=tv -vframes 1 -pix_fmt yuv444p -c:v rawvideo -y needsbroadcastsafe.nut ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers built with Apple LLVM version 7.0.2 (clang-700.1.81) configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libfaac --enable-libass --enable-ffplay --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 Input #0, lavfi, from 'color=gray:s=256x256': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 256x256 [SAR 1:1 DAR 1:1], 25 tbr, 25 tbn, 25 tbc Output #0, nut, to 'needsbroadcastsafe.nut': Metadata: encoder : Lavf56.40.101 Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p, 256x256 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 25 fps, 51200 tbn, 25 tbc Metadata: encoder : Lavc56.60.100 rawvideo Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native)) Press [q] to stop, [?] for help frame= 1 fps=0.0 q=-0.0 Lsize= 192kB time=00:00:00.04 bitrate=39382.2kbits/s video:192kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.154114%
The result of `ffmpeg -i needsbroadcastsafe.nut -vf broadcastsafe nowbroadcastsafe.nut` would result in the output containing luma values only between 16-235 inclusively (8 bit) and 16-240 for chroma planes.
Here’s an ugly method using the geq filter to force all Y samples to a 16-235 range and all U/V samples to a 16-240 range. ffmpeg -i needsbroadcastsafe.nut -vf "geq=lum=if(gt(lum(X\,Y)\,235)\,235\,if(lt(lum(X\,Y)\,16)\,16\,lum(X\,Y))):cb=if(gt(lum(X\,Y)\,240)\,240\,if(lt(lum(X\,Y)\,16)\,16\,lum(X\,Y)))" -y nowbroadcastsafe.nut ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers built with Apple LLVM version 7.0.2 (clang-700.1.81) configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libfaac --enable-libass --enable-ffplay --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 Input #0, nut, from 'needsbroadcastsafe.nut': Metadata: encoder : Lavf56.40.101 Duration: 00:00:00.36, start: 0.000000, bitrate: 43703 kb/s Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p, 256x256, SAR 1:1 DAR 1:1, 25 fps, 25 tbr, 51200 tbn, 51200 tbc Metadata: encoder : Lavc56.60.100 rawvideo Output #0, nut, to 'nowbroadcastsafe.nut': Metadata: encoder : Lavf56.40.101 Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 256x256 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 25 fps, 51200 tbn, 25 tbc Metadata: encoder : Lavc56.60.100 mpeg4 Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg4 (native)) Press [q] to stop, [?] for help frame= 10 fps=0.0 q=2.0 Lsize= 4kB time=00:00:00.40 bitrate= 91.3kbits/s video:4kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 9.206121% I’ll leave it to Kieran to complain if this is the wrong way to do this. Dave Rice
On 12/30/15, Dave Rice <dave@dericed.com> wrote:
On Feb 12, 2014, at 4:43 AM, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
Jim Shupert <jshupert <at> pps-inc.com> writes:
input a unCompressed yuv avi and get a second Uncompressed yuv avi or mov and it would be 'broadcast safe'.
Rereading your original post: Could you provide an uncompressed yuv avi that needs the filter you have in mind? (One frame is probably enough.)
Responding late, as I find myself in need of this filter as well.
A sample that needs the filter can be generated via:
ffmpeg -f lavfi -i color=gray:s=256x256 -vf format=yuv444p,geq=lum=X,scale=out_range=tv -vframes 1 -pix_fmt yuv444p -c:v rawvideo -y needsbroadcastsafe.nut ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers built with Apple LLVM version 7.0.2 (clang-700.1.81) configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libfaac --enable-libass --enable-ffplay --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 Input #0, lavfi, from 'color=gray:s=256x256': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 256x256 [SAR 1:1 DAR 1:1], 25 tbr, 25 tbn, 25 tbc Output #0, nut, to 'needsbroadcastsafe.nut': Metadata: encoder : Lavf56.40.101 Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p, 256x256 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 25 fps, 51200 tbn, 25 tbc Metadata: encoder : Lavc56.60.100 rawvideo Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native)) Press [q] to stop, [?] for help frame= 1 fps=0.0 q=-0.0 Lsize= 192kB time=00:00:00.04 bitrate=39382.2kbits/s video:192kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.154114%
The result of `ffmpeg -i needsbroadcastsafe.nut -vf broadcastsafe nowbroadcastsafe.nut` would result in the output containing luma values only between 16-235 inclusively (8 bit) and 16-240 for chroma planes.
So what it would do? Rescale everything with fixed number, just clip, or some other fancy stuff? IMHO this is scale bug, does same happens with zscale?
On Dec 30, 2015, at 12:59 PM, Paul B Mahol <onemda@gmail.com> wrote:
On 12/30/15, Dave Rice <dave@dericed.com> wrote:
On Feb 12, 2014, at 4:43 AM, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
Jim Shupert <jshupert <at> pps-inc.com> writes:
input a unCompressed yuv avi and get a second Uncompressed yuv avi or mov and it would be 'broadcast safe'.
Rereading your original post: Could you provide an uncompressed yuv avi that needs the filter you have in mind? (One frame is probably enough.)
Responding late, as I find myself in need of this filter as well.
A sample that needs the filter can be generated via:
ffmpeg -f lavfi -i color=gray:s=256x256 -vf format=yuv444p,geq=lum=X,scale=out_range=tv -vframes 1 -pix_fmt yuv444p -c:v rawvideo -y needsbroadcastsafe.nut ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers built with Apple LLVM version 7.0.2 (clang-700.1.81) configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libfaac --enable-libass --enable-ffplay --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 Input #0, lavfi, from 'color=gray:s=256x256': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 256x256 [SAR 1:1 DAR 1:1], 25 tbr, 25 tbn, 25 tbc Output #0, nut, to 'needsbroadcastsafe.nut': Metadata: encoder : Lavf56.40.101 Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p, 256x256 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 25 fps, 51200 tbn, 25 tbc Metadata: encoder : Lavc56.60.100 rawvideo Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native)) Press [q] to stop, [?] for help frame= 1 fps=0.0 q=-0.0 Lsize= 192kB time=00:00:00.04 bitrate=39382.2kbits/s video:192kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.154114%
The result of `ffmpeg -i needsbroadcastsafe.nut -vf broadcastsafe nowbroadcastsafe.nut` would result in the output containing luma values only between 16-235 inclusively (8 bit) and 16-240 for chroma planes.
So what it would do? Rescale everything with fixed number, just clip, or some other fancy stuff? IMHO this is scale bug, does same happens with zscale?
I am unfamiliar with zscale. I ran zscale=range=limited the output seems the same as the input. ffmpeg -i needsbroadcastsafe.nut -vf zscale=range=limited -pix_fmt yuv444p -c:v rawvideo -y nowbroadcastzsafe.nut ffmpeg version git-2015-12-30-2893dbf Copyright (c) 2000-2015 the FFmpeg developers built with Apple LLVM version 7.0.2 (clang-700.1.81) configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libfaac --enable-libass --enable-ffplay --enable-libzimg --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda libavutil 55. 11.100 / 55. 11.100 libavcodec 57. 20.100 / 57. 20.100 libavformat 57. 21.100 / 57. 21.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 22.100 / 6. 22.100 libavresample 3. 0. 0 / 3. 0. 0 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, nut, from 'needsbroadcastsafe.nut': Metadata: encoder : Lavf56.40.101 Duration: 00:00:00.36, start: 0.000000, bitrate: 43703 kb/s Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p, 256x256, SAR 1:1 DAR 1:1, 25 fps, 25 tbr, 51200 tbn, 51200 tbc Metadata: encoder : Lavc56.60.100 rawvideo Output #0, nut, to 'nowbroadcastzsafe.nut': Metadata: encoder : Lavf57.21.100 Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p, 256x256 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 25 fps, 51200 tbn, 25 tbc Metadata: encoder : Lavc57.20.100 rawvideo Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native)) Press [q] to stop, [?] for help frame= 10 fps=0.0 q=-0.0 Lsize= 1921kB time=00:00:00.40 bitrate=39333.5kbits/s speed= 165x video:1920kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.030212% Which zscale option would I use to create a broadcast safe output? Dave Rice
Dave Rice <dave <at> dericed.com> writes:
Responding late, as I find myself in need of this filter as well.
Instead, please explain your real-world reason why you need the filter: Do you have input that does not conform to broadcast? What does other "professional" software do with that input? Or does FFmpeg take input that conforms and produces output that does not conform? In this case you have (likely) found a bug that we should try to fix...
A sample that needs the filter can be generated via:
ffmpeg -f lavfi -i color=gray:s=256x256 -vf format=yuv444p,geq=lum=X,scale=out_range=tv
You created a formula that does not produce tv range as output (as indicated by the pix_fmt) but jpeg range. The scaler cannot know this, you have to tell it: -vf format=yuv444p,geq=lum=X,scale=in_range=jpeg:out_range=tv
ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers
For future questions, please understand that only current FFmpeg git head is supported on this mailing list.
built with Apple LLVM version 7.0.2 (clang-700.1.81) configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.4 --enable-shared
--enable-pthreads --enable-ffplay --enable-vda
These have no effect, please remove them.
--enable-gpl --enable-version3 --enable-hardcoded-tables
--enable-avresample --cc=clang
These should not be needed.
--host-cflags= --host-ldflags=
These just make reading the configure line more difficult.
--enable-opencl --enable-libx264 --enable-libmp3lame
--enable-libvo-aacenc
This was never useful together with libfaac and is now obsolete. (No runtime warning possible!)
--enable-libxvid
This was never needed. Carl Eugen
On Dec 30, 2015, at 1:40 PM, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
Dave Rice <dave <at> dericed.com> writes:
Responding late, as I find myself in need of this filter as well.
Instead, please explain your real-world reason why you need the filter: Do you have input that does not conform to broadcast?
I have video material in yuv422p pixel format that includes sample values that are outside of broadcast range. I have to deliver a version of the video where no sample values are outside of broadcast range and would like to not affect the contrast of decoded image in the process.
What does other "professional" software do with that input?
FFmpeg is the most “professional” software that I am familiar with. ;)
Or does FFmpeg take input that conforms and produces output that does not conform? In this case you have (likely) found a bug that we should try to fix…
I’m not sure this is a bug. The input file appears to be in broadcast range (yuv422p or yuv444p) but contains values that are not in broadcast range. When processed with FFmpeg those values are maintained, this is the behavior I expect; however in this case I want to adjust the process to lower or raise samples that are out-of-broadcast-range so that all samples of the output are within broadcast range.
A sample that needs the filter can be generated via:
ffmpeg -f lavfi -i color=gray:s=256x256 -vf format=yuv444p,geq=lum=X,scale=out_range=tv
You created a formula that does not produce tv range as output (as indicated by the pix_fmt) but jpeg range. The scaler cannot know this, you have to tell it: -vf format=yuv444p,geq=lum=X,scale=in_range=jpeg:out_range=tv
This isn’t exactly what I want, since this would also change the values that are within broadcast range and change the contrast of the image.
ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers
For future questions, please understand that only current FFmpeg git head is supported on this mailing list.
built with Apple LLVM version 7.0.2 (clang-700.1.81) configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.4 --enable-shared
--enable-pthreads --enable-ffplay --enable-vda
These have no effect, please remove them.
--enable-gpl --enable-version3 --enable-hardcoded-tables
--enable-avresample --cc=clang
These should not be needed.
--host-cflags= --host-ldflags=
These just make reading the configure line more difficult.
--enable-opencl --enable-libx264 --enable-libmp3lame
--enable-libvo-aacenc
This was never useful together with libfaac and is now obsolete. (No runtime warning possible!)
--enable-libxvid
This was never needed.
That installation was based on the installer from homebrew, https://github.com/Homebrew/homebrew/blob/master/Library/Formula/ffmpeg.rb. I’ve since recompiled from git master in order to test Paul’s suggestion with zscale. […] Dave Rice
Dave Rice <dave <at> dericed.com> writes:
The input file appears to be in broadcast range (yuv422p or yuv444p) but contains values that are not in broadcast range.
I don't understand this sentence. Are you aware that - afaik and I am everything but a broadcast professional - material that conforms to "broadcast" is allowed to contain (a limited number of) samples that are outside the usual limits? In any case, you will have to decide if you want to change the dynamics (contrast) of the image or if you want to clip. I had not used geq before but I suspect it supports clipping. (I am not convinced you should clip though.) For the sample command line that you provided there is no bug that can be fixed with another scaler. Carl Eugen
On 12/30/15, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
Dave Rice <dave <at> dericed.com> writes:
The input file appears to be in broadcast range (yuv422p or yuv444p) but contains values that are not in broadcast range.
I don't understand this sentence. Are you aware that - afaik and I am everything but a broadcast professional - material that conforms to "broadcast" is allowed to contain (a limited number of) samples that are outside the usual limits?
In any case, you will have to decide if you want to change the dynamics (contrast) of the image or if you want to clip. I had not used geq before but I suspect it supports clipping.
Using lut filter for clipping instead should be faster and also supports >8 bit depth.
(I am not convinced you should clip though.)
For the sample command line that you provided there is no bug that can be fixed with another scaler.
Carl Eugen
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
participants (7)
-
Carl Eugen Hoyos -
Dave Rice -
Jim Shupert -
Paul B Mahol -
Phil Rhodes -
Rio Kierkels -
Robert Krüger