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. |
|
![]() |
#1 | Link |
Registered User
Join Date: Apr 2024
Posts: 324
|
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. |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Aug 2024
Posts: 359
|
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" |
![]() |
![]() |
![]() |
#4 | Link | |
Registered User
Join Date: Apr 2024
Posts: 324
|
Quote:
|
|
![]() |
![]() |
![]() |
#5 | Link | |
Registered User
Join Date: Aug 2024
Posts: 359
|
Quote:
Since it calls FFmpeg CLI tool the same "limitation" applies. |
|
![]() |
![]() |
![]() |
#7 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,600
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#8 | Link | |
Registered User
Join Date: Aug 2024
Posts: 359
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#9 | Link |
Registered User
Join Date: Apr 2024
Posts: 324
|
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. |
![]() |
![]() |
![]() |
#10 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,600
|
Quote:
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 |
|
![]() |
![]() |
![]() |
#11 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,600
|
Quote:
Code:
[libwebp_anim @ 000000b84c414100] Using libwebp for YUV-to-RGB conversion. You may want to consider passing in RGB instead for lossless encoding. |
|
![]() |
![]() |
![]() |
#12 | Link | |
Registered User
Join Date: Apr 2024
Posts: 324
|
Quote:
Code:
ffmpeg -i video.mkv -vf format=bgra -lossless 1 output.webp |
|
![]() |
![]() |
![]() |
#13 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,600
|
Quote:
You decide what's best for you, but IMO it's pointless to use "lossless" if you incur avoidable rounding errors |
|
![]() |
![]() |
![]() |
#14 | Link |
Registered User
Join Date: Jun 2024
Location: South Africa
Posts: 254
|
I gave it a go this morning and the simplest way is:
Code:
ffmpeg -colorspace bt709 -i "sample tagless video.mkv" -frames:v 24 -sws_flags accurate_rnd "%%d.png" ffmpeg -colorspace bt709 -i "sample tagless video.mkv" -frames:v 24 -sws_flags accurate_rnd "out.apng" ![]() ![]() GIF with error-diffusion dithering Code:
ffmpeg -colorspace bt709 -i "sample tagless video.mkv" -frames:v 1 -sws_flags accurate_rnd -sws_dither ed "out.gif" ![]() Last edited by GeoffreyA; 10th December 2024 at 09:38. |
![]() |
![]() |
![]() |
#15 | Link | |
Registered User
Join Date: Aug 2024
Posts: 359
|
Quote:
Please use full_chroma_int flag as well And this way the GIF is not using palette Please use palettegen and paletteuse Last edited by Z2697; 10th December 2024 at 10:40. |
|
![]() |
![]() |
![]() |
#16 | Link |
Registered User
Join Date: Jun 2024
Location: South Africa
Posts: 254
|
Thanks, Z2697. Here's the updated script that should solve the problem, Jay:
Code:
:: Create PNG and APNG ffmpeg -colorspace bt709 -i "src.mkv" -frames:v 1 -sws_flags accurate_rnd+full_chroma_int "%%d.png" ffmpeg -colorspace bt709 -i "src.mkv" -frames:v 1 -sws_flags accurate_rnd+full_chroma_int "out.apng" :: Create palette and then GIF ffmpeg -colorspace bt709 -i "src.mkv" -vf palettegen -sws_flags accurate_rnd+full_chroma_int "palette.png" ffmpeg -colorspace bt709 -i "src.mkv" -i "palette.png" -lavfi paletteuse -frames:v 1 -sws_flags accurate_rnd+full_chroma_int "out.gif" ![]() GIF made with palette and Sierra-24A dithering: ![]() Here's a reusable way of doing it. Place this in a BAT file. Change the variables src, start, and frames and run the file. Code:
setlocal set src=sample tagless video.mkv set start=2 set frames=24 :: Create PNG and APNG ffmpeg -ss %start% -colorspace bt709 -i "%src%" -frames:v %frames% -sws_flags accurate_rnd+full_chroma_int "%%d.png" ffmpeg -ss %start% -colorspace bt709 -i "%src%" -frames:v %frames% -sws_flags accurate_rnd+full_chroma_int "out.apng" :: Create palette and then GIF ffmpeg -colorspace bt709 -i "%src%" -vf palettegen -sws_flags accurate_rnd+full_chroma_int "palette.png" ffmpeg -ss %start% -colorspace bt709 -i "%src%" -i "palette.png" -lavfi paletteuse -frames:v %frames% -sws_flags accurate_rnd+full_chroma_int "out.gif" endlocal pause Last edited by GeoffreyA; 10th December 2024 at 12:46. |
![]() |
![]() |
![]() |
#17 | Link |
Registered User
Join Date: Aug 2024
Posts: 359
|
Did you notice that the new GIF image is now having "jagged chroma" (well, not actual chroma 'cause it's RGB, but you get the point).
And the old GIF image is somehow not having "jagged chroma"... WTF? swscale and auto-inserted scale filter is a huge mess. |
![]() |
![]() |
![]() |
#19 | Link | ||
Registered User
Join Date: Jun 2024
Location: South Africa
Posts: 254
|
Quote:
EDIT: The problem is, for some reason in the GIF example, the sws flags aren't being set: Code:
[auto_scale_1 @ 0000021bcef58300] w:1920 h:1080 fmt:yuv420p csp:bt709 range:unknown sar:1/1 -> w:1920 h:1080 fmt:bgra csp:gbr range:pc sar:1/1 flags:0x00000004 Code:
[auto_scale_0 @ 000001ef02b73200] w:1920 h:1080 fmt:yuv420p csp:bt709 range:unknown sar:1/1 -> w:1920 h:1080 fmt:rgb24 csp:gbr range:pc sar:1/1 flags:0x00042000 Quote:
![]() ![]() Last edited by GeoffreyA; 10th December 2024 at 14:55. |
||
![]() |
![]() |
![]() |
#20 | Link | |
Registered User
Join Date: Aug 2024
Posts: 359
|
Quote:
Last edited by Z2697; 10th December 2024 at 16:44. |
|
![]() |
![]() |
![]() |
Tags |
colorspace, ffmpeg gui, image-quality |
Thread Tools | Search this Thread |
Display Modes | |
|
|