Combine 2 small GIF images to small animated GIF, fails with "Decoder (codec none) not found for input stream #0:0"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Combine 2 small GIF images to small animated GIF, fails with "Decoder (codec none) not found for input stream #0:0"

Jim DeLaHunt
Hello, FFMPEG folks:

I have two simple GIF images, and I want to combine them into a 2-frame
animated GIF. This is to give me a reduced input file to diagnose
another FFMpeg issue.

However, when I do the obvious command, I get an error, "Decoder (codec
none) not found for input stream #0:0".

How can I make a simple 2-frame animate GIF out of my two still GIF
images blue_1.gif and blue_2.gif?

% ls -lF blue_[0-9].gif
-rw-r--r--  1 myuser  staff  1303  6 Jan 21:04 blue_1.gif
-rw-r--r--  1 myuser  staff  1379  6 Jan 21:05 blue_2.gif

% ffmpeg -f image2 -i blue_%d.gif  -y animated_blue_12.gif
ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
   built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
   configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample
--enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora
--enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex
--enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype
--enable-libfribidi --disable-indev=jack --enable-opencl --disable-outdev=xv --enable-audiotoolbox
--enable-videotoolbox --enable-sdl2 --mandir=/opt/local/share/man --enable-shared --enable-pthreads
--cc=/usr/bin/clang --arch=x86_64 --enable-x86asm --enable-libx265 --enable-gpl --enable-postproc
--enable-libx264 --enable-libxvid
   libavutil      55. 78.100 / 55. 78.100
   libavcodec     57.107.100 / 57.107.100
   libavformat    57. 83.100 / 57. 83.100
   libavdevice    57. 10.100 / 57. 10.100
   libavfilter     6.107.100 /  6.107.100
   libavresample   3.  7.  0 /  3.  7.  0
   libswscale      4.  8.100 /  4.  8.100
   libswresample   2.  9.100 /  2.  9.100
   libpostproc    54.  7.100 / 54.  7.100
