0

I'm trying to capture a live stream from phone (iOS) and display it in a browser.

I've gotten the capturing working and I can see that about 2 second chunks of mp4 files get created on my server.

And here's where I'm stuck. What do I do from here to create a stream and display in a browser? There's a lot of good info regarding ffmpeg but I don't quite understand the flow. What do I do with these small mp4 files and create a stream? Can I use <video> tag?

I found this: Streaming via RTSP or RTP in HTML5 and rtp://myserver.com/path/to/stream is mentioned in the answer. How do I create such a stream from those mp4 files?

Thanks.

Community
  • 1
  • 1
user
  • 183
  • 1
  • 2
  • 9

1 Answers1

0

i think the simplest solution for you could be using a media server, a good example is wowza streaming engine, with it you can easily ingest a live video with one of the supported encoding technologies (rtmp is a common and easily accessible example) and choose the output format(s) that you prefer, you can then use the appropriate format for playback in your browser or other devices

update: you can also use ffmpeg to capture an input and convert it to HLS, example command

ffmpeg -i INPUT -y -threads 4 -c:a aac -strict -2 -b:a 128000 -ac 2 -s 640x360 -c:v libx264 -b:v 800000 -vprofile baseline -preset medium -x264opts level=31 -hls_time 3 -hls_list_size 10 -hls_wrap 30 -start_number 1 output.m3u8

this will create an HLS stream that you can easily play on a browser

  • Wowza isn't free through, right? There has to be some solution using `ffmpeg concat` and/or `ffserver` from what I think. Apache also has modules for live streaming. Wowww sounds easy, but need a free solution. How does Twitch or other live streaming apps do, for example? What about using flv player? What can be done to flv files to live stream through flv player? Thanks! – user Feb 28 '16 at 19:43
  • i'm updating my answer with an example ffmpeg commands, i hope it helps –  Feb 29 '16 at 06:35
  • thanks, I'll try this out command, and update/accept accordingly. – user Feb 29 '16 at 15:50
  • so that `ffmpeg` command will create that output playlist file, but for live-stream, I have files that keep getting added to the INPUT. If I do have ` – user Mar 02 '16 at 01:10
  • I've been trying this using node.js `fs` `createReadStream`, and providing `start` and `end` options. Header is: `206`, `Content-Range: bytes start-end/total`. With my movie1.mp4, it works great! As the ` – user Mar 02 '16 at 01:15