On 03/09/2011 03:20 PM, Pascal Jürgens wrote:
> SUMMARY: What's the best available tool for demultiplexing into multiple
> simultaneous recordings (files)?
The kernel. There's no need to do that in userspace.
Any(*) number of tools may open a demux simultaneously, set up a filter
for the first PID with DMX_OUT_TSDEMUX_TAP and add any(*) number of TS
PIDs with DMX_ADD_PID. Data has to be read from demux, not from the
limited and IMHO obsolete dvr device.
In simplified code for PAT, PMT PID 0x80, Video PID 0x100, Audio PID 0x101:
int fd = open("/dev/dvb/adapter0/demux0", O_RDWR);
struct dmx_pes_filter_params f = {
.pid = 0, // PAT
.input = DMX_IN_FRONTEND, // live TV
.output = DMX_OUT_TSDEMUX_TAP, // TS packets!
.pes_type = DMX_PES_OTHER, // no decoding
.flags = DMX_IMMEDIATE_START,
};
uint16_t pid[] = { 0x80, 0x100, 0x101 };
ioctl(fd, DMX_SET_PES_FILTER, &f);
for (int i = 0; i < 3; i++)
ioctl(fd, DMX_ADD_PID, &pid[i]);
ssize_t r;
unsigned char buf[N * 188];
while ((r = read(fd, buf, sizeof(buf)) >= 0)
write(1, buf, r); // write to stdout
close(fd);
If there's no tool using this interface yet, it's probably time to write
or modify one,
Regards,
Andreas
*) Depending on available system resources.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html