Version 0.71

- Fixed 'Transfer Mode' in cases where a non-primary interface was switched to
  a channel that only the primary interface can receive (which could happen in
  the EPG scanner).
- The EPG scanner now starts with the first channel (it used to start with the
  second channel).
- Reacitvated setting the PNR.
- Adapted the frame scanning to the new muxing of the driver.
- The new compile time option REMOTE=NONE can be used to compile VDR without
  any remote control support (for applications where it shall be controlled
  exclusively via SVDRP).
- The new command line option -D can be used to define which DVB interfaces
  a certain instance of VDR shall use.
- The "Left" and "Right" keys are now used to page up and down in lists (thanks
  to Martin Hammerschmid). Since the "Timers" menu already uses these keys to
  (de)activate timers, this functionality is not available there.
- The "Main" and "Commands" menu now support "hotkeys", which means that if the
  first non-blank character of a menu item is a digit in the range 1..9, that
  item can be selected by pressing the respective numeric key on the remote
  control.
- The channel data in 'channels.conf' now contains the teletext PID (thanks to
  Dave Chapman). Existing files will be read normally (and the teletext PID set
  to 0), but once they are written back (due to some channel editing) the file
  will have the new format.
- The EPG scanner now scans each transponder only once per cycle.
- Deleted recordings are now automatically removed from disk after a while (not
  only when disk space is being needed for a new recording).
- Fixed repeat function in LIRC remote control.
- Changed the MAXDVBAPI macro in dvbapi.c to 4 in order to directly support the
  maximum possible number of DVB cards.
- The 'Ca' parameter in the default 'channels.conf' has been changed from '2'
  to '3' because the VDR prototype now has 3 DVB cards (and currently the CAM
  module only works if it is inserted into the last DVB card).
- The "Now", "Next" and "Schedule" menus now remember the current channel and
  restore the list when switching between them.
- The "Green" button in the "Recordings" menu can now be used to rewind a
  recording and play it from the very beginning.
- Fixed handling ':' in timer filenames and '\n' in timer summaries (see FORMATS).
- When removing recordings empty directories are now removed from the video
  directory.
- Added the "schnitt" tools from Matthias Schniedermeyer.
- New SVDRP command MESG to display a short message on the OSD.
- The Perl script 'svdrpsend.pl' can be used to send SVDRP commands to VDR.
- SVDRP can now immediately reuse the same port if VDR is restarted.
- SVDRP now has a timeout after which the connection is automatically closed
  (default is 300 seconds, can be changed in "Setup").
