-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No audio for AC3 codec #44
Comments
I think what would be nice is a separated NPM module for this that would be named var ccCompatible = require('chromecast-compatible');
ccCompatible('http://foo/bar.mkv', function(err, video, audio, meta) {
if (video && audio) // the file can be played on chromecast
if (!video) // the video codec is incompatible and must be transcoded
if (!audio) // the audio codec is incompatible and must be transcoded
console.log(meta); // some meta information about the file (see codec-sniffer)
}); Internally the var sniffer = require('codec-sniffer');
sniffer('http://foo/bar.mkv', function(err, meta) {
console.log(meta); // some meta information about the file
}); This module could maybe use I guess the main question is if we need to fully download the video first Any Suggestions? |
I totally like this approach by separating the concerns into multiple node modules. I don't have enough insights into how we would be able to detect each codec, but using |
yep, ffprobe seems to be the better solution than ffmpeg -i. I already started writing a kind-of Using ffprobe on files hosted on webservers doesn't seem to work indeed. If the meta-data of the video is stored at the end of the file the webserver would need to be capable of range requests (if we don't want to download the whole file). Which I guess most webservers won't be. |
I've been thinking along these lines too. It'd be great to auto-detect if transcoding the video/audio codecs or changing the container format is necessary instead of relying on the user using In my testing ffmpeg needs to read entire file to print out information about the container and codecs. It should be possible get this information by partially reading the file, but the details will depend on the container format and codecs. Maybe there's another project out there that does this. |
Just created a github repo and dumped in some code => https://github.com/xat/chromecast-can-play |
Awesome! Looks like I was previously wrong and ffprobe/ffmpeg read only some bits of the file to guess the metadata (this is controlled by the If given an HTTP url ffmpeg makes smart http range requests to seek around to the bits it needs. You can see this in action using the I'm sure you've already discovered all this but I figured I'd document my findings for others. |
@parshap Really nice research! Some limitation I found is that HTTPS URLs will only work with some special compile-time-configuration ("https protocol not found, recompile with openssl or gnutls enabled."). |
I think it's reasonable to expect ffmpeg to have been built with certain options. Maybe we should add a section to the readme about ffmpeg requirements and suggested build flags. If it ends up being an issue for too many people we can always proxy the https resource through a local http server for ffprobe. |
I thought it was worth mentioning that you can leave a video paused for a few minutes and it will finish playing successfully, unlike with castnow. |
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
The text was updated successfully, but these errors were encountered: