Closed SalvatoreAD closed 7 years ago
While it would probably be possible to implement support for concatenating binary data in the browser (though this may already be supported through the shims used by Browserify and Webpack, I don't know), there are some caveats:
combined-stream2
works is that it will read streams sequentially and re-emit their data in order... meaning that for it to be useful, you'd need streams that a) aren't stored completely in memory, b) are stored persistently somewhere (eg. on disk) so that they can be read at different times. I'm not sure this is the case for audio/video streams.If you can provide a simplified example of what you're trying to implement, I'll have a look and see whether combined-stream2
makes sense there.
The idea is: I have a video of max 5 persons conference, register the conference and I upload the file every 60 seconds. The files are obtained through blob MediaStreamRecorder library.
Right. So MediaStreamRecorder, according to their docs...
MediaStreamRecorder can record both audio and video in single WebM file on Firefox.
MediaStreamRecorder can record audio as WAV and video as either WebM or animated gif on Chrome.
All of these formats have a file header, and so concatenating them together as bytes (like combined-stream2
does) would not work. Rather, you'd want to store the individual 'segments' directly on the server, and then use something like ffmpeg
to piece it back together into a single audio/video file afterwards.
Unfortunately, in this case, combined-stream2
(or any other generic stream-combining library) definitely won't help you. You'll have to use a format-aware video processor like ffmpeg
for this. I also recommend against doing this in the client-side, since it'd likely consume an unreasonable amount of resources, especially on mobile devices.
OK, thanks.
Can I use this plugin with blob audio / video recorded by the browser? I have to concatenate multiple streams to create a single video file
Thanks