Stream live webcam AV feed to wowza using FFMPEG - php

I have been trying to find out how to live stream my webcam feed to my wowza server. I am trying to make a web application in php that lets users stream live video through their webcam.
I am confused, if i need to install FFMPEG in every user's computer that uses my application or just installing it in my web server will do??
Thank you in advance. A little help would be much appreciated.

The user's webcam stream is on the client-side and the problem is getting that stream from each client to your server so having FFmpeg on the server won't help you a lot.
This is achieved by using some form of browser plugin, like Flash or Silverlight and hopefully in a near future using directly HTML5 / WebRTC.
For Wowza you can use the FlashRTMPPlayer . Here's the documentation showing how to record a webcam feed and how to setup a live video chat application which is probably a good starting point for your live streaming application.
There are some other libraries that can do the same. Search for webcam Flash RTMP capture.

Related

Video streaming/recording solution ( Wowza Streaming Engine + Flash Media Live Encoder)

I am working on a php based web application where I need the end user to be able to record video response through the application using his webcam and then that video gets stored to my server. I have been looking into Wowza streaming Engine for sometime now and have been able to figure out that I need a streaming engine and an encoder to successfully stream a video . Using Adobe Flash media live encoder (thanks to my mate jolumg) I was able to stream live video on my locally installed Wowza streaming engine, which is cool if I want to broadcast live video, however I cannot expect my enduser to install the encoder on his device. If I am not mistaken, the end user will have access to some kind of recorder through my application. So I need to know few things:
How do I create such recorder which can capture the video using user's webcam?
Which programming language do I need to create the recorder?
Assuming the Adobe Flash media live encoder(FMLE) is installed on my server, what configuration changes do I need to make so that the recorder can send the video to FMLE which is connected to my Wowza streaming engine and can thus publish the stream.
After the incoming stream is published, how do I programmatically record it(rather than using the record button on the wowza engine manager)? Do I create an api? if yes in what language?
Finally in terms of storage, would a standard AWS instance would do or do I need something with larger space?
Any ideas?
Pardon me if I am lacking in my understanding of the entire video streaming/recording platform. I am a reletively young programmer and this is totally new for me. Thanks is advance.
I think that what you are looking for is not exactly called recorder. If what you want is live streaming you will need an encoder module. Same function than FMLE.
If you can not ask user to install FMLE you need same function embeded in the webpage.
and 2.- Usually this has been done with a flash plugin. There are samples in internet of that module. But this will not work in mobiles and with Flash being phased out soon it will not work in desktop browsers either.
If you target is mobile, check Wowza GoCoder, you have an SDK to create native applications and you also have a simple application that is ready to use (but user need to install it)
Since recently we have WebRTC technologies to use the webcam in the browser. (Wihtout depending of external plugins, or applications) Wowza already support an webRTC input. This seems to be the way for the future, but this is quite new and only will work in the latest browsers but it should work in desktop and in mobiles.
WebRTC samples:
https://webrtc.github.io/samples/
3- You do not need the FMLE in this scenario. End users is doing the encoding.
4- In Wowza configure you can set that all the streams in an application being recorded automatically. You can also have an http API to start/stop the recording at any moment, if you want fine control.
5- It will depend of your usage. This is is sometging you need evaluate,
Jolumag explained well.
FMLE, Wirecast, OBS are desktop based encoder. If you are looking for recording option from browser then its Flash component that support RTMP protocol.
You can set this rtmp://wowzaip:1935/wowzapp/streamname in your flash publisher component.
Flash is now being called "dead" so you can go for WebRTC if you want this recording support in mobile as well.
Chrome stopped support for Flash as primary technology for webcam access... your users will have to enable flash plugin in chrome.

live streaming using red5

I installed red5 server on my Ubuntu 12.04 server. It is up and running.
I am trying to do live streaming. I set up rtmp protocol as well. Port 1935 is listening for red5.
I installed midiDemo app and I started my flash media encoder to start streaming. When I go to demo apps publisher.html I can see my streaming which means that rtmp is working.
I tried couple of players on my site to stream and they work just when flash media encoder is streaming. How can I stream on my site without flash media encoder? Also I want, when user comes to site to have option to start and stop streaming. My web site is php.
You can use the publisher app to "publish", similar to using FMLE. One difference is that the only audio and video codecs available in that demo app are Sorenson video and NellyMoser audio.
One option would be to use the html test bed where you can setup streaming and view the results by running one of several demos provided. Download the html5 sdk. The link below will show you how:
https://www.red5pro.com/docs/server/
Download the Red5 Pro WebRTC SDK to use the sample streaming apps. Download here:
https://www.red5pro.com/docs/client/webrtc/

How can I stream live webcam video using Adobe flex without using Flash server or Red5?

