Opened 5 years ago

Last modified 14 months ago

#443 open defect

-color_range AVOption appears to do nothing

Reported by: nichot20 Owned by:
Priority: normal Component: documentation
Version: git-master Keywords: h264
Cc: michael Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

according to source -color_range <int> can take the following values:-
"0" auto
"1" 16-235
"2" 0-255

and it functions on encode and decode. However altering the option value appears to make no change to the way media is processed, either on input, or output.

Attached stills sources and script to generate outputs using variations in value attached.

Attachments (3)

bars-601.png (4.1 KB) - added by nichot20 5 years ago.
16-235 range image
bars-rgb.png (2.2 KB) - added by nichot20 5 years ago.
full range (0-255) image
still2mov.sh (795 bytes) - added by nichot20 5 years ago.
script to generate outputs using varying values of -color_range

Download all attachments as: .zip

Change History (12)

Changed 5 years ago by nichot20

16-235 range image

Changed 5 years ago by nichot20

full range (0-255) image

Changed 5 years ago by nichot20

script to generate outputs using varying values of -color_range

comment:1 Changed 5 years ago by nichot20

Viewing the resultant clips using the waveform monitor in kdenlive shows all 601 source permutations the same, and all rgb permutations the same, with the two batches differing by the level differences in the original file.

comment:2 Changed 5 years ago by llogan

Is this reproducible with current git head? Also, please show your complete, uncut ffmpeg output.

comment:3 Changed 5 years ago by nichot20

Still the same with as near current as I can keep up with.:-

tux-scripts/still2mov.sh bars-rgb.png

ffmpeg version N-32542-g3867035-by_Tim, Copyright (c) 2000-2011 the FFmpeg developers

built on Sep 13 2011 08:59:23 with gcc 4.5.1 20101208 [gcc-4_5-branch revision 167585]
configuration: --prefix=/usr/local --shlibdir=/usr/local/lib64 --libdir=/usr/local/lib64 --mandir=/usr/local/man --incdir=/usr/local/include --extra-version=by_Tim --enable-gpl --enable-nonfree --enable-version3 --enable-pthreads --enable-x11grab --enable-libdc1394 --enable-libvpx --enable-libx264 --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libdirac --enable-libschroedinger --enable-libmp3lame --enable-libfaac --enable-libtheora --enable-libvorbis --enable-libfreetype --enable-filter=drawtext --enable-static --disable-shared
libavutil 51. 16. 0 / 51. 16. 0
libavcodec 53. 13. 0 / 53. 13. 0
libavformat 53. 12. 0 / 53. 12. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 40. 0 / 2. 40. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0

[image2 @ 0x1317b00] max_analyze_duration 5000000 reached at 5000000
Input #0, image2, from 'bars-rgb.png':

Duration: 00:00:00.04, start: 0.000000, bitrate: N/A

Stream #0.0, 127, 1/25: Video: png, rgb24, 720x576, 1/25, 25 fps, 25 tbr, 25 tbn, 25 tbc

[buffer @ 0x1317a80] w:720 h:576 pixfmt:rgb24 tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 0x131d360] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x1318060] w:720 h:576 fmt:rgb24 -> w:720 h:576 fmt:uyvy422 flags:0x4
Output #0, avi, to 'bars-rgb.0.avi':

Metadata:

ISFT : Lavf53.12.0
Stream #0.0, 0, 1/25: Video: rawvideo (2vuy / 0x79757632), uyvy422, 720x576, 1/25, q=2-31, 200 kb/s, 25 tbn, 25 tbc

Stream mapping:

Stream #0.0 -> #0.0 (png -> rawvideo)

Press [q] to stop, ? for help
frame= 125 fps= 39 q=0.0 Lsize= 101258kB time=00:00:05.00 bitrate=165901.9kbits/s
video:101250kB audio:0kB global headers:0kB muxing overhead 0.008372%
ffmpeg version N-32542-g3867035-by_Tim, Copyright (c) 2000-2011 the FFmpeg developers

