Video Streaming from an object storage - javascript

As the title depicts I am trying to stream a video from an object storage i.e minIO.
Use case : I am working on social media application for a feature called "reels" aka short videos and storing the saved videos to minio.
Problem : While scrolling through the already posted videos I am finding a buffer lag between the videos as we are accessing the videos using the url generated by the minio server.
My approach : I have planned to introduce a streaming server which can stream videos from the object storage as mentioned above which can solve the buffering issue.
I have gone through the following open source servers,
nginx rtmp
apache flink
While going through the above I am unable to find proper documentation where it fetches a video from object storage and streams it to the application.
Help?
I would like to know the following,
if the above approach is right and if its right how do I configure these servers to fetch from minio.
if this isn't right would be helpful if you could assist me with another approach.

Related

How Video streaming is implemented in popular online education websites

I need to build a web based video player. Something like coursera/udemy. I would like to know the following.
Where we can store videos (Blob,Db..etc)?
Say I uploaded video in Blob storage. How can I make sure nobody is able to download this videos?
What should be an ideal video streaming architecture(BE+FE) if I am expecting 500 concurrent users?
Do I really need to build a video streaming Back End or I can simply use services like vimeo to get this done?
I inspected how Udemy is doing, i could find the following. It looks like they are using some blob to store videos. But when I tried to access this directly it says I cannot. How this works?
There can be no way to protect your video from a determined sophisticated hacker. In the very worst case, they can record the video from their screen using a iPhone.
You can learn more about blob: URL e.g. here. The bottom line: it's a browser-side object, it's not to store videos.
You definitely can use streaming services, but this will even further reduce your control. OTOH, it's not worth your effort to develop some new streaming architecture if you only expect 500 concurrent streams.

Locally store vimeo videos on my phone (Phonegap Build APP)

I have a problem with a mobile app that I'm developing in HTML, CSS and Javascript to compile with Phonegap.
What happens is that so far the videos have been playing from an iframe on Vimeo, but now it is necessary that they can be stored locally on the phone for offline playback.
Does anyone have an idea of ​​how could I do that? I do not know if with any API or with the native android player could be done.
Thank you very much for any help.
The following two conditions must be met to gain access to the .mp4 video files.
You uploaded the videos (so you own them)
You are a PRO Vimeo user.
I haven't worked with Phonegap before but I have some perspective on Android. The easiest way to get the URL via Android code is through the the Vimeo API. There is a Java library for interacting with the Vimeo API here which will allow you to request Video objects for the videos you own (probably by hitting the /me endpoint).
This section of the README.md should be helpful in understanding how to get access to fields on the Video object (but you should read the whole thing to get it set up).
Once you have a Video object, you can access the download field which is an array of VideoFiles which will contain a link to an .mp4 file that you can pass to any file downloader. The code would look something like below:
Video myVideo = ...// Some video retrieved from the API
if(mVideo == null || mVideo.download == null || mVideo.download.isEmpty()) {
// Throw an error
}
VideoFile videoFileToDownload = mVideo.get(0);
// The url to the mp4 file
String videoFileUrl = videoFileToDownload.mLink;
download(videoFileUrl); // You'll need to make a method to download
The two holes are 1) how to get a video and 2) how to download a file. The first question can be answered by the vimeo-networking-java library's README. The second question should be easy enough to find a solution on Google (downloading a file given a link to an .mp4 file).

Web Audio API and Audio Download and Protection

I'm reading a book about Web Audio API.
In the book it states that to play and load a sound using the WEB AUDIO API, there are 4 steps that needs to be taken:
1.) Load the sound file with XHR and decode it. (Will end up with a 'buffer')
2.) Connect the buffer to audio effects nodes.
3.) To hear the sound, connect the last node in the effects chain to the destination.
4.) Start the sound.
My question is...given these 4 steps, is there a way for the user of the website that uses the Web Audio to download the audio/audios played on the website???
If so, how does one prevent this.
or does it being 'buffered' prevent it from being illegally downloaded?
I would like to find a way to protect the audio files I use inside my game/app that I put up on the webpage that are played with the Web Audio API.....
Thank you....
EASILY save it, no. But 1) if it's being transferred as an MP3, etc file the user can go into their network cache and copy it; there's no inherent DRM or anything. 2) Even if the sound was being generated completely from scratch (e.g. mathematically) the user could use a virtual audio device like Soundflower to save the output.
So no, it's not really possible to prevent the user from saving audio files.

JW Player 6 working on local server but not on live server

I'm using jw player to stream live rtmp streams off edgecast. The system works fine on my local server (wamp) but when I take the exact same code and put it on the (lamp) live server the rtmp streams don't work. Jw's controls don't come up but it throws no errors and chrome is showing all the files are loading fine.
The live server is just a git pull of what ever has been pushed from the test server so they should be identical code.
I'm really confused by this since it's all client side code in regards to the actual playing of the video... why is it acting differently on one domain and not the other? I've tried it with and without the jw license code and it makes no difference.
Figured this one out, after hours of banging my head against a wall; it turns out GIT is not super awesome for saving binary data such as SWF (which jwplayer uses for flash video display for rtmp streams!)
Answer: GIT was corrupting the jwplayer.flash.swf
Solution: Add .swf to git ignore list and don't store binary data in the repo! or add .swf binary to your.gitattributes

Recording audio to internet - SoundCloud API?

So I need to allow clients to record audio to the internet. Best solution I've found so far which keeps them on our site is the Soundcloud API and I just give them our account details and they use a version of the Soundcloud recorder (Flash/Javascript) hacked together for out site.
Main issue is, these recordings are long. Maybe up to an hour. Because Soundcloud API records in the browser then uploads the audio and transcodes on its server there's a lot to go wrong in the upload process which takes a long time with a big file. It's ok if we just record the audio in say 20 min chunks but it's just not that reliable.
We tried to build our own using wami-recorder, but that meant transcoding from wav to MP3 in the browser before upload to make the file smaller, but taking more time on the client machine - at least Soundcloud does the transcoding server-side.
Given the size of the files should I be looking at a server side recorder/streaming solution based on red5 or something, or is a client side recorder with upload a better proposal?
thanks a lot!

Categories

Resources