Rafostar / gnome-shell-extension-cast-to-tv

Cast files to Chromecast, web browser or media player app over local network.
GNU General Public License v2.0
292 stars 17 forks source link

Casting not working: "Failed to load media" #130

Open rtorrero opened 4 years ago

rtorrero commented 4 years ago

I've tried both with the version available in extensions.gnome.org, with current master and pre-3.36 versions. None work. Streaming works nicely when streaming from VLC.

I'm running it on GNOME 3.36.7, from openSUSE Tumbleweed x86_64, 20201108-0 snapshot

Followed the instructions and generated a debug log:

  1. After a fresh install of this extension and it's node modules from extension prefs, usually a reboot fixes this issue (and by reboot I mean full system reboot - not just restarting gnome-shell).

  2. Make sure you have receiver type in extension prefs set correctly to desired device type (e.g. "Chromecast"). If it wasn't try casting again.

  3. If extension seems to be working (you have a top panel drop down menu), but still experiencing problems with casting, lets take a look at what happens during file cast. Turn off this extension node service without disabling whole extension (from gnome top bar menu). TV indicator icon should disappear from top bar. Then do the following in terminal:

cd ~/.local/share/gnome-shell/extensions/cast-to-tv@rafostar.github.com/node_scripts
DEBUG=bridge,chromecast* node server

After running, extension menu and indicator should reappear. Try reproducing your problem and send me output. Stop the terminal process with Ctrl+c buttons.

Output:

# rtorrero @ nobill in ~/.local/share/gnome-shell/extensions/cast-to-tv@rafostar.github.com/node_scripts [9:34:29] 
$ DEBUG=bridge,chromecast* node server
  bridge Full playlist: ["/mnt/StorageOne/Pelis/Nocturnal.Animals.2016.1080p.BluRay.x265-RARBG/Nocturnal.Animals.2016.1080p.BluRay.x265-RARBG.mp4"] +0ms
  bridge New selection contents: {"streamType":"VIDEO","subsPath":"","filePath":"/mnt/StorageOne/Pelis/Nocturnal.Animals.2016.1080p.BluRay.x265-RARBG/Nocturnal.Animals.2016.1080p.BluRay.x265-RARBG.mp4"} +1ms
  bridge Processing video file... +0ms
  bridge No reusable subtitles file +1ms
  bridge No merged subtitles found +81ms
  bridge File processed successfully +0ms
  chromecast NEW SELECTION +0ms
  chromecast Generated new session id: YPbJabpgGO +8ms
  chromecast Media title: Nocturnal.Animals.2016.1080p.BluRay.x265-RARBG +0ms
  chromecast Setting media: {"contentId":"http://172.22.99.132:4000/cast?session=YPbJabpgGO","contentType":"video/*","streamType":"BUFFERED","metadata":{"metadataType":1,"images":[{"url":""}],"title":"Nocturnal.Animals.2016.1080p.BluRay.x265-RARBG"}} +0ms
  chromecast Setting opts: {"autoplay":false,"activeTrackIds":[],"name":"b1249ed7-6b42-cd99-9034-ed6d4aebb8c1.local","ip":"172.22.100.241"} +1ms
  chromecast Casting... +0ms
  chromecast-controller Player check: inactive +0ms
  chromecast-controller Starting new cast session... +0ms
  chromecast-controller Connecting to 172.22.100.241 +0ms
  chromecast-controller Player check: active +1s
  chromecast-controller Could not load media in current session: Load failed +260ms
  chromecast-controller Retrying... +0ms
  chromecast-controller Closing client... +0ms
  chromecast-controller Player check: active +0ms
  chromecast-controller Closed client +54ms
  chromecast-controller Connecting to 172.22.100.241 +0ms
  chromecast-controller Player check: active +1s
  chromecast-controller Could not load media in current session: Load failed +251ms
  chromecast Could not cast: Load failed +3s
  chromecast Error: Load failed
  chromecast     at /home/rtorrero/.local/share/gnome-shell/extensions/cast-to-tv@rafostar.github.com/node_modules/castv2-client/lib/controllers/media.js:75:23
  chromecast     at fn.onmessage (/home/rtorrero/.local/share/gnome-shell/extensions/cast-to-tv@rafostar.github.com/node_modules/castv2-client/lib/controllers/request-response.js:27:7)
  chromecast     at fn.emit (events.js:203:15)
  chromecast     at Channel.onmessage (/home/rtorrero/.local/share/gnome-shell/extensions/cast-to-tv@rafostar.github.com/node_modules/castv2-client/lib/controllers/controller.js:16:10)
  chromecast     at Channel.emit (events.js:198:13)
  chromecast     at Client.onmessage (/home/rtorrero/.local/share/gnome-shell/extensions/cast-to-tv@rafostar.github.com/node_modules/castv2/lib/channel.js:23:10)
  chromecast     at Client.emit (events.js:203:15)
  chromecast     at PacketStreamWrapper.onpacket (/home/rtorrero/.local/share/gnome-shell/extensions/cast-to-tv@rafostar.github.com/node_modules/castv2/lib/client.js:81:10)
  chromecast     at PacketStreamWrapper.emit (events.js:198:13)
  chromecast     at TLSSocket.<anonymous> (/home/rtorrero/.local/share/gnome-shell/extensions/cast-to-tv@rafostar.github.com/node_modules/castv2/lib/packet-stream-wrapper.js:28:16) +0ms
Chromecast: Failed to load media
Rafostar commented 4 years ago

pre-3.36 will not work on 3.36 (as name suggests).

Is this on a Chromecast Ultra or new Chromecast with Google TV (the one with remote)? Other Chromecast models do not support x265 videos (only x264). You must select "transcode video" when casting. If you are not planning a Chromecast upgrade, I advise you to always try to find x264 for download.

rtorrero commented 4 years ago

This is a Chromecast Ultra. I already tried playing a little with the transcode options without much luck

Rafostar commented 4 years ago

It seems the error comes from castv2 node package that this extension uses as dependency. I am not the creator of that one, but I see in your output that it crashes through request-response script, so I would guess that it is a firewall issue. Check if you allow incoming connections to your PC on all ports that Chromecast uses in your PC and router firewalls.

rtorrero commented 3 years ago

It doesn't look like a firewall issue since streaming through VLC to the chromecast seems to work fine. Please let me know if I can do anything else to help you debug; meanwhile since VLC is working for me I'm not going to insist on this path too much!