Using ffmpeg to create looping apng – Stack Overflowより、アニメGIFなら-loopでループできるのに APNGではこのオプションではループできないので-playsオプションを使う。このオプションはループ回数を指定する。0を指定すると無限ループになる。 透過処理にバグがある。 #9334 (MP4 to APNG conversion incorrectly has transparent background) – FFmpeg -ssで開始秒、-tで動画時間を指定する ffmpeg -ss 10 -i input.mp4 -plays 10 -t 1 -vf setpts=PTS-STARTPTS -f apng output.png 無限ループで出力フレーム数-vframesを指定する ffmpeg -ss 10 -i input.
![APNG をループ出力する | ニコラボ](https://cdn-ak-scissors.b.st-hatena.com/image/square/8d63160556b8dac2c4f1ec859b0fcc5e44e01ab9/height=288;version=1;width=512/https%3A%2F%2Fnico-lab.net%2Fwp-content%2Fuploads%2F2023%2F01%2F240x240_1_1.jpg)