Firstly, I looked at .m3u8 as the playlist response from the server, which ended up being SAMPLE-AES encrypted and as a result couldn’t be transcoded by FFMPEG. Gave up on that route.
Now I’m looking into the MPD file as an option. Using IndirectResponse(VideoClipObject, HTTPLiveStreamURL(mpd_url), http_cookies=cookies, http_headers=headers) but getting a 400 (Bad-request) response back from the transcoder. Verified that I can download the MPD file just fine with a normal requests.get.
Site request headers copied exactly and I’ve verified that I have all the necessary cookies. No dice.
If anyone can point me in the right direction I’d appreciate it. Thinking of checking to see whether the encrypted RTMP route is still open and giving up on MPD. Don’t really want to do that as I’d like to use Plex’s HTML5 player instead of some terrible SWF player.
PS. Tweaked my code and now getting a transcoder error “Invalid data found when processing input”
So, checking the contents of each of the files, I kept seeing “Created with Unified Streaming Platform”. Checked their site and they provide responses in each of the following formats;
smooth .ism/Manifest The HTTP Smooth Streaming client manifest.
hls .ism/.m3u8 The master .m3u8 playlist for HTTP Live Streaming
hds .ism/.f4m The HTTP Dynamic Streaming manifest.
dash .ism/.mpd The MPEG DASH manifest.
.f4m responds with 404 and smooth/dash gets an “Invalid data found when processing input” from the transcoder.
Testing results as follows:
hls_url = url.replace(’.isml’,’.isml/playlist.m3u8’) #FFMPEG: SAMPLE-AES encryption is not supported yet
hls_url = url.replace(’.isml’,’.isml/.mpd’) #FFMPEG: Invalid data found when processing input
hls_url = url.replace(’.isml’,’.isml/Manifest’) #FFMPEG: Invalid data found when processing input
hls_url = url.replace(’.isml’,’.isml/.f4m’) #403 Forbidden
Still checking what I can do about the “Invalid data found” error.
So, got a hold of the author of the DASH demuxer for FFMPEG. He says he’d be happy to have a look at the MPD file and he’s expecting his demuxer to become part of the main FFMPEG branch in the near future. Now the only question is how willing Plex is going to be to implement the demuxer in their customized version of FFMPEG.
Alternatively, I can look at grabbing a python demuxer and pulling the dash segments and then pushing the individual segments to FFMPEG for transcoding. Wonder if that could work, considering that FFMPEG does appear to have some kind of transcoding support for DASH files. Though how you would supply the audio and video segments to the transcoder through a Plex channel, I don’t know.
Selsta highlighted to me that each of the streams generated through USP are DRM enabled and as a result, can’t be transcoded into anything, nor would Plex be able to direct play the content. That is until Plex decides they want to add DRM support.