Search code examples
ffmpegffmpeg-php

FFMPEG question - FFMPEG no convert to the same extension


I have a question how can I do if the file has the same extension in case it is gif to gif. ffmpeg no convert to the same extension. Make ffmpeg just ignore the file?

I'm currently using -ss 5 -i filename.gif -t 10 -pix_fmt rgb24 filename.gif 2> & 1 ";

In my project there are other extensions, but it would not be necessary to convert a file that is already in the desired extension.

Every help is welcome. Thanks in advance.


Solution

  • I think I understand your doubt, ffmpeg will not ignore if the file has the same extension you are the one who must define this in your code.

    But maybe it helps this string greatly reduces the size of the gif file, because I believe that your biggest problem is gifs in the output with size larger than in the input. Try this. ->

    -i file.gif -pix_fmt rgb24 -r 4 -vf scale=540:-1 file.gif 2>&1