Flex video stream recording (not from webcam) - apache-flex

I am developing a web based media player. On server side, i am using red5's OflaDemo to stream videos, on client side (flex 4), a VideoPlayer control plays the incoming streamed video.
I want the client application to make / record clips from the played video and save them on the server.
I have some idea of netstreams and know netstream.publish is used to save recorded video on the server.
All the examples i find are of recording from webcam, i haven't found a way to set the streamed video as the source / input for the netstream to publish.
Help in this regard is greatly appreciated.
Thanks.

Related

How to check that a file is being streamed and not downloaded?

Abstract: There is a page with a player that loads audio file and plays it. The player used on the web page is jwplayer. I need to find a way to determine if the audio file is being streamed to the player or not.
Background: In my research I found that if I use nginx header like X-Accel-Redirect - the file will be streamed. I have setup the web server with nginx + apache combination (nginx is reverse proxy for apache), after that I pointed jwplayer to the mp3 file - and it is working. I mean I am able to click anywhere on the audio timeline and it immediately starts playing sound. But, since I didn't set that header yet, and adding the fact that player already works - that's why I need to check my question and know for sure.
Some of my own thoughts: JwPlayer itself supports some kind of bufferring, so I have no idea whether it just downloads the mp3 file I am testing this functions on, or it receives the stream and plays it out.
Is there a way to check and know for sure? The only idea about all of this I have is to check access logs, but I don't know what to look for, or if I need a special format for the logs to see those requried data.
While I was researching the issue I got some weird download related topics and something about HTTP headers with "Ranges" in them, but I am not sure that it relates to the streaming or not.
Please advice.
From the point of view of the server, there is no difference between download and streaming. A server just send bits. What happens to those bits later is unknown. What you need is a player that sends reports to back to the server or a loging service such as mixpanel.

How does Youtube implement live streaming

Monitoring your network while watching a Youtube live streaming (http://youtube.com/live/), you can see that they are downloading a file to your cache, and this file is actually the live stream.
Bitgravity use the same way to deliver their live stream since years (Check Twit.tv for example).
Does anyone know what is the server side used for this ? and how can someone achieve this instead of using Adobe FMS, Wowza or Red5 ?
These guys have put together an open source video streaming server, so you can look at the source code and see how they did it.
They wrote it in Java.
The current version is a working prototype, which showcases the main ideas. The main design goal is low resource usage.
there can be many ways to implement streaming, i dont think google will let you know how they do that, but it can be done even by simple http, just a simple stream that sends the video data without the "range" header so its just go on and on

Flash: netStream.info.audioBytesPerSecond alternative? Or how to detect if audio is present?

We have a flash app streaming live video to our clients which may or may not have available. When audio is available, we are showing controls to mute or alter the audio volume. When audio is not available, we hide those controls. These are necessarily different streams, but could be the same stream where the broadcaster has disbaled their microphone at some point. So the client may have detected audio initially had displayed controls, but once the broadcaster disabled their mic, the client on the receiving end recognizes no more audio is transmitting and hides the controls.
We were doing this in Flex 4, targetting flash 10, by using the netSream.info.audioBytesPerSecond property on the receiving client to see if any audio was being sent down. However we've been informed by the powers that be that we need to target flash 9 in which this property is not available.
So, in short, is there a way in Flex 3.5, targetting flash 9, to determine if a live stream has audio available? Note, we tried metaData as well for the initial indication of audio, but we need to be able to check on a timer periodically as the broadcaster may turn off their mic and thus disable audio mid stream.
What about using SoundMixer.computeSpectrum() and check the value of the ByteArray associated with it with an enterFrame event? As soon as the ByteArray is filled with values other than zero , audio is being detected

How can I record audio in a web app client side and save it in a web server?

I have a requirement to do a flash program or something like that (not necessarily flash, it can be javascript or something in aspnet) that allow me to save audio in the client side of a web app, and save it on a file in the server side of the web app.
I've been searching a lot in google, and all I've found are just old questions, but no answers that fulfill my question
Please I need help!
Ive found this but the only thing that it does its to recognize the microphone, I need the hability of saving the audio file, by the way the server is implemented in aspnet
Possible Duplicate (when tagged with Flash)
How can I record audio using Action script then upload it to server?
The static function
Microphone.getMicrophone() returns a
reference to a Microphone object for
capturing audio. To begin capturing
the audio, you must attach the
Microphone object to a NetStream
object (see NetStream.attachAudio()).
There's at least one example in the
LiveDocs. Start at
flash.media.Microphone.
via #aaaidan
This is like asking everybody to do your entire homework for you.
You need to break the problem down into smaller achievable pieces/goals.
Example:
Record audio
Send to web server
Now you'll most likely get better results when you google it up.

How do i merge an audio netstream and a video netstream into one republished netstream using flex3?

I have two netstreams:
audio published in red5
video also published in red5
Now I'm a flex3 application and I need a way to be able to attach the audio of stream 1, and the video of stream 2 to a new netstream and just publish it.
How do I do that? NetStream will only allow me to attach Camera or Microphone...
my friend I think you can merge both stream in one with FFMPEG command. But their compression mighg be an problem.
If you have record two stream separately than you can play them both in AS3 with the help of
Netstream class but remember Audio always comes first.
Well here are two links.. that may help you capture your screen
AIR 2.0 Native Process - Part 1 mentioned at http://gotoandlearn.com/
and second is for audio/video recording
http://www.adobe.com/devnet/air/flex/articles/air_screenrecording.html
i have worked on both linked and captured screen and audio from headphone and then merged it with FFMPEG ..

Resources