vvo / gifify

😻 Convert any video file to an optimized animated GIF.
ISC License
6.21k stars 314 forks source link

Incompatible pixel format 'rgb24' for codec 'gif', auto-selecting format 'rgb8' #39

Open niftylettuce opened 8 years ago

niftylettuce commented 8 years ago

I followed installation instructions exactly, all requirements met, yet I don't think ffmpeg is installed correctly - maybe you are missing a --flag for brew?

vvo commented 8 years ago

maybe you are missing a --flag for brew?

I dunno, cc @kud maybe, I am on Linux

kud commented 8 years ago

Did you do brew install ffmpeg --with-libass --with-fontconfig?

niftylettuce commented 8 years ago

Ya On Jan 6, 2016 7:21 AM, "Erwann Mest" notifications@github.com wrote:

Did you do brew install ffmpeg --with-libass --with-fontconfig?

— Reply to this email directly or view it on GitHub https://github.com/vvo/gifify/issues/39#issuecomment-169311217.

meera commented 7 years ago

I am getting same error. I see out.gif is created correctly.

Here is the command ffmpeg -i in.mov -s 200x200 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif

ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 8.0.0 (clang-800.0.42.1) configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda libavutil 55. 58.100 / 55. 58.100 libavcodec 57. 89.100 / 57. 89.100 libavformat 57. 71.100 / 57. 71.100 libavdevice 57. 6.100 / 57. 6.100 libavfilter 6. 82.100 / 6. 82.100 libavresample 3. 5. 0 / 3. 5. 0 libswscale 4. 6.100 / 4. 6.100 libswresample 2. 7.100 / 2. 7.100 libpostproc 54. 5.100 / 54. 5.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mov': Metadata: major_brand : M4V minor_version : 1 compatible_brands: M4V M4A mp42isom creation_time : 2017-07-18T06:49:45.000000Z encoder : Keynote 6.6.2 (2571) Duration: 00:00:06.13, start: 0.000000, bitrate: 175 kb/s Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 720x720 [SAR 1:1 DAR 1:1], 171 kb/s, 30 fps, 30 tbr, 600 tbn, 50 tbc (default) Metadata: creation_time : 2017-07-18T06:49:45.000000Z handler_name : Core Media Video Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> gif (native)) Press [q] to stop, [?] for help Incompatible pixel format 'rgb24' for codec 'gif', auto-selecting format 'rgb8' Output #0, gif, to 'pipe:': Metadata: major_brand : M4V minor_version : 1 compatible_brands: M4V M4A mp42isom encoder : Lavf57.71.100 Stream #0:0(und): Video: gif, rgb8, 200x200 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 10 fps, 100 tbn, 10 tbc (default) Metadata: creation_time : 2017-07-18T06:49:45.000000Z handler_name : Core Media Video encoder : Lavc57.89.100 gif frame= 62 fps=0.0 q=-0.0 Lsize= 20kB time=00:00:06.11 bitrate= 26.6kbits/s dup=0 drop=122 speed=20.9x
video:19kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.816988%

p00j4 commented 6 years ago

ok, here is what step by step to get the ffmpeg work on MAC. This might not be the same case with all but may be with majority hence posting how did I got it working on my machine.

  1. brew install ffmpeg

  2. but when I run the command, I get this error at the last line of logs Incompatible pixel format 'rgb24' for codec 'gif', auto-selecting format 'rgb8' at the last line. 3. And I ended up on this page to find the fix and I tried all the solutions mentioned above but none worked for my case. Then I go ahead and change my command to use 'rgb8' instead of 'rgb24' Eg. ffmpeg -i in.mov -s 1000x200 -pix_fmt rgb8 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif

  3. Yay, it looks worked because that error disappeared and my out.gif is created but here is the catch "its 0 byte file" - no content.

  4. Now I go and read the logs again and I observe the actual issue was at the first line (not highlighted and so was ignored) -bash: gifsicle: command not found

  5. done: brew install gifsicle

  6. all the errors are gone and I get my gif successfully with 'rgb24' (without any need to change the flags i wanted in my command).

clue: read logs from the top, till bottom and fix all warning like errors

bengsfort commented 6 years ago

+1 brew install gifsicle fixed it for me. Thanks @p00j4!