[FFmpeg-trac] #4812(undetermined:new): scale filter does not apply pure range change

FFmpeg trac at avcodec.org
Fri Aug 28 17:28:33 CEST 2015


#4812: scale filter does not apply pure range change
-------------------------------------+-------------------------------------
             Reporter:  rmk          |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 It appears the scale filter (or libswscale underneath) does not scale the
 input if only the range (tv vs. pc) has to be changed.

 Steps to reproduce:

 1) Produce a file that contains tv range (16-235) luma values
 {{{
 ffmpeg -i ~/tmp/colortest/gradient-broadcast-range.mov -vf
 scale=in_range=tv:out_range=pc -c:v ffv1 ~/tmp/colortest/tv-to-full.mov
 ffmpeg version N-74650-ga16251a Copyright (c) 2000-2015 the FFmpeg
 developers
   built with Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM
 3.6.0svn)
   configuration: --enable-gpl
   libavutil      54. 31.100 / 54. 31.100
   libavcodec     56. 58.100 / 56. 58.100
   libavformat    56. 40.101 / 56. 40.101
   libavdevice    56.  4.100 / 56.  4.100
   libavfilter     5. 37.100 /  5. 37.100
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  2.101 /  1.  2.101
   libpostproc    53.  3.100 / 53.  3.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/krueger/tmp/colortest
 /gradient-broadcast-range.mov':
   Metadata:
     major_brand     : qt
     minor_version   : 512
     compatible_brands: qt
     encoder         : Lavf56.40.101
   Duration: 00:00:00.04, start: 0.000000, bitrate: 2628 kb/s
     Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646), yuv420p, 256x256,
 2483 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
     Metadata:
       handler_name    : DataHandler
       encoder         : Lavc56.58.100 ffv1
 [mov @ 0x7fea32013200] Using MS style video codec tag, the file may be
 unplayable!
 Output #0, mov, to '/Users/krueger/tmp/colortest/tv-to-full.mov':
   Metadata:
     major_brand     : qt
     minor_version   : 512
     compatible_brands: qt
     encoder         : Lavf56.40.101
     Stream #0:0(eng): Video: ffv1, yuv420p, 256x256, q=2-31, 200 kb/s, 25
 fps, 12800 tbn, 25 tbc (default)
     Metadata:
       handler_name    : DataHandler
       encoder         : Lavc56.58.100 ffv1
 Stream mapping:
   Stream #0:0 -> #0:0 (ffv1 (native) -> ffv1 (native))
 Press [q] to stop, [?] for help
 frame=    1 fps=0.0 q=-0.0 Lsize=      13kB time=00:00:00.04
 bitrate=2628.6kbits/s
 video:12kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 5.846823%
 }}}

 2) Verify the range is correct

 {{{
 ffprobe  -f lavfi movie=/Users/krueger/tmp/colortest/gradient-broadcast-
 range.mov,signalstats -show_entries
 frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
 ffprobe version N-74650-ga16251a Copyright (c) 2007-2015 the FFmpeg
 developers
   built with Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM
 3.6.0svn)
   configuration: --enable-gpl
   libavutil      54. 31.100 / 54. 31.100
   libavcodec     56. 58.100 / 56. 58.100
   libavformat    56. 40.101 / 56. 40.101
   libavdevice    56.  4.100 / 56.  4.100
   libavfilter     5. 37.100 /  5. 37.100
   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 'movie=/Users/krueger/tmp/colortest/gradient-
 broadcast-range.mov,signalstats':
   Duration: N/A, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 256x256
 [SAR 1:1 DAR 1:1], 12800 tbr, 12800 tbn, 12800 tbc
 [FRAME]
 TAG:lavfi.signalstats.YMIN=16
 TAG:lavfi.signalstats.YMAX=235
 [/FRAME]
 }}}

 3) Attempt to scale this to full range

 {{{
 ffmpeg -i ~/tmp/colortest/gradient-broadcast-range.mov -vf
 scale=in_range=tv:out_range=pc -c:v ffv1 -y ~/tmp/colortest/tv-to-full.mov
 ffmpeg version N-74650-ga16251a Copyright (c) 2000-2015 the FFmpeg
 developers
   built with Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM
 3.6.0svn)
   configuration: --enable-gpl
   libavutil      54. 31.100 / 54. 31.100
   libavcodec     56. 58.100 / 56. 58.100
   libavformat    56. 40.101 / 56. 40.101
   libavdevice    56.  4.100 / 56.  4.100
   libavfilter     5. 37.100 /  5. 37.100
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  2.101 /  1.  2.101
   libpostproc    53.  3.100 / 53.  3.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/krueger/tmp/colortest
 /gradient-broadcast-range.mov':
   Metadata:
     major_brand     : qt
     minor_version   : 512
     compatible_brands: qt
     encoder         : Lavf56.40.101
   Duration: 00:00:00.04, start: 0.000000, bitrate: 190 kb/s
     Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646), yuv420p, 256x256,
 45 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
     Metadata:
       handler_name    : DataHandler
       encoder         : Lavc56.58.100 ffv1
 [mov @ 0x7fed4080fc00] Using MS style video codec tag, the file may be
 unplayable!
 Output #0, mov, to '/Users/krueger/tmp/colortest/tv-to-full.mov':
   Metadata:
     major_brand     : qt
     minor_version   : 512
     compatible_brands: qt
     encoder         : Lavf56.40.101
     Stream #0:0(eng): Video: ffv1, yuv420p, 256x256, q=2-31, 200 kb/s, 25
 fps, 12800 tbn, 25 tbc (default)
     Metadata:
       handler_name    : DataHandler
       encoder         : Lavc56.58.100 ffv1
 Stream mapping:
   Stream #0:0 -> #0:0 (ffv1 (native) -> ffv1 (native))
 Press [q] to stop, [?] for help
 frame=    1 fps=0.0 q=-0.0 Lsize=       1kB time=00:00:00.04 bitrate=
 190.2kbits/s
 video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 322.666656%
 }}}

 4) Check actual range of output file

 {{{
 ffprobe  -f lavfi movie=/Users/krueger/tmp/colortest/tv-to-
 full.mov,signalstats -show_entries
 frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
 ffprobe version N-74650-ga16251a Copyright (c) 2007-2015 the FFmpeg
 developers
   built with Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM
 3.6.0svn)
   configuration: --enable-gpl
   libavutil      54. 31.100 / 54. 31.100
   libavcodec     56. 58.100 / 56. 58.100
   libavformat    56. 40.101 / 56. 40.101
   libavdevice    56.  4.100 / 56.  4.100
   libavfilter     5. 37.100 /  5. 37.100
   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 'movie=/Users/krueger/tmp/colortest/tv-to-
 full.mov,signalstats':
   Duration: N/A, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 256x256
 [SAR 1:1 DAR 1:1], 12800 tbr, 12800 tbn, 12800 tbc
 [FRAME]
 TAG:lavfi.signalstats.YMIN=16
 TAG:lavfi.signalstats.YMAX=235
 [/FRAME]
 }}}

 Related discussion on the mailing list:
 http://thread.gmane.org/gmane.comp.video.ffmpeg.user/57005/focus=57093

--
Ticket URL: <https://trac.ffmpeg.org/ticket/4812>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list