[image2 @ 0x7ff99080ba00] Could not find codec parameters for stream 0 (Video: none, none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, image2, from 'blue_%d.gif':
   Duration: 00:00:00.08, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: none, none, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
   Stream #0:0 -> #0:0 (? (?) -> gif (native))
Decoder (codec none) not found for input stream #0:0

How can I get past this problem?  Maybe specify the image format, but how?

The documentation for the image2 format demuxer[1] does not appear to
say how the image2 demuxer identifies the image file formats that it
reads. Still, the extension is .gif, which I expect would be enough of a
hint.

The error message mentions the 'analyzeduration' options (default value
5,000,000 microseconds) and 'probesize' options (default value 5000000
bytes). Both these values are quite large for single-frame 1300-byte
GIFs.  But setting them to small values doesn't change anything:

% ffmpeg -f image2 -analyzeduration 0 -probesize 1000 -i blue_%d.gif  -y animated_blue_12.gif
ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
   built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
   configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-indev=jack --enable-opencl --disable-outdev=xv --enable-audiotoolbox --enable-videotoolbox --enable-sdl2 --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-x86asm --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
   libavutil      55. 78.100 / 55. 78.100
   libavcodec     57.107.100 / 57.107.100
   libavformat    57. 83.100 / 57. 83.100
   libavdevice    57. 10.100 / 57. 10.100
   libavfilter     6.107.100 /  6.107.100
   libavresample   3.  7.  0 /  3.  7.  0
   libswscale      4.  8.100 /  4.  8.100
   libswresample   2.  9.100 /  2.  9.100
   libpostproc    54.  7.100 / 54.  7.100
[image2 @ 0x7f9c5580a600] Could not find codec parameters for stream 0 (Video: none, none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, image2, from 'blue_%d.gif':
   Duration: 00:00:00.08, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: none, none, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
   Stream #0:0 -> #0:0 (? (?) -> gif (native))
Decoder (codec none) not found for input stream #0:0

Again, how can I make a simple 2-frame animated GIF out of my two still
GIF images blue_1.gif and blue_2.gif?

[1] http://ffmpeg.org/ffmpeg-all.html#image2-1

Thanks in advance for your help. Best regards,
     —Jim DeLaHunt

--
     --Jim DeLaHunt, [hidden email]     http://blog.jdlh.com/ (http://jdlh.com/)
       multilingual websites consultant

       355-1027 Davie St, Vancouver BC V6E 4L2, Canada
          Canada mobile +1-604-376-8953

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Combine 2 small GIF images to small animated GIF, fails with "Decoder (codec none) not found for input stream #0:0"

Gyan Doshi

GIFs have a dedicated demuxer and don't work via the image2 demuxer.

Try the concat demuxer, or ingest the two GIFs separately and use the
concat filter.

Regards,
Gyan
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Combine 2 small GIF images to small animated GIF, fails with "Decoder (codec none) not found for input stream #0:0"

Jim DeLaHunt
On 2018-01-07 00:16, Gyan Doshi wrote:

>
> GIFs have a dedicated demuxer and don't work via the image2 demuxer.

Thank you for your reply, Gyan.

Oh wow, this seems like a pretty significant limitation on the image2
demuxer, and a deficiency in the documentation that this isn't
mentioned. I've filed a ticket about deficiencies in the image2
documentation.[1]

It seems this is a restriction on the input format. GIF inputs don't
work even to a non-GIF output.[2]

> Try the concat demuxer, or ingest the two GIFs separately and use the
> concat filter.

Well, the easiest workaround seems to be, convert the input images from
GIF to PNG format, then `ffmpeg -f image2` to combine them to a video.[3]

But I was also able to make the `concat` filter work.[4]

Thank you for your help, Gyan!  Best regards,
       —Jim DeLaHunt, Vancouver, Canada

[1] https://trac.ffmpeg.org/ticket/6950#ticket
[2] GIF inputs don't work even to a non-GIF output.

% ffmpeg -f image2 -i blue_%d.gif animated_blue_12.mp4

ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers

   built with Apple LLVM version 8.0.0 (clang-800.0.42.1)

   configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-indev=jack --enable-opencl --disable-outdev=xv --enable-audiotoolbox --enable-videotoolbox --enable-sdl2 --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-x86asm --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid

   libavutil      55. 78.100 / 55. 78.100

   libavcodec     57.107.100 / 57.107.100

   libavformat    57. 83.100 / 57. 83.100

   libavdevice    57. 10.100 / 57. 10.100

   libavfilter     6.107.100 /  6.107.100

   libavresample   3.  7.  0 /  3.  7.  0

   libswscale      4.  8.100 /  4.  8.100

   libswresample   2.  9.100 /  2.  9.100

   libpostproc    54.  7.100 / 54.  7.100

[image2 @ 0x7f9ba4808000] Could not find codec parameters for stream 0 (Video: none, none): unknown codec

Consider increasing the value for the 'analyzeduration' and 'probesize' options

Input #0, image2, from 'blue_%d.gif':

   Duration: 00:00:00.08, start: 0.000000, bitrate: N/A

     Stream #0:0: Video: none, none, 25 tbr, 25 tbn, 25 tbc

Stream mapping:

   Stream #0:0 -> #0:0 (? (?) -> h264 (libx264))

Decoder (codec none) not found for input stream #0:0


[3] The image2 demuxer is effective at combining non-GIF inputs (here,
PNG) into an animated GIF video output

% ffmpeg -f image2 -i blue_%d.png animated_blue_12_from_png.gif

ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers

   built with Apple LLVM version 8.0.0 (clang-800.0.42.1)

   configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-indev=jack --enable-opencl --disable-outdev=xv --enable-audiotoolbox --enable-videotoolbox --enable-sdl2 --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-x86asm --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid

   libavutil      55. 78.100 / 55. 78.100

   libavcodec     57.107.100 / 57.107.100

   libavformat    57. 83.100 / 57. 83.100

   libavdevice    57. 10.100 / 57. 10.100

   libavfilter     6.107.100 /  6.107.100

   libavresample   3.  7.  0 /  3.  7.  0

   libswscale      4.  8.100 /  4.  8.100

   libswresample   2.  9.100 /  2.  9.100

   libpostproc    54.  7.100 / 54.  7.100

Input #0, image2, from 'blue_%d.png':

   Duration: 00:00:00.08, start: 0.000000, bitrate: N/A

     Stream #0:0: Video: png, pal8(pc), 212x318, 25 tbr, 25 tbn, 25 tbc

Stream mapping:

   Stream #0:0 -> #0:0 (png (native) -> gif (native))

Press [q] to stop, [?] for help

Output #0, gif, to 'animated_blue_12_from_png.gif':

   Metadata:

     encoder         : Lavf57.83.100

     Stream #0:0: Video: gif, pal8, 212x318, q=2-31, 200 kb/s, 25 fps, 100 tbn, 25 tbc

     Metadata:

       encoder         : Lavc57.107.100 gif

frame=    2 fps=0.0 q=-0.0 Lsize=       3kB time=00:00:00.05 bitrate= 423.8kbits/s speed=9.25x

video:2kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 44.596069%


[4] The concat filter is effective in combining GIF inputs into a video
output, here animated GIF output.

% ffmpeg -i blue_1.gif -i blue_2.gif -filter_complex "[0:v][1:v] concat=n=2:v=1:a=0" -y animated_blue_12.gif

ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers

   built with Apple LLVM version 8.0.0 (clang-800.0.42.1)

   configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-indev=jack --enable-opencl --disable-outdev=xv --enable-audiotoolbox --enable-videotoolbox --enable-sdl2 --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-x86asm --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid

   libavutil      55. 78.100 / 55. 78.100

   libavcodec     57.107.100 / 57.107.100

   libavformat    57. 83.100 / 57. 83.100

   libavdevice    57. 10.100 / 57. 10.100

   libavfilter     6.107.100 /  6.107.100

   libavresample   3.  7.  0 /  3.  7.  0

   libswscale      4.  8.100 /  4.  8.100

   libswresample   2.  9.100 /  2.  9.100

   libpostproc    54.  7.100 / 54.  7.100

Input #0, gif, from 'blue_1.gif':

   Duration: N/A, bitrate: N/A

     Stream #0:0: Video: gif, bgra, 212x318, 10 tbr, 100 tbn, 100 tbc

Input #1, gif, from 'blue_2.gif':

   Duration: N/A, bitrate: N/A

     Stream #1:0: Video: gif, bgra, 212x318, 10 tbr, 100 tbn, 100 tbc

Stream mapping:

   Stream #0:0 (gif) -> concat:in0:v0

   Stream #1:0 (gif) -> concat:in1:v0

   concat -> Stream #0:0 (gif)

Press [q] to stop, [?] for help

Output #0, gif, to 'animated_blue_12.gif':

   Metadata:

     encoder         : Lavf57.83.100

     Stream #0:0: Video: gif, bgr8, 212x318, q=2-31, 200 kb/s, 10 fps, 100 tbn, 10 tbc (default)

     Metadata:

       encoder         : Lavc57.107.100 gif

frame=    2 fps=0.0 q=-0.0 Lsize=       1kB time=00:00:00.11 bitrate= 102.7kbits/s speed=24.9x

video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 137.310928%



--
     --Jim DeLaHunt, [hidden email]     http://blog.jdlh.com/ (http://jdlh.com/)
       multilingual websites consultant

       355-1027 Davie St, Vancouver BC V6E 4L2, Canada
          Canada mobile +1-604-376-8953

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Combine 2 small GIF images to small animated GIF, fails with "Decoder (codec none) not found for input stream #0:0"

Carl Eugen Hoyos-2
In reply to this post by Jim DeLaHunt
2018-01-07 8:02 GMT+01:00 Jim DeLaHunt <[hidden email]>:

> % ffmpeg -f image2 -i blue_%d.gif

This did work in the past but at the same time, most gif files
were not supported at all so it is very unlikely that current
behaviour will change in the future (work-arounds are trivial
depending on what your gif files contain - technically).

Or in other words: It is a feature that we support many gif
files for which above syntax cannot work while we dropped
support for above use-case (that iirc would only work for a
small number of gif files).

> ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers

Please remember that on this mailing list, only current
FFmpeg git head is supported.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".