-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Color space/primaries/transfer not parsed correctly for HDR video #102
Comments
I can upload the source and output video clip if you need them. |
FastFlix v3.3.1, ffmpeg and libraries version can be seen in attachments |
Interesting, does it not have hdr10 metadata? (I think the issue is I don't currently specify the colorprim and so on if it doesn't have that, even if it is bt2020, so that needs fixed) Could you give the output of this command:
|
Output for source file:
|
Thank you, and I did just check that even without HDR10 metadata, it should still pass that info in. So I am unsure the issue. If you could share the clip (even a few seconds of it should be enough to test with |
I haven't done any specific updates in 3.4.0 that would change this behavior, but it's worth a try quick try to see if they appear in the command window. |
Writing these in additional x265 parameters also fixes color problem |
Input clip 20 secs: http://www.filedropper.com/kyotosample |
Also a question: If a newer version of FastFlix requires ffmpeg newer than which already exists on one computer, will the user be prompted to upgrade ffmpeg(on Windows)? |
Using 3.4.0, force HDR10 signaling&HDR10 optimizations&Repeat headers checked, Still no color-space-related data in the commands. Pass 1: |
Still no color space data in ffprobe, and no correct color. |
Thank you so much for the sample video! It seems And to answer the question abot FFmpeg, currently it does not have a way to auto-update. As the default FFmpeg is a nightly build, it would change every day. I do want to add a button to "download newest version" in the GUI and have done work on that front, just want a good way to have a progress bar or something so the user doesn't think it's frozen during the long download. |
Waiting for final 3.4.1 release & many thanks to your hardworking. |
* Fixing #102 color space and HDR details not parsed from webm correctly (thanks to leonardyan) * Fixing no warning messages for HDR10+ experimental feature
Should be good to go with 3.4.1 let me know if you run into more issues! Thanks for the help! |
Cool! Now everything seems OK. But why these master-display data in the generated commands look so weird and don't match with the source file? Pass 1: |
Good catch, the issue is all videos I have come across usually have the full ratios. For example:
The video you provided seems to reduce them:
So I need to do mathz to get them back to the proper ratio before putting them in. |
…er than x265 as well * Fixing HDR10+ details on README * Fixing #102 better with taking into account master-display ratios (thanks to leonardyan)
Is this another problem related to webm or vp9? |
I think it's just different containers / encoders are going to do things slightly differently. And I won't be able to account for them until I see them so if you have any others with issues after this fix, keep sending 'em! |
* Fixing color space details being passed correctly to everything other than x265 as well * Fixing HDR10+ details on README * Fixing #102 better with taking into account master-display ratios (thanks to leonardyan) * Fixing VP9 to accept profiles so HDR10 can be copied properly * Fixing #108 HEVC can select wrong video track for encoding (thanks to Zeid164)
Re-fixed in 3.4.2 |
I'm converting an HDR clip with BT.2020 color space and PQ(HDR10) transfer. The source file's HDR-related ffprobe JSON output says:
For the conversion options, I chose 20000kbps 2-pass, modified output filename, and remained everything else as default, including "Remove HDR" as No.
Pass 1 command line, generated by FastFlix:
"C:\Users\25305\AppData\Roaming\FFmpeg\bin\ffmpeg.exe" -y -i "E:/kyoto.original.webm" -max_muxing_queue_size 1024 -map 0:0 -c:v libx265 -pix_fmt yuv420p10le -x265-params ":pass=1:no-slow-firstpass=1" -passlogfile "C:\Users\25305\AppData\Roaming\FastFlix\temp_7t8l2imn\pass_log_file_482a2118f87cd48affc0.log" -b:v 20000k -preset medium -an -sn -dn -f mp4 NUL
Pass 2 command line:
"C:\Users\25305\AppData\Roaming\FFmpeg\bin\ffmpeg.exe" -y -i "E:/kyoto.original.webm" -max_muxing_queue_size 1024 -map 0:0 -c:v libx265 -pix_fmt yuv420p10le -x265-params ":pass=2" -passlogfile "C:\Users\25305\AppData\Roaming\FastFlix\temp_7t8l2imn\pass_log_file_482a2118f87cd48affc0.log" -b:v 20000k -preset medium -map_metadata -1 -map_chapters 0 -map 0:1 -metadata:s:1 title="" -metadata:s:1 handler="" -metadata:s:1 language=eng -c:1 copy "E:/kyoto.2passtest.mp4"
Seems no HDR-related data, other than pixel format, appeared in the commands.
After conversion I played the output file on an HDR-enabled device. The color was incorrect, looked pale. The output file's HDR-related ffprobe JSON output says:
Color space/primaries/transfer data from the original clip seem to be lost. This problem also appeared in CRF encoding.
Full ffprobe output of both these 2 clips are included in attachments.
input_file_full_ffprobe.txt
output_file_full_ffprobe.txt
Finally I solved this problem with command line ffmpeg:
ffmpeg -i E:/kyoto.original.webm -map 0 -c:v libx265 -x265-params hdr-opt=1:repeat-headers=1:colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:max-cll=0,0 -crf 20 -preset veryfast -pix_fmt yuv420p10le E:/kyoto.crf20-veryfast.mp4
I removed the master-display data because ffmpeg spits out error when I tried to manually specify it.
The output file played well, the color was correct(maybe, I'm not able to tell if there's any subtle color difference between source and output, but absolutly better than the previous output), and in the output file's ffprobe all HDR-related entries were back(including master-display).
The text was updated successfully, but these errors were encountered: