Ffmpeg将gif转换为具有反向功能的webm [英] Ffmpeg to convert gif to webm with reverse function

查看:273
本文介绍了Ffmpeg将gif转换为具有反向功能的webm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用下面的文件将gif文件转换为webm文件,但是我很想知道是否也可以使用ffmpeg来反转它,或者我需要使用imagemagick来反转它,然后覆盖它使用ffmpeg

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 to reverse it using imagemagick first then cover it using ffmpeg

ffmpeg -i your_gif.gif -c:v libvpx -crf 12 -b:v 500K output.webm

任何帮助不胜感激

推荐答案

此处发布的脚本可能会帮助您。
这个似乎是在bash中,但是翻录命令也应该在Windows上工作。
https://github.com/WhatIsThisImNotGoodWithComputers/ffmpeg-webm-scripts

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

您基本上必须将所有的静止图像转换成jpg,然后重新进入webm,但是按照相反的顺序。

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

这篇关于Ffmpeg将gif转换为具有反向功能的webm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