8 ms·
Show HN: Control Chromecasts from Linux
- jowsie 6y agoDoes this also allow you to cast arbitrary media to the Chromecast? I couldn't tell from the readme.
- input_sh 6y agoI've been using catt (https://github.com/skorokithakis/catt https://github.com/skorokithakis/catt) for years for that purpose. Basically: pip3 install catt And then: catt cast <any image/song/video/URL supported by youtube-dl>
- SyncOnGreen 6y agohttps://airflow.app/ https://airflow.app/ is worth mentioning - paid software (sadly Windows/macOS only) but works with everything you throw at it, transcodes unsupported codecs seamlessly and has great UI with remote control via an app.
- geitir 6y agoPlex does
- emayljames 6y agobubbleupnp is the most customizable and reliable app I have found for streaming/casting.
- ebg13 6y agoI can't tell from this project's readme how to actually play things. It has an instruction for connecting to your chromecast...ok, and then what? In the past I've used https://github.com/keredson/gnomecast https://github.com/keredson/gnomecast which is a standalone simple media player that transcodes if needed and streams to my Chromecast. Thoughts on what this provides that's better?
- deleted 6y ago[deleted]
- emayljames 6y agoIf on Android, bubbleupnp. It is a solid and well maintained app.
- this_machine 6y agoWhile you have chromecast_mpris running, you can use an MPRIS client to issue the OpenUri method[1]. Here's an example: $ export URL="http://ccmixter.org/content/gmz/gmz_-_Parametaphoriquement.mp3" $ playerctl -p My_Chromecast open "$URL" This will cast a song to the Chromecast named "My_Chromecast". I forgot that OpenUri was implemented in the project because I typically cast from other devices and programs, but I'll include it in the README. > Thoughts on what this provides that's better? People tend to use catt or castnow to cast from the command-line. I wrote about using VLC to cast to the Chromecast[2], but I wouldn't recommend it unless you're watching something that you need VLC for. [1] https://specifications.freedesktop.org/mpris-spec/2.2/Player_Interface.html#Method:OpenUri https://specifications.freedesktop.org/mpris-spec/2.2/Player... [2] https://alexdelorenzo.dev/linux/2020/03/14/pipes https://alexdelorenzo.dev/linux/2020/03/14/pipes
- axaxs 6y agoThanks for this, I can't wait to test it out. Are there other ways to control chromecasts from Linux? I used to be able to cast straight from Chromium, but that hasn't worked for me in at least a couple years.
- ce4 6y agoVLC has a native client afaik. Edit: included since v3.0 https://www.videolan.org/developers/vlc-branch/NEWS https://www.videolan.org/developers/vlc-branch/NEWS
- axaxs 6y agoGood to know, thanks. Usually I'm interested in either casting a browser window, or even the whole screen usually, which I've been coming up short on.
- ce4 6y agoVLC re encodes content on the fly and sends it to the chromecast, even the android app supports it (albeit making your phone hot). Not sure about your two requirements though, maybe so. else has a tip here.
- Thaxll 6y agoOnly if the content can't be played on the Chromecast but most "vacation movies" can be play on the Chromecast.
- londons_explore 6y agoCasting a browser or whole screen can be done with Chrome/Chromium on Linux. Whole screen doesn't work with wayland. Redirecting system audio doesn't work either. If you redirect a tab which is mostly a single video file, it is smart enough to do the video decoding directly on the chromecast, so you get much better quality/framerate.
- 6y ago
- baby-yoda 6y agodoes chromecast still require WAN access to operate?
- m-p-3 6y agoI believe so, and it's less than useful on network with a captive portals like hotel rooms. At least the upcoming Chromecast with Google TV comes with a remote, so you should be able to interact with the captive portal and use it that way.
- fragmede 6y agoWhile the chromecast's inability to work with captive portals is it's own problem, they make tiny wifi routers, half as tall and twice as thick as a smartphone, and they're cheap. If you find yourself facing captive portals more than once, I'd recommend buying one so you can use your Chromecast in hotel rooms, among other use cases.
- m-p-3 6y agoI already have one from TP-Link, but having the new Chromecast would allow me to shrink down on hardware even more.
- Rebelgecko 6y agoMost smartphones are also wifi routers
- kelnos 6y agoIt shouldn't. Obviously if you're casting from a WAN source (like YouTube or Netflix), it needs WAN access, but if you're casting from a source on your local network, it should work without the WAN.
- 29athrowaway 6y agoAn unpopular choice for general purpose streaming: Steam Link. You can install the Steam Link on a smart TV and your computer (including Linux), switch the Steam window and stream whatever you want to stream.
- zerop 6y agoAny way to cast zoom calls from my android zoom app to TV via Chromecast ?
- chris_engel 6y agoWell, with the google home app, you can send your whole screen to a chromecast, so whatever you are doing on your phone will be visible on your TV.
- m-p-3 6y agoYou can cast your device's screen, but you'll still have to rely on the device's camera and mic. You'll probably want to avoid outputting the sound on the TV or you'll get a feedback loop. And there's going to be a slight delay, which might be annoying with a realtime conversation. So it might not be a great idea from the start.
- londons_explore 6y agoYou'll also end up with 15 fps, high CPU usage, and random hangs... It works, but isn't really usable...
- liability 6y agoIf you don't want a Google device on your LAN and are willing to put in a little bit more work for that, I've found that remotely controlling an instance of mpv over the JSON IPC interface works well for me. I can send it URLs from the web or paths to local files. My client for this isn't currently public, but it's a rather easy interface that some of you may find it easy enough to integrate into your other systems. (Note that it only listens on a Unix socket. With socat you can redirect that to a TCP socket though, preferably listening on a wireguard interface to keep the rest of your LAN from accessing it, since there's otherwise no security.) Definitely not for everybody, but perhaps suitable for some. https://mpv.io/manual/master/#json-ipc https://mpv.io/manual/master/#json-ipc
- comboy 6y agoIf you haven't, you should check mpd (music player daemon). Lots of clients, works very well.
- miccah 6y agoThis is my preference as well! I even wrote an Android client app / Python server to control it from my phone. https://github.com/mcastorina/mpv-remote-app https://github.com/mcastorina/mpv-remote-app
- MayeulC 6y agoThis looks useful and to the point. Would you consider submitting it to f-droid?
- angrais 6y agoMaybe it's late and I am misunderstanding ... Why would one not want a Google device on their LAN? Isn't a Chromecast very different than controlling locally stored media files, i.e. you can stream YouTube, Netflix, Spotify, mirror your devices (laptop), etc on Chromecast but not your solution?
- liability 6y agompv plays youtube links and many other websites (although not netflix or spotify to my knowledge) using the excellent youtube-dl. For my purposes it is more than sufficient, but as I said it won't be for everybody. As to why I don't want google devices on my LAN, I'm sure you could already guess that the answer is the usual privacy/political concerns, which I'll not bore you with since you obviously don't care. There are however some practical benefits to my arrangement, particularly being able to play media served up by NFS (DLNA never gave me anything but grief and unreliability.) Furthermore youtube-dl supports a very long tail of sites that Chromecast doesn't (at least not without the jank of screen mirroring, which AFAIK only works for as long as the laptop being mirrored is turned on.)
- balloob 6y agoAuthor of pychromecast here, the underlying library that this project uses to control the Chromecast. I wrote this lib initially for use in Home Assistant, https://www.home-assistant.io https://www.home-assistant.io For Home Assistant I made a rule that all device drivers are stand-alone Home Assistant agnostic Python packages. That way more projects can use it. Glad to see that strategy is working out and it powering projects like this
- atomi 6y agoIt would be incredible if there was a way to use mpsyt to watch Youtube videos with your library.
- msla 6y agoIt's possible if you hook something running Kodi up to your TV. Here's some example code I wrote, in the form of a few ZSH shell scripts: https://github.com/chbarts/kodi-command-line https://github.com/chbarts/kodi-command-line The logic should port nicely to other languages. In particular, it shows how to do things like playing a YouTube video using either the URL or just the hash, plus, of course, a way to play videos on the computer you're running the commands from.
- Inversechi 6y agoAnd thank you for giving us not only pychromecast but home-assistant :)
- kingosticks 6y agoThank you for pychromecast, balloob. I know there's no real requirement but I wish projects like this would give attribution where it's due. This project benefits hugely from pychromecast but there's nothing in the readme mentioning that. Just seems a bit off.
- qwertygnu 6y agoIt's always awesome to see early, potentially unfruitful decisions workout in a project.
- 6y ago
- StavrosK 6y agoThis is nice, I've been using catt mapped to the media keys via the native window manager shortcuts, but this seems easier to set up.
- this_machine 6y agoI do something similar with chromecast_mpris. I have my media keys mapped to Plasma's Media Controller, which uses MPRIS in the background. Works well for me, and you don't have to wait for catt to launch and find your Chromecast each time.
- hansjorg 6y agoTitle says 'from Linux', but the README says 'Linux / *BSD / macOS' under 'Requirements'. How would this work on macOS?
- hugg 6y agowhere it says that, follow the link
- this_machine 6y ago> How would this work on macOS? Theoretically it should work if you're able to get D-Bus working on macOS. D-Bus is usually a Linux thing, but it's been ported to other platforms. macOS isn't included in the title because most macOS users don't have D-Bus installed. I included instructions here[1] with URLs to the macOS versions of D-Bus and PyGObject. I'd be interested in whether you're able get it working. [1] https://github.com/alexdelorenzo/chromecast_mpris#requirements https://github.com/alexdelorenzo/chromecast_mpris#requiremen...
- markbnj 6y agoShameless threadjack: does anyone know a way to cast _to_ a linux or windows desktop? We use chromecast on all our entertainment video monitors, but sometimes I would like to hang on the couch in my office and cast a video to my desktop monitor.
- mav3rick 6y agoOpen the website ?
- markbnj 6y agoWhat I would like to do is flip youtube videos or whatever on my phone and cast to the monitor, which is 6 feet from the couch... an impassable barrier as I'm sure you'll agree.
- ekianjo 6y agoJellyfin mpv shim does this
- markbnj 6y agoJellyfin seems like it might be just the thing, thanks for the tip!
- gibolt 6y agoCould add a Chromecast on one of the Hdmi ports of the monitor. That's what I do
- markbnj 6y agoYeah I thought about that a few times, but I would have to change inputs, so it wasn't really the experience I had in mind.
- _ZeD_ 6y agoMiraclecast
- 6y ago
- mijoharas 6y agosorry to somewhat hijack this thread, but does anyone know a way to stream from linux to a miracast target? I have a fire stick that I believe supports miracast, and periodically check if there is linux software that will allow me to stream as a source. Last time I checked miraclecast[0] seemed to be somewhat broken. Has anyone had any luck? [0] https://github.com/albfan/miraclecast https://github.com/albfan/miraclecast
- ariberappss 6y agoeeoer
- gala8y 6y agoOT, but i had an idea yesterday... will explain in UX language: would it be possible to send video to chromecast-like device and 'leave sound on mobile device' to be able to listen on bluetooth connected headphones while watching on big screen?
- swebs 6y agoThat would be cool. Roku boxes actually come with a headphone jack in the remote so you can do just that (but not through bluetooth).
- Falling3 6y agoI've thought about the same thing, but I don't think it's feasible because you essentially need to play the video in both places and ensure it stays in sync. The easy solution is to hook up a Bluetooth transmitted to your TV.
- gala8y 6y agoI know, but it _could_ use one stream and send audio to mobile via LAN. Syncing would be an issue, though. Overengineering at its best. ;)