0

Short version:
I need an in-browser solution to deliver the webcam and mic streams to a server.

Long version:
I'm trying to create a live streaming application. So far I've only managed to figure out this workflow:

  1. Client creates stream (some transcoder is probably required here)
  2. Client sends(publishes?) stream to server (basically hosts an RTMP/other stream that should be accessible by my server)
  3. Server transcodes, transrates, etc. and publishes the stream to a CDN
  4. Viewers watch published stream

Ideally, I'd like a browser-based solution that requires minimal setup from the client's end (a Flash plugin download might be acceptable) and streams the webcam and mic inputs to the server. I'm either unaware of the precise keywords or am looking for the wrong thing, but I can't find an apt solution.

Solutions that involve using ffmpeg or vlc to publish a stream aren't really what I'm looking for, since they require additional download and setup, and aren't restricted to just webcam and mic inputs. WebRTC probably won't serve the same quality but if all else fails, I think it can get the job done, at least for some browsers.

I'm using Ubuntu for development and have just activated a trial license for Wowza streaming server and cloud.

Is ffmpeg/vlc et. al. the only way out? Or is there something that can do the job in a single browser tab?

aergistal
  • 29,947
  • 5
  • 70
  • 92
galactocalypse
  • 1,905
  • 1
  • 14
  • 29

1 Answers1

1

If you go the RTMP way, Adobe Flash Player supports H.264 encoding directly. Since you mentioned Wowza you can find an example and complete source code (including the fla) in the examples directory. There's also a demo here. There are many other open-source Flash capture plugins.

You can also use the aforementioned Flash recorder without Wowza. In this case you'll need a RTMP server, a notable example being the Nginx RTMP module which supports recording (to flv) and also offers callbacks that allow you to launch the transcoding once the recording is done.

With WebRTC you can record (getUserMedia, MediaStreamRecorder) small media chunks and send them to the server where they will get concatenated or using the peer-to-peer communications features of WebRTC (RTCPeerConnection). For a detailed overview see my answer here.

In both cases you'll have issues with devices/browsers that don't support Flash or WebRTC, eg. iPhones, Safari. Plus getUserMedia doesn't capture the same format across all browsers: Firefox audio/video in WebM and Chrome audio in wav and video in WebM.

For mobile devices you'll probably have to write apps.

Community
  • 1
  • 1
aergistal
  • 29,947
  • 5
  • 70
  • 92
  • Thanks for the input. That Flash demo is more or less exactly what I want. Strangely enough, the included examples have the Linux install scripts missing (Windows and Mac scripts are present). I'm using Wowza Streaming Engine 4.2. Any idea how to get around this? Couldn't locate the scripts online. – galactocalypse Sep 30 '15 at 06:15
  • You should have an `install.sh` in the dir. It's there in my kit. Here's its contents: http://pastebin.com/4nZgdEaE – aergistal Sep 30 '15 at 08:16
  • Thanks for that. No idea why I don't have the Linux scripts in my installation. Anyway, I had manually done what the script did but things didn't work. Might have messed up permissions somewhere I'm guessing. So I have this example working. Any idea how this can be streamed instead of recorded client side? I want the stream to be uploaded from a remote computer to the server hosting the wowza media engine. – galactocalypse Sep 30 '15 at 09:23
  • There's a `VideoChat` in the `examples`. http://www.wowza.com/forums/content.php?42-How-to-set-up-live-video-chat – aergistal Sep 30 '15 at 09:30
  • I feel like a fool to have missed that. Thanks for the help and patience! – galactocalypse Sep 30 '15 at 09:35