FFmpeg mov 转 mp4 转 gif

发布于 2025-01-14 02:15:29 字数 803 浏览 3 评论 0原文

我正在尝试将 .mov 文件转换为内存中的 mp4,然后使用单个 ffmpeg 命令转换为最终的 GIF 输出:

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" 

但遇到:

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 -- 

线程表明 mp4 不能像这样管道。现在还是这样吗?我是否真的需要使用 bash 的 && 编写中间文件?选项

I'm trying to convert a .mov file to an in-memory mp4, then to a final GIF output with a single ffmpeg command:

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. Is this still the case? Am I left with actually writing an intermediary file using bash's && option?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光匆匆的小流年 2025-01-21 02:15:29

你有什么理由不能这样做吗?

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"

但如果你必须管道,不,你不能使用mp4容器,但你可以使用MKV

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文