VideoHelp Forum




+ Reply to Thread
Results 1 to 13 of 13
  1. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Which tool or program converts videos to image sequences consisting of png files that have the smallest file size (I mean, which of one of them will have the smallest file size for each of the png files)?
    Quote Quote  
  2. Member
    Join Date
    Jul 2022
    Location
    Spain
    Search Comp PM
    I always use ffmpeg, but I really don't know if it is the program that generates the smallest PNGs. But regardless of the program you use you can use optipng to reduce the size to the minimum. But I don't think the difference would be significant.
    Quote Quote  
  3. Member thecoalman's Avatar
    Join Date
    Feb 2004
    Location
    Pennsylvania
    Search PM
    There is a command line program called pngcrush, you can run it on entire directory. It can substantially reduce .png file sizes.
    Quote Quote  
  4. For ffmpeg you can control some png compression aspects by using "-q:v numeric value" and prediction type "-pred 5".
    Quote Quote  
  5. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by thecoalman View Post
    There is a command line program called pngcrush, you can run it on entire directory. It can substantially reduce .png file sizes.
    What should the command line be?
    Quote Quote  
  6. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by pandy View Post
    For ffmpeg you can control some png compression aspects by using "-q:v numeric value" and prediction type "-pred 5".
    What do they do? Where should I put them in the command line? What is maximum value I can put in for each?
    Last edited by Jay123210599; 10th Jan 2024 at 14:58.
    Quote Quote  
  7. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by thecoalman View Post
    Where do I even get it?
    Quote Quote  
  8. Member thecoalman's Avatar
    Join Date
    Feb 2004
    Location
    Pennsylvania
    Search PM
    You can get it from this thing called the internet, there is three requirements.

    1. Internet Connection
    2. A computer
    3. A browser

    If you have met those requirements:

    Step 1: Connect the computer to internet.
    Step 2: Turn the computer on.
    Step 3: Find your browser application
    Step 4: Visit a site like Google.
    Step 5: Type pngcrush into search box and hit submit.
    Step 6: Review the search results to find what you are looking for.
    Quote Quote  
  9. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by thecoalman View Post
    You can get it from this thing called the internet, there is three requirements.

    1. Internet Connection
    2. A computer
    3. A browser

    If you have met those requirements:

    Step 1: Connect the computer to internet.
    Step 2: Turn the computer on.
    Step 3: Find your browser application
    Step 4: Visit a site like Google.
    Step 5: Type pngcrush into search box and hit submit.
    Step 6: Review the search results to find what you are looking for.
    Wait, does pngcrush even work for Windows 11?

    Here's the link so you can download it yourself.
    https://sourceforge.net/projects/pmt/files/pngcrush/1.8.13/
    Quote Quote  
  10. Originally Posted by Jay123210599 View Post
    Originally Posted by pandy View Post
    For ffmpeg you can control some png compression aspects by using "-q:v numeric value" and prediction type "-pred 5".
    What do they do? Where should I put them in the command line? What is maximum value I can put in for each?
    This is excerpt from my script (converting video to APNG animation with antialiasing):
    Code:
    @ffmpeg.exe -y -hide_banner -v 32 -stats -i %filename% -an -sn -dn -filter_complex "eq=contrast=%contrast%:brightness=%brightness%:saturation=%saturation%,unsharp=lx=5:ly=5:la=%sharpen%:cx=3:cy=3:ca=0:ax=3:ay=3:aa=0,tblend=all_mode=average,format=pix_fmts=rgb24,zscale=d=ordered:f=spline36:r=full:w=%h_siz%:h=-2,tmix=frames=%fa%:weights=%weights%,fps=%fps%,xbr=3,zscale=d=ordered:f=spline36:r=full:w=%h_siz%:h=-2,transpose=1:none,xbr=3,transpose=2:none,zscale=d=ordered:f=spline36:r=full:w=%h_siz%:h=-2,split[v1][v2]; [v1]format=pix_fmts=rgb444le,palettegen=max_colors=%max_colors%:stats_mode=0:reserve_transparent=false [palette]; [v2][palette]paletteuse=dither=%dither%" -fps_mode auto -plays 0 -q:v 100 -f apng -pred 5 "%~n1_apng.png"
    As you can see both controls are used at the end of the command sequence - how to control quality "q:v 100" is not covered by ffmpeg documentation - it highly depends on used codec. My assumption is '100' mean maximum compression (yes, it is bit contradictory to quality but for mpeg and similar lossy codec seem q means not quality but quantization and maximum 31 means highest compression). Second option 'pred 5' is documented moderately well - this prediction type and 5 mean all types prediction is checked and best selected (not sure if this is brute force checking or something smarter).
    Btw ffmeg seem to be quite poor in terms of signal flow - above script produce many warnings about multiple color space conversion - can't find and command to switch automatic color space conversion (trough swscaler) - this is pretty stupid and highly inefficient - one of main ffmpeg flaws - i can't manually guide ffmpeg to do processing without unnecessary color space conversion.
    Quote Quote  
  11. Originally Posted by Jay123210599 View Post
    Which tool or program converts videos to image sequences consisting of png files that have the smallest file size (I mean, which of one of them will have the smallest file size for each of the png files)?
    png is lossless so you get an image that is the same as source, does not matter what size you are going to get. Each software that creates png could have a different arguments for file size 0 to 9 (opencv 0 smallest result, 9 large), zero to 100, etc. You were told so already, so you need to check how to set it depending what a PARTICULAR app tells you in its manual.

    Lossless mechanisms in a real world have a real time limits to come up with lossless results. If you have a really short time, algorithm comes up quickly with a lossless version for an image but file is largest. In theory you can create algorithms that look for lossless image for 5 minutes and maybe you save some MBytes, but that is a nonsense because you might need more time also to decode that image. Higher compressions could become really counterproductive. In real world, developers come up with sort of real world useful range and we specify in settings values (or not and it defaults).
    Quote Quote  
  12. Member
    Join Date
    Jul 2022
    Location
    Spain
    Search Comp PM
    The "-q:v 100" parameter of ffmpeg does nothing. Because png is a lossless format, the quality is the same independently of the compression used. The parameter to control compression is "-compression_level [0-9]". 0 is no compression and 9 is maximum.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!