xat / castnow

commandline chromecast player
MIT License
3.81k stars 243 forks source link

Video cast fails with `Error: Load failed` notice #230

Closed arunsathiya closed 5 years ago

arunsathiya commented 6 years ago

I am trying to cast local media files, but cast fails with this notice.

➜  ~ DEBUG=castnow* castnow /Users/arunsathiya/New\ folder/Video\ file.mp4
  castnow volume step: 0.05 +0ms
  castnow launching... +1ms
  castnow:stdin [ { path: '/Users/arunsathiya/New folder/Video file.mp4' } ] +0ms
  castnow:localfile started webserver on address 100.69.97.158 using port 4100 +7ms
  castnow player status: loading plugins +0ms
  castnow player status: scanning +1ms
  castnow player status: connecting +81ms
  castnow player status: launching +115ms
  castnow player status: loading +2s
  castnow player error: Error: Load failed at /usr/local/lib/node_modules/castnow/node_modules/chromecast-player/api.js:104:19 at fn.onmessage (/usr/local/lib/node_modules/castnow/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at emitTwo (events.js:131:20) at fn.emit (events.js:214:7) at Channel.onmessage (/usr/local/lib/node_modules/castnow/node_modules/castv2-client/lib/controllers/controller.js:16:10) at emitTwo (events.js:126:13) at Channel.emit (events.js:214:7) at Client.onmessage (/usr/local/lib/node_modules/castnow/node_modules/castv2/lib/channel.js:23:10) at emitMany (events.js:152:20) at Client.emit (events.js:224:7) +2m
Error: Load failed

The YouTube links fail as well, both in full format and shortened. I am not quite sure what might be causing that.

Sorry if this is not a support section. I couldn't find one and decided to create this issue here.

arunsathiya commented 6 years ago

I just realised that YouTube casts are dropped, but work with youtube-dl trick as shown here on the YouTube support region.

But, it doesn't seem to work either for me. It fails with a Broken pipe notice.

➜  ~ youtube-dl -o - https://youtu.be/BaW_jenozKc | castnow --quiet -
[youtube] BaW_jenozKc: Downloading webpage
[youtube] BaW_jenozKc: Downloading video info webpage
[download] Destination: -
Error: Load failed

ERROR: unable to write data: [Errno 32] Broken pipe
sujitrp commented 5 years ago

Same two error for me on raspberry Pi with raspbian os

for Local MP4 file pi@homepi:~ $ DEBUG=castnow* castnow ./V_Song.mp4 castnow volume step: 0.05 +0ms castnow launching... +9ms castnow:stdin [ { path: './V_Song.mp4' } ] +8ms castnow:localfile started webserver on address 169.254.252.84 using port 4100 +84ms castnow player status: loading plugins +10ms castnow player status: scanning +6ms castnow player status: connecting +524ms castnow player status: launching +229ms castnow player status: loading +2s castnow player error: Error: Load failed at /usr/lib/node_modules/castnow/node_modules/chromecast-player/api.js:104:19 at fn.onmessage (/usr/lib/node_modules/castnow/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at emitTwo (events.js:131:20) at fn.emit (events.js:214:7) at Channel.onmessage (/usr/lib/node_modules/castnow/node_modules/castv2-client/lib/controllers/controller.js:16:10) at emitTwo (events.js:126:13) at Channel.emit (events.js:214:7) at Client.onmessage (/usr/lib/node_modules/castnow/node_modules/castv2/lib/channel.js:23:10) at emitMany (events.js:152:20) at Client.emit (events.js:224:7) +3s Error: Load failed:

for you tube file cast 👍 pi@homepi:~ $ youtube-dl -o - https://youtu.be/BaW_jenozKc | castnow --quiet - [youtube] BaW_jenozKc: Downloading webpage [youtube] BaW_jenozKc: Downloading video info webpage [youtube] BaW_jenozKc: Extracting video information [download] Destination: - Error: Load failed

ERROR: unable to write data: [Errno 32] Broken pipe pi@homepi:~ $ DEBUG=castnow* youtube-dl -o - https://youtu.be/BaW_jenozKc | castnow --quiet - [youtube] BaW_jenozKc: Downloading webpage [youtube] BaW_jenozKc: Downloading video info webpage [youtube] BaW_jenozKc: Extracting video information [download] Destination: - Error: Load failed

ERROR: unable to write data: [Errno 32] Broken pipe

bkysela commented 5 years ago

I am trying to cast local media files, but cast fails with this notice.

➜  ~ DEBUG=castnow* castnow /Users/arunsathiya/New\ folder/Video\ file.mp4
  castnow volume step: 0.05 +0ms
  castnow launching... +1ms
  castnow:stdin [ { path: '/Users/arunsathiya/New folder/Video file.mp4' } ] +0ms
  castnow:localfile started webserver on address 100.69.97.158 using port 4100 +7ms
  castnow player status: loading plugins +0ms
  castnow player status: scanning +1ms
  castnow player status: connecting +81ms
  castnow player status: launching +115ms
  castnow player status: loading +2s
  castnow player error: Error: Load failed at /usr/local/lib/node_modules/castnow/node_modules/chromecast-player/api.js:104:19 at fn.onmessage (/usr/local/lib/node_modules/castnow/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at emitTwo (events.js:131:20) at fn.emit (events.js:214:7) at Channel.onmessage (/usr/local/lib/node_modules/castnow/node_modules/castv2-client/lib/controllers/controller.js:16:10) at emitTwo (events.js:126:13) at Channel.emit (events.js:214:7) at Client.onmessage (/usr/local/lib/node_modules/castnow/node_modules/castv2/lib/channel.js:23:10) at emitMany (events.js:152:20) at Client.emit (events.js:224:7) +2m
Error: Load failed

Had the same error loading until I opened up port 4100 in my firewall. All was well after.

dbirks commented 5 years ago

I agree, once I opened port 4100 on my computer's firewall, the chromecast was able to reach the castnow server.

arunsathiya commented 5 years ago

I have not had a chance to test this so far, but since opening up 4100 helps, I shall close this issue. I can test later. 👍🏽 Thank you, everyone!

kevr commented 4 years ago

This also happens if your computer has multiple network interfaces and castnow automatically selects an IP from an interface that isn't connected to by the chromecast. In this case, I used --myip to pass the IP my system has that's on the same network as the chromecast, which fixed the issue.

Edit: ...We could make this a bit easier for most people out of the box by selecting an IP that belongs to a default gateway's network. This would work for most out of the box scenarios, I think. Are you open to PRs for this?