I know that to get 8 bit rgb I need to use a 10 bit or more yuv. I couldn't find yuv444p10le, so I chose yuv444p16le (but ffprobe shows yuv444p10le anyway).
The result is not lossless. What am I doing wrong?Code:ffmpeg -y -vsync 0 -i %01d.png -pix_fmt yuv444p16le -c:v hevc_nvenc -tune lossless out.mov ffmpeg -i out.mov -pix_fmt rgb24 img/out-%03d.png ffmpeg -i img/out-%03d.png -i %01d.png -filter_complex ssim -f null - SSIM R:0.999988 (49.290492) G:1.000000 (inf) B:0.999971 (45.373878) All:0.999986 (48.665779)
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 12 of 12
Thread
-
-
Code:
Supported pixel formats: yuv420p nv12 p010le yuv444p p016le yuv444p16le bgr0 rgb0 cuda d3d11 -tune <int> E..V....... Set the encoding tuning info (from 1 to 4) (default hq) lossless 4 E..V....... Lossless
-
run ffmpeg with report active - perhaps some color space conversion is applied automatically - ffmpeg can do such things without notification...
you can try to use zscale or colorspace video filter to manually manage all this - also for lossless RGB conversion i would use personally YCgCo color space instead YUV (qood question if nvenc can be faked to use YCgCo as YUV) -
I don't know what to do about it:
Code:cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [graph 0 input from stream 0:0 @ 00000272c1abc140] Setting 'video_size' to value '1920x1080' [graph 0 input from stream 0:0 @ 00000272c1abc140] Setting 'pix_fmt' to value '26' [graph 0 input from stream 0:0 @ 00000272c1abc140] Setting 'time_base' to value '1/25' [graph 0 input from stream 0:0 @ 00000272c1abc140] Setting 'pixel_aspect' to value '3780/3780' [graph 0 input from stream 0:0 @ 00000272c1abc140] Setting 'frame_rate' to value '25/1' [graph 0 input from stream 0:0 @ 00000272c1abc140] w:1920 h:1080 pixfmt:rgba tb:1/25 fr:25/1 sar:3780/3780 [format @ 00000272c1abc800] Setting 'pix_fmts' to value 'yuv444p16le' [auto_scaler_0 @ 00000272c1abc900] Setting 'flags' to value 'bicubic' [auto_scaler_0 @ 00000272c1abc900] w:iw h:ih flags:'bicubic' interl:0 [format @ 00000272c1abc800] auto-inserting filter 'auto_scaler_0' between the filter 'Parsed_null_0' and the filter 'format' [AVFilterGraph @ 00000272c1ab6900] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed [auto_scaler_0 @ 00000272c1abc900] w:1920 h:1080 fmt:rgba sar:3780/3780 -> w:1920 h:1080 fmt:yuv444p16le sar:1/1 flags:0x4
-
libx265 is ok on 1.png
Code:ffmpeg -i 1.png -vf scale=out_color_matrix=bt709,format=yuv444p10le -c:v libx265 -x265-params lossless=1 libx265.mp4 ffmpeg -i libx265.mp4 -vf scale=in_color_matrix=bt709,format=rgb24 libx265_to_png.png ffmpeg -i libx265_to_png.png -i 1.png -filter_complex ssim -f null -
Code:[Parsed_ssim_0 @ 000000b166aa1d40] SSIM R:1.000000 (inf) G:1.000000 (inf) B:1.000000 (inf) All:1.000000 (inf)
-
Will you be able to compare source and decoded result (for example by subtracting) it could be interesting to check whether issue is in levels or in edges (simplification for this discussion).
Alternatively you can try to sent RGB without conversion to YUV - perhaps this can be issue.
Of course as always with NVEnc you should use latest NVidia API version. -
Thank you! You are right. Your settings are truly lossless, all pixels are exactly the same with a difference of 0. Nvenc is also lossless.
Do you know why ffmpeg uses yuv444p16le even though I specified yuv444p10le? Although checking after conversion with ffprobe shows that the file is yuv444p10le:
Code:ffmpeg -y -r 60 -i %01d.png -vf scale=out_color_matrix=bt709,format=yuv444p10le -c:v hevc_nvenc -tune lossless out.mov Stream mapping: Stream #0:0 -> #0:0 (png (native) -> hevc (hevc_nvenc)) Press [q] to stop, [?] for help cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream) [Parsed_scale_0 @ 000002470b93d840] Setting 'out_color_matrix' to value 'bt709' [Parsed_scale_0 @ 000002470b93d840] Setting 'flags' to value 'bicubic' [Parsed_scale_0 @ 000002470b93d840] w:iw h:ih flags:'bicubic' interl:0 [Parsed_format_1 @ 000002470b93c7c0] Setting 'pix_fmts' to value 'yuv444p10le' [graph 0 input from stream 0:0 @ 000002470b9bac40] Setting 'video_size' to value '1920x1080' [graph 0 input from stream 0:0 @ 000002470b9bac40] Setting 'pix_fmt' to value '26' [graph 0 input from stream 0:0 @ 000002470b9bac40] Setting 'time_base' to value '1/60' [graph 0 input from stream 0:0 @ 000002470b9bac40] Setting 'pixel_aspect' to value '3780/3780' [graph 0 input from stream 0:0 @ 000002470b9bac40] Setting 'frame_rate' to value '60/1' [graph 0 input from stream 0:0 @ 000002470b9bac40] w:1920 h:1080 pixfmt:rgba tb:1/60 fr:60/1 sar:3780/3780 [format @ 000002470b9bb080] Setting 'pix_fmts' to value 'yuv420p|nv12|p010le|yuv444p|p016le|yuv444p16le|bgr0|rgb0|cuda|d3d11' [auto_scaler_0 @ 000002470b9bb600] Setting 'flags' to value 'bicubic' [auto_scaler_0 @ 000002470b9bb600] w:iw h:ih flags:'bicubic' interl:0 [format @ 000002470b9bb080] auto-inserting filter 'auto_scaler_0' between the filter 'Parsed_format_1' and the filter 'format' [AVFilterGraph @ 000002470b937280] query_formats: 5 queried, 3 merged, 1 already done, 0 delayed [auto_scaler_0 @ 000002470b9bb600] picking yuv444p16le out of 8 ref:yuv444p10le alpha:0 [Parsed_scale_0 @ 000002470b93d840] w:1920 h:1080 fmt:rgba sar:3780/3780 -> w:1920 h:1080 fmt:yuv444p10le sar:1/1 flags:0x4 [auto_scaler_0 @ 000002470b9bb600] w:1920 h:1080 fmt:yuv444p10le sar:1/1 -> w:1920 h:1080 fmt:yuv444p16le sar:1/1 flags:0x4 Stream #0:0: Video: hevc (Rext) (hev1 / 0x31766568), yuv444p16le(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 2000 kb/s, 60 fps, 15360 tbn ffprobe Stream #0:0: Video: hevc (Rext) (hev1 / 0x31766568), yuv444p10le(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 67964 kb/s, 60 fps, 60 tbr, 15360 tbn, 60 tbc (default)
-
Another question. libx265 outputs 8-bit lossless rgb hevc video:
Code:ffmpeg -y -r 60 -i %01d.png -c:v libx265 -x265-params lossless=1 out.mov Stream #0:0: Video: hevc (Rext) (hev1 / 0x31766568), gbrp(pc, gbr/unknown/unknown, progressive), 1920x1080, 9468 kb/s, 60 fps, 60 tbr, 15360 tbn, 60 tbc (default)
hevc_nvenc supports: yuv420p nv12 p010le yuv444p p016le yuv444p16le bgr0 rgb0 cuda d3d11
I tried:
Code:ffmpeg -y -r 60 -i %01d.png -vf format=rgb0 -c:v hevc_nvenc -tune lossless out.mov
Last edited by qo4on; 24th Dec 2021 at 19:01.
Similar Threads
-
The quality of SONY FDR-Ax700, lossless NVENC_HEVC capture with Camlink 4K
By Truthler in forum Camcorders (DV/HDV/AVCHD/HD)Replies: 70Last Post: 11th Mar 2022, 11:43 -
PsX FMV source RGB24 - Keep quality - Create A/V Clip frop sources
By KlemNT in forum EditingReplies: 4Last Post: 29th Nov 2020, 09:42 -
Quick sanity check: Lossless to lossless encoding HuffYUV to UTVideo
By nicholasserra in forum Video ConversionReplies: 2Last Post: 20th Aug 2020, 11:41 -
nvenc_hevc encoding "B-adapt disabled" message - how to rectify?
By hydra3333 in forum Newbie / General discussionsReplies: 1Last Post: 28th Nov 2019, 15:59 -
how to convert a mkv or mp4 format H264 to an Uncompressed RGB24 AVI?
By lorenzo111 in forum Video ConversionReplies: 1Last Post: 9th Feb 2019, 08:34