# How to: RTSP to Chromecast

**URL:** https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087
**Category:** General
**Created:** [31 January 2020 12:48 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087 "2020-01-31T12:48:35Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Gleneroo](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@Gleneroo](https://discourse.nodered.org/u/Gleneroo)
#### Post date: [31 January 2020 12:48 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/1 "2020-01-31T12:48:36Z")

</div>

Hello

I am new and I have only one simple flow behind me (receive an http rquest, speak, on a case-by-case basis, some sentences on google home.

In my home I have surveillance cameras.  
I can get the video with an rtsp link.  
I would like to play this on my google home (with screen), which has a chromecast incorporated.

I wonder if this possible ?

I found this node

> **[node-red-contrib-cast](https://flows.nodered.org/node/node-red-contrib-cast)**
>
> NodeRED nodes to for Chromecast and Google Home

  
but in "stream a URL" it doesn't seem to accept a rtsp link.

Thank you

---

<div class="post-metadata">

### Author: ![Hypnos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hypnos/32/7566_2.png) [@Hypnos](https://discourse.nodered.org/u/Hypnos)
#### Post date: [1 February 2020 12:53 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/2 "2020-02-01T12:53:17Z")

</div>

The stream is send directly to the cast device by using the castv2 protocol. Only these formats are supported; [https://developers.google.com/cast/docs/media](https://developers.google.com/cast/docs/media)

---

<div class="post-metadata">

### Author: ![Gleneroo](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@Gleneroo](https://discourse.nodered.org/u/Gleneroo)
#### Post date: [10 February 2020 20:22 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/3 "2020-02-10T20:22:20Z")

</div>

Can you give an example ?

This flow doesn't work:

```auto
[{"id":"19d4447a.e78fcc","type":"tab","label":"Castv2","disabled":false,"info":""},{"id":"4ea4de1e.f255d","type":"castv2-sender","z":"19d4447a.e78fcc","name":"Smart Display","host":"192.168.1.113","x":540,"y":200,"wires":[["4200efb7.dfd73"]]},{"id":"4200efb7.dfd73","type":"debug","z":"19d4447a.e78fcc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":720,"y":200,"wires":[]},{"id":"bcb22075.677ec","type":"inject","z":"19d4447a.e78fcc","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":200,"wires":[["c86dad8.105995"]]},{"id":"c86dad8.105995","type":"change","z":"19d4447a.e78fcc","name":"","rules":[{"t":"set","p":"payload.media.url","pt":"msg","to":"rtsp://admin:1234@192.168.1.103:554/cam/realmonitor?channel=1&subtype=0","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"MEDIA","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":200,"wires":[["4ea4de1e.f255d"]]}]

```

I believe this is in the "change" I don't give the info it needs.

Thank you

---

<div class="post-metadata">

### Author: ![Gleneroo](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@Gleneroo](https://discourse.nodered.org/u/Gleneroo)
#### Post date: [13 February 2020 09:30 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/4 "2020-02-13T09:30:16Z")

</div>

Can someone give an example of a flow using castv2 node, streaming either a rtsp or a m3u8 file ? Documentation doesn't have an example.

Thank you

---

<div class="post-metadata">

### Author: ![Hypnos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hypnos/32/7566_2.png) [@Hypnos](https://discourse.nodered.org/u/Hypnos)
#### Post date: [13 February 2020 12:59 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/5 "2020-02-13T12:59:05Z")

</div>

> [@Gleneroo](#):
>
> [{"id":"19d4447a.e78fcc","type":"tab","label":"Castv2","disabled":false,"info":""},{"id":"4ea4de1e.f255d","type":"castv2-sender","z":"19d4447a.e78fcc","name":"Smart Display","host":"192.168.1.113","x":540,"y":200,"wires":[["4200efb7.dfd73"]]},{"id":"4200efb7.dfd73","type":"debug","z":"19d4447a.e78fcc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":720,"y":200,"wires":},{"id":"bcb22075.677ec","type":"inject","z":"19d4447a.e78fcc","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":200,"wires":[["c86dad8.105995"]]},{"id":"c86dad8.105995","type":"change","z":"19d4447a.e78fcc","name":"","rules":[{"t":"set","p":"payload.media.url","pt":"msg","to":"rtsp://admin:1234@192.168.1.103:554/cam/realmonitor?channel=1&subtype=0","tot":"str"},{"t":"set","p":"payload.type","pt":"msg","to":"MEDIA","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":200,"wires":[["4ea4de1e.f255d"]]}]

You have used not the `node-red-contrib-cast` node. So I can not help you.

In the website [node-red-contrib-cast](https://flows.nodered.org/node/node-red-contrib-cast) you can find examples for `node-red-contrib-cast`.

---

<div class="post-metadata">

### Author: ![Gleneroo](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@Gleneroo](https://discourse.nodered.org/u/Gleneroo)
#### Post date: [13 February 2020 13:40 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/6 "2020-02-13T13:40:51Z")

</div>

Hey, actually, in your first message I understood (misunderstood) you told me to use castV2 node.  
Now I understand you say I need to use CAST node (knowing it uses castV2 protocol).  
Is this correct ?

This cast node, I use it daily for TTS notifications (switching lights on/off, etc) !

So I come back to the "cast" node. In "media url" can I put a rtsp link ?

This flow (tried it with a rtsp link) does not work:

```auto
[{"id":"a32c41fb.c31c","type":"change","z":"19d4447a.e78fcc","name":"","rules":[{"t":"set","p":"ip","pt":"msg","to":"192.168.1.113","tot":"str"},{"t":"set","p":"url","pt":"msg","to":"rtsp://admin:1234@192.168.1.102:554/live","tot":"str"},{"t":"set","p":"contentType","pt":"msg","to":"video/mp4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":340,"wires":[["831444e1.916c78"]]}]

```

Working directly from a rtsp link would be my preferred option.

However an alternative, if this is not possible, is to use ffmpeg on my Pi (same one where I have nodered) to change the rtsp to m3u8 series of files. Then my question is how to read a file from the Pi (it is on the same device)

Thank you

---

<div class="post-metadata">

### Author: ![Hypnos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hypnos/32/7566_2.png) [@Hypnos](https://discourse.nodered.org/u/Hypnos)
#### Post date: [17 February 2020 11:37 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/7 "2020-02-17T11:37:13Z")

</div>

I am the author of node node-red-contrib-cast. The node node node-red-contrib-castv2 is a fork created by anybody other. So I can not give any support for the castv2 node. But as I know both using the same protocoll and to thus both hase the same limitations.

Only media types are supported that Google lists [here](https://developers.google.com/cast/docs/media). There is nothing about rtsp stream. So this seems not be suported.

---

<div class="post-metadata">

### Author: ![Gleneroo](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@Gleneroo](https://discourse.nodered.org/u/Gleneroo)
#### Post date: [17 February 2020 15:58 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/8 "2020-02-17T15:58:34Z")

</div>

> [@Hypnos](#):
>
> e node-red-contrib-cast. The node node node-red-contrib-castv2 is a fork created by anybody other. So I can not give any support for the castv2 node. But as I know both using the same protocoll and to thus both hase the same limitati

OK, well... The title of this discussion is "RTSP to chromecast" so well, yes, it is about RTSP actually... 😀  
OK so you know nothing about that.

But M3U8 series of files do you know how to read it (M3U8 is listed in "CAST" node examples) ? How to read it on the same device (how to enter path) ? Do you know something about that ? (actually did you read the questions - no offense)

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [17 February 2020 16:12 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/9 "2020-02-17T16:12:30Z")

</div>

I think you'll find he does know something about it... having read the google support page you would find no mention of RTSP or M3U8 - so the answer is that Google don't support RTSP directly. You would need some other code in between to translate. A quick google finds several suggestions including ffmpeg, a pre-build docker container, etc... so there are solutions out there - but they are not built into Node-RED.

---

<div class="post-metadata">

### Author: ![Gleneroo](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@Gleneroo](https://discourse.nodered.org/u/Gleneroo)
#### Post date: [17 February 2020 16:37 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/10 "2020-02-17T16:37:32Z")

</div>

Thank you. Actually a few messages above I explained, if RTSP is not possible, I already use FFMPEG on the Pi to change the stream to M3U8.  
This is why I asked how to read M3U8 series of files with the cast node.  
In the [cast node page](https://flows.nodered.org/node/node-red-contrib-cast), there is mention of M3U8 in MEDIA types part.  
=\> I would like an example with this.  
Among others I am curious about the file name and the path.

To be 100% complete, even better would be to have FFMPEG stream directly to the Chromecast but thtat I didn't figure out how to do this, and I am not on the right discussion board... But I am not sure this is possible anyway, without going through intermediate files.

---

<div class="post-metadata">

### Author: ![Hypnos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hypnos/32/7566_2.png) [@Hypnos](https://discourse.nodered.org/u/Hypnos)
#### Post date: [17 February 2020 16:39 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/11 "2020-02-17T16:39:41Z")

</div>

Excuse me if my answer is too short.

> So I come back to the "cast" node. In "media url" can I put a rtsp link ?

Any link can be entered in the `media url` field and the node will transmit this given link to the Cast device (e.g. chrome cast, google home, nest home, ...). The Node does only send the url and the additional context information (e.g. content type, etc...) to the cast device without changing them. To show the video/picture or play the sound it is up to the cast device itself.

The cast device is responsible for whether the desired result is achieved with the URL.  
To thus as I answered before:

> Only media types are supported that Google lists [here](https://developers.google.com/cast/docs/media). There is nothing about RTSP stream. So this seems not be suported.

Since Google unfortunately does not list RTSP as a supported format, I suspect that it will not work, but You can give it a try. (I have currently no possibility to test this.)

The other possibility is to only provide the video stream in a format that is supported by Google.

The documentation of the node is unfortunately not good here. With the formats listed in the documentation of the node, it is not guaranteed that Google also supports them. I will change the documentation in any of the next versions.

I hope that makes this more clear.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [17 February 2020 16:44 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/12 "2020-02-17T16:44:36Z")

</div>

@Gleneroo - So... as the chromcast seems to accept HLS - then maybe the answer is to use ffmpeg to convert RTSP to HLS instead of M38U ?  
eg - [https://github.com/gihad/streamer](https://github.com/gihad/streamer)

---

<div class="post-metadata">

### Author: ![Gleneroo](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@Gleneroo](https://discourse.nodered.org/u/Gleneroo)
#### Post date: [17 February 2020 17:00 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/13 "2020-02-17T17:00:31Z")

</div>

Thanks Hypnos for your more complete answer ! I do understand better what the node does and does not, and to refer to google doc and not node doc.

dceejay: Well, my understanding is HLS _is_ M3U8.  
I have ffmpeg on the pi taking the RTSP flow, and doing M3U8 files (\*.ts files).  
Now what I miss is the node to stream it to the chromecast.  
Certainly I am not far.

---

<div class="post-metadata">

### Author: ![i8beef](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/i8beef/32/3161_2.png) [@i8beef](https://discourse.nodered.org/u/i8beef)
#### Post date: [19 February 2020 22:47 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/14 "2020-02-19T22:47:04Z")

</div>

The node-red-contrib-castv2 node is just a rewrite of the cast node that (hopefully) isn't as glitchy.

As others have said, the cast protocol will only use HLS (Yes, this is m3u8) and DASH for video streaming.

If you have an HLS stream URL available already, you just need to pass a message like this into a castv2 node that's configured to point at your target:

```auto
{
    "payload": {
        "type": "MEDIA",
        "media": {
            "url": "URL of m3u8"
        }
    }
}

```

---

<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: [20 February 2020 06:49 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/15 "2020-02-20T06:49:36Z")

</div>

> [@Gleneroo](#):
>
> I have ffmpeg on the pi taking the RTSP flow, and doing M3U8 files (\*.ts files)

Could it be,,,you should configure ffmpeg to stream to http instead of creating file? Then you add the url in the castv2 node configuration

How does your ffmpeg command line look like?

---

<div class="post-metadata">

### Author: ![Gleneroo](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@Gleneroo](https://discourse.nodered.org/u/Gleneroo)
#### Post date: [20 February 2020 14:56 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/16 "2020-02-20T14:56:42Z")

</div>

Thank you i8beef and krambriw

I would like, as you suggest, to use ffmpeg that stream to http instead of creating files. I just don't know how to do that.

I am using something like that : (found on the internet)

```auto
ffmpeg -rtsp_transport tcp -i rtsp://admin:123456@192.168.0.218/live/ch1 \
  -acodec copy \
  -vcodec copy \
  -hls_wrap 40 \
  -flags -global_header \
  /var/www/html/cam/cam.m3u8

```

The link http://[IP raspberry]/cam/cam.m3u8 doesn't read, same with trying other paths. It just creates 40 small .ts files in the cam directory (overwritten in loop).

I have tried to modify the last line as: -f mpegts udp://[IP chromecast]:[port] but of course doesn't stream to chromecast as well.

I would be happy to stream this HLS to a url, I would just like to know how, then use a node for sending it to the chromecast.

Regards

---

<div class="post-metadata">

### Author: ![realjax](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realjax/32/895_2.png) [@realjax](https://discourse.nodered.org/u/realjax)
#### Post date: [20 February 2020 15:44 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/17 "2020-02-20T15:44:09Z")

</div>

Take a look here for the correct ffmpeg syntax: [Zenki](https://github.com/w23/zenki)

Keep in mind that Chromecast is finicky about the HLS flavor it gets. There is a known bug for instance when an incorrect audio codec is selected. The HLS stream is functional but Chromecast will then refuse to play it. Good luck.

---

<div class="post-metadata">

### Author: ![Gleneroo](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@Gleneroo](https://discourse.nodered.org/u/Gleneroo)
#### Post date: [20 February 2020 16:18 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/18 "2020-02-20T16:18:48Z")

</div>

Realjax maybe you had best intentions but this is not the question. I already have this part covered (rtsp to m3u8 file). Now question is to url.

---

<div class="post-metadata">

### Author: ![realjax](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realjax/32/895_2.png) [@realjax](https://discourse.nodered.org/u/realjax)
#### Post date: [20 February 2020 16:23 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/19 "2020-02-20T16:23:20Z")

</div>

Install a webserver to serve the files. The files ARE your stream. The link I gave is an example of this.

---

<div class="post-metadata">

### Author: ![Gleneroo](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@Gleneroo](https://discourse.nodered.org/u/Gleneroo)
#### Post date: [20 February 2020 16:46 UTC](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087/21 "2020-02-20T16:46:45Z")

</div>

Actually I already have this part.  
See above I have my own ffmpeg lines.

It is in the next part I needed support. "install a web server to serve the files" doesn't help.

I don't know why you want to support the part I already managed and not the part where I asked a question.

[Next page](https://discourse.nodered.org/t/how-to-rtsp-to-chromecast/21087.md?page=2)
