Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to cat a /dev/video0 device output (Transport Stream) into a temporary ring buffer. In fact i do not want that the file is growing over the time. Simultaneously access is not possible.

So the purpose is to have a file (buffer, Fifo, whatever) to be accessed by more than one consumer (example: tail -f, mencoder, VLC, ....).

Some kind of scenario: 
1# cat /dev/video0 > mybuffer.ts
And then multiple access
2# tail -f mybuffer.ts > extract1.ts
2# tail -f mybuffer.ts > extract2.ts
3# ffmpeg ... 

Does someone have an idea how to do something like this?

share|improve this question
How would the ring buffer know when all of the clients have connected to it? – Ignacio Vazquez-Abrams Aug 30 '12 at 9:18
Does the ring buffer has to know? I start the "producer" and the /dev/video0 output will be continuously written into the buffer. The consumers grabs the data from the buffer. – user155384 Aug 30 '12 at 9:25
How will the buffer know that it can release old data? – Ignacio Vazquez-Abrams Aug 30 '12 at 9:26
The buffer can release older data after a certain file size is reached (for example). 1MB, 10MB ... in fact i just need the kind of "buffer" to create a point/file/source to grab data from multiple consumers because /dev/video0 does allow only 1 consumer. – user155384 Aug 30 '12 at 9:33
But what if another consumer wants its contents after the certain size is reached? – Ignacio Vazquez-Abrams Aug 30 '12 at 9:40

You must log in to answer this question.

Browse other questions tagged .