How to cast videos

Awesome,thanks for sharing . This really helps !

UPDATE: After placing the file in /share , I was able to play the file from browser @ http://192.168.XX.XX:1880/endpoint/alavp. However the cast node is unable to play . Still getting this error

"Not able to load media:Load failed Not able to load the media."

UPDATE : Removed username/pass from the node-red configs and it works now .

http_node:
  username: ''
  password: ''

Hello.
I'm trying to cast a local video to Chromecast through Node Red with "node-red-contrib-cast" (OS Win10). The problem is that I get the following error "Not able to load media:Load failed Not able to load the media."
I've read all the posts but I haven't resolved the error. For example, this update of @Auto101 "Removed username/pass from the node-red configs and it works now" Where I can find this option to change it?
Thanks !

You can add / delete the http credentials from configuration settings

If you refer in http node, I don't have any credentials configurated.

Is it possible that the problem is where I've stored the video .mp4 I want to stream? Where I should locate the .mp4 video to allow Node-Red serve it?

Thanks.

I was referring to the configuration settings from node-red .

Pls refer to Steveā€™s response from April 22. You can import that flow and make modifications as needed.

Hi @Steve-Mcl
I'm trying to cast a local video to Chromecast through Node Red with "node-red-contrib-cast" (OS Win10). The problem is that I get the following error "Not able to load media:Load failed Not able to load the media."
I'v read all the posts, but I can't fix it. Could you help me, please?

Thanks

Did you try the flow from above marked as the solution?

Did you read the thread? There are lots of helpful notes that could potentially solve this.

Show us your flow and debug message showing this error and any other debug node outputs showing the file name etc.

Yes, I've tried that flow and not works for me, besides that I want to cast a .mp4 video not audio. I also read all the thread, but I can't make it work.

This is my flow:

[{"id":"e2b4811b.1cd0e","type":"cast-to-client","z":"948b0244.fb211","name":"","url":"","contentType":"video/mp4","message":"","language":"de","ip":"","port":"","volume":"","x":530,"y":480,"wires":[["76a8afb7.13159"]]},{"id":"76a8afb7.13159","type":"debug","z":"948b0244.fb211","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":690,"y":480,"wires":[]},{"id":"4e34322.f96becc","type":"http in","z":"948b0244.fb211","name":"","url":"/myVideo","method":"get","upload":false,"swaggerDoc":"","x":210,"y":420,"wires":[["ed25f4b3.55e2f8","e6fc7dd4.e375c"]]},{"id":"b0676984.a910f8","type":"http response","z":"948b0244.fb211","name":"","statusCode":"","headers":{"content-type":"video/mp4"},"x":610,"y":420,"wires":[]},{"id":"ed25f4b3.55e2f8","type":"file in","z":"948b0244.fb211","name":"UnderWater.mp4","filename":"C:\\Users\\David y Sara\\.node-red\\underWater.mp4","format":"","chunk":false,"sendError":false,"x":430,"y":420,"wires":[["b0676984.a910f8","a4921095.b5c51"]]},{"id":"46341e37.a7271","type":"inject","z":"948b0244.fb211","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":480,"wires":[["a80b5206.8dcee"]]},{"id":"a80b5206.8dcee","type":"change","z":"948b0244.fb211","name":"","rules":[{"t":"set","p":"ip","pt":"msg","to":"192.168.0.50","tot":"str"},{"t":"set","p":"url","pt":"msg","to":"/myVideo","tot":"str"},{"t":"set","p":"contentType","pt":"msg","to":"video/mp4","tot":"str"},{"t":"set","p":"streamType","pt":"msg","to":"BUFFERED","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":480,"wires":[["e2b4811b.1cd0e"]]},{"id":"a4921095.b5c51","type":"debug","z":"948b0244.fb211","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":630,"y":360,"wires":[]},{"id":"e6fc7dd4.e375c","type":"debug","z":"948b0244.fb211","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":390,"y":360,"wires":[]}]

And this is the debug node outputs:
Captura

Also I can play the video from browser with http://127.0.0.1:1880/myVideo but I have another problem: this is a test video (1780KB) because the real video I want to cast is 5GB, and with this video I CAN'T play it from browser, I don't know why.

Finally say that my chromecast works fine: I've send a YouTube video from Node-Red with "node-red-contrib-cast" and works perfectly. The problem is with local files.

I am very thankfull for your help

If you read through the Example - Play local files (for the cast node) it explains how to do it.
There is also a demo NR flow which should help.

Is that of the same video type as the one that works? Check the codec.

@dynamicdave I already read all the Example - Play local files and I've used the demo flow. But it doesn't work for me. In the example uses a audio mp3 file and I need video mp4 file.

@Colin The codec is the same: H263 - MPEG-4 AVC (part10) (avc1)

Thanks

Hi,
I've made it work. The error was the url of the video to cast, I was using 127.0.0.1.... instead of the ip of my PC.

But it works with a small mp4 video (1780KB). The video I need to cast is (5.300.000KB). The codec of both videos are the same, so .. I don't understadn why it works for one video and not for the another. Somebody can help me ?

Thanks

Could your problem be due to this? I think, you need to figure this out first. Could the video file be damaged? Anyway, figure this out first

Few things to check

Network bandwidth
Resolution of the video
Storage where the video file resides
Speed of read-MB/sec

I don't know how this node works and I haven't checked how the flow is configured, but often files are set to read the whole file before passing to the next node..if that is the case here then you will need at least 5gb of memory available for the file to be read into before it can be passed on.

My understanding with casting is that the node should not need to access the file at all, but should just tell the Google device which url to play. I may need to be corrected though.

That is mostly correct however this solution was originally to get small audio files from local file system and was achieved without modifying settings.is to expose a public folder.

So the solution simply created an endpoint and provided the file by loading it (file node) and sending it to the http out node upon request.

The op probably needs to go the other way and modify settings.js to expose a public folder to avoid the need for loading such a large file.

1 Like

OK, I had forgotten or missed that, so it may well be that part that is failing with a massive file, rather than the cast itself.