Sunday, 9 December 2018

Stream looping video until a specific time then switch video

I'm still a bit of a noob when it comes to streaming videos with node. I thought this would be a simple task when it came up but I'm at a loss. I have two video files and I'm reading them in with createReadStream and then I want to loop the first video until a specific time / date and then switch to the other video. I'd like to do this without interrupting the stream if a user is already watching the looping stream. I'm guessing the mp4s need to be encoded in a specific way as well. I have created a simple application that can read in a single mp4 and pipe it out as an mp4 without trouble. Once I try looping the video and using response.write, instead of pipe, it sort of "works" with lots of dropped frames or no video playback at all, just audio. Any help is appreciated.

Submitted December 10, 2018 at 12:26AM by futileboy

No comments:

Post a Comment