VideoHelp Forum




+ Reply to Thread
Results 1 to 19 of 19
  1. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    How do I convert videos to apng (Animated Portable Network Graphics) files? I tried using ffmpeg and Shutter Encoder, but I couldn't open them normally and when I did, there weren't any animation.
    Quote Quote  
  2. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by pandy View Post
    I was able to find quickly many examples how to use ffmpeg to create apng - as you not providing more details about your tries then i strongly recommend to try something from bellow links:

    https://stackoverflow.com/questions/43795518/using-ffmpeg-to-create-looping-apng
    https://video.stackexchange.com/questions/32865/how-to-convert-a-black-and-white-video...g-a-color-as-t
    https://www.reddit.com/r/steamgrid/comments/detym1/guide_for_creating_your_own_apng/
    Oh yeah, my previous attempted were successful, but I couldn't open them with XnViewMP (which was supposed to support them) and I went opened them using GIMP, there weren't no animation. I also set the frame rate in Shutter Encoder, by the way.
    Quote Quote  
  3. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Sorry, none of the solutions you gave me fixed the problem.
    Quote Quote  
  4. Banned
    Join Date
    Nov 2023
    Location
    Europe
    Search Comp PM
    Maybe this MPEG Streamclip can be of any use? It have some PNG choices such as Apple PNG, Apple Animation and some other similar ones... it does not look like the specific APNG is there though!

    Edit: I think ive seen some sort of a-png thing somewhere before, ill try find it and re-post it here what is was, if i can find it again!

    For XnView there is alot of Addons/Plugins avalible, maybe there is one that can be installed with XnView MP to help load the previously created A-PNG's? There is some addons/plugins to help create/produce things allso, maybe can get something going from there allso!
    Last edited by Swedaniel; 25th Dec 2023 at 00:16.
    Quote Quote  
  5. Originally Posted by Jay123210599 View Post
    Oh yeah, my previous attempted were successful, but I couldn't open them with XnViewMP (which was supposed to support them) and I went opened them using GIMP, there weren't no animation. I also set the frame rate in Shutter Encoder, by the way.
    Works for me - tested:
    Code:
    @set filename=%1
    
    @ffmpeg.exe -y -hide_banner -v 32 -stats -i "%filename%" -an -sn -dn -vf "zscale=f=spline36:r=full:w=64:h=-2" -r 15 -fps_mode auto -plays 0 -q:v 100 -f apng "%~n1_apng.png"
    Quote Quote  
  6. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by pandy View Post
    Originally Posted by Jay123210599 View Post
    Oh yeah, my previous attempted were successful, but I couldn't open them with XnViewMP (which was supposed to support them) and I went opened them using GIMP, there weren't no animation. I also set the frame rate in Shutter Encoder, by the way.
    Works for me - tested:
    Code:
    @set filename=%1
    
    @ffmpeg.exe -y -hide_banner -v 32 -stats -i "%filename%" -an -sn -dn -vf "zscale=f=spline36:r=full:w=64:h=-2" -r 15 -fps_mode auto -plays 0 -q:v 100 -f apng "%~n1_apng.png"
    I got this in XnViewMP when I used the code.
    Image
    [Attachment 75748 - Click to enlarge]
    Quote Quote  
  7. For ffmpeg : use the ".apng" extension in the commandline , but rename it to ".png" after
    Quote Quote  
  8. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by poisondeathray View Post
    For ffmpeg : use the ".apng" extension in the commandline , but rename it to ".png" after
    Still didn't work.
    Quote Quote  
  9. Originally Posted by Jay123210599 View Post
    Originally Posted by poisondeathray View Post
    For ffmpeg : use the ".apng" extension in the commandline , but rename it to ".png" after
    Still didn't work.
    Post your command line

    Works for me

    Plays in browsers, XnViewMP
    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
    Originally Posted by poisondeathray View Post
    For ffmpeg : use the ".apng" extension in the commandline , but rename it to ".png" after
    Still didn't work.
    Post your command line

    Works for me

    Plays in browsers, XnViewMP
    command line: ffmpeg -i input.mkv output.apng
    Quote Quote  
  11. Originally Posted by Jay123210599 View Post

    command line: ffmpeg -i input.mkv output.apng

    Code:
    ffmpeg -i input.mkv -plays 0 -c:v apng output.apng
    Rename "output.apng" to "output.png"
    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

    command line: ffmpeg -i input.mkv output.apng

    Code:
    ffmpeg -i input.mkv -plays 0 -c:v apng output.apng
    Rename "output.apng" to "output.png"
    Sorry, but no. Here's the video and its information if it helps.
    Image Attached Files
    Quote Quote  
  13. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Video here:
    Image Attached Files
    Quote Quote  
  14. Because it's 10bit444 source, ffmpeg will auto convert to 16bit RGB by default, instead of 8bit RGB. But 16bit RGB apng will not be compatible with most browsers or applications

    Use -vf format=gbrp to convert it to 8bit planar RGB. In this example, I also downscaled it to 640x360

    Code:
    ffmpeg -i ggg.mkv -vf format=gbrp,scale=640:360 -plays 0 -c:v apng output.apng
    Rename output.apng to output.png
    Quote Quote  
  15. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Because it's 10bit444 source, ffmpeg will auto convert to 16bit RGB by default, instead of 8bit RGB. But 16bit RGB apng will not be compatible with most browsers or applications

    Use -vf format=gbrp to convert it to 8bit planar RGB. In this example, I also downscaled it to 640x360

    Code:
    ffmpeg -i ggg.mkv -vf format=gbrp,scale=640:360 -plays 0 -c:v apng output.apng
    Rename output.apng to output.png
    Why does it convert to 16 RGB? Why isn't apngs like that compatible?
    Quote Quote  
  16. Originally Posted by Jay123210599 View Post

    Why does it convert to 16 RGB? Why isn't apngs like that compatible?
    ffmpeg auto converts to 16bit RGB from 10bit YUV source because that's the way it's coded right now. Maybe behaviour will change sometime, ffmpeg is a fluid, always changing project

    16bit RGB filesizes are massive and incompatible for most display scenarios . Browsers are meant to be light weight, fast transfers . If you have to wait an hour before the apng even loads, it's pretty silly . Some people in rural areas, some countries have very slow internet

    Ask the developers/programmers for your various software why it's not compatible , maybe they have other reasons
    Quote Quote  
  17. Banned
    Join Date
    Oct 2023
    Location
    Los Angeles
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Originally Posted by Jay123210599 View Post

    Why does it convert to 16 RGB? Why isn't apngs like that compatible?
    ffmpeg auto converts to 16bit RGB from 10bit YUV source because that's the way it's coded right now. Maybe behaviour will change sometime, ffmpeg is a fluid, always changing project

    16bit RGB filesizes are massive and incompatible for most display scenarios . Browsers are meant to be light weight, fast transfers . If you have to wait an hour before the apng even loads, it's pretty silly . Some people in rural areas, some countries have very slow internet

    Ask the developers/programmers for your various software why it's not compatible , maybe they have other reasons
    I also want the frame rate of my apng file to match the one from the output. How do I do that?

    Plus, for Shutter Encoder, how do I adjust the RGB to fix it to 8 RGB?
    Quote Quote  
  18. Originally Posted by Jay123210599 View Post
    I also want the frame rate of my apng file to match the one from the output. How do I do that?

    Framerate of output should be automatic same as input file in ffmpeg . You can force a different framerate with -r as an input option

    Or for full control you can use other software such as apngasm with individual frames. You can specify different frame delay times



    If the framerate doesn't look the same, it might be the program is having difficulty playing back apng with large sizes at full speed. And/Or your hardware is too slow . apng is not a playback optimized format


    Plus, for Shutter Encoder, how do I adjust the RGB to fix it to 8 RGB?
    Not sure, I don't use it





    If I didn't downscale, just keep 8bit RGB the apng is massive - 12.7MB source video balloons to 474MB (!)

    Even with downscaling it's still 59.3MB .

    No downscaling plus 16bit RGB ballons to 1.15GB(!!)

    apng's are meant to be used in very specific display scenarios, not general use
    Quote Quote  



Similar Threads

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