Was looking for an easy way to send pictures on my computer to my ChromeCast, and thought having a "native" app would be a nice way to do it without having to cast a Chrome tab. Since Google explicitly doesn't make SDKs available for anything other than iOS/Android/Chrome I ended up wrapping a couple of things together in a long little afternoon. Let me know what you think!
That is coming: ran out of time and didn't want to drag my feet on actually releasing it. Video is also complicated: transcoding becomes a real requirement and its just messy to do that in a performant way. But I have something like 40 apps and libraries I've written that are all 80% there but never get released, so for this one I set an explicit rule that it would be released in whatever stable state it is in by the end of July.
It will be available for Linux (at least Ubuntu): I just need to brush off my old scripts for generating .deb packages and I'll have something. Just didn't want to dawdle and let it fall into my pile of neglected projects.
Looks nice! I've been using https://github.com/googlecast/CastHelloVideo-chrome plus some custom Java code to stream video content for a few months now. I'd love to have something like this as a UI instead of my cobbled mess. Drop me a PM or email @gmail if you want to compare notes. Cheers!
Thanks. Will reach out once I get a chance: the video transcoding/streaming will be the real heavy lifting. This was mostly just a node-webkit exercise, but not sure how cleanly it will merge with the Chrome code you linked to.
The transcoding isn't actually too bad. You basically just need ffmpeg compiled from source on your box, and you can use https://github.com/fluent-ffmpeg/node-fluent-ffmpeg . You just need to transcode everything go h264 / AAC (so make sure you compile with libfdk_aac ).
The thing I have been unable to figure out so far is how to start streaming to chromecast before the transcoding is complete. It will play to the point it was transcoded when I started playing, regardless of how far it has gotten since then. I have tried transcoding to HLS which chromecast supports, but have not been able to figure it out.
Are you planning on develping this open source? I didn't see a github for the actual project on first glance.
Thanks for the transcoding tips: will look into that.
Wasn't actually thinking about github for this: if I develop a lot of free time I might tidy it up for public consumption, but by default its not particularly well commented or documented.
I got something similar working in Java by simply exec'ing ffmpeg and getting a handle on the stream. Not being able to seek kind of sucks, and Chromecast does not like infinite streams. However, I've seen that he Chromecast will actually stream some MKVs just fine (so long as the underlying codecs are supported).
It's a better experience when you're dealing with a complete file and not an in-progress transcode anyways. With a file you can seek and pause/resume. That's much, much harder with a stream (if at all possible). The other trick is that the Chromecast does some poking around in the stream to figure out the total time. This requires that you support Range requests and return correct Content-Length headers.
Thanks for the tips. I will look into the headers and see if I can't implement the range quests and content-length headers correctly, it doesn't seem like it should be that difficult.
All of the other NodeJS clients I found were written for version 1 and stopped working, so I ended up forking Popcorn Time and hacking it to work in a regular browser so I could use the official Chromecast Extension.
Yeah, spent a couple of hours trawling the web before I stumbled upon that: gold, that one. I'd originally started using ChromeCast's DIAL support but that's apparently deprecated, which is a shame because the replacement is quite a bit more complicated.
Thanks! Will make a note of that: I was afraid the answer would have to be ffmpeg (as it so often is with video). Was hoping for something neater, but I guess I should just be grateful for ffmpeg.
Those solutions do exist, but to a certain degree the point of this was not to need a phone or Chrome. It is obvious that those are the sanctioned solutions from Google's perspective, but this is an attempt to provide a different option.
Did they ever do anything about the audio jack? I always thought it was wack how they not only forced you to buy a dongle, but also a 3.55m to rca cable.
Some mini-dp to HDMI adapters also pass audio through (including I believe the Apple branded one as well as one I bought after confirming reviews on Amazon), but I've also bought a couple that do not
But you're giving up the freedom to decide what content you consume. Chromecast is the media equivalent of AOL. I know what I want to watch/listen to, so let me decide, instead of hamstringing me with apps, or making me jump through hoops to circumvent the restrictions.
Plus, if you're watching a movie, or otherwise streaming for a considerable length of time, you're on wall power anyways, so whats one more cable?
No, I meant that chromecast's value proposition isn't "if you don't have an HDMI port, you can use this to watch things!", so I don't understand the comment about Macs and HDMI ports. My computer has an HDMI port and I wouldn't dream of that making my chromecast redundant.
37 comments
[ 0.18 ms ] story [ 74.8 ms ] threadThe thing I have been unable to figure out so far is how to start streaming to chromecast before the transcoding is complete. It will play to the point it was transcoded when I started playing, regardless of how far it has gotten since then. I have tried transcoding to HLS which chromecast supports, but have not been able to figure it out.
Are you planning on develping this open source? I didn't see a github for the actual project on first glance.
Wasn't actually thinking about github for this: if I develop a lot of free time I might tidy it up for public consumption, but by default its not particularly well commented or documented.
I've got this working in my own chromecast app mkvcast: https://github.com/maherbeg/mkvcast
See https://github.com/maherbeg/mkvcast/blob/master/lib/controll... for the parameters to use.
https://github.com/spouliot/airplay
All of the other NodeJS clients I found were written for version 1 and stopped working, so I ended up forking Popcorn Time and hacking it to work in a regular browser so I could use the official Chromecast Extension.
Plus, if you're watching a movie, or otherwise streaming for a considerable length of time, you're on wall power anyways, so whats one more cable?
Function > Form.
Perhaps you mean't Chromecast doesn't compete very well with HDMI?
Edit: This is great, btw. Thanks, fomojola!