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 ?
CodePudding user response:
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