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

**URL:** https://discourse.nodered.org/t/how-to-create-send-a-telegram-conform-video-format/35996
**Category:** General
**Created:** [16 November 2020 11:23 UTC](https://discourse.nodered.org/t/how-to-create-send-a-telegram-conform-video-format/35996 "2020-11-16T11:23:12Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![loeten](https://avatars.discourse-cdn.com/v4/letter/l/b38774/32.png) [@loeten](https://discourse.nodered.org/u/loeten)
#### Post date: [16 November 2020 11:23 UTC](https://discourse.nodered.org/t/how-to-create-send-a-telegram-conform-video-format/35996/1 "2020-11-16T11:23:12Z")

</div>

Dear all,

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

> **[node-red-contrib-telegrambot](https://flows.nodered.org/node/node-red-contrib-telegrambot)**
>
> Telegram bot nodes for Node-RED

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:

```auto
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):

```auto
#!/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?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [16 November 2020 12:44 UTC](https://discourse.nodered.org/t/how-to-create-send-a-telegram-conform-video-format/35996/2 "2020-11-16T12:44:05Z")

</div>

> [@loeten](#):
>
> I can watch it immidiately on the telegram PC client

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?

---

<div class="post-metadata">

### Author: ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)
#### Post date: [16 November 2020 15:27 UTC](https://discourse.nodered.org/t/how-to-create-send-a-telegram-conform-video-format/35996/3 "2020-11-16T15:27:12Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/4/54e0fadf278670f64d132029e5a5b18dd5c0a953.jpeg)

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

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

```

---

<div class="post-metadata">

### Author: ![loeten](https://avatars.discourse-cdn.com/v4/letter/l/b38774/32.png) [@loeten](https://discourse.nodered.org/u/loeten)
#### Post date: [16 November 2020 16:36 UTC](https://discourse.nodered.org/t/how-to-create-send-a-telegram-conform-video-format/35996/4 "2020-11-16T16:36:36Z")

</div>

> [@Steve-Mcl](#):
>
> Is that the same PC that the video file is saved on?

no.

> [@Steve-Mcl](#):
>
> Try manually copying the mp4 file to your phone - does it play?

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

> [@krambriw](#):
>
> Code in my function node below

Ok; how did you create / encode the video?

---

<div class="post-metadata">

### Author: ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)
#### Post date: [16 November 2020 16:39 UTC](https://discourse.nodered.org/t/how-to-create-send-a-telegram-conform-video-format/35996/5 "2020-11-16T16:39:31Z")

</div>

> [@loeten](#):
>
> Ok; how did you create / encode the video?

I did not, was a mp4 video I had already

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [15 January 2021 16:39 UTC](https://discourse.nodered.org/t/how-to-create-send-a-telegram-conform-video-format/35996/6 "2021-01-15T16:39:42Z")

</div>

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