built on Sep 13 2011 08:59:23 with gcc 4.5.1 20101208 [gcc-4_5-branch revision 167585]
configuration: --prefix=/usr/local --shlibdir=/usr/local/lib64 --libdir=/usr/local/lib64 --mandir=/usr/local/man --incdir=/usr/local/include --extra-version=by_Tim --enable-gpl --enable-nonfree --enable-version3 --enable-pthreads --enable-x11grab --enable-libdc1394 --enable-libvpx --enable-libx264 --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libdirac --enable-libschroedinger --enable-libmp3lame --enable-libfaac --enable-libtheora --enable-libvorbis --enable-libfreetype --enable-filter=drawtext --enable-static --disable-shared
libavutil 51. 16. 0 / 51. 16. 0
libavcodec 53. 13. 0 / 53. 13. 0
libavformat 53. 12. 0 / 53. 12. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 40. 0 / 2. 40. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0

[image2 @ 0x1317cc0] max_analyze_duration 5000000 reached at 5000000
Input #0, image2, from 'bars-rgb.png':

Duration: 00:00:00.04, start: 0.000000, bitrate: N/A

Stream #0.0, 127, 1/25: Video: png, rgb24, 720x576, 1/25, 25 fps, 25 tbr, 25 tbn, 25 tbc

[buffer @ 0x1317b60] w:720 h:576 pixfmt:rgb24 tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 0x131d740] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x131b1a0] w:720 h:576 fmt:rgb24 -> w:720 h:576 fmt:uyvy422 flags:0x4
Output #0, avi, to '0.bars-rgb.avi':

Metadata:

ISFT : Lavf53.12.0
Stream #0.0, 0, 1/25: Video: rawvideo (2vuy / 0x79757632), uyvy422, 720x576, 1/25, q=2-31, 200 kb/s, 25 tbn, 25 tbc

Stream mapping:

Stream #0.0 -> #0.0 (png -> rawvideo)

Press [q] to stop, ? for help
frame= 125 fps= 37 q=0.0 Lsize= 101258kB time=00:00:05.00 bitrate=165901.9kbits/s
video:101250kB audio:0kB global headers:0kB muxing overhead 0.008372%
ffmpeg version N-32542-g3867035-by_Tim, Copyright (c) 2000-2011 the FFmpeg developers

built on Sep 13 2011 08:59:23 with gcc 4.5.1 20101208 [gcc-4_5-branch revision 167585]
configuration: --prefix=/usr/local --shlibdir=/usr/local/lib64 --libdir=/usr/local/lib64 --mandir=/usr/local/man --incdir=/usr/local/include --extra-version=by_Tim --enable-gpl --enable-nonfree --enable-version3 --enable-pthreads --enable-x11grab --enable-libdc1394 --enable-libvpx --enable-libx264 --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libdirac --enable-libschroedinger --enable-libmp3lame --enable-libfaac --enable-libtheora --enable-libvorbis --enable-libfreetype --enable-filter=drawtext --enable-static --disable-shared
libavutil 51. 16. 0 / 51. 16. 0
libavcodec 53. 13. 0 / 53. 13. 0
libavformat 53. 12. 0 / 53. 12. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 40. 0 / 2. 40. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0

[image2 @ 0x1317b00] max_analyze_duration 5000000 reached at 5000000
Input #0, image2, from 'bars-rgb.png':

Duration: 00:00:00.04, start: 0.000000, bitrate: N/A

Stream #0.0, 127, 1/25: Video: png, rgb24, 720x576, 1/25, 25 fps, 25 tbr, 25 tbn, 25 tbc

[buffer @ 0x1317a80] w:720 h:576 pixfmt:rgb24 tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 0x131d360] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x1318060] w:720 h:576 fmt:rgb24 -> w:720 h:576 fmt:uyvy422 flags:0x4
Output #0, avi, to 'bars-rgb.1.avi':

Metadata:

ISFT : Lavf53.12.0
Stream #0.0, 0, 1/25: Video: rawvideo (2vuy / 0x79757632), uyvy422, 720x576, 1/25, q=2-31, 200 kb/s, 25 tbn, 25 tbc

Stream mapping:

Stream #0.0 -> #0.0 (png -> rawvideo)

Press [q] to stop, ? for help
frame= 125 fps= 40 q=0.0 Lsize= 101258kB time=00:00:05.00 bitrate=165901.9kbits/s
video:101250kB audio:0kB global headers:0kB muxing overhead 0.008372%
ffmpeg version N-32542-g3867035-by_Tim, Copyright (c) 2000-2011 the FFmpeg developers

