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.

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion

Reply
 
Thread Tools Search this Thread Display Modes
Old 4th December 2024, 23:31   #1  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 304
Shutter Encoder 709 Colors

Here is a sample of my video without any colorimetry flags:
https://www.mediafire.com/file/0r160...video.mkv/file

Now use Shutter Encoder make png files and/or an apng out of it. Do they have the 709 colors or the 601 ones? Did they have the gAMA and cHRM tag issues?

You can get Shutter Encoder here:
https://www.shutterencoder.com/

Last edited by jay123210599; 5th December 2024 at 22:29.
jay123210599 is offline   Reply With Quote
Old 4th December 2024, 23:58   #2  |  Link
Z2697
Registered User
 
Join Date: Aug 2024
Posts: 329
True.
Z2697 is offline   Reply With Quote
Old 5th December 2024, 00:35   #3  |  Link
Z2697
Registered User
 
Join Date: Aug 2024
Posts: 329
Code:
"C:\Users\a\Desktop\Shutter Encoder 18.6 Windows 64bits\Library\ffmpeg.exe" -strict -2 -hide_banner -threads 0  -i "C:\Users\a\Desktop\sample tagless video.mkv" -compression_level 0 -sws_flags bicubic -an -y "C:\Users\a\Desktop\sample tagless video_%06d.png"
go figure
Z2697 is offline   Reply With Quote
Old 5th December 2024, 22:30   #4  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 304
Quote:
Originally Posted by StainlessS View Post
Maybe you'll wanna fix thread title typo.
(click EDIT button, then ADVANCED EDIT, on 1st post)
Fixed it
jay123210599 is offline   Reply With Quote
Old 5th December 2024, 23:29   #5  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 304
Quote:
Originally Posted by Z2697 View Post
Code:
"C:\Users\a\Desktop\Shutter Encoder 18.6 Windows 64bits\Library\ffmpeg.exe" -strict -2 -hide_banner -threads 0  -i "C:\Users\a\Desktop\sample tagless video.mkv" -compression_level 0 -sws_flags bicubic -an -y "C:\Users\a\Desktop\sample tagless video_%06d.png"
go figure
What's this? What does the command mean? Did the PNGs and APNGs have the right colors? Do they have tag issues?
jay123210599 is offline   Reply With Quote
Old 9th December 2024, 14:08   #6  |  Link
Z2697
Registered User
 
Join Date: Aug 2024
Posts: 329
Quote:
Originally Posted by jay123210599 View Post
What's this? What does the command mean? Did the PNGs and APNGs have the right colors? Do they have tag issues?
This is the command that Shutter Encoder uses when converting video to PNG image sequence.
Since it calls FFmpeg CLI tool the same "limitation" applies.
Z2697 is offline   Reply With Quote
Old 9th December 2024, 15:27   #7  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 304
Quote:
Originally Posted by Z2697 View Post
This is the command that Shutter Encoder uses when converting video to PNG image sequence.
Since it calls FFmpeg CLI tool the same "limitation" applies.
So it would call the wrong colors and have tag issues for PNG and APNG?
jay123210599 is offline   Reply With Quote
Old 9th December 2024, 15:33   #8  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,599
Quote:
Originally Posted by jay123210599 View Post
So it would call the wrong colors and have tag issues for PNG and APNG?
No

To recap: for unflagged colorimetry input files, it uses Rec601 for the YUV=>RGB conversion. No PNG chunks written in that case.

See this thread (again)
http://forum.doom9.org/showthread.php?t=185921

I tested Shutter 18.6 - behaviour is the same as default ffmpeg . As you would expect for that command line. There is no other "logic" used in Shutter.
poisondeathray is offline   Reply With Quote
Old 9th December 2024, 16:33   #9  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 304
Quote:
Originally Posted by poisondeathray View Post
No

To recap: for unflagged colorimetry input files, it uses Rec601 for the YUV=>RGB conversion. No PNG chunks written in that case.

See this thread (again)
http://forum.doom9.org/showthread.php?t=185921

