如何将FFMPEG的输出输出到VAR并使用卷发上传?

发布于 2025-02-12 08:41:44 字数 392 浏览 0 评论 0原文

如何将ffmpeg的输出输出到var并使用卷发上传,例如

ffmpeg -i test.mp4 -f avi pipe:1 | cat > out | curl -F document=@"$out" https://api.telegram.org/bot<token>/sendDocument?chat_id=<chat_id>

此命令 test.mp4 是输入文件,并且out out ut是 out

,我在这里试图将 ffmpeg的输出存储到名为out的var,然后尝试将其直接上传到电报,但没有发生。有什么办法吗?

how to get the output of the ffmpeg to the var and upload it using curl, like here

ffmpeg -i test.mp4 -f avi pipe:1 | cat > out | curl -F document=@"$out" https://api.telegram.org/bot<token>/sendDocument?chat_id=<chat_id>

In this command test.mp4 is input file and out put is out

Here I am trying to store output of ffmpeg to a var named out and then trying to upload it to telegram directly but nothing happen. Is there any way to do it ?

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

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

发布评论

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

评论(1

深巷少女 2025-02-19 08:41:44

这是使用ffmpeg的一种不寻常的方法。我认为可能有一种方法可以使用stdout作为ffmpeg命令的输出,但这是一种肮脏的方法!
您应该设置ffmpeg命令的输出文件,然后通过curl发送此文件。然后,您可以根据需要删除文件。您可以将这些命令放在.sh.bat文件中,然后使用单个命令运行:

ffmpeg -i test.mp4 -f avi out.mp4
curl -T out.mp4 https://api.telegram.org/bot<token>/sendDocument?chat_id=<chat_id>
rm out.mp4

This is an unusual way of using ffmpeg. I think there might be a way of using stdout as the output of ffmpeg command but it is a dirty way if any!
You should set the output file of ffmpeg command and then send this file by curl. Then you can delete the file if you want. You can put these commands in a .sh or .bat file and run it using a single command:

ffmpeg -i test.mp4 -f avi out.mp4
curl -T out.mp4 https://api.telegram.org/bot<token>/sendDocument?chat_id=<chat_id>
rm out.mp4
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文