built on Sep 13 2011 08:59:23 with gcc 4.5.1 20101208 [gcc-4_5-branch revision 167585]
configuration: --prefix=/usr/local --shlibdir=/usr/local/lib64 --libdir=/usr/local/lib64 --mandir=/usr/local/man --incdir=/usr/local/include --extra-version=by_Tim --enable-gpl --enable-nonfree --enable-version3 --enable-pthreads --enable-x11grab --enable-libdc1394 --enable-libvpx --enable-libx264 --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libdirac --enable-libschroedinger --enable-libmp3lame --enable-libfaac --enable-libtheora --enable-libvorbis --enable-libfreetype --enable-filter=drawtext --enable-static --disable-shared
libavutil 51. 16. 0 / 51. 16. 0
libavcodec 53. 13. 0 / 53. 13. 0
libavformat 53. 12. 0 / 53. 12. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 40. 0 / 2. 40. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0

[image2 @ 0x1317cc0] max_analyze_duration 5000000 reached at 5000000
Input #0, image2, from 'bars-rgb.png':

Duration: 00:00:00.04, start: 0.000000, bitrate: N/A

Stream #0.0, 127, 1/25: Video: png, rgb24, 720x576, 1/25, 25 fps, 25 tbr, 25 tbn, 25 tbc

[buffer @ 0x1317b60] w:720 h:576 pixfmt:rgb24 tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 0x131d740] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x131b1a0] w:720 h:576 fmt:rgb24 -> w:720 h:576 fmt:uyvy422 flags:0x4
Output #0, avi, to '1.bars-rgb.avi':

Metadata:

ISFT : Lavf53.12.0
Stream #0.0, 0, 1/25: Video: rawvideo (2vuy / 0x79757632), uyvy422, 720x576, 1/25, q=2-31, 200 kb/s, 25 tbn, 25 tbc

Stream mapping:

Stream #0.0 -> #0.0 (png -> rawvideo)

Press [q] to stop, ? for help
frame= 125 fps= 40 q=0.0 Lsize= 101258kB time=00:00:05.00 bitrate=165901.9kbits/s
video:101250kB audio:0kB global headers:0kB muxing overhead 0.008372%
ffmpeg version N-32542-g3867035-by_Tim, Copyright (c) 2000-2011 the FFmpeg developers

built on Sep 13 2011 08:59:23 with gcc 4.5.1 20101208 [gcc-4_5-branch revision 167585]
configuration: --prefix=/usr/local --shlibdir=/usr/local/lib64 --libdir=/usr/local/lib64 --mandir=/usr/local/man --incdir=/usr/local/include --extra-version=by_Tim --enable-gpl --enable-nonfree --enable-version3 --enable-pthreads --enable-x11grab --enable-libdc1394 --enable-libvpx --enable-libx264 --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libdirac --enable-libschroedinger --enable-libmp3lame --enable-libfaac --enable-libtheora --enable-libvorbis --enable-libfreetype --enable-filter=drawtext --enable-static --disable-shared
libavutil 51. 16. 0 / 51. 16. 0
libavcodec 53. 13. 0 / 53. 13. 0
libavformat 53. 12. 0 / 53. 12. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 40. 0 / 2. 40. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0

[image2 @ 0x1317b00] max_analyze_duration 5000000 reached at 5000000
Input #0, image2, from 'bars-rgb.png':

Duration: 00:00:00.04, start: 0.000000, bitrate: N/A

Stream #0.0, 127, 1/25: Video: png, rgb24, 720x576, 1/25, 25 fps, 25 tbr, 25 tbn, 25 tbc

[buffer @ 0x1317a80] w:720 h:576 pixfmt:rgb24 tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 0x131d360] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x1318060] w:720 h:576 fmt:rgb24 -> w:720 h:576 fmt:uyvy422 flags:0x4
Output #0, avi, to 'bars-rgb.2.avi':

Metadata:

ISFT : Lavf53.12.0
Stream #0.0, 0, 1/25: Video: rawvideo (2vuy / 0x79757632), uyvy422, 720x576, 1/25, q=2-31, 200 kb/s, 25 tbn, 25 tbc

Stream mapping:

Stream #0.0 -> #0.0 (png -> rawvideo)

Press [q] to stop, ? for help
frame= 125 fps= 37 q=0.0 Lsize= 101258kB time=00:00:05.00 bitrate=165901.9kbits/s
video:101250kB audio:0kB global headers:0kB muxing overhead 0.008372%
ffmpeg version N-32542-g3867035-by_Tim, Copyright (c) 2000-2011 the FFmpeg developers

built on Sep 13 2011 08:59:23 with gcc 4.5.1 20101208 [gcc-4_5-branch revision 167585]
configuration: --prefix=/usr/local --shlibdir=/usr/local/lib64 --libdir=/usr/local/lib64 --mandir=/usr/local/man --incdir=/usr/local/include --extra-version=by_Tim --enable-gpl --enable-nonfree --enable-version3 --enable-pthreads --enable-x11grab --enable-libdc1394 --enable-libvpx --enable-libx264 --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libdirac --enable-libschroedinger --enable-libmp3lame --enable-libfaac --enable-libtheora --enable-libvorbis --enable-libfreetype --enable-filter=drawtext --enable-static --disable-shared
libavutil 51. 16. 0 / 51. 16. 0
libavcodec 53. 13. 0 / 53. 13. 0
libavformat 53. 12. 0 / 53. 12. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 40. 0 / 2. 40. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0

[image2 @ 0x1317cc0] max_analyze_duration 5000000 reached at 5000000
Input #0, image2, from 'bars-rgb.png':

Duration: 00:00:00.04, start: 0.000000, bitrate: N/A

Stream #0.0, 127, 1/25: Video: png, rgb24, 720x576, 1/25, 25 fps, 25 tbr, 25 tbn, 25 tbc

[buffer @ 0x1317b60] w:720 h:576 pixfmt:rgb24 tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 0x131d740] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x131b1a0] w:720 h:576 fmt:rgb24 -> w:720 h:576 fmt:uyvy422 flags:0x4
Output #0, avi, to '2.bars-rgb.avi':

Metadata:

ISFT : Lavf53.12.0
Stream #0.0, 0, 1/25: Video: rawvideo (2vuy / 0x79757632), uyvy422, 720x576, 1/25, q=2-31, 200 kb/s, 25 tbn, 25 tbc

Stream mapping:

Stream #0.0 -> #0.0 (png -> rawvideo)

Press [q] to stop, ? for help
frame= 125 fps= 40 q=0.0 Lsize= 101258kB time=00:00:05.00 bitrate=165901.9kbits/s
video:101250kB audio:0kB global headers:0kB muxing overhead 0.008372

Version 0, edited 5 years ago by nichot20 (next)

comment:4 follow-up: Changed 4 years ago by cehoyos

  • Keywords h264 added
  • Status changed from new to open
  • Version changed from git to git-master

color_range is an input option that allows you to force a colour range for h264 input.

Unfortunately, this is not what the documentation of the field in avcodec.h explains...
I am not sure if this a documentation bug or if the h264 decoder has a problem.

comment:5 in reply to: ↑ 4 ; follow-up: Changed 4 years ago by nichot20

Replying to cehoyos:

color_range is an input option that allows you to force a colour range for h264 input.

Unfortunately, this is not what the documentation of the field in avcodec.h explains...
I am not sure if this a documentation bug or if the h264 decoder has a problem.

Well if its only an input option for H264 material it may only be a documentation bug as this is not how I tested it it! (Being in avcodec.h and with the current documentation it appeared to have a wider scope so I tried with non H264 source and also on output)

Is this limitation to H264 input something you just happened to know, or is it documented elsewhere?

comment:6 in reply to: ↑ 5 ; follow-up: Changed 4 years ago by cehoyos

Replying to nichot20:

Is this limitation to H264 input something you just happened to know, or is it documented elsewhere?

Neither.
I searched the source for an actual use case;-)

comment:7 in reply to: ↑ 6 Changed 4 years ago by nichot20

Replying to cehoyos:

Replying to nichot20:

Is this limitation to H264 input something you just happened to know, or is it documented elsewhere?

Neither.
I searched the source for an actual use case;-)

It would be good if it were of wider application, but in the meantime a documentation patch would help remove unwarranted expectations.

comment:8 Changed 4 years ago by richardpl

  • Component changed from undetermined to documentation

This option needs clarification.

comment:9 Changed 14 months ago by michael

  • Cc michael added
Note: See TracTickets for help on using tickets.