如何将FFMPEG的输出输出到VAR并使用卷发上传?
如何将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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是使用
ffmpeg
的一种不寻常的方法。我认为可能有一种方法可以使用stdout
作为ffmpeg
命令的输出,但这是一种肮脏的方法!您应该设置
ffmpeg
命令的输出文件,然后通过curl
发送此文件。然后,您可以根据需要删除文件。您可以将这些命令放在.sh
或.bat
文件中,然后使用单个命令运行:This is an unusual way of using
ffmpeg
. I think there might be a way of usingstdout
as the output offfmpeg
command but it is a dirty way if any!You should set the output file of
ffmpeg
command and then send this file bycurl
. 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: