Man this is pretty cool, thanks Abdi!! Keep it up Since the videoSize is unlikely to change, I would move the call to obtain the statsSync outside the /video endpoint.
@abdicodes4 жыл бұрын
I’m happy you liked it! I’m a fan of your channel 😄 And that makes a lot of sense, thanks for the feedback!
@Epistemer3 жыл бұрын
oh wow, I'm a big fan Hussein ❤
@Iammrunkown3 жыл бұрын
use stat method
@sanatgawade80453 жыл бұрын
But what if this method is fetching the video dynamically.?
@nirajmotiani9 ай бұрын
this feels like a PR comment from senior engineer 😂
@gamingllama74643 жыл бұрын
You know I have no idea who you are but just from that introduction I can already tell you'll have 100K subs within the next year
@hikari16903 жыл бұрын
One month later and he's 10% of the way. He's ahead of schedule xD
@ShahriyarAlam13 жыл бұрын
Looks like this won't happen
@sheesh2363 жыл бұрын
@@ShahriyarAlam1 it will happen
@sheesh2363 жыл бұрын
@@ShahriyarAlam1 he just stopped uploading videos
@paulchaperon22072 жыл бұрын
Bruh
@edwardmacnab3543 жыл бұрын
I don't know why you don't do more videos like this. By just watching stuff like this people learn a lot and what might seem easy and obvious to you is pretty obscure to many of us. Thank you for this nice little presentation , It was very informative. But please, could we have more ?
@TroenderTass3 жыл бұрын
That is because he really don't know what he's doing. he's just copy pasting a tutorial
@midnightcigarettes85643 жыл бұрын
I'm trying to build an audio streaming server instead, and this is helping me get the blocks I need to piece things together. Thanks Abdi!
@karabomahlong93683 жыл бұрын
Im on a mission to build one as well but have no clue to go about it.. Im currently debating whether or not I should set up my own server or piggyback off of something like a Soundcloud. Would you kindly please share your journey so far?
@alejandropoirier6493 Жыл бұрын
Nice video, I'm a front end developer and I was contacted by a streaming company to have a chat, they offered my a position and I have to learn all this stuff as soon as posible :)
@markericfairweather97222 жыл бұрын
This is Netflix's architecture. Love to see this Abdi!
@ArisFilms2 жыл бұрын
Extremely informative and straightforward. Thank you.
@Epistemer3 жыл бұрын
you explained everything so clearly, loved it
@hd3adpool3 жыл бұрын
Great explanation with the pros and cons, and especially the introduction. Keep going brother!
@franktfrisby3 жыл бұрын
very cool and I like the way you walk through the video explaining all of the parts. Thanks
@chadzulu43282 жыл бұрын
Very clear and easy to understand explanation, thanks so much Abdi!
@alexandrumarius50044 жыл бұрын
Thank you man, very well explained, with all the details and very good English!
@shivangchaturvedi2373 жыл бұрын
Man oh man!! Thank you! I will be waiting for more such content from you.
@aghiadalzein30692 жыл бұрын
that was the most clear description,thanks
@joselito77764 жыл бұрын
Thanks, dude, for showing me how to stream video. It also gave me the motivation to pay attention to http headers.
@abdicodes4 жыл бұрын
They are super important! Happy to have helped :)
@arielspalter74253 жыл бұрын
You've earned yourself another subscriber. Awesome tutorial!
@thomasandon2539 Жыл бұрын
Clear and straightforward! Thx.
@elad39582 жыл бұрын
Thank you brother. I will try this out. I look forward to more tutorials
@karnatakastatesyllabusexpl394 жыл бұрын
Thanks for the simple but useful video
@abdicodes4 жыл бұрын
Glad it was helpful!
@dhyey23167 ай бұрын
This was amazing for clearing basics.
@Pikachu-oo5ro4 жыл бұрын
Great Video! Hope to see more content! Young and Talented!
@pavithranrocky3164 жыл бұрын
Keep it up! Good Work Buddy...Very Helpful
@abdicodes4 жыл бұрын
Thanks! 😁
@captainanonymous70904 жыл бұрын
Keep going bro. You’ve got good explanation
@abdicodes4 жыл бұрын
Thanks for the support!
@albertmends3 жыл бұрын
a very cool tutorial.. Thanks mhan
@vaibhavpawar45353 жыл бұрын
Amazing 🔥 content ..... This channel is so underrated
@nadaz73334 жыл бұрын
This is really good! Keep going!
@maskman48214 жыл бұрын
Thank you for this tutorial, it is very cool and practical, we can let everyone access the server to see the video; I have a request, how do we send webcam video stream to server and let everyone views like youtube live stream ? It would be awesome if you can make such a tutorial and I think everyone wants to know how to achieve it !!!
@atalaysezen33912 жыл бұрын
Thank you buddy, you should do more videos like this
@bevedel4 жыл бұрын
Really helpful, Thank you so much. keep going please ...
@candidodmv6 ай бұрын
Congratulations for this simple but very helpful video. I got a question: when you skipt to a specific point of the video, the intermediate chunks are downloaded too or not? Thanks and hello from Brazil!
@kuku55673 жыл бұрын
you've earned a subscriber, thanks dude!
@abdicodes3 жыл бұрын
Awesome, thank you!
@arthurk72703 жыл бұрын
Great tutorial, thanks. How would this work in practice, though? The video blobs will presumably reside on S3/GCS/whatever. When a request for a video comes in, surely the server wouldn't fetch the whole video and keep it in memory, while serving chunks of it? Would it prefetch chunks of the video from blob storage and serve that until the next chunk is required? Or would the server containers somehow connect to a huge local storage area network with all the videos?
@abdicodes3 жыл бұрын
Good question! In practice this method should not be used ;) When I made the video it was kind of an experiment and I didn't know much about best practices.
@softwarelivre23893 жыл бұрын
@@abdicodes Hey man! Do you have a video with those "best practices" available anywhere? O really enjoyed the video and I'd also like to know how should I be implementing these "the correct way". Thanks!!
@softwarelivre23893 жыл бұрын
@@abdicodes Ohh, and I just subscribed! Thanks for the content!!
@persianaz63892 жыл бұрын
@@softwarelivre2389 Take a look at HLS and MPEG-DASH those 2 are the industry standard protocols for video streaming
@softwarelivre23892 жыл бұрын
@@persianaz6389 thanks! I'll take a look. I ended up using WebRTC for some projects and it worked quite well
@ytlagu20105 ай бұрын
You deserve more subscribers buddy!!
@CheezePie Жыл бұрын
You are the best❤ I'll try to implement this in Next.js
@ujwalc92263 жыл бұрын
Awesome tutorial ,thank you soo much ♥️♥️♥️
@karnatakastatesyllabusexpl394 жыл бұрын
It worked perfect Sir!
@jamespatterson19894 жыл бұрын
Hey I really did the clear explanation of both the overview and the line-by-line code. And such a simple code to illustrate the point. From the figure you have at 1:10, the two-way arrows got me wondering: how could we send recorded video from a client to the server in the same kind of bit-by-bit stream? I've build a client-side page that records video that I can then send to a server, but am looking to speed up the process and avoid saving anything client-side. Any ideas? Cheers!
@abdicodes4 жыл бұрын
I think that could work! You’ve got a good idea 😁
@silugr2 жыл бұрын
Your video is really interesting . I have a challenge in this . I am downloading the file from a FTP location and the the received file is in the form of a stream . How to send that stream as chunks without storing the ftp received file in the local system ?
@elieonokoko37823 жыл бұрын
This is great! Exactly what I was looking for. I am curious to know how you would implement view count. Thanks so much!
@L1CBot Жыл бұрын
exactly what am I searching... 👍🏿👍🏿👍🏿
@madbadseagulls13 жыл бұрын
Amazing tutorial, Thank you
@paragbhide1695 Жыл бұрын
awesome. have subscribed.. looking forward for more videos to learn!!!
@mohamedyoussef88352 жыл бұрын
Super Awesome explanation & topic ++++++++++++++++++++++ Thank You
@io-er1ex4 жыл бұрын
Thanks this was very helpful. Keep it up
@abdicodes4 жыл бұрын
Glad it helped! 😁
@bodolawale54483 жыл бұрын
Loved it. Thanks.. I will build upon this
@danielrocha57744 жыл бұрын
I don't know if you tested with a longer video. But in my case after 7 minutes playing. Audio starts loosing synchronization with the video
@abdicodes3 жыл бұрын
Interesting... I'll look into this
@danielrocha57743 жыл бұрын
@@abdicodes in my case I have videos downloaded from the internet some of them are 23fps and those loose sync when streaming. But the other videos at 30fps are fine
@DJFunkyNutti2 ай бұрын
thank you. one question, how did you do the cached refresh? you had a menu under refresh button. thanks
@andrewndotela74073 жыл бұрын
Hey man, this is really helpful. Thanks
@kj2w Жыл бұрын
Great video! It helped me grasp an upcoming feature we are implementing. Question, what tests would be applicable to write for this?
@sungjun947 ай бұрын
Hi, can you deep dive into how pipe works and how req.headers.range is generated with new values?
@FPChris3 жыл бұрын
Cool but why was the video's name not include in the src = at 3:07? Usually that's where you'd put it.
@abdicodes3 жыл бұрын
There's no video name because /video is pointing to the nodejs server that gives the same video every time.
@dhanushkamadushan19893 жыл бұрын
Really good explanation. keep it up.
@sniviobraganca98992 жыл бұрын
can you make a tutorial on the latter to save the video stream on front-end
@pcmguru60113 жыл бұрын
Can you please make a video which can demonstrate how to handle the pre-existing video data in frontend. As you suggested in the last part of the video. Please reply.
@karabomahlong93683 жыл бұрын
Hi there, thanks for the video! Im trying to build an audio streaming site but have no clue how to go about it.. Im currently debating whether or not I should set up my own server or piggyback off of something like a Soundcloud as an example. Would you kindly please share any tips for this kind of approach?
@sem_dev3 жыл бұрын
Love you for this video!!! Instant sub
@ignitedroads3 жыл бұрын
got a lot of info here, thanks
@mohammadhosienartaneh Жыл бұрын
please explain about hls and how can i use that in node js
@thomasminoungou37794 жыл бұрын
What a great tutorial!!! Just one question, who do I apply this but with a video store in the cloud? If you have any resource I will really appreciate it!
@abdicodes4 жыл бұрын
I don’t think this method can work with the cloud :/
@JenilCalcuttawala3 жыл бұрын
Great tutorial Abdi. It would be helpful if you can also highlight how do we elevate this concept to streaming cloud storage contents i.e google cloud storage, aws s3.
@bhattakshay78167 ай бұрын
Are you using RTSP protocol for this?
@juanoude3 жыл бұрын
Nice video man. Thanks a lot.
@konandev42783 жыл бұрын
thats great bro, thank for video.
@danielstella24252 жыл бұрын
very useful, is it possibile to do with any mid-level language? such as Java, C#?
@ejazahmedj21032 жыл бұрын
this is nice but how do i have to implement with multiple videos and getting the video URL by giving id?
@saramshshrestha76412 жыл бұрын
Love you man, you're great.
@varunrajkumar27644 жыл бұрын
Thanks, this really helped.
@abdicodes4 жыл бұрын
Glad it helped!
@nicetomeetugaming70242 жыл бұрын
Thanks for this video!
@CodeProps3 жыл бұрын
That was really helpful, thanks
@bakamarimo75283 жыл бұрын
Great content man Subscribing hoping for more awesome content
@ofiresaban45102 жыл бұрын
Thanks! very useful
@thanasisathanasi49652 жыл бұрын
Is it possible to start streaming from the middle of the file and skip the beginning?
@RupamBumba2 жыл бұрын
great video, make some more in details videos like that
@RivenbladeS3 жыл бұрын
@AbdisalanCodes Please do a tutorial about caching when user rewinds back the already streamed part of video.
@harshavardhannakkina18434 жыл бұрын
great content thank you so much
@bonbonpony3 жыл бұрын
01:04 So the player is sending those Range requests on its own? We don't have to do anything fancy, it's built in? 10:17 Saving WHERE? And what about those videos that have src="blob:here_some_weird_url_with_numerical_id" ?
@bonbonpony3 жыл бұрын
@Rajat What makes you think so?
@abdicodes3 жыл бұрын
Correct, the built-in HTML video player sends the requests for the video and provides the range headers! The saving part was just an idea for how you could possibly preserve the buffer, it's probably a bad idea to save it in local storage now that I think about it. I've had better success giving a range of the entire video in the response. This makes sense because the video player requests "0-" range which means, give me everything from the start to the end.
@abdicodes3 жыл бұрын
For videos with a blob source, you can't stream it from the server because the video is already on the client. It's a trade-off of making the user load the entire video when they come to the page, in exchange for a seamless watching experience.
@abdicodes3 жыл бұрын
@Rajat I try to get to all the comments but I miss a few sometimes :/ I'll check out your question
@bonbonpony3 жыл бұрын
@@abdicodes Hmm, how about streaming the 1MB chunks with XHR and swapping them in the player as blobs? Would that work? Still, I don't see how could I possibly save the chunks locally if the player sends those range requests itself (that is, I don't have any control over the headers it sends to the server nor the server's responses). But if I could use the blob chunks, then I think this might be possible, because those blobs could be stored locally and swapped in the player if needed without making any remote requests.
@diegomartin63325 ай бұрын
Its incredible! Its possible to do the backend in python?
@TechPuzzle_Haven3 жыл бұрын
Please make a video on mux with Nodejs for live video streaming.
@samplerun46863 жыл бұрын
i really like your concept, i have a question if you can answer. how do i switch between audio track if video file have multiple audio tracks? i couldnt find this solution where i can change my audio track in video controller. thank you
@danemiller48523 жыл бұрын
How would one set up a code to get OBS to communicate with your node?
@sivach86674 жыл бұрын
Hmm... How's this working? I don't see that we're sending any "range" in our request. When I tried to implement it, it went to the "if(!range)" in index.js and got that "Requires Range Header".
@abdicodes4 жыл бұрын
The range request comes from putting the endpoint into the HTML5 video player! We don’t make the requests, the video player does :)
@JohnWeland3 жыл бұрын
I would love to see the server-side of this... what Imean is an endpoint you could point something like OBS to and live stream so stream -> server -> client
@hypocritical73793 жыл бұрын
this is the server-side
@JohnWeland3 жыл бұрын
@@hypocritical7379, right but in this example, the server is only set up to stream existing files. How does the server handle receiving an encoded stream and sending it out to connected clients. In a situation like that, you don't have the file to reference but an open file stream (would be my guess)
@hypocritical73793 жыл бұрын
@@JohnWeland depends, you would save chunks of incoming video, so, you could have it setup so that when you get a new video chunk you send the previous one (might save 20 sec fragments in a encryption setup like base64 for video) (there are other ways of doing this like having a array and when the array gets more than 20 base64 images it sends the images full of images out, then clears the array and starts loading it with images again) edit: I did make a live streaming service like this
@denismbabazi80942 жыл бұрын
is it possible to have one using the dash streaming protocol
@djamaatul Жыл бұрын
hi, give me reason why videoSize - 1 and end - start + 1?
@voalcalisticTanmay4 жыл бұрын
thanks a lot for the video ...
@1manbeats8692 жыл бұрын
Very cool video, i like your code style and explanations. Just one thing, i believe this is not good to use statSync (or any sync IO function) inside a request handler, cause this would block the JS runtime event loop.
@ominezx94 жыл бұрын
its lit💥, thanks bruv.
@abdicodes4 жыл бұрын
Thank you! 🙏🏾
@Ason_Project3 жыл бұрын
Can I contact u for a small job...
@coffeecuppepsi2 жыл бұрын
this is awesome thank you
@semariaissac91194 жыл бұрын
Thanks Abdi! Its a great info, do you have any idea how to stream kinesis video stream in node js within Amazon console?
@abdicodes4 жыл бұрын
I haven’t tried that but could be a cool video idea!
@justfun591 Жыл бұрын
what if I want to server videos from S3 bucket using that technique?
@ziranshuzhang68312 жыл бұрын
is this something similar KZbin does or KZbin is somehow fundamentally different?
@vishaljoshi64064 жыл бұрын
really good! appreciate it
@adithyapaib3 жыл бұрын
can you make a like time video streamer like a tv video which doesn't allow you to go forward or backward but steam at the same time for all people ?
@miniburger93233 жыл бұрын
thanks for the video! may i ask, why it Cannot GET /bigbuck.mp4 when i implement it on hosting (heroku)
@karmadipdodiya4421Ай бұрын
I am receiving a video stream over a TCP socket. How can I stream that video in a browser? I don't know the length, i just need to transfer the data.
@ulrichnwembe95793 жыл бұрын
Great video i liked it i would know if you get a document which explain the Video progress bar When you leave a video without finishing it, a red bar under the video thumbnail shows you where you left off. When you play the video again, it will restart from where you were. I really need help to associate it a video streaming.Thanks
@artificallead4993 жыл бұрын
would this mean that someone who steal the code from inspect element couldnt watch the full video if you had a membership site
@jairam21004 жыл бұрын
Really nice one.learned lot.Is it possible to do the same but from mongodb?
@abdicodes4 жыл бұрын
Thanks 😊 I think so! I’ve never tried mongodb with big files but I think there’s support for it using GridFS
@abdicodes4 жыл бұрын
I made the video! Hope its as helpful as this one!
@jairam21004 жыл бұрын
@@abdicodes Thanks a lot :)
@flyancesystems83283 жыл бұрын
Hi, I created an Android video streaming application but the videos take too long to load and play, what could be the problem?