- The compile time switch VFAT can be used to make VDR avoid the ':' character
  in file names (VFAT can't handle them). Do 'make VFAT=1' to enable this.
- Support for DVB-C (thanks to Hans-Peter Raschke and Peter Hofmann).
  See the INSTALL file for more information about the use of VDR with cable.
- Fixed an occasional segfault in the EIT processor.
- A value of '0' for the EPGScanTimeout setup parameter now completely turns off
  scanning for EPG data on both single and multiple card systems.
- New setup parameter "PrimaryLimit" that allows to prevent timers from using the
  primary DVB interface in multi card systems. Default value is 0, which means
  that every timer may use the primary interface.
- The 'active' field of a timer will now be explicitly set to '1' if the user
  modifies an active timer (see FORMATS for details).
- The new command line option -w can be used to activate a watchdog that makes
  VDR exit in case the main program loop does not respond for more than the
  given number of seconds. This is mainly useful in combination with the new
  'runvdr' script that restarts VDR in case is has exited.
This commit is contained in:
Klaus Schmidinger
2001-02-24 18:00:00 +01:00
parent 3fe3c15d5d
commit f2937af95c
58 changed files with 2214 additions and 401 deletions

84
Tools/schnitt/README Normal file
View File

@@ -0,0 +1,84 @@
Sammlung von "Hilfs"-Scripten
Diese Sammlung an "Hilfs"-Scripten habe ich mir zum scheiden und anderen
Zwecken zusammengeschrieben.
Das ganze unterliegt natuerlich der GPL.
Ich bin nicht sonderlich gut im "Dokumentieren". Also gilt die Devise
"Hilf dir selbst".
Ein paar Worte zu den "Hart"-Codierten Pfaden.
/yele/video (/video/video0)
/yelg/video (/video/video1)
Sind die 2 Pfade auf meinem DVB-Rechner
/x1/video
Ist das Verzeichniss in das die Video zum schneiden verschoben werden.
/x1/temp
/x2/temp
Sind die beim schneiden verwendeten Temporaer-Verzeichnisse
Enthalten sind folgende Scripte:
cutall -> "Master"-Script zum starten des Scheide vorgangs.
Ist ein "find" nach "cut" -Dateien
cutt -> Das "eigentliche" Schnitt-Script
Scheidet die Stuecke aus, demultipext, remultipext,
splitted die Dateien und macht am Ende ein
ISO-Image daraus
index.php -> PHP-Script zum finden der Schnitt-Punkte, mit
Testmoeglichkeit ob erfolgreich an diesem Punkt
geschnitten werden kann
mv2 -> Zum Moven der Aufnahmen von meinem DVB-Rechner
auf mein "Arbeitsrechner"
schnitt.pl -> Extraiert ein einzelnes Bild um es anzuzeigen
(Fuer index.php)
schnitt2.pl -> Gibt alles zwischen 2 Schnittpunkten auf STDOUT aus
schnitt3.pl -> Testet ob erfolgreich geschnitten werden kann.
schnitt3.pl.new -> Version fuer PES-Datenstroeme
schnitt4.pl -> "Beschleunigtes" Schnitt-Programm fuer VIVA
aufnahmen. 1 "VIDEO" pro Zeile erzeugt
"a", "b" ... Dateien
schnitt5.pl -> Gibt Datei-Nummern von einer Schnittmarke
+- 15000 Frames aus
schnitt6.pl -> Loescht alle Dateien die nicht von in einer von
schnitt5.pl abgedeckt ist. (Damit mv2 nicht so
lange braucht)
show -> Wird auf einem X-Display gestartet und zeigt das
aktuelle Bild von "schnitt.pl" an
vdr-remote.pl -> "Skeleton" um ueber SVDR-Kommandos zu schicken
vdr2 -> Start-Script
vmount -> Mounten aller zusammengehoeriger ISO-Images zum
abspielen
Hilsscripte:
------------
cut.pl -> Entspricht weitestgehend "split" aber mit
"Nummer" anstatt Buchstaben
cut2 -> Entfernt escapende Backslashes
cutall2 -> Springt ins Schnitt-Verzeichniss und ruft das
"eigentliche" Schnitt-Script auf
lmplex -> Multiplexed Datenstrome unter Zurhilfename
saemtlicher CPUs
schnittcommon.pli -> Das "Common" Script fuer schnitt?.pl
getpreviframe.pl -> Findet das vorherige I-Frame.
unsort -> Macht das Gegenteil von sort.
Die ganze "Schnittloesung" ist leider etwas "unbrauchbar", weil ich aus
Unachtsamkeit leider die gepatchten Sourcen von 2 wichtigen Programm
geloescht habe.
dumpfrage -> Extraiert das erste Frage in eine Datei zum
anzeigen (gepatchtes dump aus "libmpeg3"
pvademux -> gepatcht um eine Pfad-Angabe
Entweder macht jemand/ich patchen "nochmal" oder ich kann auch die
Binaries zur Verfuegung stellen.

40
Tools/schnitt/cut.pl Executable file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/perl -w
use strict;
my $maxsize = 660 * 1024 * 1024;
my $read = 1024*1024;
my $size = 1024*1024;
my $filenum = "1";
my $count = 0;
my ($fi,$data);
$fi = sprintf ("part%d",$filenum);
open (FI,">$fi");
while ($read == $size)
{
if ($count < $maxsize)
{
$read = read (STDIN,$data,$size);
print FI $data;
$count += $size;
$a = $count /1024/1024;
if ($a % 10 == 0) {
print STDERR "File: $filenum Size: ${a}MB\n";
}
}
else
{
close (FI);
$filenum++;
$fi = sprintf ("part%d",$filenum);
open (FI,">$fi");
$count = 0;
}
}
close FI;

2
Tools/schnitt/cut2 Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
cat cut | head -n 1 | tr -d [\\\\]

4
Tools/schnitt/cutall Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
cutdir=/x1/video/
find $cutdir -name "cut" -exec cutall2 {} \;

5
Tools/schnitt/cutall2 Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
a=`echo $1 | cut -d / -f1-5`
cd $a
cutt
mv cut cut.bak

85
Tools/schnitt/cutt Executable file
View File

@@ -0,0 +1,85 @@
#!/bin/sh
DIRA=/x2/temp
DIRB=/x1/temp
if [ -f cut ]; then
name="`cut2`"
echo $name
count=`cat cut | wc -l`
let count=count-1
let test=count%2
if [ "$test" == "1" ]; then
echo Ungerade Anzahl von Markierungen
exit 1
fi
file=1
while [ "$count" != "0" ]
do
start=`cat cut | tail -n $count | head -n 1`
let count=count-1
end=`cat cut | tail -n $count | head -n 1`
let count=count-1
echo Cutting\&Demuxing from $start to $end
schnitt2.pl $start $end | pvademux $DIRA teil$file
# schnitt2.pl $start $end | pes2av_pes | pvademux $DIRA teil$file
let file=file+1
done
else
echo Keine Beschreibungsdatei
exit 1
fi
# Ab hier mkimg
sync
lmplex $DIRA $DIRB `ls -la $DIRA/teil*.m2v | cut -b 30- | sort -n -r | cut -d / -f4`
echo Multiplexing DONE
rm -f $DIRA/teil*.m2v $DIRA/teil*.mp2
sync
if [ -f $DIRB/teil1.mpg ]; then
echo Splitting
cd $DIRA
# cat $DIRB/teil*.mpg | split -b 723517440
cat $DIRB/teil*.mpg | cut.pl
rm $DIRB/teil*
fi
sync
cd $DIRA
if [ -f part2 ]; then
count=1
cond=0
while [ "$cond" != "1" ]
do
mkdir a
mv "part$count" "a/${name} Teil $count"
echo mkisofs Teil $count
mkisofs -r -o $DIRB/image1.raw a
rm -rf a
mv -- $DIRB/image1.raw "$DIRB/${name} Teil $count"
sync
let count=count+1
if [ ! -f "part$count" ]; then
cond=1
fi
done
else
mkdir a
mv part1 "a/${name}"
echo mkisofs
mkisofs -r -o $DIRB/image1.raw a
rm -rf a
mv -- $DIRB/image1.raw "$DIRB/${name}"
fi

31
Tools/schnitt/getpreviframe.pl Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/perl
use strict;
my ($index, $oindex);
require "/usr/local/bin/my/schnittcommon.pli";
if (!open (INDEX,"index.vdr"))
{
exit 1;
}
$index = $oindex = $ARGV[0];
if ($index > 0)
{
&prevI;
if ($oindex != $index)
{
print "$index\n";
}
else
{
print "$oindex\n";
}
}
else
{
print "0\n";
}

215
Tools/schnitt/index.php Normal file
View File

@@ -0,0 +1,215 @@
<html>
<head>
<title>Schneiden</title>
</head>
<body bgcolor=#C0C0C0>
<?
if ($level == 0)
{
$dircount=0;
$handle=opendir('/x1/video');
while ($file = readdir($handle)) {
if ($file != "." && $file != ".." && $file != "epg.data") {
$dir=$file;
$dircount++;
}
}
if ($dircount == 1) {
$level=1;
}
else
{
?>
<center><h1>Sender</h1></center>
<form action="index.php" method="post">
<input type=hidden name=level value="1">
<?
$handle=opendir('/x1/video');
while ($file = readdir($handle)) {
if ($file != "." && $file != ".." && $file != "epg.data") {
echo "<input type=submit name=dir value=\"$file\">\n";
}
}
closedir($handle);
?>
</form>
<?
}
}
if ($level == 1)
{
$dircount=0;
$handle=opendir("/x1/video/$dir");
while ($file = readdir($handle)) {
if ($file != "." && $file != "..") {
$dira="$dir/$file";
$dircount++;
}
}
if ($dircount == 1) {
$dir = $dira;
$level = 2;
}
else
{
?>
<form action="index.php" method="post">
<input type=hidden name=level value="2">
<?
echo "<center><h1>Filme/Serien fuer den Sender $dir</h1></center>";
$handle=opendir("/x1/video/$dir");
while ($file = readdir($handle)) {
if ($file != "." && $file != "..") {
echo "<input type=submit name=dir value=\"$dir/$file\"><br>\n";
}
}
closedir($handle);
?>
</form>
<?
}
}
if ($level == 2)
{
if ($aindex)
$index = $aindex;
else if (!$index)
$index = 0;
if ($dir)
chdir ("/x1/video/$dir");
switch ($cindex) {
case "-10000":
if ($index >=10000)
$index -= 10000;
break;
case "-4000":
if ($index >=4000)
$index -= 4000;
break;
case "-2000":
if ($index >=2000)
$index -= 2000;
break;
case "-1000":
if ($index >=1000)
$index -= 1000;
break;
case "-500":
if ($index >=500)
$index -= 500;
break;
case "-100":
if ($index >=100)
$index -= 100;
break;
case "Vorheriges I-Frame":
$pindex = $index - 1;
$fp = popen ("/usr/local/bin/my/getpreviframe.pl $pindex","r");
$i = fgets($fp,1000);
$index = chop ($i);
pclose ($fp);
break;
case "Naechstes I-Frame":
$index ++;
break;
case "+100":
$index += 100;
break;
case "+500":
$index += 500;
break;
case "+1000":
$index += 1000;
break;
case "+2000":
$index += 2000;
break;
case "+4000":
$index += 4000;
break;
case "+10000":
$index += 10000;
break;
}
if ($test)
{
$fp = popen ("/usr/local/bin/my/schnitt3.pl $index","r");
$i = fgets($fp,1000);
pclose ($fp);
$index = chop ($i);
}
if ($name)
{
$fp = fopen ("cut","w");
fputs ($fp,"$name\n");
fclose ($fp);
}
if ($cut)
{
$fp = fopen ("cut","a");
fputs ($fp,"$index\n");
fclose ($fp);
}
$fp = popen ("/usr/local/bin/my/schnitt.pl $index","r");
$i = fgets($fp,1000);
pclose ($fp);
$index = chop ($i);
system ("/usr/local/bin/my/dumpframe /x2/temp/bild.m2v");
system ("mv output.ppm /x2/temp");
system ("touch /x2/temp/newpic");
system ("killall sleep");
?>
<form action="index.php" method="post">
<input type=hidden name=level value="2">
<input type=hidden name=dir value="<?=$dir?>">
<input type=hidden name=index value=<?=$index?>>
<table width=90% align=center>
<tr>
<td><h1>Index <?=$index?></h1></td>
<td><h1>Dir: <?=$dir?></h1></td>
</tr>
</table>
<table width=80% align=center>
<tr>
<td><input type=submit name=cindex value="-10000"></td>
<td><input type=submit name=cindex value="-4000"></td>
<td><input type=submit name=cindex value="-2000"></td>
<td><input type=submit name=cindex value="-1000"></td>
<td><input type=submit name=cindex value="-500"></td>
<td><input type=submit name=cindex value="-100"></td>
<td><input type=submit name=cindex value="Vorheriges I-Frame"></td>
<td><input type=submit name=cindex value="Naechstes I-Frame"</td>
<td><input type=submit name=cindex value="+100"></td>
<td><input type=submit name=cindex value="+500"></td>
<td><input type=submit name=cindex value="+1000"></td>
<td><input type=submit name=cindex value="+2000"></td>
<td><input type=submit name=cindex value="+4000"></td>
<td><input type=submit name=cindex value="+10000"></td>
</tr>
</table>
<table>
<tr>
<td>Absoluter Index: <input type=text name=aindex size=6></td>
<td><input type=submit name=test value="Schnitt-Test"></td>
<td><input type=submit name=cut value="Mark"></td>
</form>
<form action="index.php" method="post">
<input type=hidden name=level value="2">
<input type=hidden name=dir value="<?=$dir?>">
<input type=hidden name=index value=<?=$index?>>
<td>Titel: <input type=text name=name size=50 maxlength=255></td>
</form>
</tr>
</table>
<?
}
?>
</body>
</html>

51
Tools/schnitt/lmplex Executable file
View File

@@ -0,0 +1,51 @@
#! /usr/bin/perl
### Calculate the number of CPUs we want to keep busy
open IN, "/proc/cpuinfo";
$cpus = grep /processor.*:/, <IN>;
close IN;
### This is a list of files to encode
@names = @ARGV;
$dira = shift @names;
$dirb = shift @names;
### This is the name of the encoder to use.
$coder = "/usr/local/bin/mplex ";
###
###
###
###
# Encode a single file
sub do_one {
my($m2v) = shift;
# Make mp3 from wav
$m2v =~ s/\.m2v$//;
# In a subprocess, encode the file
printf "Multiplexing ${m2v}\n";
unless($pid = fork) {
system ("$coder ${dira}/${m2v}.m2v ${dira}/${m2v}.mp2 ${dirb}/${m2v}.mpg");
exit;
}
}
# Go ahead and prefork $cpus encoders
foreach $i (0 .. $cpus-1) {
&do_one($names[0]) if ($names[0] ne "");
shift @names;
}
# Wait for the end of each encoder, start a new one...
foreach $i (@names) {
wait;
&do_one($i);
}
# Wait for everything to close down.
while(wait > 0) {
;
}

23
Tools/schnitt/mv2 Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
DIR = /x1/video
if [ ! "$UID" = 0 ]; then
if [ -d "$1" ]; then
cd $DIR
a=`echo "$1" | cut -d / -f4-`
mkdir -p "$a"
cd "$a"
(echo cd "$1"; echo mget \*)| ftp -i dvb
cd $DIR
ls -Ls $1 > /tmp/yele
ls -Ls $a > /tmp/x1
a=`echo "$1" | cut -d \/ -f3-`
diff -u /tmp/yele /tmp/x1 &> /dev/null && rm -rfv /yel?/$a
rm /tmp/yele
rm /tmp/x1
rmdir /yel?/video/*
fi
else
echo Not as root
fi

26
Tools/schnitt/schnitt.pl Executable file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/perl
require "/usr/local/bin/my/schnittcommon.pli";
if (!open (INDEX,"index.vdr"))
{
exit 1;
}
$index = $ARGV[0];
&nextI;
$offset1 = $offset;
&readnext;
$off = $offset - $offset1;
close (FI);
$fi = sprintf ("%03d.vdr",$file);
open (FI,$fi);
open (FO,">bild");
sysseek (FI,$offset1,0);
sysread (FI,$temp,200000);
syswrite (FO,$temp,200000);
close (FI);
close (FO);
`/usr/local/bin/pvademux.old /x2/temp bild`;
#`/usr/local/bin/pes2av_pes bild | /usr/local/bin/pvademux /x2/temp bild`;
print "$index\n";

91
Tools/schnitt/schnitt2.pl Executable file
View File

@@ -0,0 +1,91 @@
#!/usr/bin/perl
require "/usr/local/bin/my/schnittcommon.pli";
if (!open (INDEX,"index.vdr"))
{
print "Error opening index.vdr";
exit 1;
}
$index = $ARGV[0];
&nextI;
$file1 = $file;
$offset1 = $offset;
$index = $ARGV[1];
&nextI;
$file2 = $file;
$offset2 = $offset;
if ($file1 == $file2)
{
$count = $offset2 - $offset1;
$cond = 0;
$size = 1024*1024;
$fi = sprintf ("%03d.vdr",$file);
open (FI,$fi);
sysseek (FI,$offset1,0);
while ($cond == 0)
{
if ($count > $size)
{
$read = sysread (FI,$data,$size);
print $data;
$count -= $size;
}
else
{
$read = sysread (FI,$data,$count);
print $data;
$cond = 1;
}
}
}
else
{
$count = $offset2;
$cond = 0;
$read = $size = 1024*1024;
$fi = sprintf ("%03d.vdr",$file1);
open (FI,$fi);
sysseek (FI,$offset1,0);
while ($read == $size)
{
$read = sysread (FI,$data,$size);
print $data;
}
close (FI);
$file1++;
while ($file1 != $file2)
{
$fi = sprintf ("%03d.vdr",$file1);
open (FI,$fi);
$read = 1024*1024;
while ($read == $size)
{
$read = sysread (FI,$data,$size);
print $data;
}
close (FI);
$file1++;
}
$fi = sprintf ("%03d.vdr",$file2);
open (FI,$fi);
while ($cond == 0)
{
if ($count > $size)
{
$read = sysread (FI,$data,$size);
print $data;
$count -= $size;
}
else
{
$read = sysread (FI,$data,$count);
print $data;
$cond = 1;
}
}
}

64
Tools/schnitt/schnitt3.pl Executable file
View File

@@ -0,0 +1,64 @@
#!/usr/bin/perl
require "/usr/local/bin/my/schnittcommon.pli";
open (INDEX,"index.vdr");
$index = $ARGV[0];
&nextI;
$oldindex = $index;
$tempindex = $index;
$add = -1;
$fi = sprintf ("%03d.vdr",$file);
open (FI2,$fi);
open (FO,">test");
sysseek (FI2,$offset,0);
sysread (FI2,$temp,3000000);
syswrite (FO,$temp,3000000);
close (FI2);
close (FO);
`/usr/local/bin/pvademux.old . test`;
if ( -s "test.mp2")
{
`rm test*`;
print "$index\n";
exit 0;
}
while (1)
{
if ($index == 0)
{
$add = 1;
}
if ($add = -1)
{
$index--;
&prevI;
}
else
{
nextI;
}
$fi = sprintf ("%03d.vdr",$file);
open (FI2,$fi);
open (FO,">test");
sysseek (FI2,$offset,0);
sysread (FI2,$temp,3000000);
syswrite (FO,$temp,3000000);
close (FI2);
close (FO);
`/usr/local/bin/pvademux.old . test`;
if ( -s "test.mp2")
{
`rm test*`;
if ($index < 0)
{
$index *= -1;
}
print "$index\n";
exit 0;
}
}

77
Tools/schnitt/schnitt3.pl.new Executable file
View File

@@ -0,0 +1,77 @@
#!/usr/bin/perl
require "/usr/local/bin/my/schnittcommon.pli";
open (INDEX,"index.vdr");
$index = $ARGV[0];
&nextI;
$oldindex = $index;
$tempindex = $index;
$add = -1;
$fi = sprintf ("%03d.vdr",$file);
open (FI2,$fi);
open (FO,">test2");
sysseek (FI2,$offset,0);
sysread (FI2,$temp,3000000);
syswrite (FO,$temp,3000000);
close (FI2);
close (FO);
system ("pes2av_pes test2 > test 2>/dev/null");
open (PVA,"/usr/local/bin/pvademux.old . test 2>&1 |");
@a=<PVA>; close PVA;
@b=split (/\s/,$a[2]);
if (!($b[4] =~ /\-/) && $b[4] < 2000)
{
unlink <test*>;
print "$index\n";
exit 0;
}
while (1)
{
if ($index == 0)
{
$add = 1;
}
if ($add = -1)
{
$index--;
&prevI;
}
else
{
nextI;
}
$fi = sprintf ("%03d.vdr",$file);
open (FI2,$fi);
open (FO,">test2");
sysseek (FI2,$offset,0);
sysread (FI2,$temp,3000000);
syswrite (FO,$temp,3000000);
close (FI2);
close (FO);
system ("/usr/local/bin/pes2av_pes test2 > test 2>/dev/null");
open (PVA,"/usr/local/bin/pvademux.old . test 2>&1 |");
@a=<PVA>; close PVA;
@b=split (/\s/,$a[2]);
if (!($b[4] =~ /\-/) && $b[4] < 2000)
{
unlink <test*>;
if ($index < 0)
{
$index *= -1;
}
print "$index\n";
exit 0;
}
}

13
Tools/schnitt/schnitt4.pl Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/perl
open (FI,$ARGV[0]) or die "Kann Input-Datei nicht oeffnen";
$count = 1;
while (<FI>)
{
chomp;
$char = sprintf ("%c",$count + 96);
print "Cutting from/to $_ into /x2/clips/$char\n";
system ("/usr/local/bin/my/schnitt2.pl $_ > /x2/clips/$char");
$count++;
}

16
Tools/schnitt/schnitt5.pl Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/perl
require "/usr/local/bin/my/schnittcommon.pli";
open (INDEX,"index.vdr");
$index = $ARGV[0] - 15000;
&nextI;
$file1 = $file;
$index += 30000;
&nextI;
$file2 = $file;
print "$file1 $file2\n";

30
Tools/schnitt/schnitt6.pl Executable file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/perl
open (FI,"a");
while (<FI>)
{
open (SCH,"/usr/local/bin/my/schnitt5.pl $_|");
$files = <SCH>;
chomp $files;
($a,$b) = split (/\s/,$files);
$files[$a] = 1;
$files[$b] = 1;
close (SCH);
}
while (<0*.vdr>)
{
$_ =~ /\d(\d\d)\.vdr/;
if ($files[$1])
{
print "Keeping $1\n";
}
else
{
print "Deleting $_\n";
unlink $_;
}
}
close (FI);

64
Tools/schnitt/schnittcommon.pli Executable file
View File

@@ -0,0 +1,64 @@
sub nextI
{
if (!$size)
{
$size = -s INDEX;
}
local ($a,$b,$c,$dummy);
$cond = 0;
seek (INDEX,$index * 8,0);
while ($cond == 0)
{
&readnext;
if ($frame == 1)
{
$cond = 1;
}
else
{
$index++;
if ($index > ($size/8-1))
{
$index = $size/8-1;
&prevI;
print "$index\n";
exit 1;
}
}
}
}
sub readnext
{
read (INDEX,$a,4);
read (INDEX,$b,1);
read (INDEX,$c,1);
read (INDEX,$dummy,2);
$offset = unpack ("L",$a);
$frame = unpack ("C",$b);
$file = unpack ("C",$c);
}
sub prevI
{
local ($a,$b,$c,$dummy);
$cond = 0;
seek (INDEX,$index * 8,0);
while ($cond == 0)
{
&readnext;
if ($frame == 1)
{
$cond = 1;
}
else
{
$index--;
seek (INDEX,$index * 8,0);
}
}
}
1;

11
Tools/schnitt/show Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
cd /x2/temp
while true
do
if [ -f newpic ]; then
killall xli
rm -f newpic
xli output.ppm &
fi
sleep 24h
done

25
Tools/schnitt/unsort Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/perl
while (<>)
{
$h{$_}=1;
}
foreach $key (sort shuffle keys %h)
{
print $key;
}
sub shuffle {
$ran = rand(1);
if ($ran > 0.5)
{
return -1;
}
else
{
return 1;
}
}

40
Tools/schnitt/vdr-remote.pl Executable file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/perl -w
use strict;
use Socket;
my ($dest, $port, $iaddr, $paddr, $proto, $line);
$dest = "localhost";
$port = "2001";
$iaddr = inet_aton($dest) || Error("no host: $dest");
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) || Error("socket: $!");
connect(SOCK, $paddr) || Error("connect: $!");
select (SOCK); $| = 1;
$a=<SOCK>;
for (;;)
{
open (FI,"/tmp/vdr-keys");
while (<FI>)
{
chomp;
print "$_\r\n";
$a=<SOCK>;
}
close (FI);
}
print "quit\r\n";
$a=<SOCK>;
close (SOCK) || Error("close: $!");
sub Error
{
print STDERR "@_\n";
exit 0;
}

2
Tools/schnitt/vdr2 Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
irpty ~/.lircrc-vdr -- vdr -c /home/ms/.vdr -v /video/video0

18
Tools/schnitt/vmount Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/sh
count=1
cond=0
if [ -f "$1" ]; then
mount "$1" /mnt/1 -o loop
$cond = 1
else
while [ "$cond" != "1" ]
do
if [ -f "$1$count" ]; then
mount "$1$count" /mnt/$count -o loop
else
cond=1
fi
let count=count+1
done
fi