[FFmpeg-user] Create a 10-bit VLog test video

Paul B Mahol onemda at gmail.com
Sat Sep 19 18:01:06 EEST 2020


On Sat, Sep 19, 2020 at 12:10 PM Michael Koch <astroelectronic at t-online.de>
wrote:

> Hello all,
>
> I want to create a 10-bit VLog test video which contains 18 levels of
> gray, according to Panasonic's VLog curve.
> The curve is documented here:
>
> https://pro-av.panasonic.net/en/cinema_camera_varicam_eva/support/pdf/VARICAM_V-Log_V-Gamut.pdf
>
> I want the leftmost bar to be black (128) and the other 17 bars are for
> -8 to +8 stops, so that the rightmost bar is at level 1023. I'm using
> this command line and the console output is copied below:
>
> ffmpeg -f lavfi -i nullsrc=s=svga,format=gray16 -lavfi
> geq=lum='st(0,trunc(18*X/W));64*(128*eq(ld(0),0)+132*eq(ld(0),1)+136*eq(ld(0),2)+144*eq(ld(0),3)+160*eq(ld(0),4)+192*eq(ld(0),5)+240*eq(ld(0),6)+298*eq(ld(0),7)+363*eq(ld(0),8)+433*eq(ld(0),9)+505*eq(ld(0),10)+578*eq(ld(0),11)+652*eq(ld(0),12)+726*eq(ld(0),13)+800*eq(ld(0),14)+874*eq(ld(0),15)+949*eq(ld(0),16)+1023*eq(ld(0),17))'
>
> -pix_fmt yuv444p10le -crf 10 -c:v h264 -t 5 -y VLog_10bit.mov
>
> The video looks perfect when played with FFplay. The leftmost bars are
> indistinguishable on a 8-bit monitor because the levels are too close
> together, but the rightmost bars look as expected.
>
> However when I play the same video with VLC, the two brightest bars at
> the right side have the same shade of gray. I don't understand why. Is
> this a problem in my video, or is it a problem in VLC?
>
> When I extraxt a 16-bit PNG image from the video, this looks as expected
> with 18 levels of gray.
> ffmpeg -i VLog_10bit.mov -frames 1 -y out.png
>
> Unrelated: I did try to add the oscilloscope filter at the end of the
> filter chain, but it seems it doesn't work with 16-bit data. There
> should be a warning or an error message. oscilloscope=tw=1:s=1
>

That happened only with gray>8 formats and have been fixed already.


