Hi all,
I have made great progress with casting from UMS and thought I'd share my findings with everyone. Here is my configuration:
Code: Select all
#----------------------------------------------------------------------------
# Profile for Chromecast.
# See PS3.conf for a description of all possible configuration options.
#
RendererName=ChromeCast
RendererIcon=chromecast.png
UserAgentSearch=CrKey
Video=true
Audio=true
Image=true
# Allcast moves forward in 30 second increments and this works when casting from UMS, like-wise seeking works with BubbleUpnp
SeekByTime = true
# TranscodeVideo isn't really necessary but is here for good measure.
TranscodeVideo = H264TSAC3
TranscodeAudio = MP3
#BubbleUpnp won't work without this since it performs its own compatibility check when attempting a cast. If you experience problems using other casting services, maybe commenting this out will help.
UseSameExtension = mp4
#Sometimes this value seems to be ignored but I left it in case it works. Increase it if you like. I usually don't see problems past 45 Mbps.
MaxVideoBitrateMbps = 20
#These values don't seem to matter with this configuration.
MediaInfo = true
Supported = f:bmp m:image/bmp
Supported = f:gif m:image/gif
Supported = f:jpg m:image/jpeg
Supported = f:png m:image/png
Supported = f:mp4 v:mp4|h264 a:aac|aac-he|mp3|ogg m:video/mp4 n:2
Supported = f:webm v:mp4|h264 a:aac|aac-he|mp3|ogg m:video/mp4 n:2
Supported = f:mp3 m:audio/mpeg n:2
SupportedSubtitlesType = WEBVTT
# This is the important part:
# (Make video work) -map 0:v which maps the first video stream. -c:v through -level ensure the video stream is encoded properly for chromecast.
# (Make audio work) -map 0:a maps the first audio stream. -c:a and -ac encode audio for casting.
# (Prevent stutter due to slow encoding) -preset ultrafast helps your processor encode the video as quickly as possible. if your processor is fast enough try increasing this. I expect you might get better quality out of your limited bitrate.
# (Prevent stutter due to slow connection) -b:v and -buffsize should ensure the encoded video does not exceed a bitrate that can fit through a wifi connection. These sometimes seem to be ignored in the same way MaxVideoBitrateMBPS does.
# (output) -f matroska, I know chromecast doesn't support mkv. But webm is basically a dumbed down mkv so this works. using mp4 instead has given me problems for some reason.
CustomFFmpegOptions = -async 1 -fflags +genpts -map 0:v -c:v libx264 -profile:v high -level 4.1 -map 0:a -c:a libmp3lame -ac 2 -preset ultrafast -b:v 35000k -bufsize 35000k -f matroska
So with this .conf I have been able to throw every combination of containers and codecs I have at the chromecast without any playback issues. In short, this works! However, there are still some issues.
1. language selection: the problem is that my configuration assuredly maps the first audio stream in the file. However, this isn't necessarily the language set as preferred in your UMS settings. UMS normally uses MediaInfo.dll to parse the file and map audio and subtitles according to your settings. The reason this doesn't happen with my .conf is that, for some reason, mediainfo always returns null when playing to chromecast.
2. subtitles: what can I say, chromecast has issues with subtitles. But UMS would usually bypass this quite easily. UMS will typically burn-in subtitles after encoding them to a temporary external .ass file. This happens during the transcode, when necessary based on your settings. But once again since mediainfo returns null UMS doesn't set this up.
3. seeking: the above configuration actually doesn't have much to do with this but seeking actually does work for Allcast and BubbleUpnp. I can't get it to work for localcast though. The reason for this is that localcast seems to use a ratio based on duration. duration is retrieved by (did you guess it?) mediainfo, which returns null for this value as well. Allcast doesn't care about duration and just seeks by time in 30 second increments so this works. BubbleUpnp somehow grabs duration itself. (in the log, duration is still null but Bubble gets the right value regardless) So seeking works here too.
Okay so to recap the main points are thus.
The good:
-This configuration
will play your file limited only by the capabilities of ffmpeg. (on that note, make sure ffmpeg is at the top of the transcode list, lest nothing work)
The bad:
-There will be no subtitles
-Audio may not be your preferred language.
-Seeking support is limited.
I decided to post this because I felt like this is good enough for most viewers. Sorry if you like soft-subbed anime or anything of that sort, I'm still working to fix this. Many of you seem to use Avia. Sorry again, I can't guarantee compatibility as I haven't used it for testing. Also, maybe this will help others to help me solve the mediainfo issue. I feel like fixing this would solve most of the remaining problems.
As a final note to everyone who is trying to get this working, android.conf actually works in tandem with chromecast.conf when casting. The effects android.conf has on casting seem pretty ambiguous. But a simple test of making android.conf match the above chromecast.conf and then playing locally on my nexus7 proved to have made everything work on my android viewing in exactly the way I wish it would for casting. But leaving android.conf like that then trying to cast causes problems. If you're going to mess with android.conf, make sure to make a backup because its effects are pretty unpredictable.