How to create/send a telegram-conform video format?

Dear all,

I use the telegram node and a telegram bot to send short video files to telegram, like explained here:

This works, but I cannot watch the video on my mobile phone instantly/directly in telegram. The first frame is shortly shown but then it gets white (WHY??) - it is offered / passed by telegram to a different location/app and then it is displayed. That's on a mobile. I can watch it immidiately on the telegram PC client.

I send it using a telegram sender node and function for the payload like:

let payload = {
    "chatId":111111111,
    "type":"video",
    "content":"/home/auser/video/myvideo.mp4"
};
return {payload};

The video itself is recorded by a shell script (simple usb camera connected to a Raspberry Pi):

#!/bin/bash
video_file="/home/auser/video/myvideo.mp4"
rm $video_file
ffmpeg -i /dev/video0 -t 8 -v "error" $video_file

Somebody knows about this?

Is that the same PC that the video file is saved on?

I am not certain, but it looks like the video is not actually sent - but instead - a path to the video. i.e. your phone wont have access to /home/auser/video/myvideo.mp4. My guess is you would need to generate a buffer & send as attachment.

for example, if you send a URL to a video instead, that will work.


or perhaps it does work but your phone doesnt like the MP4 encoding?

Try manually copying the mp4 file to your phone - does it play?

I tested similar and this works fine for me (viewing on an Iphone, Ipad and mac, no problems)

Code in my function node below. The mp4 file is located in /home/pi

msg.payload = {content:"/home/pi/pedestrians.mp4", type:"video", chatId:xxxxxx};
return msg;
1 Like

no.

yes, it plays, just not with the Telegram app, but with a different player (mxplayer)

Ok; how did you create / encode the video?

I did not, was a mp4 video I had already

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.