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. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#1 | Link |
|
Registered User
Join Date: Apr 2024
Posts: 504
|
From PNGs to APNGs
I have 227 PNGs. I want to make APNGs out of them where each APNG has 50 frames in them. I also want to make all of the APNGs in one setting. How do I do that using ffmpeg?
Last edited by jay123210599; 16th January 2025 at 16:40. |
|
|
|
|
|
#2 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,409
|
"From APNGs from PNGs",
Typo ?, Maybe "To APNGs from PNGs", or "From PNGs to APNGs". Select EDIT, Advanced EDIT, on first post to edit thread title.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
|
|
|
|
#3 | Link |
|
Registered User
Join Date: Feb 2020
Posts: 577
|
APNG implementaion in ffmpeg is subpar. You use https://apngasm.sourceforge.net/
|
|
|
|
|
|
#4 | Link |
|
Donor
![]() Join Date: Jun 2024
Location: South Africa
Posts: 679
|
Here's a working method for the time being. I tried to do it all automatically, but nested FOR loops are problematic in Windows batch files. So, you will have to change the "start" and "end" variables each time. The first time would be "start=1" and "end=50" and the second time, "start=51" and "end=100" and so on. Your filenames will have to be in the format of "1.png" and so forth, starting from 1. Please run this on a copy of your original folder in case something gets accidentally overwritten. I'll see if I can improve to do everything automatically.
Code:
setlocal EnableDelayedExpansion set start=1 set end=50 mkdir "OUT" (for /l %%i in (!start!, 1, !end!) do @echo file %%i.png) > "Jay2025.txt" ffmpeg -f concat -r 23.976 -i "Jay2025.txt" "OUT\FINAL_%RANDOM%.apng" pause |
|
|
|
|
|
#5 | Link | |
|
Donor
![]() Join Date: Jun 2024
Location: South Africa
Posts: 679
|
Quote:
|
|
|
|
|
|
|
#6 | Link | |
|
Registered User
Join Date: Apr 2024
Posts: 504
|
Quote:
|
|
|
|
|
|
|
#9 | Link |
|
Registered User
Join Date: Apr 2024
Posts: 504
|
Well, the default frame delay is 1/10 sec. How do I adjust it so my output APNG has 23.976 fps?
Also, which compressions for the tools are lossless, zlib, 7zip, or Zopfli? How does the number of iterations affect the compression/speed/quality? If I choose to optimize the palette and/or original color type of the PNGs, will it affect the quality of the APNG? |
|
|
|
|
|
#11 | Link | |
|
Donor
![]() Join Date: Jun 2024
Location: South Africa
Posts: 679
|
Quote:
Last edited by GeoffreyA; 6th January 2025 at 21:12. |
|
|
|
|
|
|
#14 | Link | |
|
Registered User
Join Date: Apr 2024
Posts: 504
|
Quote:
|
|
|
|
|
|
|
#16 | Link | |
|
Registered User
Join Date: Sep 2007
Posts: 5,669
|
Quote:
Palette optimization for PNG can be lossless if it's a very simple source with a few colors . This technique is typically used for simple graphics / logos with a few colors |
|
|
|
|
|
|
#17 | Link | |
|
Registered User
Join Date: Apr 2024
Posts: 504
|
Quote:
|
|
|
|
|
|
|
#18 | Link | |
|
Registered User
Join Date: Sep 2007
Posts: 5,669
|
Quote:
In simple cases (e.g. simple logo with 6 colors) you might not get rid of any colors You can test it yourself. If you cannot "see" the quality loss, measure it with an objective metric such as PSNR. This method was shown to you in other threads. Another indirect way is to count the number of unique colors e.g. imagemagick. If you start with say 6,467,433 . But you optimize the pallette and now you have 1,234,453. You've lost millions of colors => quality loss "mathematically lossless" means the decoded data is the same - or bit for bit identical |
|
|
|
|
|
|
#19 | Link | |
|
Donor
![]() Join Date: Jun 2024
Location: South Africa
Posts: 679
|
Quote:
These are my findings; but you've got to test it out yourself because your files may yield different results. Regarding the delay, use the ratio of 1001/24000. It yields 23.976 fps. Yesterday, I was under the impression that one could add a decimal number to the program, but actually, it has to be in the form of a fraction. |
|
|
|
|
|
|
#20 | Link | |
|
Registered User
Join Date: Sep 2007
Posts: 5,669
|
My comments for "pallete optimization" for PNG were "in general" . It's a commonly used lossy technique for web graphics
If you're referring to apngasm specifically , the optimizations used there should be lossless according to the instructions. Quote:
Last edited by poisondeathray; 7th January 2025 at 18:41. |
|
|
|
|
![]() |
| Tags |
| ffmpeg, png |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|