Ffmpeg to convert gif to webm with reverse function

前端 未结 2 1019
野性不改
野性不改 2021-01-15 03:41

I\'m trying to convert a gif file to webm file using the below which works fine however I’m wondering is it also possible to reverse it as well using ffmpeg or would I need

相关标签:
2条回答
  • 2021-01-15 03:54

    From ffmpeg --help, you can see what codecs ffmpeg supports with ffmpeg -codecs. ffmpeg -codecs|grep -i gif on mine says it supports gif.

    ffmpeg checks extensions to get file type if you don't override,

    ffmpeg -i onoz.webm onoz.gif
    

    does the trick just fine.

    0 讨论(0)
  • 2021-01-15 03:58

    The script posted here might help you. This one seems to be in bash but ripping the commands should work on Windows as well. https://github.com/WhatIsThisImNotGoodWithComputers/ffmpeg-webm-scripts

    These are the relevant lines of code (note that they need to edited for your setup):

    ffmpeg -i "${INPUT_FILE}" -ss $START_TIME -to $TO_TIME -an -qscale 1 $TEMP_FOLDER/%06d.jpg
    cat $(ls -r $TEMP_FOLDER/*jpg) | ffmpeg -f image2pipe -vcodec mjpeg -r 25 -i - -c:v libvpx -crf 20 -b:v $FRAMERATE $CROPSCALE -threads 0 -an $OUTPUT_FILE
    

    You basically have to convert all stills to jpgs and then back into webm, but in reverse order.

    0 讨论(0)
提交回复
热议问题