>
> Michael
>
>
>
> C:\Users\astro\Desktop\Test_10-bit>c:\ffmpeg\ffmpeg -f lavfi -i
> nullsrc=s=svga,format=gray16 -lavfi
> geq=lum='st(0,trunc(18*X/W));64*(128*eq(ld(0),0)+132*eq(ld(0),1)+136*eq(ld(0),2)+144*eq(ld(0),3)+160*eq(ld(0),4)+192*eq(ld(0),5)+240*eq(ld(0),6)+298*eq(ld(0),7)+363*eq(ld(0),8)+433*eq(ld(0),9)+505*eq(ld(0),10)+578*eq(ld(0),11)+652*eq(ld(0),12)+726*eq(ld(0),13)+800*eq(ld(0),14)+874*eq(ld(0),15)+949*eq(ld(0),16)+1023*eq(ld(0),17))'
>
> -pix_fmt yuv444p10le -crf 10 -c:v h264 -t 10 -y VLog_10bit.mov
> ffmpeg version N-99135-gaa8935b395-2020-09-13-gyan-beta2 Copyright (c)
> 2000-2020 the FFmpeg developers
>    built with gcc 10.2.0 (Rev1, Built by MSYS2 project)
>    configuration: --enable-gpl --enable-version3 --enable-sdl2
> --enable-fontconfig --enable-gnutls --enable-iconv --enable-libdav1d
> --enable-libbluray --enable-libfreetype --enable-libmp3lame
> --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb
> --enable-libopenjpeg --enable-libopus --enable-libshine
> --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora
> --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp
> --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg
> --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab
> --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc
> --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
> --enable-libgsm --enable-librav1e --enable-libsvtav1 --enable-avisynth
> --enable-libopenmpt --enable-chromaprint --enable-frei0r
> --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite
> --enable-libfribidi --enable-libgme --enable-libilbc --enable-libmodplug
> --enable-librubberband --enable-libssh --enable-libzmq --enable-libzvbi
> --enable-ladspa --enable-libglslang --enable-vulkan --disable-w32threads
> --disable-autodetect --enable-libmfx --enable-ffnvcodec
> --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc
> --enable-nvdec --enable-dxva2 --enable-amf --enable-static
>    libavutil      56. 58.100 / 56. 58.100
>    libavcodec     58.106.100 / 58.106.100
>    libavformat    58. 54.100 / 58. 54.100
>    libavdevice    58. 11.101 / 58. 11.101
>    libavfilter     7. 87.100 /  7. 87.100
>    libswscale      5.  8.100 /  5.  8.100
>    libswresample   3.  8.100 /  3.  8.100
>    libpostproc    55.  8.100 / 55.  8.100
> Input #0, lavfi, from 'nullsrc=s=svga,format=gray16':
>    Duration: N/A, start: 0.000000, bitrate: N/A
>      Stream #0:0: Video: rawvideo (Y1[0][16] / 0x10003159), gray16le,
> 800x600 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
> Stream mapping:
>    Stream #0:0 (rawvideo) -> geq
>    geq -> Stream #0:0 (libx264)
> Press [q] to stop, [?] for help
> [libx264 @ 0000018100489740] using SAR=1/1
> [libx264 @ 0000018100489740] using cpu capabilities: MMX2 SSE2Fast SSSE3
> SSE4.2 AVX FMA3 BMI2 AVX2
> [libx264 @ 0000018100489740] profile High 4:4:4 Predictive, level 3.1,
> 4:4:4, 10-bit
> [libx264 @ 0000018100489740] 264 - core 161 r3018 db0d417 - H.264/MPEG-4
> AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html -
> options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7
> psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1
> 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=12
> lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0
> bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
> b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250
> keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf
> mbtree=1 crf=10.0 qcomp=0.60 qpmin=0 qpmax=81 qpstep=4 ip_ratio=1.40
> aq=1:1.00
> Output #0, mov, to 'VLog_10bit.mov':
>    Metadata:
>      encoder         : Lavf58.54.100
>      Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661),
> yuv444p10le, 800x600 [SAR 1:1 DAR 4:3], q=-1--1, 25 fps, 12800 tbn, 25 tbc
>      Metadata:
>        encoder         : Lavc58.106.100 libx264
>      Side data:
>        cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
> frame=  250 fps=8.6 q=-1.0 Lsize=      13kB time=00:00:09.88 bitrate=
> 11.0kbits/s speed=0.339x
> video:10kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
> muxing overhead: 39.237000%
> [libx264 @ 0000018100489740] frame I:1     Avg QP: 8.27  size:   541
> [libx264 @ 0000018100489740] frame P:63    Avg QP: 4.13  size:    32
> [libx264 @ 0000018100489740] frame B:186   Avg QP: 7.67  size:    35
> [libx264 @ 0000018100489740] consecutive B-frames:  0.8%  0.0%  0.0% 99.2%
> [libx264 @ 0000018100489740] mb I  I16..4: 68.6% 30.5%  0.9%
> [libx264 @ 0000018100489740] mb P  I16..4:  0.0%  0.0%  0.0% P16..4:
> 0.0%  0.0%  0.0%  0.0%  0.0%    skip:100.0%
> [libx264 @ 0000018100489740] mb B  I16..4:  0.0%  0.0%  0.0% B16..8:
> 0.6%  0.0%  0.0%  direct: 0.0%  skip:99.4%  L0: 0.0% L1:100.0% BI: 0.0%
> [libx264 @ 0000018100489740] 8x8 transform intra:30.5%
> [libx264 @ 0000018100489740] coded y,u,v intra: 0.3% 0.0% 0.0% inter:
> 0.0% 0.0% 0.0%
> [libx264 @ 0000018100489740] i16 v,h,dc,p: 100%  0%  0%  0%
> [libx264 @ 0000018100489740] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 88%  2% 10%
> 0%  0%  0%  0%  0%  0%
> [libx264 @ 0000018100489740] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 61%  0% 39%
> 0%  0%  0%  0%  0%  0%
> [libx264 @ 0000018100489740] Weighted P-Frames: Y:0.0% UV:0.0%
> [libx264 @ 0000018100489740] kb/s:7.25
>
> C:\Users\astro\Desktop\Test_10-bit>c:\ffmpeg\ffmpeg -i VLog_10bit.mov
> -frames 1 -y out.png
> ffmpeg version N-99135-gaa8935b395-2020-09-13-gyan-beta2 Copyright (c)
> 2000-2020 the FFmpeg developers
>    built with gcc 10.2.0 (Rev1, Built by MSYS2 project)
>    configuration: --enable-gpl --enable-version3 --enable-sdl2
> --enable-fontconfig --enable-gnutls --enable-iconv --enable-libdav1d
> --enable-libbluray --enable-libfreetype --enable-libmp3lame
> --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb
> --enable-libopenjpeg --enable-libopus --enable-libshine
> --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora
> --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp
> --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg
> --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab
> --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc
> --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
> --enable-libgsm --enable-librav1e --enable-libsvtav1 --enable-avisynth
> --enable-libopenmpt --enable-chromaprint --enable-frei0r
> --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite
> --enable-libfribidi --enable-libgme --enable-libilbc --enable-libmodplug
> --enable-librubberband --enable-libssh --enable-libzmq --enable-libzvbi
> --enable-ladspa --enable-libglslang --enable-vulkan --disable-w32threads
> --disable-autodetect --enable-libmfx --enable-ffnvcodec
> --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc
> --enable-nvdec --enable-dxva2 --enable-amf --enable-static
>    libavutil      56. 58.100 / 56. 58.100
>    libavcodec     58.106.100 / 58.106.100
>    libavformat    58. 54.100 / 58. 54.100
>    libavdevice    58. 11.101 / 58. 11.101
>    libavfilter     7. 87.100 /  7. 87.100
>    libswscale      5.  8.100 /  5.  8.100
>    libswresample   3.  8.100 /  3.  8.100
>    libpostproc    55.  8.100 / 55.  8.100
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VLog_10bit.mov':
>    Metadata:
>      major_brand     : qt
>      minor_version   : 512
>      compatible_brands: qt
>      encoder         : Lavf58.54.100
>    Duration: 00:00:10.00, start: 0.000000, bitrate: 10 kb/s
>      Stream #0:0: Video: h264 (High 4:4:4 Predictive) (avc1 /
> 0x31637661), yuv444p10le, 800x600 [SAR 1:1 DAR 4:3], 7 kb/s, 25 fps, 25
> tbr, 12800 tbn, 50 tbc (default)
>      Metadata:
>        handler_name    : VideoHandler
>        encoder         : Lavc58.106.100 libx264
> Stream mapping:
>    Stream #0:0 -> #0:0 (h264 (native) -> png (native))
> Press [q] to stop, [?] for help
> Output #0, image2, to 'out.png':
>    Metadata:
>      major_brand     : qt
>      minor_version   : 512
>      compatible_brands: qt
>      encoder         : Lavf58.54.100
>      Stream #0:0: Video: png, rgb48be, 800x600 [SAR 1:1 DAR 4:3],
> q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)
>      Metadata:
>        handler_name    : VideoHandler
>        encoder         : Lavc58.106.100 png
> frame=    1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
> speed=0.773x
> video:25kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
> muxing overhead: unknown
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list