fluent-ffmpeg
can not accept two input from PassThroughflag | meaning |
---|---|
-tune zerolatency | —> this will also disable b-frame |
-bf 0 | disable b-frame |
3 Approaches:
#1 MJPEG FROM RAW
==================
rawStream = mjpeg (also preview via mjpeg)
recordingStream = rawStream + mic
[+] mjpeg is easier
[-] Audio sync issue
[-] not possible to play audio on browser
[...] 2 ffmpeg processes, no muxing in browser
Tried out with a separate audio stream, but too bad, `fluent-ffmpeg` do not
accept two PassThrought stream
#2 BROADCAST VIA WEBSOCKET
===========================
rawStream = cam + mic = mpegts
* broadcast via websocket
* using mpegts.js to view in the browser
--> OK when just video, has more delay when involving video
[-] it's not very reliable with muxing in the browser
mjpeg is much easier to deal with
[+] but with this one, it's possible to play audio in the browser when live
[...] 2 ffmpeg process + browser need to mux
rawStream -> pipe -> recoridngStream
#3 RELAYED MJPEG
=================
rawStream = cam + mic = mpegts
rawStram -> pipe -> previewStream (this will be use for preview)
rawStram -> pipe -> recordingStream (just -copy everything)
--> Has some delay in the preview stream
--> 3 ffmpeg processe
#4 RECORD STREAM FROM BROWSER (MediaRecoder)
============================================
[+] browser handling dealing with devices
[+] Only 1 ffmpeg process
[+] No delay at all