using ffmpeg to convert gif to mp4 , output doesn't play on android

女生的网名这么多〃 提交于 2019-12-07 08:05:42

问题


I just use the following command to convert a gif file to mp4 but the resulting mp4 file doesn't play in android default video player .
what did I wrong ?
is there any aditional steps should I take to produce android playable mp4 files ?

$ ffmpeg -f gif -i infile.gif outfile.mp4

my test gif file : Test Gif File
My desktop played the output.mp4 very well using VLC Media Player and also MX Player on my android device played the video file without any error.


回答1:


Try this:

ffmpeg -i file.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" out.mp4



回答2:


You can use this:

ffmpe -f gif -i firstFile.gif -pix_fmt yuv420p -c:v libx264 -movflags +faststart -filter:v crop='floor(in_w/2)*2:floor(in_h/2)*2' result.mp4


来源:https://stackoverflow.com/questions/31781238/using-ffmpeg-to-convert-gif-to-mp4-output-doesnt-play-on-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!