简体   繁体   English

FFmpeg mov转mp4转gif

[英]FFmpeg mov to mp4 to gif

I'm trying to convert a.mov file to an in-memory mp4, then to a final GIF output with a single ffmpeg command:我正在尝试将 a.mov 文件转换为内存中的 mp4,然后使用单个 ffmpeg 命令转换为最终的 GIF output:

ffmpeg -t 22 -i "select image and zoom.mov" -f mp4 - | ffmpeg -vf "fps=10,scale=320:-1:flags=lanczos,setpts=0.7*PTS,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 "select image and zoom.gif" 

but am running into:但我遇到了:

muxer does not support non seekable output
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 -- 

This thread suggests mp4 cannot be piped like this. 线程建议 mp4 不能像这样通过管道传输。 Is this still the case?现在还是这样吗? Am I left with actually writing an intermediary file using bash's && option ?我是否只剩下使用 bash 的&& 选项实际编写一个中间文件?

Is there a reason you cannot just do this?你有什么理由不能这样做吗?

ffmpeg -t 22 -i "select image and zoom.mov" \
  -vf "fps=10,scale=320:-1:flags=lanczos,setpts=0.7*PTS,split[s0][s1];\
       [s0]palettegen[p];[s1][p]paletteuse" \
  -loop 0 "select image and zoom.gif"

But if you must pipe, no, you cannot use mp4 container, but you can use MKV但是如果一定要pipe,不行,不能用mp4容器,但是可以用MKV

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM