Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
1st May 2016, 17:51 | #3641 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
Piping is simple. Replace ffmpeg output and x264 input file name with a "-", signal both to use y4m (since they don't have a file name they cannot guess from the file extension) and write the commands in a single line connect with a pipe symbol "|".
Code:
ffmpeg.exe -framerate 24 -i "E:\Sequence\img-%%05d.png" -strict -1 -pix_fmt yuv420p10 -f YUV4MPEGPIPE - | x265.exe --input-depth 10 --uhd-bd --preset slow --crf 18 --colorprim bt2020 --transfer smpte-st-2084 --colormatrix bt2020nc --master-display "G(8500,39850)B(6550,2300)R(35400,14600)WP(15635,16450)L(10000000,1)" --max-cll "0,0" --output "E:\x265\output.hevc" - --y4m |
1st May 2016, 17:52 | #3642 | Link |
Registered User
Join Date: Sep 2013
Posts: 919
|
It definitely works and the conversion from 16bit RGB Full range to 10bit YUV 4:2:0 Limited range is flawless.
The Y4M 10bit is properly dithered by ffmpeg and not simply truncated. A smooth 16bit grey ramp looks absolutely identical after the conversion. But if you find flaws, this will be informative to us all.
__________________
System: i7 3770K, GTX660, Win7 64bit, Panasonic ST60, Dell U2410. Last edited by James Freeman; 1st May 2016 at 17:59. |
1st May 2016, 17:56 | #3643 | Link | |
Registered User
Join Date: Sep 2013
Posts: 919
|
Quote:
Why that is absolutely PERFECT! I'm off to try it.
__________________
System: i7 3770K, GTX660, Win7 64bit, Panasonic ST60, Dell U2410. |
|
1st May 2016, 18:19 | #3645 | Link |
Registered User
Join Date: Sep 2013
Posts: 919
|
The PNG images are already in 2020 and HDR, they are exported from After Effects with Color space and range conversion with official Rec.2020 ST.2084 (PQ) profiles and edited with 1000 nit in mind.
Think of the PNG files as though I just graded a movie on a Rec.2020 ST.2084 monitor. I don't know about chroma position but it looks right to me on default settings. EDIT: The pipe works perfectly, you saved me a lot of effort, thank you!
__________________
System: i7 3770K, GTX660, Win7 64bit, Panasonic ST60, Dell U2410. Last edited by James Freeman; 1st May 2016 at 18:57. |
1st May 2016, 19:13 | #3646 | Link | |
Registered User
Join Date: Jul 2015
Posts: 708
|
Quote:
mp4box.exe -new -info -add E:\X265\output.h265:mpeg4:noedit:trailing:xps_inband E:\X265\output.mp4 or mkvmerge.exe --ui-language en --fourcc 0:HEVC --cues 0:iframes "E:\X265\output.h265" --track-order 0:0 --disable-track-statistics-tags --output "E:\X265\output.mkv" |
|
1st May 2016, 19:32 | #3647 | Link |
Registered User
Join Date: Sep 2013
Posts: 919
|
I had to add "-vf colormatrix=bt601:bt709" to ffmpeg so the RGB -> YUV color conversion will be correct.
Now it looks and measures 1:1 to the RGB. EDIT Important! The "-vf colormatrix=bt601:bt709" should be changed to "-vf scale=out_color_matrix=bt709" because the colormatrix command is only 8bit and it dithers down to 8bit. While the scale=out_color_matrix=bt709 command bypasses any conversion while retains correct chroma values between RGB to YUV conversion.
__________________
System: i7 3770K, GTX660, Win7 64bit, Panasonic ST60, Dell U2410. Last edited by James Freeman; 2nd May 2016 at 12:05. |
1st May 2016, 19:45 | #3649 | Link |
Registered User
Join Date: Sep 2013
Posts: 919
|
Okay I run a single batch file that does everything in one click:
Code:
ffmpeg.exe -framerate 24 -i "E:\x265\Sequence\%%05d.png" -strict -1 -pix_fmt yuv420p10 -vf colormatrix=bt601:bt709 -f YUV4MPEGPIPE - | x265.exe --input-depth 10 --uhd-bd --preset slow --crf 18 --colorprim bt2020 --transfer smpte-st-2084 --colormatrix bt2020nc --master-display "G(8500,39850)B(6550,2300)R(35400,14600)WP(15635,16450)L(10000000,1)" --max-cll "0,0" --output "E:\x265\output.hevc" - --y4m mp4box.exe -add E:\X265\output.hevc -new E:\X265\output.mp4 pause EDIT Important! The "-vf colormatrix=bt601:bt709" should be changed to "-vf scale=out_color_matrix=bt709" because the colormatrix command is only 8bit and it dithers down to 8bit. While the scale=out_color_matrix=bt709 command bypasses any conversion while retains correct chroma values between RGB to YUV conversion.
__________________
System: i7 3770K, GTX660, Win7 64bit, Panasonic ST60, Dell U2410. Last edited by James Freeman; 2nd May 2016 at 12:05. |
1st May 2016, 19:53 | #3650 | Link |
Registered User
Join Date: May 2014
Location: Hungary
Posts: 64
|
James, please write your post into to the 4K HDR encoding topic too and post the example files.
Ps.: As I have time I will try this with Cineform RGBA 12bit files (instead of pngs), I read somewhere that ffmpeg supports them already... but if somebody knows more please say something. |
1st May 2016, 19:56 | #3651 | Link |
Registered User
Join Date: Sep 2013
Posts: 919
|
Alright surami.
Basically What I need now is the smallest high bitdepth Image file that After Effects will render the fastest. Cineform RGBA 12bit is smaller that PNG 16bit?
__________________
System: i7 3770K, GTX660, Win7 64bit, Panasonic ST60, Dell U2410. |
1st May 2016, 20:06 | #3652 | Link |
Registered User
Join Date: May 2014
Location: Hungary
Posts: 64
|
I need to test too what you did, what was your exact visual source, settings, etc., let's continue in the other topic, if that is good for you and so poeple could follow there the process.
Last edited by surami; 1st May 2016 at 20:08. |
1st May 2016, 20:36 | #3654 | Link | |
Registered User
Join Date: Jul 2015
Posts: 708
|
Quote:
I use .h265 in MP4Box because of .hevc I had problems previously. For what purpose? Last edited by Jamaika; 1st May 2016 at 20:57. |
|
1st May 2016, 21:36 | #3656 | Link | ||
Registered User
Join Date: Sep 2013
Posts: 919
|
After few tests, OpenEXR sequence is actually smaller and faster to render than PNG, and it is in floating point too.
And most importantly ffmpeg can work with EXR. Quote:
I read somewhere that ffmpeg treats RGB as 601 so this conversion has to occur for the colors to be right in 709. After encoding I compared with the original RGB image and indeed the colors are accurate 1:1 which is important when creating calibration/measurement patterns. http://forum.videohelp.com/threads/3...122&viewfull=1 EDIT Important! The "-vf colormatrix=bt601:bt709" should be changed to "-vf scale=out_color_matrix=bt709" because the colormatrix command is only 8bit and it dithers down to 8bit. While the scale=out_color_matrix=bt709 command bypasses any conversion while retains correct chroma values between RGB to YUV conversion.
__________________
System: i7 3770K, GTX660, Win7 64bit, Panasonic ST60, Dell U2410. Last edited by James Freeman; 2nd May 2016 at 12:04. |
||
1st May 2016, 22:49 | #3657 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,783
|
If you have an ffmpeg with included libx265, you may not need to pipe to a separate x265 encoder, not even create a raw *.h265 video first. But anyway, remultiplexing to a complete MP4 container using MP4Box or L-SMASH is still recommendable, I am not sure how complete the MP4 container created by ffmpeg is (it used to be adversely arranged, due to its "filter" / FIFO behaviour: attributes only known at the end of the conversion have to be written to the end of the output).
|
1st May 2016, 23:05 | #3658 | Link | |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
|
Quote:
Looking at what Adobe Media Encoder supports, high quality options include:
Blackmagic v210 certainly works as well, although is huge. If you can get native OpenEXR to work as you describe, with the correct luma curve, that seems pretty optimal to me. In practice, the best HDR-10 mezz format is likely a high quality HEVC, as that's the only bitstream format that can include all the HDR-10 metadata, including MaxFALL and MaxCLL. And it can do chromaloc 2, if you can find a tool that'll actually do the 0.25 pel chroma sample vertical offset. That might require a whole new color space format in ffmpeg. |
|
2nd May 2016, 00:28 | #3659 | Link |
Registered User
Join Date: Dec 2014
Posts: 666
|
Guys,
Can you help me with my ghost problem. Maybe a missing switch? Doing x265 10bit 2pass via staxrip
__________________
Asus ProArt Z790 - 13th Gen Intel i9 - RTX 3080 - DDR5 64GB Predator - LG OLED C9 - Yamaha A3030 - Windows 11 x64 - PotPlayerr - Lav - MadVR |
2nd May 2016, 00:34 | #3660 | Link | |
Registered User
Join Date: Oct 2014
Posts: 23
|
Quote:
|
|
|
|