apivideo / browserLiveStream

Use webcam, browser and Node to stream live video. From api.video (https://api.video)
http://livestream.a.video/
MIT License
193 stars 48 forks source link

Is it possible to output webrtc as an mp4 file instead of rtmp / flv? #10

Open Madriix opened 2 years ago

Madriix commented 2 years ago

Hi

I got to know "BrowerLiveStream" via this page https://stackoverflow.com/questions/67508284/webrtc-video-track-to-ffmpeg-in-node

Is it possible to replace the RTMP system with a simple mp4 video?

Salutations

dougsillars commented 2 years ago

yes you can.. The code for that is actually in a different repository: https://github.com/apivideo/recordavideo

The function is commented out - its called "download" and it will save a webm. It saves a webm because all webRTC videos are webm. You'll have to transmux it to mp4.

Madriix commented 2 years ago

Ah yes this system is like a recording then an upload. The thing I would like to have is to turn on my webcam from the web page and ffmpeg it records in real time on the server side with ffmpeg and it records the file.mp4 or file.webm without doing any upload on the client side which slow

It's doable ?

dougsillars commented 2 years ago

In the code for record.a.video:

  1. camera is client side
  2. recording is done client side in the browser with JS
  3. recording is "downloaded" from the browser to to local computer.

None of the video EVER hits the server, and no FFMPEG is required. note 3- is commented out in the Github repo. Instead the video is uploaded to api.video where it is transcoded into a mp4 and a stream.