0

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

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:

Producer:
# cat /dev/video0 > mybuffer.ts

And then multiple access by consumer
2# tail -f mybuffer.ts > extract1.ts
2# tail -f mybuffer.ts > extract2.ts
3# ffmpeg -i mybuffer.ts ...

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

Fox
  • 35
  • 1
  • 5

2 Answers2

0

Parhaps you want to just split the stream:

cat /dev/video0 | tee extract1.ts extract2.ts | ffmpeg -i mybuffer.ts ...

tee copies the stream to files and stdout

Imre L
  • 6,159
  • 24
  • 32
0

Looks like you need a /dev/fanout.

abbot
  • 27,408
  • 6
  • 54
  • 57