Opened 15 months ago

Closed 15 months ago

Last modified 15 months ago

#5972 closed enhancement (fixed)

Zscale st_2084 transfer function from ZIMG

Reported by: muxketeer Owned by:
Priority: wish Component: avfilter
Version: git-master Keywords: libzimg
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When compiling ffmpeg with the latest version of ZIMG and then using the 'zscale' video filter, unable to make use of the latest transfer functions/primatries/matrix available in ZIMG via zscale video filter.
Zscale allows one to specify input/output color: primaries, transfer function, matrix, and do the transformations in a proper manner.
A couple of months back, ZIMG added the ability to specify ’st_2084’ (the SMPTE 2084 color transfer function for HDR) as a transfer function. When compiling ffmpeg with the latest version of ZIMG, expected result was the ability to specify these new values to arguments in zscale , such as ‘transfer.’
Does zscale need to be made aware of new transfer functions in ZIMG when they appear?

How to reproduce:

./ffmpeg -loglevel debug -y -start_number 86400 -f image2 -r 23.976 -i /path/to/my/422-RGB/tiffSequence%5d.tiff -t 2 -sws_flags lanczos+accurate_rnd+print_info+full_chroma_int -vf showinfo,zscale=rangein=full:primariesin=2020:transferin=st_2084:matrixin=2020_ncl:range=full:primaries=2020:transfer=st_2084:matrix=2020_ncl,format=yuv420p10 -c:v rawvideo /path/to/raw/output.yuv

ffmpeg version: N-82492-g605f308 Copyright (c) 2000-2016 the FFmpeg developers

 built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)

 configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libzimg --enable-nonfree

 libavutil      55. 40.100 / 55. 40.100

 libavcodec     57. 66.103 / 57. 66.103

 libavformat    57. 57.100 / 57. 57.100

 libavdevice    57.  2.100 / 57.  2.100

 libavfilter     6. 67.100 /  6. 67.100

 libswscale      4.  3.101 /  4.  3.101

 libswresample   2.  4.100 /  2.  4.100

 libpostproc    54.  2.100 / 54.  2.100


compiled a local version of zimg before compiling ffmpeg. then compiled ffmpeg

grabbed latest zimg from: https://github.com/sekrit-twc/zimg.git (latest as of 18NOV2016)

built on … clean image of Ubuntu 14.04.

Change History (21)

comment:1 Changed 15 months ago by cehoyos

  • Component changed from undetermined to avfilter
  • Keywords libzimg added; HDR zscale smpte2084_transfer_function removed
  • Priority changed from important to wish
  • Type changed from defect to enhancement
  • Version changed from unspecified to git-master

comment:2 Changed 15 months ago by richardpl

Should be fixed, its 'smpte2084' and not "st_2084" though.

comment:3 Changed 15 months ago by richardpl

  • Resolution set to fixed
  • Status changed from new to closed

comment:4 Changed 15 months ago by muxketeer

  • Resolution fixed deleted
  • Status changed from closed to reopened

Thanks @richardpl. I'm now able to specify the updated strings in zimg but it stills errors out with a :

ffmpeg: ./src/zimg/common/static_map.h:96: zimg::static_map<Key, T, Sz, Compare>::static_map(std::initializer_list<std::pair<_T1, _T2> >, const Compare&) [with Key = zimg_transfer_characteristics_e; T = zimg::colorspace::TransferCharacteristics; long unsigned int Sz = 8ul; Compare = std::less<zimg_transfer_characteristics_e>]: Assertion (init.size() <= Sz) && (`list size incorrect`)' failed.

The full command and output I'm seeing is as follows:

