My goal is to let users be able to upload their own videos and then play them back using Azure Media Services and Azure Media Player. I want the video playback to be supported in all modern browsers.
Currently I have only tested uploading manually using the Azure portal and I have some questions/concerns..
HTML
<link href="//amp.azure.net/libs/amp/latest/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet">
<script src="//amp.azure.net/libs/amp/latest/azuremediaplayer.min.js"></script>
<video id="azuremediaplayer" class="azuremediaplayer amp-default-skin amp-big-play-centered" controls autoplay width="640" height="400" poster="" data-setup='{"nativeControlsForTouch": false}' tabindex="0">
<source src="https://MYSTORAGE.blob.core.windows.net/asset-ad8677da-8869-4eb9-a93b-5805fc7e8122/bigbuck.mp4?sv=2012-02-12&sr=c&si=c7011ff9-be73-4ad4-a55a-fd05099ffa50&sig=WNnjsHGJB8PN8ZbmCGdBM34MEQ1oXsSxMXaPAqF1yK0I%3D&st=2016-05-11T14%3A32%3A19Z&se=2116-04-17T14%3A32%3A19Z" type="application/vnd.ms-sstr+xml" />
<p class="amp-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video</p>
1. With the example code above I have uploaded a mp4 video to Azure Media Services. Everything works when using Chrome, but with Firefox I get this error message:
A network error made downloading the video stopped. Check your network
connection and try again later.
My guess here is that I need to do some additional coding on the video? If so, what encodings do I need for my spec?
In other examples I've seen people use special formats, ism/Manifest something(?) Did I miss a step? What I did was publish the asset, retrieve the URL and paste it into my HTML5 player. My URL looks like a SAS URI..
2. Do I need to create a Streaming Endpoint with atleast one unit? I looked at the pricing and I think it was around $139/month. Yuck. Is that not just for live streaming?
3. Each uploaded video in Azure Media Services, (asset), gets it's own blob container. Now imagine if I have over a thousand of users and even more videos. Is this really how it's done? Is it not possible to have the same blob container for all videos? Is Azure Media Service really what I'm looking for?
4. If I didn't use Azure Media Services, what would be my other options? Convert uploaded videos to MP4/WebM/Ogg and tripple my storage space?
Quick thing to note above is that the mime type you have provided in the source tag is incorrect because you are using progressive MP4 and are not using adaptive streaming. You have "application/vnd.ms-sstr+xml" when it should be "video/mp4" – there is a sample http://amp.azure.net/libs/amp/latest/samples/videotag_progressiveVideo.html for this use case.
Related
I am trying to create a web app for that can convert user uploaded video to different format using ffmpeg. This is my first project idea with using ASP.NET. I would like to ask an advice on how should I manage user uploaded videos to optimize disk consumption.
I'm making an app that enables me to download YouTube videos. If you weren't aware by selecting the network tab on a YouTube video then refreshing the page, filtering using "mime-type:audio/webm" {EDIT:: and removing &range=.. from the url} you get access to all the video's files like just audio, just video, low quality, high quality etc.
The app I'm wanting to make but can't seem to figure out will go to https://youtube.com/watch?v=VIDEO_ID, filter the requests by "mime-type:audio/webm" and list all of the links found.
How could I access this from C#?
a screenshot of what I'm talking about in regards to video types
You can clearly see that the web request is initiated by a javascript.
By doing so, it has been made hard to initiate such a request from C#, because;
you either need to parse and execute the javascript, or
recreate the generated URL's in C#, or
use a proxy to capture the incoming data
Another option would be to check out Google's API, but I am not sure they expose such functionality.
I can upload videos to youtube programatically, I have an adsense account. In my channel options "monetize in all countries" is selected. When I upload manually in youtube, advertisements start showing.
How can I make ads show automatically when I upload videos via API programatically. But I need C# code example which I couldn't find in youtube documentation page
https://developers.google.com/youtube/partner/upload_claim_sample
If you are an Adsense account owner, you cannot monetize (claim) your videos via API. In order to monetize (claim) your videos, you should have CMS account..
I hope it helps,
Best,
For my scenario, our current app is begin coded in html5 and angularjs communicating with web api. I have a workflow scenario that I seem to not be able to find an end to end example for. I would like to allow users of my website to upload videos and images to Azure Media Services. I found several examples that seem to move the data from a web page to blob storage and then copy over to azure media services.
Is there a way to upload the file directly to Media Services, instead of having a temporary and permanent blob container(one tied to AMS), as this approach seems to force me to have an additional storage container or is there a way to move the file to blob storage followed by linking the blob file to AMS via IAssetFile?
Can someone provide an end example that demonstrates the flow from web frontend upload to the file ending up in AMS?
Once up there, is there a way to make sure users can view but not download videos?
1.Is there a way to upload the file directly to Media Services:
The Media Services SDK requires you to first create an Asset object in our system. That Asset object is backed by a container in Storage. You can create an empty Asset object, and request a write only SAS URL (We call them "Locators" in our API) to upload your content directly into. You may want to check out this AngularJS module and see if it works. http://ngmodules.org/modules/angular-azure-blob-upload
2.Can someone provide an end example that demonstrates the flow from web frontend upload to the file ending up in AMS?
Your web API/frontend should use the Media Services SDK to create the empty Asset first. Once created, hand create a write only SAS URL and hand that back to your Angular client. The Angular client can then use client side javascript library to upload directly to the blob/container using the SAS URL and a module for azure-blob upload like the one here: http://ngmodules.org/modules/angular-azure-blob-upload
3.Once up there, is there a way to make sure users can view but not download videos?
Once the video is uploaded, you should Delete the Write only SAS "Locator" from your Asset's Locators collection. This way, nobody can use it to write again.
At this point you can create a Streaming Locator. Users will only be able to stream the file through our streaming services. Your file has to be encoded in a format that we can support streaming for, so you may have to first kick off an encoding job to get it into the right format and encoding settings (MP4 files with H264 and AAC audio). If you want to stream from Media Services, you need to make sure you have at least 1 streaming reserved unit enabled on your account. In addition, if you are looking to protect your files, you can take a look at our Content Protection services, which will provide on-the-fly AES 128 or PlayReady DRM encryption to your assets. You can integrate that with JWT tokens and Active Directory to authenticate/auth your users before they are able to decrypt the video on the client side.
I'm not too familiar with Azure Media Services but after looking at this guide http://azure.microsoft.com/en-us/documentation/articles/media-services-rest-get-started/ it appears to me that you can create an asset on Azure Media Services and link it to a blob. This means you'll only have one blob container.
AMS provides Rest API for all media processing capabilities including uploading, encoding, publishing. There is a sample project (postman collection) in GitHub to play around. This sample project is also accompanied by a well-written article. Please find the links below.
https://github.com/Azure-Samples/media-services-v3-rest-postman
https://learn.microsoft.com/en-us/azure/media-services/latest/stream-files-tutorial-with-rest
Hope this will help
I need to extract an image/thumbnail from a video hosted on some website. For exemple, the host could be youtube.com or whatever.com and i want to extract an image for a precise frame, i.e 2:12.
I have the direct URL for the video. I searched and found how to do it for youtube or vimeo, they provide xml or json with a path to the thumbnail. However i can't find how to do it for a web site that doesn't provide those informations.
Ive downloaded FFmpeg, but it doesn't seem to offer to extract an image from a video hosted on some web site.
Any other tool or any idea to make a tool myself ?
Thanks
I'm guessing that you are trying to do this on server side, and as far as I know you then need to transfer the video over to the server and run ffmpeg, as you already suggested.