VideoHelp Forum




+ Reply to Thread
Results 1 to 19 of 19
  1. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    I found that VirtualDub2, Shotcut, and Kdenlive can make png files smaller than ffmpeg. How do I adjust the settings to match the file size (or make it even smaller, if possible)?

    Also, can ffmpeg make zip/7z/rar/zqad files?
    Quote Quote  
  2. Use the ffmpeg png -pred (prediction method) settings listed in the help file to adjust the ffmpeg png compression . Default is "none" so it will produce larger files but export faster than say, vdub2's or shotcut's or kdenlive's png's . Higher compression ratio means slower exports as usual for tradeoffs
    Quote Quote  
  3. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    And my other question?

    Oh, I tried what you said but they're still not smaller.
    Image Attached Files
    Quote Quote  
  4. Don't forget about specifying proper pixel type - you might be exporting 16bit RGB . By default if input video is >8bit, ffmpeg will export 16bit PNG's

    Don't forget about proper YUV to RGB conversion or you'll get wrong colors

    Don't forget the warning in your other thread about colorimetry flagged input YUV video to PNG sequence using ffmpeg - and the cHRM, gAMA tags - or PNGs will display differently in different programs and browser versions
    Quote Quote  
  5. Originally Posted by Jay123210599 View Post

    Also, can ffmpeg make zip/7z/rar/zqad files?
    I think not. They are not listed in the formats help
    Quote Quote  
  6. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Don't forget about specifying proper pixel type - you might be exporting 16bit RGB . By default if input video is >8bit, ffmpeg will export 16bit PNG's

    Don't forget about proper YUV to RGB conversion or you'll get wrong colors

    Don't forget the warning in your other thread about colorimetry flagged input YUV video to PNG sequence using ffmpeg - and the cHRM, gAMA tags - or PNGs will display differently in different programs and browser versions
    My videos are 10bit.
    Quote Quote  
  7. So specify 8bit PNG. Most displays will be 8bit RGB anyways. There is no benefit to use 16bit RGB for posting to a website for display, it will just make filesize larger

    You know how to use zscale, format filters from the other threads . Sometimes ffmpeg gets it correct "automatically", sometimes not . It depends on the source video, flags, and the ffmpeg version

    But you will get the wrong colors in some browsers like firefox with that workflow, because of the cHRM, gAMA tags if YUV video is colorimetry flagged . If using ffmpeg to export PNG's , I would use an avisynth script with PropClearAll() . That clears the flags and the exported PNG's will not have those tags, colors will look correct everywhere. You can also control the YUV to RGB conversion properly in avisynth if you wanted to

    Vdub2 will look at flags for it's RGB conversion by default. If video flags are correct, RGB conversion should be correct. If flags are wrong, conversion will be wrong. If video is unflagged, it will use Rec601 for RGB conversion - it will be wrong for most HD sources
    Quote Quote  
  8. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by poisondeathray View Post
    So specify 8bit PNG. Most displays will be 8bit RGB anyways. There is no benefit to use 16bit RGB for posting to a website for display, it will just make filesize larger

    You know how to use zscale, format filters from the other threads . Sometimes ffmpeg gets it correct "automatically", sometimes not . It depends on the source video, flags, and the ffmpeg version

    But you will get the wrong colors in some browsers like firefox with that workflow, because of the cHRM, gAMA tags if YUV video is colorimetry flagged . If using ffmpeg to export PNG's , I would use an avisynth script with PropClearAll() . That clears the flags and the exported PNG's will not have those tags, colors will look correct everywhere. You can also control the YUV to RGB conversion properly in avisynth if you wanted to

    Vdub2 will look at flags for it's RGB conversion by default. If video flags are correct, RGB conversion should be correct. If flags are wrong, conversion will be wrong. If video is unflagged, it will use Rec601 for RGB conversion - it will be wrong for most HD sources
    What about be the avisynth script or how do I use it to make sure that all colors are correct for png files and well as lossless webp and jxl files, and get low file sizes for them?
    Quote Quote  
  9. Originally Posted by Jay123210599 View Post
    What about be the avisynth script or how do I use it to make sure that all colors are correct for png files and well as lossless webp and jxl files, and get low file sizes for them?
    It depends on the input video and output format

    There is no 1 size fits all.

    Different videos have different pixel types, different matrix/transfer/primaries , HDR vs. SDR . If you use the same settings for everything, you're going to get the wrong result for many cases . You saw an example of that before in your other threads

    So it might be a different script for each video, same with output format. I only suggested the script as a workaround for ffmpeg png's . The ffmpeg png issues has reported many times . Many software that use ffmpeg for png exports have the same problem

    For the compression side, use the highest compression settings in the help file and it will be the slowest as well. Trade offs.
    Quote Quote  
  10. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Originally Posted by Jay123210599 View Post
    What about be the avisynth script or how do I use it to make sure that all colors are correct for png files and well as lossless webp and jxl files, and get low file sizes for them?
    It depends on the input video and output format

    There is no 1 size fits all.

    Different videos have different pixel types, different matrix/transfer/primaries , HDR vs. SDR . If you use the same settings for everything, you're going to get the wrong result for many cases . You saw an example of that before in your other threads

    So it might be a different script for each video, same with output format. I only suggested the script as a workaround for ffmpeg png's . The ffmpeg png issues has reported many times . Many software that use ffmpeg for png exports have the same problem

    For the compression side, use the highest compression settings in the help file and it will be the slowest as well. Trade offs.
    I looked at the details of the png files and it turns out the ffmpeg png files are 48 bit while the other pngs are 24 bit. What is and how do I get the lowest bit for png files, and will it affect the quality of the images?
    Quote Quote  
  11. Originally Posted by Jay123210599 View Post
    I looked at the details of the png files and it turns out the ffmpeg png files are 48 bit while the other pngs are 24 bit. What is and how do I get the lowest bit for png files, and will it affect the quality of the images?
    "24bpp" or "bit per pixel" is the same thing as 8bpc or "bit per channel" . 8bit Red, 8bit Green, 8bit Blue

    -vf format=rgb24
    Yes lower quality; but on a 8bit RGB display, you will not see any difference - and there will be no additional compression losses eitherway (you're not going to get those additional artifacts such as in the jpeg or jpegxl thread)

    The 8bit RGB image will be lower quality if your source material was true 10bit or higher (not 10bit encoded from a 8bit source) . And on a 10bit display (there are getting more common these days, but the majority are still 8bit), you might see a difference in quality, especially around gradients. The 8bit RGB image will show more banding
    Quote Quote  
  12. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Originally Posted by Jay123210599 View Post
    I looked at the details of the png files and it turns out the ffmpeg png files are 48 bit while the other pngs are 24 bit. What is and how do I get the lowest bit for png files, and will it affect the quality of the images?
    "24bpp" or "bit per pixel" is the same thing as 8bpc or "bit per channel" . 8bit Red, 8bit Green, 8bit Blue

    -vf format=rgb24
    Yes lower quality; but on a 8bit RGB display, you will not see any difference - and there will be no additional compression losses eitherway (you're not going to get those additional artifacts such as in the jpeg or jpegxl thread)

    The 8bit RGB image will be lower quality if your source material was true 10bit or higher (not 10bit encoded from a 8bit source) . And on a 10bit display (there are getting more common these days, but the majority are still 8bit), you might see a difference in quality, especially around gradients. The 8bit RGB image will show more banding
    How about this? How do I get ffmpeg to take screenshots (not extract frames) of every single frame in a video?
    Quote Quote  
  13. Originally Posted by Jay123210599 View Post
    How do I get ffmpeg to take screenshots (not extract frames) of every single frame in a video?
    Screenshots of every single frame in a video - is the same thing as exporting an image sequence from a video

    Or maybe you're not describing what you want correctly ?


    (and if video is YUV, and tagged with colorimetry flags - the output PNG sequence will have cHRM, gAMA tags that cause the PNG to display with wrong colors in firefox, chrome, edge(chromium) - thats about 90% of browsers)
    Quote Quote  
  14. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Originally Posted by Jay123210599 View Post
    How do I get ffmpeg to take screenshots (not extract frames) of every single frame in a video?
    Screenshots of every single frame in a video - is the same thing as exporting an image sequence from a video

    Or maybe you're not describing what you want correctly ?


    (and if video is YUV, and tagged with colorimetry flags - the output PNG sequence will have cHRM, gAMA tags that cause the PNG to display with wrong colors in firefox, chrome, edge(chromium) - thats about 90% of browsers)
    I mean like actually taking a screenshot on my computer (e.g. I press Win+PrtScr to take a screenshot and it produces a png file in kbs).
    Quote Quote  
  15. Originally Posted by Jay123210599 View Post
    I mean like actually taking a screenshot on my computer (e.g. I press Win+PrtScr to take a screenshot and it produces a png file in kbs).
    ffmpeg does not display video . It's not a video player.

    If you mean screen capture the video displayed from playing in another application - there will likely be problems like dropped frames
    Quote Quote  
  16. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Originally Posted by Jay123210599 View Post
    I mean like actually taking a screenshot on my computer (e.g. I press Win+PrtScr to take a screenshot and it produces a png file in kbs).
    ffmpeg does not display video . It's not a video player.

    If you mean screen capture the video displayed from playing in another application - there will likely be problems like dropped frames
    What if I use -f image2 and/or -frames:v with making an image sequence of png files?
    Quote Quote  
  17. Originally Posted by Jay123210599 View Post
    What if I use -f image2 and/or -frames:v with making an image sequence of png files?
    -f image2 specifies the format as an image sequence, I don't see it helping in any way

    -frames:v "n" limits the number of written images. eg. If "n" was 100, it would only write 100 images
    Quote Quote  
  18. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Originally Posted by Jay123210599 View Post
    What if I use -f image2 and/or -frames:v with making an image sequence of png files?
    -f image2 specifies the format as an image sequence, I don't see it helping in any way

    -frames:v "n" limits the number of written images. eg. If "n" was 100, it would only write 100 images
    So my only option to get images sequences of kbs is using lossy compression?
    Quote Quote  
  19. Originally Posted by Jay123210599 View Post

    So my only option to get images sequences of kbs is using lossy compression?
    Depends on the source

    But for the examples you posted - probably

    You can crop to a region of interest at 1:1 . e.g. display the top left corner.


    For websites that have limits on image upload filesizes, you can post links to 3rd party image hosts . This is a very common practice
    Quote Quote  



Similar Threads

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