Re: gnutv: move channel_name to flag to allow piped output

2010-11-28 Thread Oliver Endriss
On Sunday 28 November 2010 05:42:21 David Liontooth wrote:
 I need to capture ATSC QAM closed captioning to file, and at the same 
 time the mpeg-ts stream to a different file. I've been looking for an 
 app that will let me do this.
 
 A simple cat works:
 
   cat /dev/dvb/adapter0/dvr0 | tee $FIL.mpg | zvbi-atsc-cc --atsc -m -C 
 $FIL.txt -T KCBS
 
 But there is naturally no tuner or timer in cat, so closing the 
 processes at the end of the recording is a hassle; there may be other 
 issues cat doesn't handle optimally. I looked around and found gnutv in 
 the dvb-apps project.
 
 gnutv is actively maintained, tunes ATSC QAM-256, handles individual 
 channels well, and has a timer -- but it has a small, show-stopper problem.
 
 gnutv mandates that the channel name be placed at the end of the user 
 input. There is a great -out stdout option, but you can't use it to 
 pipe, since the channel name has to be placed afterwards.
 
 I suggest we move the channel name into a flag, like the other user 
 values, so that we can pipe the output like this:
 
   gnutv -adapter 0 -channel_list ~/.azap/channels.conf -timeout 10 
 -channel_name  KCBS \
   -out stdout | tee $FIL.mpg | zvbi-atsc-cc --atsc -T -9 $FIL.txt -n KCBS
 
 With a simple patch against the today's mercurial tree, as below, this 
 works great. For clarity, I renamed channels to channels_list; I'll be 
 happy to remove that change if it breaks too many scripts. I don't know 
 how to make the change to channel_name so that it's backwardly 
 compatible, but maybe we don't need to.

Hm, I do not understand, why it might be a problem to have the channel
name as the last parameter.

What happens if you try
  gnutv -adapter 0 -channels ~/.azap/channels.conf -timeout 10 -out stdout KCBS 
| tee $FIL.mpg | zvbi-atsc-cc --atsc -T -9 $FIL.txt -n KCBS
with an unpatched gnutv?

CU
Oliver

-- 

VDR Remote Plugin 0.4.0: http://www.escape-edv.de/endriss/vdr/
4 MByte Mod: http://www.escape-edv.de/endriss/dvb-mem-mod/
Full-TS Mod: http://www.escape-edv.de/endriss/dvb-full-ts-mod/

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [linux-dvb] gnutv: move channel_name to flag to allow piped output

2010-11-28 Thread David Liontooth

On 11/28/2010 03:40 AM, Edgar Matzinger wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Dave,

On 28/11/10 05:42, David Liontooth wrote:


  gnutv -adapter 0 -channel_list ~/.azap/channels.conf -timeout 10
-channel_name  KCBS \
  -out stdout | tee $FIL.mpg | zvbi-atsc-cc --atsc -T -9 $FIL.txt -n KCBS


This should work:

$ gnutv -adapter 0 -channel_list ~/.azap/channels.conf -timeout 10 \

-out stdout KCBS | tee $FIL.mpg | zvbi-atsc-cc --atsc -T -9 $FIL.txt \
-n KCBS

Yes it does - I didn't think of trying that. Thanks to you and Oliver!


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


gnutv: move channel_name to flag to allow piped output

2010-11-27 Thread David Liontooth
I need to capture ATSC QAM closed captioning to file, and at the same 
time the mpeg-ts stream to a different file. I've been looking for an 
app that will let me do this.


A simple cat works:

 cat /dev/dvb/adapter0/dvr0 | tee $FIL.mpg | zvbi-atsc-cc --atsc -m -C 
$FIL.txt -T KCBS


But there is naturally no tuner or timer in cat, so closing the 
processes at the end of the recording is a hassle; there may be other 
issues cat doesn't handle optimally. I looked around and found gnutv in 
the dvb-apps project.


gnutv is actively maintained, tunes ATSC QAM-256, handles individual 
channels well, and has a timer -- but it has a small, show-stopper problem.


gnutv mandates that the channel name be placed at the end of the user 
input. There is a great -out stdout option, but you can't use it to 
pipe, since the channel name has to be placed afterwards.


I suggest we move the channel name into a flag, like the other user 
values, so that we can pipe the output like this:


 gnutv -adapter 0 -channel_list ~/.azap/channels.conf -timeout 10 
-channel_name  KCBS \

 -out stdout | tee $FIL.mpg | zvbi-atsc-cc --atsc -T -9 $FIL.txt -n KCBS

With a simple patch against the today's mercurial tree, as below, this 
works great. For clarity, I renamed channels to channels_list; I'll be 
happy to remove that change if it breaks too many scripts. I don't know 
how to make the change to channel_name so that it's backwardly 
compatible, but maybe we don't need to.


Cheers,
Dave


--- gnutv.c2010-11-27 10:56:57.0 -0800
+++ gnutv-new.c2010-11-27 11:34:41.0 -0800
@@ -54,7 +54,8 @@
  -frontend idfrontend to use (default 0)\n
  -demux iddemux to use (default 0)\n
  -caslotnum idca slot number to use (default 0)\n
- -channels filenamechannels.conf file.\n
+ -channel_list filenamechannels.conf file.\n
+ -channel_name name Name of the channel to tune to.\n
  -secfile filenameOptional sec.conf file.\n
  -secid secidID of the SEC configuration to use, one of:\n
  * UNIVERSAL (default) - Europe, 10800 to 11800 
MHz and 11600 to 12700 Mhz,\n

@@ -82,8 +83,7 @@
  -timeout secsNumber of seconds to output channel for\n
 (0=exit immediately after successful tuning, 
default is to output forever)\n

  -cammenuShow the CAM menu\n
- -nomovecaDo not attempt to move CA descriptors from 
stream to programme level\n

- channel name\n;
+ -nomovecaDo not attempt to move CA descriptors from 
stream to programme level\n;

 fprintf(stderr, %s\n, _usage);

 exit(1);
@@ -154,11 +154,16 @@
 if (sscanf(argv[argpos+1], %i, caslot_num) != 1)
 usage();
 argpos+=2;
-} else if (!strcmp(argv[argpos], -channels)) {
+} else if (!strcmp(argv[argpos], -channel_list)) {
 if ((argc - argpos)  2)
 usage();
 chanfile = argv[argpos+1];
 argpos+=2;
+} else if (!strcmp(argv[argpos], -channel_name)) {
+if ((argc - argpos)  2)
+usage();
+channel_name = argv[argpos+1];
+argpos+=2;
 } else if (!strcmp(argv[argpos], -secfile)) {
 if ((argc - argpos)  2)
 usage();
@@ -235,11 +240,6 @@
 } else if (!strcmp(argv[argpos], -cammenu)) {
 cammenu = 1;
 argpos++;
-} else {
-if ((argc - argpos) != 1)
-usage();
-channel_name = argv[argpos];
-argpos++;
 }
 }


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html