Ultimate Cord Cutting Revelation With Castnow

I have long relied on the HDMI cable to play any video content off my Linux laptop onto an external monitor. But recent purchase of a device with in-built Chromecast has given me a completely different outlook towards consuming local media. Ability to “cast” content onto the Chromecast device was known to me but it is only now that I have discovered a way to play local media files to the device. You can stream videos to the Chromecast on Linux via command line. This will help me let go of the HDMI cable for good. Read on to find out more about my ultimate code cutting revelation.

The software in question is castnow which works with NodeJS and npm. Once NodeJS and npm are installed on the distro, installing castnow is just a simple command.

$ sudo npm install castnow -g

Once installed, you can start casting local as well as remote content onto the chromecast device. If you have just one chromecast device, it is automatically detected and used by castnow. For multiple devices the device name can be provided using flag –device [name of device].

Remote Streaming

$ castnow https://onlinecontent.com/video.mp4

Video format mp4 works best with castnow, but I have seen it work well with mkv and mov formats also. This has been tested with file samples available at https://filesamples.com/categories/video

Local Streaming

$ castnow /path/to/video.mp4

Local streaming also worked well for mkv and mov formats. castnow does have a flag to convert the video to mp4 as it plays. This is a also a handy thing.

$ castnow /path/to/video.avi 
Error: Load failed
$ castnow /path/to/video.avi --tomp4
State : Playing...

Streaming Music

This again is as simple as issuing the same command but for an mp3 file instead.

$> castnow https://hostedsongs.com/onlinesong.mp3
$> castnow /path/to/localsong.mp3

The help for castnow provides some more useful details and flags. Listing a few important ones here.

--address <ip>           The IP address or hostname of your Chromecast device
--subtitles <path/url>   Path or URL to an SRT or VTT file
--type <type>            Explicitly set the mime-type (e.g. "video/mp4")
--loop                   Loop over playlist, or file, forever
--shuffle                Play in random order
--recursive              List all files in directories recursively

That’s all there is to have a quick and easy “cast” option to be able to cast local as well as remote media to a chromecast device. Castnow is a nifty and an ultimate cord cutting tool. I am definitely digging it.