Hosting Audio Files - audio

I'm considering building a website that helps musicians collaborate remotely. To do this, they would need to share large (uncompressed) audio files.
For the solution I'm considering, I'd like to be able to perform the following functions:
upload/download uncompressed audio files
stream uploaded audio
My concern is the large bandwidth demand. Should I perform these actions on my own (hosted) server space, or is there a service with APIs I can use?
I've checked out Amazon's S3 which allows me to host files, however I can't find anything that suggests I can stream from their services. I'm not sure that S3 is right for what I'm trying to achieve.
Can someone provide some high-level architectural advice?
Thanks in advance.

What Paul mentioned in his comments is true... S3 is not designed to be a CDN.
However, if your audio files aren't intended to be used by over a thousand people at a time, you don't actually need a CDN. You can put them on S3 and stream directly from there (over HTTP) without difficulty. It sounds like you're going to have a bunch of tracks that will only be accessed by a handful of people. S3 is fine for this.
When it comes to publishing finished work that might be used by many, that would be a good time to use Cloudfront.

Related

Is saving uploaded filles in folder in the server a Good practice?

Hey guys I'm begginer and asking if i could save uploaded files in a folder in the server and then save a path in the database
Note that I'm building a short video sharing app
Here's what I can tell you from my personal experience + research.
You should definitely put videos in a server and store the URL in the DB.
Make sure you use a Compression Library inside your app to compress videos before uploading! Think of what's app and messenger, they compress before uploading.
When Retrieving Said videos, store them in the App Cache and try to clear the cache when the video is out of scope or not in use. An App like this requires multithreading for optimal performance. I know that there is a lot to take in but try to experiment, and you'll understand why these concepts are important.
For images, it may vary. I'm mentioning pictures because you may have thumbnails, etc. If they are small images and you're able to compress them you can store them as a Blob in your SQL DB however most people wouldn't recommend it.

Storing video that can be played from the middle