I tested Shutter 18.6 - behaviour is the same as default ffmpeg . As you would expect for that command line. There is no other "logic" used in Shutter.
I added colorimetry flags using this command:
Code:
-map 0 -c copy -bsf:v h264_metadata=colour_primaries=1:transfer_characteristics=1:matrix_coefficients=1
It should produce the right colors, but will it have the tag issues?

https://www.mediafire.com/file/jsydt...video.mkv/file
jay123210599 is offline   Reply With Quote
Old 9th December 2024, 16:39   #10  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,599
Quote:
Originally Posted by jay123210599 View Post
I added colorimetry flags using this command:
Code:
-map 0 -c copy -bsf:v h264_metadata=colour_primaries=1:transfer_characteristics=1:matrix_coefficients=1
It should produce the right colors, but will it have the tag issues?

https://www.mediafire.com/file/jsydt...video.mkv/file


If you add colorimetry tags to the input file, the output file with have PNG chunks and colors will appear incorrect in many programs, including browsers

See this thread (again). You questions were already asked, multiple answers and options give
http://forum.doom9.org/showthread.php?t=185921


Quote:
Originally Posted by poisondeathray View Post

3) If you add the colorimetry flags to the source, or for sources with colorimetry flags already present , the ffmpeg PNG's will display incorrect colors in many programs, including browsers (!) - because of gAMA and cHRM tag issue. Other formats like GIF are not affected

In case you've forgotten what you asked 2 weeks ago, and the many answers already provided, use search
http://forum.doom9.org/forum-rules.htm

Code:
1a) Use the search function before posting. Chances are your question has already been answered.
poisondeathray is offline   Reply With Quote
Old 9th December 2024, 17:03   #11  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 304
Quote:
Originally Posted by poisondeathray View Post
If you add colorimetry tags to the input file, the output file with have PNG chunks and colors will appear incorrect in many programs, including browsers

See this thread (again). You questions were already asked, multiple answers and options give
http://forum.doom9.org/showthread.php?t=185921





In case you've forgotten what you asked 2 weeks ago, and the many answers already provided, use search
http://forum.doom9.org/forum-rules.htm

Code:
1a) Use the search function before posting. Chances are your question has already been answered.
I just want to check and see if Shutter Encoder had the same problems for PNG and APNG as ffmpeg.

Also, can I can correctly assume that the PNG chunks apply to APNG as well, and for unflagged sources, ffmpeg and Shutter Encoder will use 601 by default for all formats like JPG and GIF, and even video formats like MP4 and MKV?
jay123210599 is offline   Reply With Quote
Old 9th December 2024, 17:17   #12  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,599
Quote:
Originally Posted by jay123210599 View Post
Also, can I can correctly assume that the PNG chunks apply to APNG as well,
You don't have to assume. You already asked. Already answered

See this thread
http://forum.doom9.org/showthread.php?t=185921&page=2


Quote:
Originally Posted by jay123210599 View Post
But what about APNG?
Quote:
Originally Posted by poisondeathray View Post
Yes ffmpeg apng is affected .

Quote:
and for unflagged sources, ffmpeg and Shutter Encoder will use 601 by default for all formats like JPG and GIF, and even video formats like MP4 and MKV?
See this thread
http://forum.doom9.org/showthread.php?t=185921

Again, 601 by default for YUV to RGB conversions.

But not all your formats are necessarily RGB

To remind you, JPG usually does not use RGB, but YUV and full range 601 as per the spec JPEG spec, and GIF uses PAL8

See this thread, post 15
http://forum.doom9.org/showthread.php?t=185921


Mp4 and MKV are container formats. So it would depend on what you used inside the MP4 and MKV
poisondeathray is offline   Reply With Quote
Old 9th December 2024, 17:41   #13  |  Link
Z2697
Registered User
 
Join Date: Aug 2024
Posts: 329
Quote:
Originally Posted by Z2697 View Post
The entity "Jay" (SCP-Doom9-123210599) keeps asking questions follwoing one or more of these rules:
1) The question can easily be looked up with a simple web search engine search.
2) The question can easily be answered by performing the actions involved in the question. "F*ck around and find out".
3) The question is ambiguous.
4) The question is subjective.
5) The question is a variation of previously asked question(s).
Z2697 is offline   Reply With Quote
Old 9th December 2024, 21:41   #14  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 304
In that case, I'm just going to add flags to my videos and convert it to lossless animated WEBP with the format being bgra, because I know by now that without flags it won't get the 709 colors I want.

Then I'll extract the frames from the WEBP using IrfanView as PNGs where it won't have any tag issues and display the right colors.
jay123210599 is offline   Reply With Quote
Old 9th December 2024, 21:58   #15  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,599
Quote:
Originally Posted by jay123210599 View Post
In that case, I'm just going to add flags to my videos and convert it to lossless animated WEBP with the format being bgra, because I know by now that without flags it won't get the 709 colors I want.

Then I'll extract the frames from the WEBP using IrfanView as PNGs where it won't have any tag issues and display the right colors.

Or you could use the zscale filter as suggested in that thread. It would be much faster, no intermediate files or extra HDD space (hard drives do break from usage eventually). 1 step instead of 3
poisondeathray is offline   Reply With Quote
Old 9th December 2024, 22:23   #16  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,599
Quote:
Originally Posted by jay123210599 View Post
In that case, I'm just going to add flags to my videos and convert it to lossless animated WEBP with the format being bgra, because I know by now that without flags it won't get the 709 colors I want...
Also, BTW that proposed 2nd step converts incorrectly. If video has 709 colorimetry flags, it uses 601 for the actual conversion for lossless webp. It even gives you a warning

Code:
[libwebp_anim @ 000000b84c414100] Using libwebp for YUV-to-RGB conversion. You may want to consider passing in RGB instead for lossless encoding.
poisondeathray is offline   Reply With Quote
Old 10th December 2024, 00:53   #17  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 304
Quote:
Originally Posted by poisondeathray View Post
Also, BTW that proposed 2nd step converts incorrectly. If video has 709 colorimetry flags, it uses 601 for the actual conversion for lossless webp. It even gives you a warning

Code:
[libwebp_anim @ 000000b84c414100] Using libwebp for YUV-to-RGB conversion. You may want to consider passing in RGB instead for lossless encoding.
Well, this is the command I used after adding the flags to my video, and I had not gotten a warning.
Code:
ffmpeg -i video.mkv -vf format=bgra -lossless 1 output.webp
jay123210599 is offline   Reply With Quote
Old 10th December 2024, 01:28   #18  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,599
Quote:
Originally Posted by jay123210599 View Post
Well, this is the command I used after adding the flags to my video, and I had not gotten a warning.
Code:
ffmpeg -i video.mkv -vf format=bgra -lossless 1 output.webp
Ok, that looks mostly correct for flagged input, but there are avoidable rounding errors from -vf format's use of swscale's default fast low quality conversion mode. If you look at that same thread, it mentions the swscale issue and workarounds

You decide what's best for you, but IMO it's pointless to use "lossless" if you incur avoidable rounding errors
poisondeathray is offline   Reply With Quote
Old 10th December 2024, 03:12   #19  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 304
Quote:
Originally Posted by poisondeathray View Post
Ok, that looks mostly correct for flagged input, but there are avoidable rounding errors from -vf format's use of swscale's default fast low quality conversion mode. If you look at that same thread, it mentions the swscale issue and workarounds

You decide what's best for you, but IMO it's pointless to use "lossless" if you incur avoidable rounding errors
How should I avoid their rounding errors?
jay123210599 is offline   Reply With Quote
Old 10th December 2024, 03:47   #20  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,599
Quote:
Originally Posted by jay123210599 View Post
How should I avoid their rounding errors?
Either use the sws accurate flags, or zscale. It was already mentioned and instructions given in yes... that same thread

But if you're using ffmpeg anyways to export webp, then irfanview - you might as well export PNG or apng once directly and correctly from ffmpeg - and skip the adding metadata , webp, and irfanview steps. It was already mentioned... yes in that same thread, the commands to use. No use repeating everything here again
poisondeathray is offline   Reply With Quote
Reply

Tags
colorspace, ffmpeg gui, image-quality

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:39.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.