Using ffmpeg to create looping apng

12,977

The parameter for looping APNGs is -plays.

ffmpeg -ss 16:43 -i ./10.mkv -plays 10 -t 1 -vf "setpts=PTS-STARTPTS, crop=1200:800, hqdn3d=1.5:1.5:6:6, scale=600:400"  10-file-2.apng
  • -plays 0: loops forever
  • -plays 1: plays once (i.e. no loop)
  • etc.
Share:
12,977

Related videos on Youtube

Harry
Author by

Harry

Updated on June 06, 2022

Comments

  • Harry
    Harry about 2 years

    I'm trying to create looping apng files from mkvs. My problem is that they don't loop. The files play once, but stop.

    This is what I'm doing:

     ffmpeg -ss 16:43 -i ./10.mkv -loop 10 -t 1 -filter:v "setpts=PTS-STARTPTS, crop=1200:800, hqdn3d=1.5:1.5:6:6, scale=600:400"  10-file-2.apng
    

    I've tried -loop -1 -loop 10 -loop 1 but there is no looping done. My version is

    ffmpeg-3.3.el_capitan.bottle.tar.gz

    • Ryan
      Ryan over 2 years
      ffmpeg -i 'input.mp4' -framerate 5 -plays 0 screenshot.webp was a helpful command for me
  • Harry
    Harry about 7 years
    Do you have a documentation link? And how do I set infinite loops? -1 Value -1.000000 for parameter 'plays' out of range [0 - 4.29497e+09]
  • Gyan
    Gyan about 7 years
    No doc for apng muxer at all! Strange. Anyway, 0 for infinite loops.
  • Ken Sharp
    Ken Sharp over 6 years
  • Ricardo Bohner
    Ricardo Bohner over 2 years
    What does this part do hqdn3d=1.5:1.5:6:6 ?
  • Gyan
    Gyan over 2 years
    That's a denoiser. See docs at ffmpeg.org/ffmpeg-filters.html#hqdn3d-1