My hosting service doesn't allow Flash server or Red5 to be used on the shared hosting account, only with a VPS account. This is something, I do not want to pay for. I have managed to create a MXML application and successfully compile it into a .SWF file that will grab the user's live cam. Now the problem I'm having is displaying that webcam to other users. So I'm assuming I need some sort of server to send that video to, so that I can connect to it, and then display the stream. Now my question is, is there a work around in which I don't need another server, such as Red5 or Flash server? Why can I not handle the live webcam myself and display the live stream using ActionScript3.0?
Go for Adobe Cirrus as Reboog711 mentioned. Its a peer-2-peer protocol.
Well to answer your questions..
is there a work around in which I don't need another server, such as
Red5 or Flash server?
Yes, you don't need any servers involved here. Just connect to the service and get a token id. Exchange that token id with your remote end user and do the vice-versa, such that both of you can able to see yourselves.
Why can I not handle the live webcam myself and display the live
stream using ActionScript3.0?
Who said you can't ;) ? You can very well control the settings including the webcam video size, aspect ratio, quality, bandwidth , etc everything using your actionscript 3.0.

Record video from webcam with jquery/flash directly in browser?

I want to let users record video via webcam and then upload the recorded video to the site all through the browser.
Here is an example that works exactly how I want my site to work except it does not seem to capture video, just images.
http://www.xarg.org/project/jquery-webcam-plugin/
Please let me know if there is a way I can customize this or if there is something else out there that I can use.
I want something standalone and don't want to rely on another service to accomplish this.
Thanks!
We've been looking for the same thing, but from my research, it appears there's no way to do it strictly through jquery and Flash without some back end help.
What I've found is three options:
Adobe Flash Media Server
Wowza Media Server
Red5 Media Server
There's advantages and disadvantages to all three. Flash and Wowza are not free, but have great documentation and support. Red5 is free, but the documentation can be lacking depending on what you're doing.
We just signed up for a free 180-day Developer license for Wowza and are currently evaluating that.
HaxeVideo is an multithread FLV streaming server entirely written using the Haxe programming language.
And this link for information Haxe programming language.
But I found an easy way out for me. I have 2 options for you.
youtube api (Free) https://developers.google.com/youtube/youtube_upload_widget
http://nimbb.com/ (Not Free)
But if you want to try.
Check out http://hdfvr.com . It is a commercial video recording solution developed in Flash. It can record to both .flv and .mp4 files and when used with Wowza and the Wowza Transcoder it can record MP4 files with AAC audio and H.264 video.
It works with all 3 media servers in the top answer: Adobe Media Server, Wowza Media Server and Red5 Media Server .
You had better to use a third party tool like red5 or wowza. I already implemented wowza with php.
you can chech http://www.wowza.com/streaming/record. It is easy to implement and video recording is too good and fast. But it is not free.
This can be a good helpful resource for further readers. Click here
Wowza seems a good solution for recordings considering price/documentation&reliability ratio. Many users reported broken videos when trying to record with Red5.
This solution mentioned in Wowza Streaming Engine forums works with latest Wowza server.
http://www.wowza.com/forums/showthread.php?35683-Webcam-Video-Recorder-for-PHP-scripts
It's free to download and try so it could be a great method to test your setup and start such project.

How to record voice files using PHP, FLASH

I am developing an application where I need to record voice(for those who does not have a webcam so they can use only microphone to record voice) or video(those who have a a webcam - like laptop or external) files and save them on server, thereafter save the file name and logged in users id on database for later access.
I know I need to use some sort of flash app for this. But is there any free one which could server this purpose or even if there are paid ones which could serve this purpose that would be great. I tried google but may be I was not being able to go after the proper term or something, I could not succeed finding a proper solution for this.
Please, help me out!
You can do that simply using jRecorder, a jQuery plugin. You don't even need a Flash Media Server or RED server. JRecorder is same as jPlayer, you can use jQuery and HTML to design your recorder and you don't even need Flash or Action script knowledge for this.
jRecorder uses 1 pix hidden swf file which manages all the recording / previewing and sending the file data (wav file) to a URL you defined (Where you can write code in PHP or Java to receive a POST file)
It is quite simple and tidy.
You can download this Plugin from:
http://www.sajithmr.me/jrecorder-jquery
I have same feature in our latest project, the client want to have video recording from webcam and the video appear in the user's profile page.
For the server, we implement the RED5 server. It need a Java virtual machine in your hosting. You can read the detail requirement and installation instruction in the website.
To handle recording, we develop our own flash application, because the client request a custom interface to match with the overall website interface. I don't know the detail, since we outsource it to a fellow flash developer. Maybe you can see follow this thread, the development of flash recording by JeroenW.
To play recorded video, you can use any flash video player that support playing rtmp video source. You cannot play the recorded flv file in RED5 directly, since the file lack of metadata required by the player. Serving the recorded file as rtmp is done by RED5.
In addition to red5 there is Adobe's own Flash Media server that allows you to record audio/video straight to the server.
Or if you feel geeky you might be able to put together your own solution for this using a socket connection to the server and decoding the stream yourself on the server side. You should be able capture the audio/video locally into memory and then feed the byte stream up to your own server application.
There are Open Source solutions but you will need an own server to run them.
There is no way to run these things from shared hosting except if your provider is really nice, and ready to install the necessary software.
I asked the same question a few weeks back, check out the answers.
This question when googling "How to record audio php" comes up first so here for anyone from the future.
A simple way to record audio with flash and save it with PHP:
https://github.com/clouddueling/SimpleRecorder
Record audio, post audio data to your choice of url.
You could try recordmp3online.com which has an SDK. The nice thing about this one, is that it doesn't need a third party server(ala Red5), and supports mobile devices that don't have flash installed.

Categories