ffmpeg.wasm icon indicating copy to clipboard operation
ffmpeg.wasm copied to clipboard

Ingest Live Stream

Open DAConsulting opened this issue 4 years ago • 3 comments

Is your feature request related to a problem? Please describe. I would like to ingest a live stream and output to another endpoint

Describe the solution you'd like For example:

ffmpeg -listen 1 -i rtmp://source-server/stream01 rtmp://destnation-server/streamkey

Describe alternatives you've considered searching for solutions..... all kinds.... too many and too nebulous (right now) to list here....

DAConsulting avatar Sep 15 '21 17:09 DAConsulting

Hi @DAConsulting. We are in the same boat. Here are some points I got from my readings:

  1. Browsers don't support RTMP.
  2. You can't use browser socket with wasm.
  3. Even if you try to use HTTP while live streaming (eg. hls), browser will not allow it.
  4. You need to use your own implementation to ingest stream to server using allowed method by browser such as WebRTC or HTTP.

adibzter avatar Oct 02 '21 08:10 adibzter

Hi, @ADIBzTER 👍

I understand that browsers do not directly support RTMP. But using FFMPEG, I can ingest a stream (or a file) and output to an RTMP url.

So... If ffmpeg wasm is a port of FFMPEG, my hope was that one could do the same.

I beleive you can indeed stream a file to an RTMP end point using ffmpeg wasm. (Need to double check this)... so the only difference would be the ability to ingest a stream to be sent. (i.e., as in UNIX: everything is a "file"... , etc).

The limitation with ffmpeg wasm seems to be that one must load a finished file into FSMEM first. And a source stream is, by definition, infinate.

However... if FSMEM had the ability to accept abd buffer input from a stream... then it should be able to output to a stream url (RTMP or otherwise).

How does one submit an enhancment request? ;-)

This would be a huge asset. It seems that many developers are looking for such a solution.

It is possible to do all of this now using OBS... but it would be a big advantage to do it all from javascript... in the browser... without the need for extrrnal software (such as OBS and FFMPEG)

DAConsulting avatar Oct 16 '21 13:10 DAConsulting

https://stackoverflow.com/questions/8051516/how-to-establish-a-tcp-socket-connection-from-a-web-browser-client-side

Allowing regular socket connections directly from the browser is never going to happen because it opens up a huge risk. WebSockets is about as close to raw sockets from the browser as you are going to get.

davidjytang avatar Jan 05 '22 09:01 davidjytang

@DAConsulting @ADIBzTER Hi, are your problem solved yet? Is there still a demand? I'm working on something which may helps. I'm trying to get more about the use case. Contact me if you need, [email protected]

carsonDB avatar Feb 14 '23 01:02 carsonDB