BWAHAHAHAHAHA! Great success! I have found that my previous beliefs on how mediainfo.dll is utilized have been proven! As I said before, I had believed that the reason mediainfo was null for chromecast was that UMS had initialized mediainfo for the android client we browsed with but would not initialize for chromecast since chromecast does no browsing of the files and only asks for them. I had an epiphany while I was explaining this issue I've been working on to a friend. I essentially hacked chromecast.conf to be inclusive of the android user-agent header as well as the chromecast user-agent header. So to see what I'm talking about this is what you need to do:
Step 1. Start UMS
Step 2. Open the 'General Configuration' tab
Step 3. Click the 'Select renderers' button
Step 4. Deselect Android
Step 5. Click 'OK'
Step 6. Modify Chromecast.conf to this:
Code: Select all
#----------------------------------------------------------------------------
#Profile for Android/Chromecast.
#See PS3.conf for a description of all possible configuration options.
#
RendererName=Android/Chromecast
RendererIcon=android.png
UserAgentSearch=Android
UserAgentAdditionalHeader=User-Agent
UserAgentAdditionalHeaderSearch=CrKey
Video=true
Audio=true
Image=true
SeekByTime = true
TranscodeVideo = H264TSAC3
TranscodeAudio = MP3
MaxVideoBitrateMbps = 20
MimeTypesChanges = video/mpeg=video/mp4
MediaInfo = true
CreateDLNATreeFaster = 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
CustomFFmpegOptions = -async 1 -fflags +genpts -c:v libx264 -profile:v high -level 4.1 -c:a libmp3lame -ac 2 -preset ultrafast -b:v 35000k -bufsize 35000k -f matroska
Step 7. Restart UMS
Step 8. Use LocalCast or equivalent app to browse for a video to play
Step 9. Play the video
Now, if you inspect the log you'll see that media info has returned all the appropriate information for the file. Better yet, if your file has multiple audio languages or subtitles they are now appropriately mapped. My CustomFFmpegOptions still encode the file into a chromecast compatible format so now I can officially say everything works! *except seeking which is still limited in support

Here's the coolest part about this set up though. I used BubbleUpnp to browse UMS and play a video locally on my nexus 7. I found that full functionality still exists for Android as well! For those of you that understand what I did at the top of my .conf, I would say this is something of a hack to get around the problem but one that works remarkably well! For those of you that don't quite get what's been done, I'll explain.
UserAgentSearch searches all User-Agent headers for the indicated value 'Android' in this case. Then, UserAgentAdditionalHeader searches for all headers that start with the indicated value 'User-Agent' in this case. Finally, UserAgentAdditionalHeaderSearch searches the headers found by UserAgentAdditionalHeader for the indicated value 'CrKey' in this case. What this has done is when you browse UMS with your android device it sees it as the renderer 'Chromecast' and mediainfo is called to set up the files for appropriate mapping once your renderer calls for a file. But when you select a video to play with localcast or an equivalent app your
real chromecast asks for it. This used to be a problem. However, now when chromecast sends its request header UMS finds "CrKey" inside the header "User-Agent" and says "Oh! This is an additional header for the Chromecast renderer" and decides it is the same kind of renderer. So UMS now knows it can use the same values for this renderer as what it set up for your other chromecast (android).
All together I'd say this could potentially be improved to actually support Android and Chromecast as different renderers. But for now, this absolutely WORKS!!!! BubbleUpnp still refuses to play files that aren't MP4s but I bet adding UseSameExtension=mp4 to my provided .conf will solve that. And if it does then BubbleUpnp would be my recommended client application to use since it supports playback from many servers to many clients including local playback and best of all it's free. Due to this set-up you don't have to set up the bubble server on your pc either because UMS does the transcoding. Finally, since it has some way that it parses duration on its own, it also has the best seeking support. I hope this helps some of you out with casting your media. Until next time!
Happy Casting!
Edit: So I was wrong about UseSameExtension. Bubble no longer cares about the extension and checks the mimetype only. But adding "MimeTypesChanges = video/mpeg=video/mp4" has fixed the problem. I've updated the code to reflect this and a couple of optimizations.