./ffmpeg -loglevel debug -y -start_number 87041 -f image2 -r 23.976 -i /path/to/my/tiff_sequence/sequence.00%5d.tiff -vf showinfo,zscale=rangein=full:primariesin=smpte432:transferin=smpte2084:matrixin=2020_ncl:range=full:primaries=2020:transfer=smpte2084:matrix=2020_ncl,format=yuv420p10 /root/myfifo1.yuv
ffmpeg version N-82665-gbda6f29 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libzimg --enable-nonfree
  libavutil      55. 41.101 / 55. 41.101
  libavcodec     57. 66.108 / 57. 66.108
  libavformat    57. 58.101 / 57. 58.101
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 67.100 /  6. 67.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-start_number' ... matched as AVOption 'start_number' with argument '87041'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'image2'.
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '23.976'.
Reading option '-i' ... matched as input file with argument '/path/to/my/tiff_sequence/sequence.00%5d.tiff'.
Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'showinfo,zscale=rangein=full:primariesin=smpte432:transferin=smpte2084:matrixin=2020_ncl:range=full:primaries=2020:transfer=smpte2084:matrix=2020_ncl,format=yuv420p10'.
Reading option '/root/myfifo1.yuv' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file /path/to/my/tiff_sequence/sequence.00%5d.tiff.
Applying option f (force format) with argument image2.
Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 23.976.
Successfully parsed a group of options.
Opening an input file: /path/to/my/tiff_sequence/sequence.00%5d.tiff.
[file @ 0x2999ae0] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x2998540] Statistics: 12441758 bytes read, 0 seeks
[tiff @ 0x2999100] compression: 1
[image2 @ 0x2997500] Probe buffer size limit of 5000000 bytes reached
Input #0, image2, from '/path/to/my/tiff_sequence/sequence.00%5d.tiff':
  Duration: 00:01:11.65, start: 0.000000, bitrate: N/A
    Stream #0:0, 1, 125/2997: Video: tiff, 1 reference frame, rgb48le, 1920x1080, 0/1, 23.98 tbr, 23.98 tbn, 23.98 tbc
Successfully opened the file.
Parsing a group of options: output file /root/myfifo1.yuv.
Applying option vf (set video filters) with argument showinfo,zscale=rangein=full:primariesin=smpte432:transferin=smpte2084:matrixin=2020_ncl:range=full:primaries=2020:transfer=smpte2084:matrix=2020_ncl,format=yuv420p10.
Successfully parsed a group of options.
Opening an output file: /root/myfifo1.yuv.
[file @ 0x299c0e0] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 32 logical cores
[Parsed_zscale_1 @ 0x29f8040] Setting 'rangein' to value 'full'
[Parsed_zscale_1 @ 0x29f8040] Setting 'primariesin' to value 'smpte432'
[Parsed_zscale_1 @ 0x29f8040] Setting 'transferin' to value 'smpte2084'
[Parsed_zscale_1 @ 0x29f8040] Setting 'matrixin' to value '2020_ncl'
[Parsed_zscale_1 @ 0x29f8040] Setting 'range' to value 'full'
[Parsed_zscale_1 @ 0x29f8040] Setting 'primaries' to value '2020'
[Parsed_zscale_1 @ 0x29f8040] Setting 'transfer' to value 'smpte2084'
[Parsed_zscale_1 @ 0x29f8040] Setting 'matrix' to value '2020_ncl'
[Parsed_format_2 @ 0x29f8e00] compat: called with args=[yuv420p10]
[Parsed_format_2 @ 0x29f8e00] Setting 'pix_fmts' to value 'yuv420p10'
[graph 0 input from stream 0:0 @ 0x29f7ea0] Setting 'video_size' to value '1920x1080'
[graph 0 input from stream 0:0 @ 0x29f7ea0] Setting 'pix_fmt' to value '42'
[graph 0 input from stream 0:0 @ 0x29f7ea0] Setting 'time_base' to value '125/2997'
[graph 0 input from stream 0:0 @ 0x29f7ea0] Setting 'pixel_aspect' to value '0/1'
[graph 0 input from stream 0:0 @ 0x29f7ea0] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x29f7ea0] Setting 'frame_rate' to value '2997/125'
[graph 0 input from stream 0:0 @ 0x29f7ea0] w:1920 h:1080 pixfmt:rgb48le tb:125/2997 fr:2997/125 sar:0/1 sws_param:flags=2
[force CFR for input from stream 0:0 @ 0x29f9520] Setting 'expr' to value 'N'
[auto-inserted scaler 0 @ 0x29fb780] Setting 'flags' to value 'bicubic'
[auto-inserted scaler 0 @ 0x29fb780] w:iw h:ih flags:'bicubic' interl:0
[force CFR for input from stream 0:0 @ 0x29f9520] auto-inserting filter 'auto-inserted scaler 0' between the filter 'graph 0 input from stream 0:0' and the filter 'force CFR for input from stream 0:0'
[AVFilterGraph @ 0x29f4f20] query_formats: 6 queried, 4 merged, 1 already done, 0 delayed
[auto-inserted scaler 0 @ 0x29fb780] picking yuv444p16le out of 44 ref:rgb48le alpha:0
[auto-inserted scaler 0 @ 0x29fb780] w:1920 h:1080 fmt:rgb48le sar:0/1 -> w:1920 h:1080 fmt:yuv444p16le sar:0/1 flags:0x4
[auto-inserted scaler 0 @ 0x29fb780] TB:0.041708 FRAME_RATE:23.976000 SAMPLE_RATE:nan
[Parsed_showinfo_0 @ 0x29f7ce0] config in time_base: 125/2997, frame_rate: 2997/125
[Parsed_showinfo_0 @ 0x29f7ce0] config out time_base: 0/0, frame_rate: 0/0
[Parsed_zscale_1 @ 0x29f8040] w:1920 h:1080 fmt:yuv444p16le sar:0/1 -> w:1920 h:1080 fmt:yuv420p10le sar:0/1
Output #0, rawvideo, to '/root/myfifo.yuv':
  Metadata:
    encoder         : Lavf57.58.101
    Stream #0:0, 0, 125/2997: Video: rawvideo, 1 reference frame (Y3[11][10] / 0xA0B3359), yuv420p10le, 1920x1080, 0/1, q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc
    Metadata:
      encoder         : Lavc57.66.108 rawvideo
Stream mapping:
  Stream #0:0 -> #0:0 (tiff (native) -> rawvideo (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    Last message repeated 1 times
[tiff @ 0x299cb80] compression: 1
[file @ 0x29f8b20] Setting default whitelist 'file,crypto'

[AVIOContext @ 0x29fb180] Statistics: 12441758 bytes read, 0 seeks
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[tiff @ 0x29ab160] compression: 1
[file @ 0x29fb180] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x29f8b20] Statistics: 12441758 bytes read, 0 seeks
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[tiff @ 0x29afda0] compression: 1
[file @ 0x29fb180] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x29f8b20] Statistics: 12441758 bytes read, 0 seeks
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[tiff @ 0x29b4c20] compression: 1
[file @ 0x29fa0c0] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x29f8b20] Statistics: 12441758 bytes read, 0 seeks
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[tiff @ 0x29b9b20] compression: 1
[file @ 0x29fa0c0] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x2a14360] Statistics: 12441758 bytes read, 0 seeks
[tiff @ 0x29bea20] compression: 1     0kB time=00:00:00.00 bitrate=N/A speed=   0x
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[file @ 0x29fa0c0] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x29f8b20] Statistics: 12441758 bytes read, 0 seeks
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[tiff @ 0x29c3920] compression: 1
[file @ 0x2a14360] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x29fa0c0] Statistics: 12441758 bytes read, 0 seeks
cur_dts is invalid (this is harmless if it occurs once at the start per stream) 0x
[tiff @ 0x29c8820] compression: 1
[file @ 0x29fa0c0] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x2a15560] Statistics: 12441758 bytes read, 0 seeks
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[tiff @ 0x29cd720] compression: 1
[file @ 0x2a15560] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x29f8b20] Statistics: 12441758 bytes read, 0 seeks
[tiff @ 0x29d2620] compression: 1     0kB time=00:00:00.00 bitrate=N/A speed=   0x
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[file @ 0x2a15560] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x29fa0c0] Statistics: 12441758 bytes read, 0 seeks
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[tiff @ 0x29d7520] compression: 1
[file @ 0x2a15560] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x2a21700] Statistics: 12441758 bytes read, 0 seeks
[tiff @ 0x29dc420] compression: 1     0kB time=00:00:00.00 bitrate=N/A speed=   0x
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[file @ 0x2a15560] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x2a21700] Statistics: 12441758 bytes read, 0 seeks
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[tiff @ 0x29e1320] compression: 1
[file @ 0x2a21700] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x2a218e0] Statistics: 12441758 bytes read, 0 seeks
cur_dts is invalid (this is harmless if it occurs once at the start per stream) 0x
[tiff @ 0x29e6220] compression: 1
[file @ 0x2a21700] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x2a21900] Statistics: 12441758 bytes read, 0 seeks
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[tiff @ 0x29eb120] compression: 1
[file @ 0x2a21700] Setting default whitelist 'file,crypto'
[AVIOContext @ 0x2a21920] Statistics: 12441758 bytes read, 0 seeks
[tiff @ 0x29f0020] compression: 1
[Parsed_showinfo_0 @ 0x29f7ce0] n:   0 pts:      0 pts_time:0       pos:       -1 fmt:yuv444p16le sar:0/1 s:1920x1080 i:P iskey:1 type:? checksum:EF8F8841 plane_checksum:[148DC5BC E80BF23D F4DBD02A] mean:[84 115 109] stdev:[61.5 62.9 61.7]
[Parsed_zscale_1 @ 0x29f8040] w:1920 h:1080 fmt:yuv444p16le sar:0/1 -> w:1920 h:1080 fmt:yuv420p10le sar:0/1
ffmpeg: ./src/zimg/common/static_map.h:96: zimg::static_map<Key, T, Sz, Compare>::static_map(std::initializer_list<std::pair<_T1, _T2> >, const Compare&) [with Key = zimg_transfer_characteristics_e; T = zimg::colorspace::TransferCharacteristics; long unsigned int Sz = 8ul; Compare = std::less<zimg_transfer_characteristics_e>]: Assertion `(init.size() <= Sz) && ("list size incorrect")' failed.

encoded 0 frames

I have double checked that my version of ZIMG is indeed 2.3.0. and according to ../zimg/zimg.pc it is version 2.3.0.

Do I need to change the way I am specifying the transfer characteristics?

comment:5 Changed 15 months ago by richardpl

You need to compile latest zimg git version because of silly bug in their code.

comment:6 Changed 15 months ago by muxketeer

Compiled latest zimg, it no longer throws the above error. However, 'matrixin=rgb' doesn't seem to be allowed. I know that there is a 'ZIMG_MATRIX_RGB' enum in the zimg lib. (it also seems that vf_scale.c makes one reference to it)

Should I open a new ticket for this, or may it be updated from reporting it here?

comment:7 Changed 15 months ago by richardpl

Because rgb matrix is automatically picked up if you use such pixel format either as input or as output. So not setting matrixin, or setting it to 'input' will also work.

comment:8 Changed 15 months ago by v0lt

How to convert HDR in the SDR via zscale?
zscale receives HDR data from avcodec?

I used a simple command

ffplay -i "The World in HDR.mkv" -vf zscale=size=hd720

but there is no conversion necessary.

comment:9 Changed 15 months ago by richardpl

Use:

ffplay -i "The World in HDR.mkv" -vf zscale=size=hd720,format=yuv420p

comment:10 Changed 15 months ago by v0lt

It does not change anything. I would like to get a result similar madvr.

PS: I am using an ffmpeg-20161122-d316b21-win64-static because version 20161127-801b5c1 and 20161130-2c908f2 write error "No such filter: 'zscale' ".

comment:11 Changed 15 months ago by richardpl

  • Resolution set to fixed
  • Status changed from reopened to closed

I'm really sorry, but you may need to manually compile your own build.

comment:12 Changed 15 months ago by muxketeer

  • Resolution fixed deleted
  • Status changed from closed to reopened

@v0lt: please use a different ticket. In my case, I compiled and installed zimg first (in Linux) then I compiled ffmpeg (in the same Linux environment) so that ffmpeg would link to the zimg lib I had previously compiled.
@richardapl: anytime I assign 'matrixin' to anything other than '2020ncl' (all else the same from OP ffmpeg command) I get the following error

[Parsed_zscale_1 @ 0x27e3100] w:1920 h:1080 fmt:yuv444p16le sar:0/1 -> w:1920 h:1080 fmt:yuv420p10le sar:0/1
[Parsed_zscale_1 @ 0x27e3100] code 3074: colorspace not present in database

I tried assigning 'matrixin' to 'input,' per your suggestion, and received the same error.

My input sequence is indeed using a rgb matrix.

Last edited 15 months ago by muxketeer (previous) (diff)

comment:13 Changed 15 months ago by richardpl

Could you please provide input file somehow and exact command you want to use?

comment:14 Changed 15 months ago by richardpl

Also, how can input use rgb matrix if it is reported as yuv444p16?

comment:15 Changed 15 months ago by muxketeer

The command I want to use is as follows:

./ffmpeg -loglevel debug -y -start_number $startNumber -f image2 -r 23.976 -i $input -vf showinfo,zscale=rangein=full:primariesin=smpte432:transferin=smpte2084:matrixin=input:range=full:primaries=2020:transfer=smpte2084:matrix=2020_ncl:filter=lanczos:dither=error_diffusion,format=yuv420p10 ~/myfifo.yuv &

According to ffprobe the pixel format is rgb48le (see below). I think the 'yuv444p16' is the pixel format it gets "up-converted" to (basically, just adding empty bits) before being converted to yuv420p.

root@71cd9cfee65a:~/ffmpeg_sources/ffmpeg_hdr/ffmpeg# ./ffprobe -show_frames -show_format -show_streams -print_format json -i /path/to/just/onetiff/inTIFFsequence0001.tiff
ffprobe version N-82665-gbda6f29 Copyright (c) 2007-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libzimg --enable-nonfree
  libavutil      55. 41.101 / 55. 41.101
  libavcodec     57. 66.108 / 57. 66.108
  libavformat    57. 58.101 / 57. 58.101
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 67.100 /  6. 67.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
{
[tiff_pipe @ 0x2d91bc0] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, tiff_pipe, from '/path/to/just/onetiff/inTIFFsequence0001.tiff':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: tiff, rgb48le, 1920x1080, 25 tbr, 25 tbn, 25 tbc
    "frames": [
        {
            "media_type": "video",
            "stream_index": 0,
            "key_frame": 1,
            "pkt_pts": 0,
            "pkt_pts_time": "0.000000",
            "pkt_dts": 0,
            "pkt_dts_time": "0.000000",
            "best_effort_timestamp": 0,
            "best_effort_timestamp_time": "0.000000",
            "pkt_duration": 1,
            "pkt_duration_time": "0.040000",
            "pkt_pos": "0",
            "pkt_size": "12441758",
            "width": 1920,
            "height": 1080,
            "pix_fmt": "rgb48le",
            "pict_type": "?",
            "coded_picture_number": 0,
            "display_picture_number": 0,
            "interlaced_frame": 0,
            "top_field_first": 0,
            "repeat_pict": 0
        }
    ],
    "streams": [
        {
            "index": 0,
            "codec_name": "tiff",
            "codec_long_name": "TIFF image",
            "codec_type": "video",
            "codec_time_base": "0/1",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "width": 1920,
            "height": 1080,
            "coded_width": 1920,
            "coded_height": 1080,
            "has_b_frames": 0,
            "sample_aspect_ratio": "0:1",
            "display_aspect_ratio": "0:1",
            "pix_fmt": "rgb48le",
            "level": -99,
            "refs": 1,
            "r_frame_rate": "25/1",
            "avg_frame_rate": "0/0",
            "time_base": "1/25",
            "nb_read_frames": "1",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            }
        }
    ],
    "format": {
        "filename": "/path/to/just/onetiff/inTIFFsequence0001.tiff",
        "nb_streams": 1,
        "nb_programs": 0,
        "format_name": "tiff_pipe",
        "format_long_name": "piped tiff sequence",
        "size": "12441758",
        "probe_score": 51
    }
}

I'll get one .tiff from the sequence to you.

comment:16 Changed 15 months ago by richardpl

Doing yuv444p16 conversion from rgb48 is very bad, it is automatically done by scale filter. There is no output support for gbrp16 so you can not use scale filter to convert packed rgb48 to planar gbrp16 one, which zscale and zimg needs. So that is unrelated bug but I understand how you feel. Will try to make output support for gbrp16 in swscale to work.

comment:17 Changed 15 months ago by muxketeer

As an alternative to entering the vast land of swscale and its many "features" :), is there a way to chain the zscale filter such that swscale filters don't get auto-added? EG have first zscale filter convert to yuv444p16 then have the next(second) zscale filter instance convert to yuv420p?
Just a brainstorm idea.
If no, thanks for fixing it in swscale.

Where is gbrp16 required? Is it the only format zscale accepts, as input, to convert to yuv420p?

Here's one .tiff encoded in the same way as the OP .tiff files.
https://www.datafilehost.com/d/73cfe550

Last edited 15 months ago by muxketeer (previous) (diff)

comment:18 Changed 15 months ago by muxketeer

I re-read your response. Somehow It didn't come through to me the first time. I now see what you're saying about gbrp16 and that zimg/zscale requires it as input. Further, I see what you're saying about swscale not properly converting and/or allowing output of proper gbrp16.

Hopefully having an example file of what I'm working with is helpful.

comment:19 Changed 15 months ago by richardpl

Tiff file is just black, anyway try latest git master the issue should now be resolved.

comment:20 Changed 15 months ago by richardpl

  • Resolution set to fixed
  • Status changed from reopened to closed

Feel free to reopen if something is still wrong.

comment:21 Changed 15 months ago by muxketeer

Thanks @richardpl. It worked, and the color came out as expected. Great work!

Last edited 15 months ago by muxketeer (previous) (diff)
Note: See TracTickets for help on using tickets.