7 ms·
Use Unix Pipes to Improve Chromecast Playback
- sdfhbdf 6y agoIt's a nice solution to a problem that the author found. I am afraid that knowing Google's walled garden around Chromecast, the `castnow` and `catt` utilities might have trouble staying afloat.
- tantalor 6y agoHere's the API docs for the "walled garden": https://developers.google.com/cast/docs/reference https://developers.google.com/cast/docs/reference
- arilotter 6y agoThis lets you create programs that run on the Chromecast, and programs that can send data to the Chromecast. Programs that run on the Chromecast must be "registered" on Google's cloud platform, and "published" on Google's Chromecast platform. https://developers.google.com/cast/docs/registration https://developers.google.com/cast/docs/registration The only way to run code on the device is to either serve your code through Google's platform, or root the device and own it like the Linux box it is. None of Google's documentation speaks about the Cast protocol itself. It's against the Chromecast TOS to create a custom receiver device. You must buy the Chromecast hardware. There have been several attempts to reverse-engineer the receiver protocol and create custom receiver devices, but none of them work with the current protocol. I'd call this a "walled garden."
- frafra 6y agoI wrote something similar 9 months ago (just relying on VLC functionalities + youtube-dl + avahi) and I have been using it since then (but less elegant): https://gist.github.com/frafra/9f5770c6af6e4dcdf91ba815225e5e65 https://gist.github.com/frafra/9f5770c6af6e4dcdf91ba815225e5... The main problem I have is that it is not possible to easily resume the stream when youtube-dl stops working and you use a pipe or mkfifo. It would be cool to be able to rerun the program again and continue from where it left, but some streams are not seekable, so you would need to restart the software automatically, consume or skip the first part and start adding the new content at the end of the FIFO device.
- knorker 6y agoUhm, the castnow readme has an example of how to cast from stdin. Are you saying that doesn't work for you?
- barbegal 6y agoWhat are the advantages of using a named rather than an anonymous pipe?
- scarmig 6y agoHere? I guess that VLC displays whatever name you give the named pipe instead of just a file descriptor. In general, another advantage is that in scripts giving a pipe a name can sometimes aid in clarity, supposedly.
- gpvos 6y agoTechnically, they're the same kind of pipe as the anonymous ones you create in a shell. But you can give them a name yourself, and you can create one, then later have a program listening to it, and then later send data to it, from different programs if you want. You can also create them, send some data to them, and then later start a program to read that out, but you're likely to run into buffering issues with that. Also, don't forget to remove one when you don't use it anymore.
- deleted 6y ago[deleted]
- steve_adams_86 6y agoMaybe this isn’t a great place to ask, but: I’m so sick of my chromecast. The audio and video issues are absurd. I have a fibre connection but I can’t manage to keep a 1080p cast working from my machine, and Youtube frequently stutters and lags. Sometimes I go to Apple’s website and almost buy an Apple TV, other times I think about something more DIY like a raspberry pi media centre. But what I wonder is... is all of this stuff shit? Do I just stick with my chromecast? Maybe I’m just fooling myself that spending money and switching would be any better. Reading this just reminded me of how obnoxious my chromecast is.
- dmonitor 6y agoYou can use an adapter to get ethernet to your chromecast. I’ve never run into issues on mine with YouTube at 1080p
- mongol 6y agoI think this adapter is also bundled with the Ultra. Upgrading to that might do the trick.
- noselasd 6y agoAre you sure it's the fault of the device ? Could just be your wifi that has intermitten issues
- steve_adams_86 6y agoI thought so too, but I’ve cycled through hardware (some of it quite good) and the issues were consistent.
- marsRoverDev 6y agoDo you have a chromecast ultra or a standard chromecast?
- Shish2k 6y agoI’ve been looking at this for a while and not seen anything better than chromecast :( (For the specific use-case of “streaming from phone / laptop to TV”) I really wish Kodi had a chromecast-server plugin, as Kodi is way better at everything else in the media-playback realm; but having a single-click button for “take this video I’m viewing on my phone and show it on my TV” is just so convenient that it’s ended up becoming the default way of viewing media in my house.
- steerablesafe 6y agoRe seeking: instead of pipes one could probably use youtube-dl to dump the url and use a fuse filesystem to mount the url as a seekable file (it is typically implemented as range requests). I found httpfs2 [1] in the Debian repositories [2]. [1] https://sourceforge.net/projects/httpfs/ https://sourceforge.net/projects/httpfs/ [2] https://packages.debian.org/sid/httpfs2 https://packages.debian.org/sid/httpfs2
- Foxboron 6y ago> ip=$(dig +short chromecast.lan | tail -n 1) This line requires some mdns server setup I believe. I didn't like running avahi and thought there should be some super simple client for this, but after searching I didn't find anything. I wrote up 10 lines of go which spits out chromecast devices as json and use jq to get the appropriate IP. Works quit well and now I have a fairly seemless way to play videos to my chromecast from qutebrowser. https://github.com/Foxboron/mdns https://github.com/Foxboron/mdns
- mnw21cam 6y agoIs there anything particularly wrong with running: youtube-dl -q -o - 'url' | castnow /dev/stdin
- dannypgh 6y agoIf it didn't work with process substitution, that's not likely to work either. I'm guessing it is trying to seek, or running a stat first to check filesize or similar.
- commotionfever 6y agomaybe I've missed something, but `catt` supports youtube natively. $ catt cast https://youtube.com/watch?v=xxx $ catt add https://youtube.com/watch?v=xxx the latter will even add to your existing youtube chromecast queue (it's using youtube-dl in the backgroud, but no need to mess about with pipes)
- rahimnathwani 6y agoPresumably this just tells the Chromecast to stream that video from YouTube directly. But OP's problem is that this doesn't work well for some specific videos. So OP is using catt not just to send a video URL to the Chromecast, but also to actually serve the content.
- Bnshsysjab 6y agoI’ve never figured out if it’s possible to stream to anything that’s not a chromecast, e.g pc -> phone, or phone -> pc. Are these possible using ‘cast’ technologies available in iOS and Android?
- zamadatix 6y agohttps://en.wikipedia.org/wiki/Google_Cast https://en.wikipedia.org/wiki/Google_Cast device list at the bottom. When they went to the CASTV2 protocol it became very difficult to do anything unofficial as a server side implementation since official Cast SDK clients try to authenticate the server as an authentic device.
- fooblat 6y agoMy friends often tease me because I read the manual from everything I buy. Even if it is a tiny pamphlet. I really like this informative blog post on unix pipes, but reading the readme would have saved some time. It contains the answer in a simple form: `youtube-dl -o - https://youtu.be/BaW_jenozKc | castnow --quiet -`
- qwertox 6y agoDo you really read them entirely? I mean, when I buy a TV, I download the manuals first and check if the features in the menu are what I expect from it. Same goes for a mainboard, monitor or a car, things where the capabilities are important to me. But when something arrives I don't read the manual unless a question arises, then I search for it specifically in that section. For example how exactly did that microwave/grill-combo work? What exactly did this setting in the washing machine do? I mean, people say the same thing about me, but I think that this is because they never even consider picking up the manual when they have a problem, while for me it's normal to tell them to read the manual. Maybe I should tell them "maybe you can find the answer in the manual", instead of "read the manual". But some don't even look the "getting started mini-manual". This drives me crazy, specially when they then struggle using the scanning functionality of the printer or stuff like that.
- fooblat 6y agoYes I really do read them cover to cover and when I find something interesting I make a note of it. Perhaps I'm unusual in that I like reading manuals and documentation. For me it is part of my enjoyment of learning how things work.
- entropicdrifter 6y agoI read the entire manual for tech stuff before I buy it if the manual is available online, but that's just part of my compulsive researching habit.
- piva00 6y ago
- jeffbee 6y agoWhat does the author mean about the "final update"? Is the original Chromecast really not getting any new software?
- judge2020 6y agoThe generation 1 chromecast is pretty old and underpowered (can't run YouTube TV DRM fast enough apparently) so I wouldn't be surprised, however I can't find anything about it no longer receiving uodates.
- dmix 6y agoThe author links to bug reports for Chromecast 1, the current generation of Chromecast is 3.
- adrianmonk 6y agoPerhaps they are just using final to mean latest? Most often, final means not only that something is currently the last item in a sequence but also that there will not be any more items in the sequence in the future. However, sometimes people use (misuse?) it to mean merely the last time in the sequence for now.
- jeffbee 6y agoIt's confusing because it says "latest and final".
- gregmac 6y agoSo this (and I assume every other solution people have mentioned) are using youtube-dl -- which means the chromecast is playing a stream from the device initiating the cast. When I cast from my Android phone to a cast receiver, my understanding is it's basically sending the URL to the receiver and my phone is no longer involved, other than as a remote to control position. (And frustratingly, I find my phone will often get disconnected even though the video is still playing, so I have to spend several seconds waiting or forcing it to reconnect to be able to pause/stop). What's the difference between these two modes? Is there something preventing the URL method from working, or is there a reason it's preferable to download + stream?