
How to send local files to Chromecast with Python - rinze
https://rinzewind.org/blog-en/2018/how-to-send-local-files-to-chromecast-with-python.html
======
spaceandshit
I'm surprised no one has mentioned Videostream! Works so smooth, and there's
an iOS app so you don't need your computer for play back control.

[https://getvideostream.com/](https://getvideostream.com/)

I also recently downloaded Soda Player for OSX to stream, and it also has
similar capabilities.

~~~
kojeovo
> so you don't need your computer

.. which I have. Now I need an iOS device.

Or set up a GET endpoint with the python library and access that from my
mobile device of choice

~~~
spaceandshit
I should have said mobile app.

My TV is not in the same room as my computer setup, so it is more convenient
for me to control with a smartphone.

------
atomi
[https://github.com/skorokithakis/catt](https://github.com/skorokithakis/catt)

~~~
samspenc
When I read the original article, my first thought was: wow, someone could or
should really build an interface on top of this that let's you cast all
things.

Looking at this GitHub project, looks like it lets you do exactly that.

~~~
opencl
VLC also has similar functionality as of version 3.0.

~~~
sohkamyung
VLC also does transcoding of video formats that Chromecast does not support.
For the python script, you have to ensure the video format is supported by
Chromecast [1].

[1]
[https://developers.google.com/cast/docs/media](https://developers.google.com/cast/docs/media)

------
NicoJuicy
I'm using castnow, a cli in nodejs and has support for streaming torrents and
local files

[https://github.com/xat/castnow](https://github.com/xat/castnow)

Edit: from Python to nodejs

~~~
terminalcommand
Castnow is great, but it is written in node.js not python.

~~~
NicoJuicy
You are right, i thought it had a dependency on Python (checked it in the
past) and interpreted it as Python.

While checking it, no idea where that came from.

------
wybiral
What about the opposite? Are there any good server libraries to cast content
to as opposed to casting content from?

~~~
jordanthoms
This used to be possible, but IIRC Google locked things down and the cast
receiver apps for Android stopped working.

------
Legogris
Another alternative that worked pretty well for me with Linux:
[http://mkchromecast.com/](http://mkchromecast.com/)

------
keredson
a GUI that does exactly that (and the occasional transcoding / reboxing when
necessary, to handle mkv files, etc.):
[https://github.com/keredson/gnomecast](https://github.com/keredson/gnomecast)

~~~
FrenchyJiby
Yey! Note that, much to my unhappiness (see issue #42) transcoding is a
process that blocks the streaming from starting, which can take several
minutes at 100% CPU.

~~~
keredson
yeah, that's a sticky problem unfortunately. on the plus side real transcoding
is pretty rare given h264 is pretty much everywhere now. most of the
"transcoding" gnomecast does is repackaging an unmodified h264 stream from one
container format to another, which FFMPEG can do at 30-100x (rather than 1-2x
for real transcoding).

------
foxhop
Woah this is really, really cool! I've been meaning to mess with chromecast
and this does all the heavy lifting for me!

I think I'm going to wrap the script to get a REPL so that I don't loose
access to the object, similar to what I did for AWS:
[https://github.com/russellballestrini/botoform/blob/master/b...](https://github.com/russellballestrini/botoform/blob/master/botoform/plugins/repl.py)

------
kfir
SimpleHTTPServer is no longer part of python 3. On Python 3 this `python -m
SimpleHTTPServer` should be `python -m http.server`

~~~
emj
python2 will work for many years to come.

    
    
         python2 -m SimpleHTTPServer

------
epiphyte
I normally just use LocalCast ([http://www.localcast-
app.com/](http://www.localcast-app.com/)), although there may be a use case
for a kind of "jukebox" application using PyChromecast.

------
trevordixon
I have [http://movies.foamsnet.com/url/](http://movies.foamsnet.com/url/)
bookmarked. Give it a URL, and it will send it to Chromecast and provide
playback controls in your browser.

------
bkovacev
I am using a tool called AirFlow - has built in support for subtitles which
was the first thing I look for when chromcasting. Even though it's not free,
it's an amazing tool. (not affiliated with them at all)

------
mschuster91
Interesting. Is it known which libraries the Chromecast uses under the hood?
Given that RCE exploits are commonplace for media/codec libraries, this can
easily be used to get a decent jailbreak on the thing...

~~~
kuschku
It has been semi-jailbroken in the past, but Google has always very quickly
closed anything.

Chromecast (device, protocol, libraries, firmware) are Google’s most user-
hostile and restrictive project so far.

~~~
terminalcommand
Chromecast even stops working if you do not have a working outside internet
connection. On many occasions I've been unable to cast movies to chromecast
simply because my internet connection was broken.

After some time it bothered me that I had a machine plugged in 24/7 connected
to both my local LAN and Internet, owned by Google. So, every night I unplug
the chromecast and then plug it again whenever I want to cast something.

~~~
bogle
If physically disconnecting it is easy enough then I'd agree that is
preferable. Only plug it in when required.

How about creating a firewall rule and then toggling that instead of
physically disconnecting the Chromecast? I found a likely configuration:
[https://blog.g3rt.nl/allow-google-chromecast-host-
firewall-i...](https://blog.g3rt.nl/allow-google-chromecast-host-firewall-
iptables.html#comment-2981801043)

------
daveFNbuck
This would be great if it worked. It's pretty simple, just pip install
pychromecast and call pychromecast.get_chromecasts() in the repl. This returns
an empty list for me every time.

~~~
StavrosK
Is your Chromecast on the same subnet as your computer? If not, autodiscovery
won't work.

~~~
daveFNbuck
I believe so, it works for my browser and phone.

------
mrguyorama
This is awesome! I gave up on my hopes of doing custom stuff with my
chromecast when I discovered there was a pricetag on the developer license,
but this could be handy!

------
Mrgir
Does this also work with the Chromecast audio? and if not does anyone know of
any great open tools for that hardware?

~~~
LordDragonfang
It looks like pychromecast implements the Google Chromecast API, so any
Chromecast audio devices should show up in the list for
pychromecast.get_chromecasts()

[https://github.com/balloob/pychromecast](https://github.com/balloob/pychromecast)

~~~
Mrgir
Nice, I'll have to try and play around with that to see if I can create some
Sonos/Heos like functionality.

------
nsomaru
Great. Casting is broken on Chromium from the Debian stretch stable repos.

------
xchaotic
generally, you can cast anything from a Chrome browser tab, so just open those
files in a new tab and cast away.

------
zaptheimpaler
im pretty sure you can open chrome and just drag a local video into a tab and
then chromecast the tab.

~~~
Insanity
The quality of doing that however, is not great

