Extract cue-point or data from live video stream - streaming

Does anybody know of a way I can extract timing data from any kind of live video stream?
I have tried with JWPlayer, but it is not capable of doing that.
My encoder is Streamcoders Mediasuite and I am happy to stream using whatever streamtype is necessary, in order for me to get cuepoint info (or any kind of timing info) from the stream.
Caveat - Flash and Silverlight are not an option, as the viewer-base is restricted by policy.
Thanks in advance.
Neil.

Related

Using libvlc to stream a video from memory?

I am generating a video stream in real time, and I've got it as a series of bitmaps in memory.
I'd like to stream these bitmaps over the network using libvlc, but I wasn't able to find the right functions in the API (all streaming functions expect a file or other source).
I even thought of emulating a capture device, but that seemed too convoluted to be true, so I'd rather ask.
My question is, what do I now have to do with these bitmaps to be able to use libvlc to stream them?
I found a question which appears to be solving the same issue.
Other suggestion with significantly less overhead is "emulating" a file with named pipes, i.e. FIFOs.

How can I monitor an mp3 live stream to detect corruption?

Once a month the mp3 streams messes up and the only way to tell it has messed up is by listening to it as it streams. Is there a script or program or tool I can use to monitor the live streams at a given url and send some kind of flag when it corrupts?
What happens is normally it plays a song for example or some music but once a month, every month, randomly, the stream corrupts and starts random chimpmunk like trash audio. Any ideas on this? I am just getting started at this with no idea at all.
Typically, this will happen when you play a track of the wrong sample rate.
Most (all that I've seen) SHOUTcast/Icecast encoders (going straight from files) will compress for MP3 just fine, but assume a fixed sample rate of whatever they are configured for. Typically this will be 44.1kHz. If you drop in a 48kHz track, or a 22.05kHz track, they will play at different speeds while causing all sorts of random issues with the stream.
The problem is easy enough to verify. Simply create a file of a different sample rate and test it. I suspect you will reproduce the problem. If that is the case, to my knowledge there is no way to detect it, since your stream isn't actually corrupt... it just sounds incorrect. You will have to scan all of your files for sample rate. FFMPEG in a script should be able to help you with that.
Now, if the problem actually is a corrupt MP3 stream, then you have problems on your encoding side. I suspect simply swapping out whatever DLL or module you're using with a recent stable version of LAME will help.
To detect a corrupt MP3 stream, your encoder must be using CRC. If you enable it, you should be able to read through the headers of each frame to find the CRC, and then run it on the audio data. In the event you get an error (or several frames with errors), you can then trigger a warning.
You can find information on the MP3 stream header here:
http://www.mp3-tech.org/programmer/frame_header.html

Video recording and saving the video on a server

I just caught with a task which is how should i go about capturing a video in my app and saving it directly on some server. I have the sample code discussed in WWDC2010 but i just need some other more helpful links or tutorials to complete this task.
Please give me your opinion or share any links if you have.
Thanks,
There is nothing in the APIs that will allow you to do this. The only way is to use AVAssetWriters to segment the video. You would then stream the completed segments. These would need to be reassembled on the server side if you require a single file.

MPMoviePlayerController : a way to get used bandwidth?

I would like to check used bandwidth when playing a video with MPMoviePlayerController to be able to play a video which matched client bandwidth.
For now, I download a part of my file by using NSURLConnection and I can find bandwidth. But I think it's not a good idea to download more data than expected (and the goal is to use as less bandwidth as possible).
Does a 'current downloaded bytes' property, or something like that, exist ? I hope you can help me.
Thanks a lot !
Take a look at the Reachability sample code, it will help you determine if the client is on WiFi,WWAN (3G/Edge), etc. You can make certain assumptions based on these findings. If you want exact speed, you'll download a file and check the speed.
You may want to look into HTTP video streaming, you can provide different (varying level of quality) versions of the video for each connection speed. The server determines the version to send.
Some docs on HTTP Streaming:
http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/Introduction/Introduction.html
http://www.scribd.com/doc/20173481/iPhone-Streaming

how to read a http video stream with libavcodec (ffmpeg)

I'm trying to read a real-time http video stream (I've set one up using VLC and my webcam) using libavcodec from ffmpeg. so far I've been able to read an mpeg file fine but when I pass a url instead of the file name it hangs (I assume it's waiting for the end of the file).
anyone have experience/ideas on how to do this? I'm also open to alternatives if people have other suggestions.
the end goal is to do live video-streaming on the iphone. apple's http live streaming has too much lag for what I need but that's for another post :)
any help is greatly appreciated!
if you aren't using apple's way, you can't.
I have to admit I dont quite understand what you want to achieve, however, based on my interpretation of the question it seems like it is related to the segmenting of the video.
The segmenting can be achieved using ffmpeg and libavcodec (look for example here, key line is the one with packet.flags). Just remember that the segment length (in time) depends on the keyframe interval (for h264 at least). If you want an example of a full segmented streaming solution that works (most of the time), check here.
Otherwise, you have to dig into the codec and create the transport stream manually. The MPEG2-TS, which is what iOS supports, can be a little bit difficult sometimes, but it is not too bad. Good luck!
you can use libcurl to download http segment file