Re: Streaming live video.
Brought to you by:
aeb,
bencollins
From: <br...@pr...> - 2000-06-05 01:10:02
|
On Jun 3, 0:47, Daniel Kobras wrote: > > As stated in my previous message, I can display live video streams > on-screen using linux1394 and libdv. I'm not too happy about the > implementation though. What's bothering me most is the internal buffering > of iso data in the subsystem. I'd like to drop intermittent frames if my > processing is too slow. It might be useful to look at the model used by the SGI digital media libraries for real-time streamed data (this applies to analog video I/O e.g. on the O2, not sure what they do in their 1394 library for iso transfers). They use a circular buffer with a fixed size (i.e. frames) and incoming data just keeps being written around the circle. The kernel/library gives you an event (select'able via a file descriptor) when each new frame arrives, you then use the mmapped frame data as you wish. It's up to you to use the data quickly enough to avoid overflow - if it looks like you're running behind, you can opt to skip some frames in the buffer. I believe you tell the library when you start and finish using the data from a frame, which allows the detection of overflows as well as preventing an 'in use' frame from being overwritten. It works well with their UST/MSC system, which assigns a 64-bit nanosecond accuracy timestamp (relative to machine reset time) and a 'media count' (i.e. frame count) to each incoming media unit (i.e. frame) around the circular buffer, so you can accurately match up similarly-labelled incoming audio, detect dropped frames, etc. Outgoing data can also be accurately synced to absolute time and/or other media types. In the case of 1394/DV, you would also want to associate DV timecode and 'time of day' timestamps to incoming frames. I'd be interested to hear if there is any movement in these directions in the Linux 1394 or Video4Linux camps... I hope this is not too far off topic, and might give some inspiration to Linux 1394 developers. Regards, Brian. -- -- ----------------------------------- Brian Murray Proximity Pty Ltd http://www.proximity.com.au/~brian/ ----------------------------------- |