Which video format can be used in Telegram Bot API sendVideo
method?
On the page they only mention "H.264/MPEG-4 AVC"
So if I convert a video (without sound) with
ffmpeg -i input -an -c:v libx264 -crf 26 out.m4v
I get an ok:true
as response but I can't see the preview (blurred still image) in the Telegram client.
As the answer above stated: Telegram indeed uses H. 264 and MPEG-4 is a must as a container. If you upload a video file from computer, in the case the file exceeds 10 MB it will be marked as a file and will not be playable by Web app or Android app.
Open a chat or channel and tap on the attachment menu (paperclip icon) and you'll see a menu where you can choose what you want to upload. Here you can select photos, videos, files, etc. You can upload a video up to 1.5 GB and share it with your friends or keep it in your cloud for safe-keeping.
API TL-schema, as JSON.
This was really driving me nuts: It's important that the file extension is ".mp4". If you upload a video with ".m4v" extension you'll not see a preview window and the video is opened in an external player.
So here is my final command to reencode and resize a video and send it to the bot using curl:
ffmpeg -i input -an -c:v libx264 -crf 26 -vf scale=640:-1 out.mp4
curl -v -F chat_id=CHATID -F [email protected] -F caption=foobar https://api.telegram.org/bot<TOKEN>/sendVideo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With