xat / castnow Goto Github PK
View Code? Open in Web Editor NEWcommandline chromecast player
License: MIT License
commandline chromecast player
License: MIT License
When running castnow
without arguments, it crashes with this error:
> castnow Projects/castnow
/usr/local/lib/node_modules/castnow/node_modules/playerui/index.js:77
+ pad(l.label, labelPadding)
^
TypeError: Cannot read property 'label' of undefined
at /usr/local/lib/node_modules/castnow/node_modules/playerui/index.js:77:30
at Array.map (native)
at Object.render (/usr/local/lib/node_modules/castnow/node_modules/playerui/index.js:75:10)
at /usr/local/lib/node_modules/castnow/index.js:148:10
at /usr/local/lib/node_modules/castnow/node_modules/chromecast-player/api.js:53:7
at RequestResponseController.onmessage (/usr/local/lib/node_modules/castnow/node_modules/castv2-client/lib/controllers/request-response.js:27:7)
at RequestResponseController.emit (events.js:117:20)
at Channel.onmessage (/usr/local/lib/node_modules/castnow/node_modules/castv2-client/lib/controllers/controller.js:16:10)
at Channel.emit (events.js:98:17)
at Client.onmessage (/usr/local/lib/node_modules/castnow/node_modules/castv2-client/node_modules/castv2/lib/channel.js:23:10)
The transcode plugin has certain limitations at the moment:
Improvements that could be made:
It works fine with other video files mp4 and mov but mkv don't seem to have sound.
Whenever I cast a file with the --tomp4
option, the state constantly says "Buffering..." even though the video is playing smoothly. In addition, this doesn't let me use any of the key-bindings to pause or seek.
$ uname -a
Linux electron 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt2-1 (2014-12-08) x86_64 GNU/Linux
$ ffmpeg --version
ffmpeg version 2.5.1 Copyright (c) 2000-2014 the FFmpeg developers
built on Dec 16 2014 08:05:21 with gcc 4.9.2 (Debian 4.9.2-8)
Currently issuing the following commands result in an error (exception):
castnow
castnow -h
castnow --help
I think most people are used to getting the 'usage' printed out in case of errorneous input. This would also be a good way to educate the users about options (e.g., --tomp4
).
Casting youtube http
links works, but when using an https
link, the app doesn't work.
No error, nothing.
left right keys - should seek 30 sec
left right + shift - should seek 5 min
.alias('f', 'path').describe('f', 'change buffer file path')
This doesn't do anything for me. I'm on Ubuntu 14.04. Installed npm then did npm install castnow -g. Had to also install node. Once I did that I tried castnow
Seems like only audio works when playing youtube videos at the moment.
Can anyone confirm this? Current guess is that they changed something within the protocol.
My host computer is running behind a vpn, which I think would be a good idea when streaming torrents, can't find my chromecast, tried using --myip with both ip that my vpn is behind and the vpn my router is behind. Still trying to troubleshoot, but I was hoping someone had a solution.
Hi, it would be great to be able to switch between different audio tracks. Perhaps it is a problem with the Chromecast stick itself, which seems to be capable of it. I am no expert on the mkv container format, but perhaps there is the ability to change the order of the audio tracks just inside the container description. Castnow could then send a slightly manipulated mkv container in the beginning of the video file to the Chromecast stick?
PS: Great application, thanks a lot!
For example if someone is using the --tomp4 parameter and dosn't have ffmpeg installed.
When the playback is paused for more than about 5 minutes, resuming it makes castnow switch to idle.
Once it is idle, is there any way to continue the playback, without reopening castnow with an approximate --seek
?
Simon,
I understand that new "Issue" is not the right place to share ideas but I thought we can use it for now.
After using castnow to stream online content I'm amazed how well this works. I currently have it loaded on one of my Debian Wheezy box that I have on LAN. This way I have a central place that I can go to and start the stream. The box is CLI only.
The immediate idea I had was to have castnow-webserver which would serve web interface around castnow so no ssh would be needed to start the stream. What do you all think?
does not play local and web subtitles, will continue to play video though.
my command for the web video with local srt file looks like this:
castnow http://fsd2.vodlocker.com:8777/lgceai7pno4pcnokak5ch46gw
ytrkwjptq2hk4fbjqlgvens3w4w5hrdlu/v.mp4 --subtitles \Downloads\w\w.srt
my path to the web srt file looks like this
castnow http://fsd2.vodlocker.com:8777/lgceai7pno4pcnokak5ch46gw
ytrkwjptq2hk4fbjqlgvens3w4w5hrdlu/v.mp4 --subtitles https://fs10n4.sendspace.com
/dl/c534b77b6c4f704f8c5f6763436f09b0/548caba42045fb07/5ol0x1/w2.srt
Debug is also not a recognized command when I try to input
DEBUG=castnow* castnow --subtitles </path to srt file>
I've got an error and it's seems to be an error from ffmpeg or transcoder.
I use avconv (ffmpeg will be remove from Debian and it's removed from Ubuntu 14.04)
The bug occurs both on Debian Wheezy (ffmpeg v6:0.8.16) and Ubuntu 14.04 (alias avconv v6:9.16)
Works (Debian & Ubuntu)
$ castnow --myip 192.168.1.93 ./myvideo.mp4
$ castnow http://commondatastorage.googleapis.com/gtv-videos-bucket/ED_1280.mp4
Failed (Ubuntu)
$ castnow --myip 192.168.1.93 ./myvideo.avi --tomp4
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:988:11)
at Process.ChildProcess._handle.onexit (child_process.js:779:34
Making link (Ubuntu)
$ sudo ln -s /usr/bin/avconv /usr/bin/ffmpeg
$ castnow --myip 192.168.1.93 ./myvideo.avi --tomp4
State : Loading...
events.js:72
throw er; // Unhandled 'error' event
^
Error: FFmpeg error: Stream mapping:
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/castnow/node_modules/stream-transcoder/lib/transcoder.js:264:28)
at ChildProcess.EventEmitter.emit (events.js:117:20)
at Process.ChildProcess._handle.onexit (child_process.js:797:12)
Failed (Debian)
$ castnow --myip 192.168.1.93 ./myvideo.avi --tomp4
events.js:72
throw er; // Unhandled 'error' event
^
Error: FFmpeg error: Stream mapping:
at ChildProcess.<anonymous> (/usr/lib/node_modules/castnow/node_modules/stream-transcoder/lib/transcoder.js:264:28)
at ChildProcess.emit (events.js:117:20)
at Process.ChildProcess._handle.onexit (child_process.js:810:12)
But when I run (Debian & Ubuntu)
ffmpeg -i myvideo.avi -strict experimental -vcodec h264 out.mp4
castnow --myip 192.168.1.93 ./out.mp4
It works.
$ npm version
{
http_parser: '1.0',
node: '0.10.25',
v8: '3.14.5.9',
ares: '1.10.0',
uv: '0.10.23',
zlib: '1.2.8',
modules: '11',
openssl: '1.0.1f',
npm: '2.1.8'
}
Any idea?
Any plans to make the background of subtitles transparent?
Great piece of software. Thanks for working on it.
On Fedora 20, fully up to date. It installs correctly. It stalls forever "scanning". Passing --device 'the right name' did not help. Neither --verbose nor --debug flags shed any light.
Chrome web browser with the chrome cast extension finds the Chromecast immediately and can cast a tab without problem.
The machine has a single network interface active. Passing --myip did not help either.
The machine has a physical network (1Gbps) to the AP where the Chromecast is associated. Other machines also connect the Chromecast over the same network without problem.
What can I do to help debug this? I'm a fairly competent programmer, but not familiar with the node.js stack in the least.
thanks!
~martin
To make
castnow http://mirrorblender.top-ix.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_surround.avi --tomp4
My machine has multiple IP addresses (I've got virtualization software installed). I noticed castnow picks up the wrong IP address, thus initially it was never working for me .. I noticed that if I pass the --myip parameter, it does work (and it's awesome)
castnow should automatically pick the IP address that falls within the network of the chromecast device.
Not sure what can it go wrong, but here it goes.
DEBUG=castnow* castnow --myip "192.168.1.51" --tomp4 --bypass-srt-encoding --subtitles "./mysub.chs.srt" "./myvideo.mkv"
castnow launching... +0ms
castnow:transcode started webserver on address 192.168.1.51 using port 4103 +6ms
castnow player status: loading plugins +12ms
castnow player status: scanning +1ms
castnow player status: connecting +21ms
castnow player status: launching +123ms
castnow player status: loading +1s
castnow:transcode incoming request for path ./myvideo.mkv +2s
castnow:transcode spawning ffmpeg -i - -vcodec h264 -f mp4 -movflags frag_keyframe+faststart -strict experimental pipe:1 +7ms
castnow:transcode got error: { [Error: connect ECONNREFUSED] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect' } +15ms
Using:
[email protected] /usr/local/lib/node_modules/castnow
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected])
I tried it with a magnet link.
(castnow magnet --subtitles C:\path\to\file.srt)
Entire thing says this:
'dn' is not recognized as an internal or external command,
operable program or batch file.
tr: two strings must be given when translating
tr: unrecognized option--subtitles' Try
tr --help' for more information.
Edit: Looks like it works with local video files, not with magnets.
I guess jumping to the next video only works for youtube videos if the player is in idle-state.
Hi,
I was playing a video , when suddenly it stopped with this error :
/usr/local/lib/node_modules/castnow/node_modules/castv2-client/node_modules/castv2/lib/client.js:126
this.ps.send(buf);
^
TypeError: Cannot call method 'send' of null
at Client.send (/usr/local/lib/node_modules/castnow/node_modules/castv2-client/node_modules/castv2/lib/client.js:126:11)
at Channel.send (/usr/local/lib/node_modules/castnow/node_modules/castv2-client/node_modules/castv2/lib/channel.js:34:12)
at RequestResponseController.Controller.send (/usr/local/lib/node_modules/castnow/node_modules/castv2-client/lib/controllers/controller.js:28:16)
at RequestResponseController.request (/usr/local/lib/node_modules/castnow/node_modules/castv2-client/lib/controllers/request-response.js:34:8)
at /usr/local/lib/node_modules/castnow/node_modules/chromecast-player/api.js:108:17
at Api.getCurrentSession (/usr/local/lib/node_modules/castnow/node_modules/chromecast-player/api.js:95:35)
at Api.sessionRequest (/usr/local/lib/node_modules/castnow/node_modules/chromecast-player/api.js:105:8)
at Api.pause (/usr/local/lib/node_modules/castnow/node_modules/chromecast-player/api.js:128:8)
at Object.ke%
This is my assumption and I can be completely wrong but I came across URLs with no file extensions that will not play using castnow.
The direct link to the file looks like this:
0:{src:'http://<IP_here>/token/video/vod/<current_time>/<current_date>/<some_number>/f7b03ddc-03a3-484d-bc76-2330ed9a2801', type: 'video/mp4'},
castnow --device "Living room" http://<IP_here>/token/video/vod/<current_time>/<current_date>/<some_number>/f7b03ddc-03a3-484d-bc76-2330ed9a2801
I get the following:
Launching ...
Loading ... < app gets loaded on the TV
Here I'm being dropped to the prompt with no error message. App stays loaded on the TV
There is no problems when the file gets downloaded first:
wget http://<IP_here>/token/video/vod/<current_time>/<current_date>/<some_number>/f7b03ddc-03a3-484d-bc76-2330ed9a2801
castnow --device "Living room" f7b03ddc-03a3-484d-bc76-2330ed9a2801
I get the following:
Launching ...
Loading ...
Buffering ...
Playing ...
Also there is no problems when I use Chrome browser to go directly to the link:
http://<IP_here>/token/video/vod/<current_time>/<current_date>/<some_number>/f7b03ddc-03a3-484d-bc76-2330ed9a2801
The video gets loaded in the Chrome tab and can be played in Chrome browser as usual.
Here is a different URL from the same website that works with castnow. This one has the extension.
The direct link to the file looks like this:
1:{src:'http://<IP_here>/token/video/vod/<current_time>/<current_date>/<some_number>/398431c5-b4f1-42ca-b8e7-51b2227f7250/video-5.mp4', type: 'video/mp4'},
castnow --device "Living room" http://<IP_here>/token/video/vod/<current_time>/<current_date>/<some_number>/1593557513/398431c5-b4f1-42ca-b8e7-51b2227f7250/video-5.mp4
Launching ...
Loading ...
Buffering ...
Playing ...
This is when using the latest 0.4.5 version. Let me know if you need any more debug.
Thanks
Hubert
Added:
I was wondering what happened to --debug
flag :)
Including debug info for anyone who may come across the same issue.
castnow launching... +0ms
castnow player status: loading plugins +7ms
castnow player status: scanning +1ms
castnow player status: connecting +84ms
castnow player status: launching +122ms
castnow player status: loading +1s
castnow player error: [Error: Load failed] +2s
Error: Load failed
This issue occurs on install
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/castnow/node_modules/peerflix/node_modules/numeral/min' npm ERR! error rolling back [email protected] { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/castnow/node_modules/peerflix/node_modules/numeral/min'] npm ERR! error rolling back errno: 53, npm ERR! error rolling back code: 'ENOTEMPTY', npm ERR! error rolling back path: '/usr/local/lib/node_modules/castnow/node_modules/peerflix/node_modules/numeral/min' } npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/castnow/node_modules/peerflix/node_modules/numeral/min/languages' npm ERR! error rolling back [email protected] { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/castnow/node_modules/peerflix/node_modules/numeral/min/languages'] npm ERR! error rolling back errno: 53, npm ERR! error rolling back code: 'ENOTEMPTY', npm ERR! error rolling back path: '/usr/local/lib/node_modules/castnow/node_modules/peerflix/node_modules/numeral/min/languages' } npm ERR! Error: No compatible version found: mdns-js@'shahriman/node-mdns-js' npm ERR! Valid install targets:
C:\Users\User>castnow "C:\Users\User\Videos\True Detective Season 1\True Detectiv
e S01E01 - The Long Bright Dark - Ehhhh.mkv" --tomp4
castnow launching... +0ms
castnow:localfile started webserver on address 192.168.1.20 using port 4100 +14
ms
castnow:transcode started webserver on address 192.168.1.20 using port 4103 +8m
s
castnow player status: loading plugins +2ms
castnow player status: scanning +0ms
castnow player status: connecting +132ms
castnow player status: launching +152ms
castnow player status: loading +1s
castnow:transcode incoming request for path http://192.168.1.20:4100/0 +299ms
castnow:transcode spawning ffmpeg -i - -vcodec h264 -f mp4 -movflags frag_keyfr
ame+faststart -strict experimental pipe:1 +17ms
castnow:localfile incoming request serving C:\Users\User\Videos\True Detective
Season 1\True Detective S01E01 - The Long Bright Dark - Ehhhh.mkv +15ms
castnow:transcode transcoding error: [Error: FFmpeg error: Stream mapping:] +29
8ms
castnow player error: [Error: Load failed] +1s
Error: Load failed
It would be nice to toggle subtitles through a key. Maybe with v-key ("VTT") since the s-key is already in use.
Hi,
what can be the cause for that?
I get the loading bar on tv but nothing happens. I tried with mp3 and mkv with --tomp4...
Does castnow playback .avi files? When I try to stream an .avi file, castnow seems to start playing the file then stops. castnow works with other file formats I have.
Saw this in the subtitles plugin:
https://github.com/xat/castnow/blob/master/plugins/subtitles.js#L34
Chromium doesn't support AC3, which means that MP4/MKV files with AC3 codec will be played with no audio. This can be solved by piping the file through ffmpeg using the acodec libmp3lame
param, as Chrome supports MP3.
Suggestion:
Detect audio codec in local file, and start the local file using --tomp4 --ffmpeg-acodec libmp3lame
uname -a
Linux justin-Latitude-D620 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty
ffmpeg version 1.2.6-7:1.2.6-1trusty1 Copyright (c) 2000-2014 the FFmpeg developerstrusty1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
built on Apr 26 2014 18:52:58 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --arch=amd64 --disable-stripping --enable-avresample --enable-pthreads --enable-runtime-cpudetect --extra-version='7:1.2.6-1
libavutil 52. 18.100 / 52. 18.100
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.104 / 54. 63.104
libavdevice 53. 5.103 / 53. 5.103
libavfilter 3. 42.103 / 3. 42.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
node --version
v0.10.25
npm --version
1.3.10
NPM Debug Log:
9825 silly lockFile 652c89fc--justin-npm-co-3-1-0-package-tgz tar:///home/justin/.npm/co/3.1.0/package.tgz
9826 verbose lock tar:///home/justin/.npm/co/3.1.0/package.tgz /home/justin/.npm/652c89fc--justin-npm-co-3-1-0-package-tgz.lock
9827 silly gunzTarPerm modes [ '755', '644' ]
9828 error Error: No compatible version found: mdns-js@'shahriman/node-mdns-js'
9828 error Valid install targets:
9828 error ["0.0.1","0.0.2","0.0.3","0.0.5","0.0.6","0.1.0","0.1.1","0.1.2","0.1.3"]
9828 error at installTargetsError (/usr/share/npm/lib/cache.js:719:10)
9828 error at /usr/share/npm/lib/cache.js:638:10
9828 error at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7)
9828 error at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
9828 error at Object.oncomplete (fs.js:107:15)
9829 error If you need help, you may report this log at:
9829 error http://github.com/isaacs/npm/issues
9829 error or email it to:
9829 error [email protected]
9830 error System Linux 3.13.0-24-generic
9831 error command "/usr/bin/nodejs" "/usr/bin/npm" "install" "castnow" "-g"
9832 error cwd /home/justin
9833 error node -v v0.10.25
9834 error npm -v 1.3.10
9835 verbose exit [ 1, true ]
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.10.32","npm":"1.4.28"})
npm ERR! Error: 400 Bad Request
At the moment plugin-initialization can only happen one time in the life-cycle of castnow. This is because some plugins start HTTP servers which would need to be closed before the player can be booted again. Also peerflix must get shutdown and the transcode process must be ended.
The solution is to introduce some sort of shutdown-process. Maybe a "close" event could be emitted on the ctx object. The plugins would listen to this event and clearup their stuff. Only problem is that this would need to be sort of async with next()/done() functions and stuff. Otherwise we would not know when the player is fully un-initializated.
This is also important for the Web UI ( #29 ) to work since castnow acts as an ongoing process in that scenario.
I've one problem... its working from WIFI to WIFI, but won't work from LAN to WIFI.
Any ideas?
Would it be possible to add data to the screen that is being cast to, such as what is currently playing.
From Fedora 20, fully up to date, I can use castnow with a youtube url, but not with a local MP4 file.
Using --debug, the last status printed is "player status: ready". Not sure how to debug this further...
Hi,
First compliments for the work so far, it's a great concept and what's implemented so far works very well for me.
The key feature for me would be to be able to script my HTPC to launch live tv channels. The provider I use has iOS and Android mobile apps and a web interface which all have chromecast support built in. Under OS X I can go to a URL, click the chromecast button and I get full screen video (e.g. not just a cast of the full tab).
When I try to load the URL with castnow I get:
DEBUG=castnow* castnow http://zattoo.com/watch/bbc-one
castnow launching... +0ms
castnow player status: loading plugins +3ms
castnow player status: scanning +1ms
castnow player status: connecting +164ms
castnow player status: launching +595ms
castnow player status: loading +4s
castnow player error: [Error: Load failed] +2s
Error: Load failed
I'm not sure if Zattoo is accessible internationally. In any case it's behind a user login. Sorry if there's not much for you to work with - but I hoped you might be able to advise of any general approach to get castnow to handle a web page which flawlessly supports chromecast from a browser?
thanks!
We could parse the package.json to retrieve the current version.
I've tried different files from different sources including magnet links and nothing seems to work. As an example I can't get this to work:
I also tried putting the link in quotes and I tried to just download the torrent and run it that way. I can't tell that it is doing anything, is there a log I could tail?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.