ASP.NET Video Converter Website How to manage user uploaded videos? - c#

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.

Related

How to make fake video source and make it non-downloadbale in ASP.NET MVC

I'm working on an educational site that will plays online and offline videos.
I will forbid users from downloading the video from browser link and will force them to register in my app and then be able to download videos.
I solved the site visiting issue by creating a FileContentResult action and make this action login-needed.
But it has its own issues as a person will register in my app and enroll to class that contains video and download it then send it to his friends :)
Now I had searched many articles and probably in 90% of them I saw this is impossible.
But I have a sample site that contains videos and we can't download that with browser url.
This site is Aparat
If you open it's videos you will see that src attribute value begins like blob:some address and you can't download it directly from browser with src attributes value.
How should I implement this in ASP.NET MVC?

How to properly upload video files to Azure Media Services from angularjs

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

Accessing OneDrive from Azure Mobile Service

I'm developing a mobile app to share some content between users and I'm facing a weird problem.
Currently, what the app does is to allow the users to download some files from the web and store them on their OneDrive account.
The problem is that I need to download the file from the web first, and then upload it to OneDrive, and this means that I'm wasting double bandwidth for each file (OneDrive does not allow to upload a remote file).
The other required feature is to upload a file from OneDrive to my Azure storage, so, basically, I need my Azure service to work with both upload/download from/to OneDrive.
I can't find anything useful online, but I think I got a solution for the OneDrive-to-Azure scenario:
Get the file ID using the LiveSDK on my phone
Build a download link for the given file
Send the link to the Azure Mobile Service
Download the file in the Azure Storage
I've not tried it yet because I still got no access to Azure (I need to register for the trial), but I'm not sure that this may work, and even if it does I still need to figure out how to make the Azure-to-OneDrive stuff.
Do you guys have any clues?
This thing is really driving me insane :\

Download txt file anonymously from Google drive using C#.Net

I'm making a simple program with C#.Net that provides some clients with links which are continuously updated ,and I need to provide a simple text database for my app.
I need to use Google drive to make it easy to edit the database by some users.
So ,how can I download a text or doc file uploaded to Google drive and shared publicly ?
Use the following Google Drive SDK
https://developers.google.com/drive/examples/dotnet

Extract an image from a video hosted on a web site

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.

Categories

Resources