Flash webcam/microphone capture with open-source media server
Asked Answered
Y

4

9

A media server is required for capturing video from Flash but none of them seem to have any documentation available (not even API docs or other source code comments). I would prefer crtmpserver because my application is written in C++ and it needs to receive and process the captured data in real time. However, Red5 is clearly a lot more mature and better known project so I do consider that an option too. Adobe FMS is too expensive and might be difficult to integrate with my application as Adobe never mentions such use case.

As far as I can tell, one has to write an "application" for the media server (they don't ship with anything usable) and that will then have to forward the data for actual processing. What sort of data can an application expect from the media server, is it going to be a plain FLV stream or is there something more to it (bandwidth negotiations etc)?

Coding the Flash side is not an issue, there are plenty of examples for that (even if they don't tell how the media server URL should be constructed).

The actual question: how does the server side work (high level view) and is there anything to get one started with the live capture functionality?

Yearlong answered 15/12, 2010 at 18:2 Comment(0)
C
3

A couple years back I was working on an e-learning project that allowed the students to record an answer (audio only in my case) and the professor could listen to it and grade the student.

We considered Adobe FMS, Wowza Media Server (http://www.wowzamedia.com) and Red5. In the end Red5 was chosen because it was the only free open source options which was stable enough to be used in this project, even though it lacked much documentation.

How it worked was I ended up modifying one of the packaged examples to suit my need and had the server running on Mac OS 10.4.? Red5 basically grabbed the audio stream and saved the file to a directory on the machine. I had to then update the database to point to the audio file for the professor to be able to play it. Note, I did not do any live modification or re-broadcasting of the stream; in case that's part of the scope of your project.

Anyway, Red5 didn't have much of a community at the time so I wasn't able to contribute what I had learned to their documentation but it seems like they're more active now and if you do choose to go with Red5 I would ask that you become involved in the project and help document it.

Consueloconsuetude answered 4/1, 2011 at 21:24 Comment(3)
Saving to file is entirely suitable for my needs because this needs to work realtime. However, if I could get even that working, I could probably figure out the rest by myself (most likely need to write some JNI for Red5 to communicate with my app). Could you be more specific about how you set it up?Yearlong
I would recommend these excellent resources by Dennie Hoopingarner from MSU: fms.denniehoopingarner.com and fms.denniehoopingarner.com/FMS_solutions.pdfConsueloconsuetude
My solution followed Dennie's instruction and it borrowed a lot from oflaDemo which came with Red5. One thing I remember which game me a hard time (mainly because I was a server newbie) was to make sure the correct write privilages were given to the streams folder where the recorded files were saved.Consueloconsuetude
A
1

You could take a look if haxevideo might be suitable for your development.

Abject answered 15/12, 2010 at 18:22 Comment(1)
Sorry but I am really not interested on an experimental server written in an obscure programming language. That would be a maintenance nightmare :)Yearlong
S
1

Media servers typically do just that - serve media. Are you trying to consume streaming video in a flash application? If so, either of the servers you mentioned should be suitable for that.

If you are, however, trying to capture and publish streaming video from flash, aside from webcam streams, AFAIK there's no great way to do it.

For real-time publishing of webcam streams and other basic interaction, you may want to check out the Adobe LiveCycle collab service (codename Cocomo).

Soilasoilage answered 3/1, 2011 at 22:15 Comment(0)
Y
1

We are now using crtmpserver. A few notes: Flash needs to connect to rtmp://server:1935/appname (where appname is the application to use - these are configured on server side). Even if there are multiple parts in the URL (separated by slashes), the entire combination is considered the appname (even though there appears to be an exception for playback, permitting the flv filename to be put there).

Recording happens by connecting to "flvplayback" application and then publishing by "somename" (with "record" or "append"), making the server write to (relative to CWD) applications/flvplayback/mediaFolder/somename.flv

You cannot change the application name but it might look nicer to use one of the aliases of flvplayback in the URL (that doesn't affect the folder where the files go). One of the default aliases is "live", so you may use "rtmp://server:1935/live" as the URL.

Yearlong answered 3/3, 2011 at 13:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.