I have been searching all around the web to try to understand how to stream videos to my android app.
I learned:
That the videos must be in the HLS or MPEG-DASH format to be adaptive for streaming .
What I mean by adaptive streaming:
The kind of streaming that allows the user to change the quality while video is streaming.
What could help me do this:
The first thing should be to encode my videos into an HLS or MPEG-DASH, for that I found a service that could do this which is Bitmovin.
The second thing is to play the adaptive video, I found two ways exoplayer and Bitmovin-player.
The problem:
I made an account on bitmovin and tried to test an mp4 video to encode, but there are too many stuff there like input, output and manifest and I don't know what URL I should use to pass to the bitmovin player to play. I encoded the video but I don't know where the reference to the enocoded video is.
My question:
1) Is my approach of streaming videos correct?
2) Can someone explain which url I must pass to the player or where I can find the video that was encoded in Bitmovin cloud?
1) Is my approach of streaming videos correct?
Short answer: Yes :) Adaptive streaming is used by almost every major VoD platform out there, and a proper way to do that. Further it allows you and your viewers to either
let the player decide on its own to select the optimal quality for the given connection and device of the viewer to provide continuous playback
and the viewer can select a specific quality on their own as well, if they want to.
When creating adaptive streaming content using MPEG-DASH and/or HLS as streaming format, your output would typically consist of the following:
Video/Audio Segments
MPD Manifest, and/or HLS playlists
1) Your input file (e.g. an mp4 file) will be downloaded and splitted into segments, which are being processed by the Bitmovin encoding. Out of these, it creates the different qualities the player or your viewer can choose from later.
2) This segmented output is then transferred back to your own storage, e.g. a cloud storage like AWS Simple Storage, or Google Cloud Storage. Other output types like (S)FTP and many others can be used as well.
3) In order to play your created MPEG-DASH or HLS content, a MPD manifest and/or HLS playlist needs to be created. Those are basically an index for the player, which tells it which qualities are available and where to find them to start the playback.
2) Can someone explain which url I must pass to the player or where I can find the video that was encoded in Bitmovin cloud?
The URL you would have to provide to the player, has to point the MPD and/or HLS master playlist, that gets transferred to your storage. Bitmovin doesn't offer a hosting service for your encoded content, which is why you didn't find an URL to the manifest that is used. So you would need a storage first, where the encoding could be transferred to.
Give the getting started guide a try. Select your preferred API client. Then you will be guided step by step on how to integrate this encoding service. I hope this helps :)
To test the playback of the player you can also have a look at https://bitmovin.com/demos/stream-test and select "Use our defaults" which provide URL's to sample content for testing the player and playback.
Related
I have been searching a lot about this by now and I got nothing:
I am trying to play a video from firebase storage and trying to be able to see its progress on the player as it loads and to be able to seek it backward and forward (stuff that any player does while streaming a video).
The problem:
Firebase team say that it is not possible to stream a video from the cloud storage (it is not supported).
Eventhough I was able to do this:
String url = "my_url_at_firebase_storage";
video_View.setVideoUri(Uri.parse(url));
video_View.start();
and I was able to load the video from firebase storage into a video view.
I checked:
I checked this link that has an answer that says you have to transcode the video to chunks and save the chuncks to firebase storage and then load them:
But I am lost here:
1) What are chunks of video?
2) How would you stream these chunks if firebase doesn't support streaming?
My question:
As this topic is rarely documented and the link above doesn't provide enough info about how to acheive it:
I ask:
If firebase doesnt support streaming how come we are able to load video directly to videoview?
Tried the same with exoplayer and didn't work?
Thanks for your efforts.
"Transcoding the video into chunks" means dividing it into multiple small pieces (separate files). Those parts are then uploaded to Firebase Cloud Storage.
Once you divided the video into those pieces, you can download them. Since Firebase does not support streaming, you have to download each chunk entirely before playing, but the trick is that you only have to download that chunk, not the entire video.
Does that answer your question?
I am trying to implement Video on Demand using Azure Media Services on Android.
I have uploaded the video, encoded it to Multi-Bitrate MP4 and then added AES encryption and published it.
I received this MPEG-DASH Url: http://prepladder-inct.streaming.media.azure.net/xxxx-xxxx-xxxx-xxxx-xxxxxxxx/sample-video.ism/manifest(format=mpd-time-csf)
But i am unable to play this video on any MPEG-DASH player (Android or web)
I am even unable to play this video on Azure dash player link: http://dashplayer.azurewebsites.net/
When i enter the stream url, the player is able to show the duration of the video but does not play.
On ExoPlayer on Android, i am able to play all MPEG-DASH streams available online for testing purpose.
Also, i am able to play HLS stream provided by Azure for the same media on ExoPlayer and on iOS.
I have not added any token authorization or DRM during video encryption.
I am missing something? Please help.
The problem is likely that your video file name has unsupported characters. The issue is documented here, where we point out that certain characters should not be used. Try renaming the source video to, say, GM_1st_acid_fast_stain.mp4, upload it to a new Asset, encode, and then create the streaming URL.
For FairPlay/HLS, it is critical to provide the Application Cert (public key only) to the player. Apple's recommended way is to host this App Cert on a web server and pass the URL to player.
SPC/CKC negotiation is performed inside the player.
I would suggest to use this test/diag tool http://aka.ms/amtest which is equipped to support all 3 DRMs (FairPlay, Widevine, PlayReady) and AES-128. If you expand "player_settings" you will see an entry called "FPS AC Path" which is where you paste in your App Cert URL. Also put in "FairPlay" under protectionInfo.type. Of course you need to run the test in Safari on macOS.
Hope this helps.
William
Is it somehow possible, you can load the movie trailers from imdb to videoView or the native android player.
so far, what i've tried.
Iframe approach which let me load trailer in webview, which is exactly i don't want.
Here i found a link which is something a direct link to stream.
I want this to play in video view or native android control.
thanks in advance.
The link you have above is not a direct link to the video - it is actually a link to a web page which contains an embedded player, which in turn has a link to the actual trailer video itself.
You can see the link the to the video if you use the network timeline tab in a browser inspector to look at the network requests. For your example above the client (the browser running the HTML5 page you have downloaded) is requesting the video m3u8 file with the following request:
http://imdb-video.media-imdb.com/vi1225109529/1421100405014-mxwp62-1434643350557.m3u8
This is the 'index' file for a HLS format video file - it tells the client where to request the video streams. The client then downloads the video chunk by chunk which you can see as requests for TS segments - e.g. for you example above:
http://imdb-video.media-imdb.com/vi1225109529/1421100405014-mxwp62-143464335055700002.ts
If the IMDB site does not protect or restrict the video in some way (for example only allowing it play from their embedded web page) then in theory Android should be able to play a HLS file if you point the Media Player towards the m3u8 file. In practice however Android has well know issues with HLS playback so you may find it problematic - see this summary: http://www.jwplayer.com/blog/the-pain-of-live-streaming-on-android/
I'm trying to play video stream with specific DRM implementation. I've got specific parameters for video segments in HLS playlist.
So I need to write a class(es) that gets information from HLS playlist, decrypts and decompresses the video segments and passes them further to video decoding. That wouldn't be a big problem.
The problem is that I can't find any way to tell Android component how to handle this file. Both VideoView and MediaPlayer take only URI of media/video and no further information about processing playlist.
I appreciate any kind of help. It's the biggest problem in application I'm programming and I'm wondering if it is even possible to solve.
HLS doesn't have direct support for DRM, but it does have support for AES-128 CBC encrypted media. I don't know which DRM type you are looking at, but one approach taken by some DRM vendors is to independently access the decryption keys for the encrypted media segments, then use either a custom URL scheme registered by your app or a localhost https proxy to serve the keys. This might require rewriting the HLS variant playlists to point to the appropriate place.
What is most preferred method to play video and audio on mobile websites?
I want to know if I'm having and Video and an MP3 file then how to convert them and embed in a webpage which is a page of mobile website.
I think you know the answer to that already since you're tagging this as HTML5!
Use the audio and video elements. Use a fallback to Flash if you so wish.