I want to create a web application (I am quite good with PHP) that captures webcam shots every 1 minute from different persons that open the application page and sends it via smthng to the web/ftp server.
I mean PC1, PC2 and PC3 opens the web aplication, their webcam it's opened and it captures images every 1 minute so PCSERVER should be able to see the persons behind the webcam "realtime".
I read about Flash Video Server (hope I am quite around the words) but it's purchasable solution and I want to redistribute the application freely.
Any ideas how should I do this?
EDIT:
If I am required to learn another programming language such as ActionScript, I don't mind, but if I am going to learn that, it should resolve my problem.
For video capture and video sharing, you need something like Adobe's Flash Media Server or the open source alternative Red5, that Johni mentions, but since you say you only need "shots every minute", not video, it could also be done without a streaming media server, only the Flash based client and PHP on the server.
What you could do instead of video is capture bitmap images from the web camera, using Flash/ActionScript, encode that bitmap image as JPEG or PNG and upload the image to the server by POSTing it to a PHP page.
It would require more code that fits in a SO Q&A, but you can easily find examples for the different steps of the process - access the web cam - get bitmap image - encode bitmap - POST encoded image top PHP from ActionScript.
The Red5 Media Server is a good open source alternative to the Flash Media Server:
http://red5.org/
It is programmed in Java.
Related
I'm writing an app for both Android and iPhone devices. The app uploads a base64 encoded string of a video to a PHP server and stores the encoded string in a MySQL database. Obviously, I would like the videos to have the ability to be played on both the Android and iPhone versions of the app simply by requesting the web URL along with the ID of the video to be retrieved. So far, I've verified that the base64 encoded string of the video is successfully being sent to the PHP server and stored in the database.
I'm just unsure of the proper way to serve up the decoded version of the video through PHP so that it can be viewed through the app on both Android and iPhone devices without compatibility issues. My assumption is that the approach would be similar to how I'm serving base64 encoded images that are stored in the database with a few differences such as the type of header specified in the PHP code and the specific PHP command that serves up the video after it has been selected from the database and decoded.
Can anyone tell me if I'm on the right track here? Are there any lessons learned that anyone can provide?
I'm able to successfully play the video on the following link in iPhone, but I haven't tried it on Android yet:
http://jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v
I've read through a lot of information, but some of it appears to be dated a while back and I'm concerned about the relevance of the information still being legit. Here's an article I found from 2008 http://mobiforge.com/design-development/content-delivery-mobile-devices
Any help or points in the right direction is very much appreciated.
First, start with the most compatible type of video: mp4 with h.264 encoding and aac audio.
The mp4's should be "optimized" which means some important control and information blocks are placed at the front of the file which will allow playback to start almost instantly. Otherwise you end up downloading the entire video before playback starts and viewers don't wait
Then in your php program just respond to the video request with the video file and it will play using progressive download.
If you want the viewer to have playback (shuttle) controls you will have to use mod_h264 or some similar add-on to respond to requests for forward or backward seeks. Apple devices may require this mod to play properly and handle the byte-range requests.
Without progressive download it gets more complicated (RTSP for Android and HLS for iOS).
I have tried a lot of things out there: red5, jquery webcam, html5 ... but none of these solution record a video and leave it ready to upload to a server.
Is there anyway (html5, flash, whatever ... the better cross-broswer solution, the best) to upload video (+ audio!) and upload the result to a server (I guess through AJAX) ?
Summarize:
jQueryWebcam (https://github.com/infusion/jQuery-webcam): it has flash video, uploads to a server image, not a video
Eric Bidelman's solution (http://ericbidelman.tumblr.com/post/31486670538/creating-webm-video-from-getusermedia):records video in html5 and allows you to download (so you can upload
to a server), but no audio !
Red5 (http://www.red5-recorder.com/services.php): paid services, not
uploading in free version :(
DMV (https://github.com/rwldrn/dmv): it just captures a photo ... besides not cross-browser
I have developed video recording solutions for the better part of the last 5 years and contributed a lot to fixing video recording bugs in Red5.
There are currently 2 production ready technical solutions for recording audio and video on the web. One for desktop and one for mobile.
On desktop you will need a Flash application that sits embedded in a web page, captures the visitors webcam and mic, encodes the raw video and audio data and streams it as it is recorded (through rtmp) to a media server.
You have at least 3 options for the media server:
Red5 is free and open source (btw. recording works out of the box in Red5)
Wowza ($65/month)
Adobe Media Server Pro ($4500)
The media server receives (again through streaming/rtmp not through http) the data and, depending on the codec used on the client, saves it to mp4, flv or f4v files.
This Flash client + media server recording process - which has worked pretty well since Flash Player 6 in 2002 - will most likely replaced by the HTML5 alternative named MediaStream Recorder (not yet implemented fully by any browser).
On mobile you can use HTML Media Capture (explained here with screenshots) to record video using the device's native video recording app and codecs. HTML Media Capture records locally (on the device) and then you upload (normal HTTP upload process) the file to the web server.
A commercial solution that implements both (Flash client + media server on desktop and HTML Media Capture on mobile) is HDFVR.
You could use something like binary download via javascript.
Here is one example
As you have not much info about video protocols i cant give you better answer
you can try this library, RecordRTC. It generates a blob file to put in video source and you can upload this file later to your server.
RecordRTC Library
This library is a container for other libraries, like Whammy for video, Recorderjs for audio and jsGif for gifs.
You can use Whammy library for record videos too:
Whammy
Our aim is to create a live video streaming site for each individual paid registered user only by php platform.
I need video camera to take videos and i want to know function flow.I dont know where i have to start.
What are all things needed? Especially live video uploading using ordinary video camera. I have found http://www.videowhisper.com/?p=PHP+Live+Streaming This is the site, i exactly needed. Unfortunately but its camera option only includes "webcam only". I would like input video camera instead of webcam.
I need suggestions for requirements to create the site.
I need to stream live video for each paid user. That includes flash player content.
Uploading and video control by admin side. Only live links is shared to customers.
i think it is nothing about PHP, but something about JAVA.
You can use Red5 as media server, and users watch videos via flash player. You also can take videos with flash.
Found an interesting link on it: http://en.wikipedia.org/wiki/Push_technology
And Symfony 2.1 is going to handle streamed responses: http://symfony.com/doc/current/components/http_foundation.html#streaming-a-response, but is not stable yet.
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.
I need help finding resources that would help me or at least point me in the right direction in building a Flash media server/PHP application. I basically want to improve my current application by instead of progressive download using flash media server so that the videos will not only stream well but they can't be downloaded by the end user.
What the current application does is show a login form on the homepage and then when logged in the user can then navigate the site by choosing videos from a particular video category or video uploaded by a specific user. All this is done with PHP. The video page uses progressive download to display the video after the video ID has been passed using PHP.
I need to know how PHP and flash media server work together. Are there any resources out there where I can find a good application example (really simple) that demonstrates how PHP and flash media server can be used to stream videos dynamically such that PHP checks for the login, video ID, video channels, and video category information while the flash media server streams the video.
Really, PHP and FMS shouldn't be talking at all. It can be done within FMS, but a much easier approach is to let your Flash Player (which you'll have to have anyway) do the talking to FMS. Flash to FMS communication is well documented and very easy. Just have the PHP call forth a Flash video player with whatever info you need. It would probably be eaiser to have PHP authenticate and give the Flash some sort of authentication token if you're really worried about security.
Just so you know though, just because your media is streaming doesn't mean someone can't download it. There's several tools to rip streamed media out there. It is of course more secure, but it's not full-proof.
You may want to try Red5 instead of Flash Media Server. I've use Flash Media Server in the past and it can be a pain to take care of. With Red5 you at least have more flexibility and it is free. If you go down the Red5 path you will find more people customizing it like this one time ticket for Red5 post. I believe that is very close to what you are looking for.
The biggest problem with PHP and Flash (mediaserver) is the different "flow" of code.
PHP is straightforward:
Start request, do something, send response. Done.
Flashmedia only loads (compiles) your code when a client connects, and then only events are triggered. Most operations do not return, but need a callback.
Load application.. wait for something.. Event launched: do something, fire off another request together with a response handler object.. etc.
I have build an extensive chatservice with FlashMedia server and PHP as front and back-end.
The front-end is simple: just plain PHP/HTML-pages which will eventually create an <OBJECT>-tag loading some Flash applet.
That flash applet should connect to the Flash media server using information/credentials passed to it with the FlashVars-option or loaded (generated) XML-data from a separate URL.
From that point, the Flash applet (client) does it's thing with the Flashmedia server.
For this example, you want to verify credentials from the Mediaserver. You should use the AMFPHP framework for that.
AMFPHP is a replacement for Macromedia's "Flash Remoting" system where Flash [applets/servlets] can do asynchronious communications over HTTP.
For the AMFPHP-framework you write an interface class wrapping your credential-validation code. There is a test-page which validated the response of your wrapper.
(The AMFPHP Framework can also generate AS2 sample code so you have an idea how the Flashmedia server should send an request and handle responses.)
A warning: AMFPHP uses POSTs to send
and retrieve data. In the past,
there were problems when more than
2k of data was truncated. I now only
use it for relative short messages.
AMFPHP is very reliable. You can use it to do external logging for example.
Using flash media server so that the
videos will not only stream well but
they can't be downloaded by the end
user
This won't really work. It make make it "harder" for some people in the same way that not putting a big, huge "download here" button makes it "harder", but the content is still being downloaded to their computer, just in a different way. Anything that's downloaded can be saved to the disk.
I am doing similar thing. First, for authentication, you can use FMS's authentication plug-in. Of course, you can make your own stuff in PHP. Instead of adding PHP into FMS's original Apache, I decided to run XAMPP in parallel, with different port of course.
To start and stop the encoder, you can make use of FMLEcmd command.
My environment:
Flash Media Development Server 3.5
Flash Media Live Encoder 3.1
XAMPP (at port 8080)