I am using Azure Blob Storage to store a video. I would like a user to be able to scroll the video to any point in time and play it from there.
For short videos, there is no problem because the whole video loads and you can do that, but for larger videos, it does not seem to work out of the box. And in some sense it makes sense - files by default do not have the functionality to be downloadable from the middle. But all decent video streaming websites offer this functionality. I must be missing some video concepts, would appreciate, if someone linked me to some articles explaining how things like this are done. Bonus points if the solution is using Microsoft Azure.
Large video example (28 secs, 126MB):
https://www.w3schools.com/code/tryit.asp?filename=GP328W3SEY77
Small video example (10 secs, 1MB):
https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_video
Video streaming servers or cloud services are usually dedicated specialised servers and their functionality can be quite complex.
A video 'file' typically consists of one or more video and audio tracks in a 'container' like MP4. The container will have header information and pointers to the track info.
Simple HTTP streaming of an mp4 file is possible if your server supports range requests, i.e. downloading parts of the file at a time, and if the header information is at the start of the video file - in mp4 is it usually at the end by default but can be moved to the start.
More sophisticated streaming servers, including most/all of the popular commercial services, use a dedicated streaming protocol, typically ABR HLS or DASH these days. These provide chunked multiple different bit rate versions of the video and allow the client switch between bit rates for each chunk it downloads - see more info here: https://stackoverflow.com/a/42365034/334402
The thumbnails you see when you scroll along a video timeline are actually usually a separate track in the video file or stream. They are a set of images at timepoints and the entire set of thumbnails can be downloaded quickly at the start of playback to give a view of what a particular part of the video will look like if the user wants to jump to it. When the user actually jumps to that section of the video, the client requests from the server the chunks or section of the file corresponding to that thumbnail.
Azure CDN actually provides some nice functionality:
video starts to play instantly (browser doesn't need to wait for the video to fully load)
you can scroll back/forward in time.
(Obviously, this in addition to the standard CDN functionality of multiple PoP, caching, etc.)
The above CDN setup was tested on Standard Microsoft, but Verizon and Akamai seem to be offering similar functionality.

Do I need azure media services for streaming a video to html5

I am currently planing the total cost of hosting my videos on azure. After studying the pricing I noted that the costs for storing the data is actually much lower than the price for converting them. Unfortunately I will have many videos, but they won't be watched a lot. Therefore the relative cost for converting them to different formats is too high for me.
Now my question, do I actually need to convert the videos to different formats or wouldn't it be possible to send the video directly from the storage to the browser?
To send video's from storage to browser you can use SAS urls as Zain mentioned. You need to ask yourself what devices,bitrates your solution is targeting: which browsers, web only or web + mobile.
Probably you want your users be able to start watching video before it has been fully downloaded on client(progressive download). Make sure that you encoded it into desired bitrate and moov atom in the video is placed at the beginning of file -https://support.jwplayer.com/customer/portal/questions/12945932-mp4-file-progressive-play.
Based on your original video format and answers to above questions you might need to re-encode your videos and upload re-encoded version to server.
Yes, it's possible to send them directly from storage to the browser, just like it's possible to send any file that you make publicly accessible.
If you're going to store your videos in blob storage, just make sure you either mark the container as public or you generate SAS urls for each video that make them publicly accessible.

Securing PDF and embedded video

My company delivers programming instructions for products we sell in both streaming video (hosted on CloudFront) and pdfs (hosted on Amazon S3). We don't want for our customers to be able to take the content out of these PDFs, save the PDF, or be able to share the link. At the same time, we don't want for people to be able to streal the video (we're less concerned with the videos).
I've been racking my brain trying to figure out the best options on securing this. What are the limitations with PDF security, at the end of the day, can you stop them? Or at least make it really hard?
Unless you create and deliver your data in custom format, your own viewer with built-in content protection mechanisms, you are out of luck. Everything you deliver to the client can be captured, copied and distributed. With PDFs and video streams this is trivial.
If you can suffer the PDF generation overhead, you could individualize the PDFs by putting the customer's name on each page. Turn off editing as well, and that'll discourage people. It'll still be quite possible to get around these, of course.

How would you display Video on the web?

Sorry if the question is confused, as I'm confused myself. I'm working around these requirements:
I'm building a public website where I need to display video.
I need to control what the player looks like
I'm the sole publisher of the video, meaning it can't be on YouTube for example
I need as much protection as possible in terms of protecting the content from being downloaded
So, I've read around StackOverflow and the web, and found lots of suggestions, like numerous flash players, Streaming servers, DRM protocols, services like Panda etc etc.
The problem is I don't understand how everything fits together.
For example, what makes my video content secure?
Is it the player on the client? is it the server that hosts the content? is it the streaming process? who hosts the streaming servers and what difference does this make?
Bearing in mind this is otherwise a very simple site, and is not a business venture.
if you were working around my requirements, what would you do? Could you explain step by step at a high level?
EDIT:
Just based on a couple of answers, I'm not saying no one can ever download my content. And I realize this kind of thing is expensive.
I'm just asking, if you had my requirements, what would you do? And could you explain it to me so i understand?
thanks again
Edit:
Thanks again for all the feedback, I can't vote anyone up as I'm a new user, but your answers have been very helpful.
The one thing I will say, is that my only request was to attempt security, that is 'make it difficult' for most users...that is common in software security.
Some of the suggestions have been just to not even try.
My question was really based around the fact that I know nothing about video deployment on the web, apart form the basic embedded swf flv combo.
Anyway, your info has been very useful though. I'll try a simple "real" streaming service (as opposed to HTTP streaming).
Any other recommendations would be awesome
cheers
"For example, what makes my video content secure? " Nothing.
"Is it the player on the client?" Neither. Anyone can write a client and retain the video content. Remember this. Anyone can write a client. This client can absorb and save your video. Nothing can stop this. Nothing.
"is it the server that hosts the content?" No. Server is only one piece of security. You have to secure the protocol. And the client. And anyone can write a client and retain the video content.
"is it the streaming process?" No. Protocol is only one piece of security. You have to secure the server, the protocol and the client. And anyone can write a client and retain the video content.
"who hosts the streaming servers and what difference does this make?" You host the streaming video servers. Otherwise, you might as well use YouTube.
Edit
"The problem is I don't understand how everything fits together."
"For example, what makes my video content secure?"
These are unrelated. You keep mentioning security, AND not knowing how "everything" fits together.
Here's a suggestion: stop mentioning security -- edit your question to eliminate all references to security and see if you get more useful answers.
Many companies sell streaming media servers. You put HTML in your page that references the streaming media site.
Example. Apple sells Quicktime media server. Read http://developer.apple.com/documentation/QuickTime/Conceptual/QTScripting_HTML/QTScripting_HTML_Document/chapter_1000_section_1.html for lots of information on how to present video from quicktime.
Before you go too far worrying about setting up these secure streaming protocol client server whatevers, make sure you weigh up the cost of your time getting this going, versus the cost of someone downloading your video.
Just to be clear: if your server is sending to a client, then they can copy (download) it. There's no way around it.
Response to your comment:
What I'd probably try doing if you wanted to try to avoid users downloading the files is this (I'll assume you're using FLV files, since they're the de facto standard on the web these days):
Put the FLV files in a non web-accessible directory.
Have a player.swf file request the file via a script on your site, eg: video.php?file=myVideo.flv
The video.php can then perform whatever security checks you'd like: for example, require logins, check the referrer, etc.
If the security checks are ok, then pass through the appropriate video file. If not, then perhaps have a short back-up video which is an ad for your site or something, saying "to watch this video, please come to mysite.com!"
Mostly video streaming sites like Hulu achieve a kind of poor-man's security by using RTMP to transfer the video data. You would need special server software to serve video via RTMP, for example Adobe Flash Media Server or WebORB.
RTMP is a proprietary protocol, so this is a case of security through obscurity; it's non-trivial to download a copy of the video (you can't just grab the file from a URL), but there are programs out there that are capable intercepting the stream and keeping a copy.
2.I need to control what the player looks like
Download and customise a free player like OSFLV.
4.I need as much protection as possible in terms of protecting the content from being downloaded
Forget it.
DRM for FLV exists, but you'll have to pay Adobe a load of money for Flash Media Server and Flash Media Rights Management Server, you'll lose client compatibility and ease of deployment, and in the end it's still breakable. Big old waste of time.
Accept that some people will download your videos, and put a big watermark on them so at least when they do you're getting free advertising.

Resources