[FFmpeg-user] Animated GIF convertion and average frame rate

Sub Phil phil4000n at gmail.com
Sat Jul 25 19:48:26 CEST 2015


RE:
https://trac.ffmpeg.org/wiki/Create%20a%20video%20slideshow%20from%20images

To see why some animated GIF are not working in the export of LibreOffice
Impress, I compare thanks to ffprobe.

I noticed that working animated GIF has:
r_frame_rate=20/1
avg_frame_rate=20/1

While non working animated GIF has:
r_frame_rate=100/7
avg_frame_rate=57/4

I try to use ffmpeg to converted the non working gif to the same parameters
as the working one my CLI is


F:\Art>ffmpeg -y -i "feather.gif" -r 20 -s 260x173 "feather conv.gif"
(Console output below)

Now, if I ffprobe the new gif I see:
r_frame_rate=20/1
avg_frame_rate=175/12

How can I now change the avg_frame_rate to 20/1?
I tried to use the framerate option, but didn't work.

F:\Art>ffmpeg -framerate 20/1 -i "feather.gif" -r 20 -s 260x173 "feather
conv.gif"
ffmpeg version N-73993-g8a17335 Copyright (c) 2000-2015 the FFmpeg
developers
  built with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --enable-fo
ntconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass
--enable-libbluray --enable-libbs2b --ena
ble-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme
--enable-libgsm --enable-libilbc --enable-lib
modplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr
--enable-libspeex --enable-libtheora --enable-l
ibtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --
enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxavs --enable-libxvid --enable-l
zma --enable-decklink --enable-zlib
  libavutil      54. 29.100 / 54. 29.100
  libavcodec     56. 52.100 / 56. 52.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 28.100 /  5. 28.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Option framerate not found.

F:\Art>

Thanks


ffmpeg version N-73993-g8a17335 Copyright (c) 2000-2015 the FFmpeg
developers
  built with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --enable-fo
ntconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass
--enable-libbluray --enable-libbs2b --ena
ble-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme
--enable-libgsm --enable-libilbc --enable-lib
modplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr
--enable-libspeex --enable-libtheora --enable-l
ibtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --
enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxavs --enable-libxvid --enable-l
zma --enable-decklink --enable-zlib
  libavutil      54. 29.100 / 54. 29.100
  libavcodec     56. 52.100 / 56. 52.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 28.100 /  5. 28.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, gif, from 'hj tease feather.gif':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: gif, bgra, 400x225, 14.25 fps, 14.29 tbr, 100 tbn,
100 tbc
Output #0, gif, to 'hj tease feather conv.gif':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: gif, bgr8, 260x173, q=2-31, 200 kb/s, 20 fps, 100
tbn, 20 tbc
    Metadata:
      encoder         : Lavc56.52.100 gif
Stream mapping:
  Stream #0:0 -> #0:0 (gif (native) -> gif (native))
Press [q] to stop, [?] for help
frame=   42 fps=0.0 q=-0.0 Lsize=     934kB time=00:00:02.90
bitrate=2639.2kbits/s
video:933kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.118986%

F:\Art\>


More information about the ffmpeg-user mailing list