public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Simultaneous recordings from one frontend
@ 2011-03-09 14:20 Pascal Jürgens
  2011-03-09 14:47 ` Guy Martin
  2011-03-09 16:22 ` Andreas Oberritter
  0 siblings, 2 replies; 4+ messages in thread
From: Pascal Jürgens @ 2011-03-09 14:20 UTC (permalink / raw)
  To: linux-media

Hi all,

SUMMARY: What's the best available tool for demultiplexing into multiple simultaneous recordings (files)?

I'm looking for a way to record a program (video, audio, subtitle, teletext PIDs) to overlapping files (ie, files2 should start 5 minutes before file1 ends). This means that two readers need to access the card at once. As far as I can tell from past discussions [1], this is not a feature that's currently present or planned in the kernel.

So while searching for a userspace app that is capable of this, I found two options[3]:

- Adam Charrett's dvbstreamer [2] seems to run a sort-of ringbuffer and can output to streams and files. However, it's not all too stable, especially when using the remote control protocol and in low signal situations.

- the RTP streaming apps (dvblast, mumudvb, dvbyell etc.) are designed to allow multiple listeners. The ideal solution would be something like an interface-local ipv6 multicast. Sadly, I haven't gotten that to work [4].

Hence my questions are:
- Am I doing something wrong and is there actually an easy way to stream to two files locally?
- Is there some other solution that I'm not aware of that fits my scenario perfectly?

Thanks in advance,
regards,
Pascal Juergens

[1] http://www.linuxtv.org/pipermail/linux-dvb/2008-February/024093.html /
http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/15413
[2] http://sourceforge.net/projects/dvbstreamer/

[3] There's also the Linux::DVB::DVBT perl extension, but in my tests it wasn't happy about recording anything: "timed out waiting for data : Inappropriate ioctl for device at /usr/local/bin/dvbt-record line 53"

[4] dvblast, for example, gives "warning: getaddrinfo error: Name or service not known
error: Invalid target address for -d switch" when using [ff01::1%eth0] as the target address.
Additionally, I wasn't able to consume a regular ipv4 multicast with two instances of mplayer - the first one worked, the second one couldn't access the url.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Simultaneous recordings from one frontend
  2011-03-09 14:20 Simultaneous recordings from one frontend Pascal Jürgens
@ 2011-03-09 14:47 ` Guy Martin
  2011-03-09 15:19   ` Pascal Jürgens
  2011-03-09 16:22 ` Andreas Oberritter
  1 sibling, 1 reply; 4+ messages in thread
From: Guy Martin @ 2011-03-09 14:47 UTC (permalink / raw)
  To: Pascal Jürgens; +Cc: linux-media


Hi Pascal,

I've written a very small program that does just that :
https://svn.tuxicoman.be/listing.php?repname=dvbsplit
It's a quick hack, there is probably a better way to do this but at
least it works :)

To get the sources : "svn checkout
https://svn.tuxicoman.be/svn/dvbsplit/trunk dvbsplit". Check the readme
for compilation.

You'll need to tune to the right TP with `{stc}zap -r`, then start it
and it will dump everything in the directory.

HTH,
  Guy

On Wed, 9 Mar 2011 15:20:06 +0100
Pascal Jürgens  <lists.pascal.juergens@googlemail.com> wrote:

> Hi all,
> 
> SUMMARY: What's the best available tool for demultiplexing into
> multiple simultaneous recordings (files)?
> 
> I'm looking for a way to record a program (video, audio, subtitle,
> teletext PIDs) to overlapping files (ie, files2 should start 5
> minutes before file1 ends). This means that two readers need to
> access the card at once. As far as I can tell from past discussions
> [1], this is not a feature that's currently present or planned in the
> kernel.
> 
> So while searching for a userspace app that is capable of this, I
> found two options[3]:
> 
> - Adam Charrett's dvbstreamer [2] seems to run a sort-of ringbuffer
> and can output to streams and files. However, it's not all too
> stable, especially when using the remote control protocol and in low
> signal situations.
> 
> - the RTP streaming apps (dvblast, mumudvb, dvbyell etc.) are
> designed to allow multiple listeners. The ideal solution would be
> something like an interface-local ipv6 multicast. Sadly, I haven't
> gotten that to work [4].
> 
> Hence my questions are:
> - Am I doing something wrong and is there actually an easy way to
> stream to two files locally?
> - Is there some other solution that I'm not aware of that fits my
> scenario perfectly?
> 
> Thanks in advance,
> regards,
> Pascal Juergens
> 
> [1]
> http://www.linuxtv.org/pipermail/linux-dvb/2008-February/024093.html /
> http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/15413
> [2] http://sourceforge.net/projects/dvbstreamer/
> 
> [3] There's also the Linux::DVB::DVBT perl extension, but in my tests
> it wasn't happy about recording anything: "timed out waiting for
> data : Inappropriate ioctl for device at /usr/local/bin/dvbt-record
> line 53"
> 
> [4] dvblast, for example, gives "warning: getaddrinfo error: Name or
> service not known error: Invalid target address for -d switch" when
> using [ff01::1%eth0] as the target address. Additionally, I wasn't
> able to consume a regular ipv4 multicast with two instances of
> mplayer - the first one worked, the second one couldn't access the
> url.-- To unsubscribe from this list: send the line "unsubscribe
> linux-media" in the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Simultaneous recordings from one frontend
  2011-03-09 14:47 ` Guy Martin
@ 2011-03-09 15:19   ` Pascal Jürgens
  0 siblings, 0 replies; 4+ messages in thread
From: Pascal Jürgens @ 2011-03-09 15:19 UTC (permalink / raw)
  To: Guy Martin; +Cc: linux-media

Dear Guy,

I compiled your tool and from what I see, it demuxes the ts into separate streams for each program.
While it's a very handy thing to have, I'm actually looking for something slightly different.

I'm sorry if I didn't describe it very clearly.

What I'm looking to do is to record ONE and the same program into two different files, but start and stop at distinct points in time.

This means that the recording schedule would look something like this:

Program "arte":
file1		(start 11:55)--------------------(end 13:05) ...
file2		                    start(start 12:55)--------------------(end 14:05) ...

So far, Brice Dubost has already hinted that mumudb is able to stream the same program to a unicast port on a loopback device, and I've been able to do multiple simultaneous recording this way.

However, I'm still curious to see if there are other options :)

Thanks,
Pascal

On Mar 9, 2011, at 3:47 PM, Guy Martin wrote:

> 
> Hi Pascal,
> 
> I've written a very small program that does just that :
> https://svn.tuxicoman.be/listing.php?repname=dvbsplit
> It's a quick hack, there is probably a better way to do this but at
> least it works :)
> 
> To get the sources : "svn checkout
> https://svn.tuxicoman.be/svn/dvbsplit/trunk dvbsplit". Check the readme
> for compilation.
> 
> You'll need to tune to the right TP with `{stc}zap -r`, then start it
> and it will dump everything in the directory.
> 
> HTH,
>  Guy


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Simultaneous recordings from one frontend
  2011-03-09 14:20 Simultaneous recordings from one frontend Pascal Jürgens
  2011-03-09 14:47 ` Guy Martin
@ 2011-03-09 16:22 ` Andreas Oberritter
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Oberritter @ 2011-03-09 16:22 UTC (permalink / raw)
  To: Pascal Jürgens; +Cc: linux-media

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-09 16:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-09 14:20 Simultaneous recordings from one frontend Pascal Jürgens
2011-03-09 14:47 ` Guy Martin
2011-03-09 15:19   ` Pascal Jürgens
2011-03-09 16:22 ` Andreas Oberritter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox