From f2937af95ceaf3a52c327e96571367ef5475b3a1 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 24 Feb 2001 18:00:00 +0100 Subject: 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. --- Tools/schnitt/README | 84 ++++++++++++++++ Tools/schnitt/cut.pl | 40 ++++++++ Tools/schnitt/cut2 | 2 + Tools/schnitt/cutall | 4 + Tools/schnitt/cutall2 | 5 + Tools/schnitt/cutt | 85 ++++++++++++++++ Tools/schnitt/getpreviframe.pl | 31 ++++++ Tools/schnitt/index.php | 215 ++++++++++++++++++++++++++++++++++++++++ Tools/schnitt/lmplex | 51 ++++++++++ Tools/schnitt/mv2 | 23 +++++ Tools/schnitt/schnitt.pl | 26 +++++ Tools/schnitt/schnitt2.pl | 91 +++++++++++++++++ Tools/schnitt/schnitt3.pl | 64 ++++++++++++ Tools/schnitt/schnitt3.pl.new | 77 ++++++++++++++ Tools/schnitt/schnitt4.pl | 13 +++ Tools/schnitt/schnitt5.pl | 16 +++ Tools/schnitt/schnitt6.pl | 30 ++++++ Tools/schnitt/schnittcommon.pli | 64 ++++++++++++ Tools/schnitt/show | 11 ++ Tools/schnitt/unsort | 25 +++++ Tools/schnitt/vdr-remote.pl | 40 ++++++++ Tools/schnitt/vdr2 | 2 + Tools/schnitt/vmount | 18 ++++ 23 files changed, 1017 insertions(+) create mode 100644 Tools/schnitt/README create mode 100755 Tools/schnitt/cut.pl create mode 100755 Tools/schnitt/cut2 create mode 100755 Tools/schnitt/cutall create mode 100755 Tools/schnitt/cutall2 create mode 100755 Tools/schnitt/cutt create mode 100755 Tools/schnitt/getpreviframe.pl create mode 100644 Tools/schnitt/index.php create mode 100755 Tools/schnitt/lmplex create mode 100755 Tools/schnitt/mv2 create mode 100755 Tools/schnitt/schnitt.pl create mode 100755 Tools/schnitt/schnitt2.pl create mode 100755 Tools/schnitt/schnitt3.pl create mode 100755 Tools/schnitt/schnitt3.pl.new create mode 100755 Tools/schnitt/schnitt4.pl create mode 100755 Tools/schnitt/schnitt5.pl create mode 100755 Tools/schnitt/schnitt6.pl create mode 100755 Tools/schnitt/schnittcommon.pli create mode 100755 Tools/schnitt/show create mode 100755 Tools/schnitt/unsort create mode 100755 Tools/schnitt/vdr-remote.pl create mode 100755 Tools/schnitt/vdr2 create mode 100755 Tools/schnitt/vmount (limited to 'Tools/schnitt') diff --git a/Tools/schnitt/README b/Tools/schnitt/README new file mode 100644 index 0000000..29953e0 --- /dev/null +++ b/Tools/schnitt/README @@ -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. diff --git a/Tools/schnitt/cut.pl b/Tools/schnitt/cut.pl new file mode 100755 index 0000000..dd62c18 --- /dev/null +++ b/Tools/schnitt/cut.pl @@ -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; diff --git a/Tools/schnitt/cut2 b/Tools/schnitt/cut2 new file mode 100755 index 0000000..0193ac0 --- /dev/null +++ b/Tools/schnitt/cut2 @@ -0,0 +1,2 @@ +#!/bin/sh +cat cut | head -n 1 | tr -d [\\\\] diff --git a/Tools/schnitt/cutall b/Tools/schnitt/cutall new file mode 100755 index 0000000..355935f --- /dev/null +++ b/Tools/schnitt/cutall @@ -0,0 +1,4 @@ +#!/bin/sh +cutdir=/x1/video/ + +find $cutdir -name "cut" -exec cutall2 {} \; diff --git a/Tools/schnitt/cutall2 b/Tools/schnitt/cutall2 new file mode 100755 index 0000000..90b0f46 --- /dev/null +++ b/Tools/schnitt/cutall2 @@ -0,0 +1,5 @@ +#!/bin/sh +a=`echo $1 | cut -d / -f1-5` +cd $a +cutt +mv cut cut.bak diff --git a/Tools/schnitt/cutt b/Tools/schnitt/cutt new file mode 100755 index 0000000..4e89b7a --- /dev/null +++ b/Tools/schnitt/cutt @@ -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 diff --git a/Tools/schnitt/getpreviframe.pl b/Tools/schnitt/getpreviframe.pl new file mode 100755 index 0000000..6774f31 --- /dev/null +++ b/Tools/schnitt/getpreviframe.pl @@ -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"; +} diff --git a/Tools/schnitt/index.php b/Tools/schnitt/index.php new file mode 100644 index 0000000..58a288f --- /dev/null +++ b/Tools/schnitt/index.php @@ -0,0 +1,215 @@ + + + Schneiden + + + +

Sender

+
+ +\n"; + } + } + closedir($handle); +?> +
+ +
+ +

Filme/Serien fuer den Sender $dir

"; + $handle=opendir("/x1/video/$dir"); + while ($file = readdir($handle)) { + if ($file != "." && $file != "..") { + echo "
\n"; + } + } + closedir($handle); +?> +
+=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"); +?> +
+ + +> + + + + + +

Index

Dir:

+ + + + + + + + + + + + + + + + +
+
+ + + + + + + + + +> + + + +
Absoluter Index:
Titel:
+ + + diff --git a/Tools/schnitt/lmplex b/Tools/schnitt/lmplex new file mode 100755 index 0000000..8cbb50f --- /dev/null +++ b/Tools/schnitt/lmplex @@ -0,0 +1,51 @@ +#! /usr/bin/perl + +### Calculate the number of CPUs we want to keep busy +open IN, "/proc/cpuinfo"; +$cpus = grep /processor.*:/, ; +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) { + ; +} diff --git a/Tools/schnitt/mv2 b/Tools/schnitt/mv2 new file mode 100755 index 0000000..a0cefba --- /dev/null +++ b/Tools/schnitt/mv2 @@ -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 diff --git a/Tools/schnitt/schnitt.pl b/Tools/schnitt/schnitt.pl new file mode 100755 index 0000000..d5521eb --- /dev/null +++ b/Tools/schnitt/schnitt.pl @@ -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"; diff --git a/Tools/schnitt/schnitt2.pl b/Tools/schnitt/schnitt2.pl new file mode 100755 index 0000000..e52b245 --- /dev/null +++ b/Tools/schnitt/schnitt2.pl @@ -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; + } + } + } diff --git a/Tools/schnitt/schnitt3.pl b/Tools/schnitt/schnitt3.pl new file mode 100755 index 0000000..7cc0f7f --- /dev/null +++ b/Tools/schnitt/schnitt3.pl @@ -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; + } + } diff --git a/Tools/schnitt/schnitt3.pl.new b/Tools/schnitt/schnitt3.pl.new new file mode 100755 index 0000000..04a6239 --- /dev/null +++ b/Tools/schnitt/schnitt3.pl.new @@ -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=; close PVA; +@b=split (/\s/,$a[2]); + +if (!($b[4] =~ /\-/) && $b[4] < 2000) + { + unlink ; + 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=; close PVA; +@b=split (/\s/,$a[2]); + +if (!($b[4] =~ /\-/) && $b[4] < 2000) + { + unlink ; + if ($index < 0) + { + $index *= -1; + } + print "$index\n"; + exit 0; + } +} diff --git a/Tools/schnitt/schnitt4.pl b/Tools/schnitt/schnitt4.pl new file mode 100755 index 0000000..75f2ad1 --- /dev/null +++ b/Tools/schnitt/schnitt4.pl @@ -0,0 +1,13 @@ +#!/usr/bin/perl + +open (FI,$ARGV[0]) or die "Kann Input-Datei nicht oeffnen"; +$count = 1; + +while () + { + 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++; + } diff --git a/Tools/schnitt/schnitt5.pl b/Tools/schnitt/schnitt5.pl new file mode 100755 index 0000000..7626ab5 --- /dev/null +++ b/Tools/schnitt/schnitt5.pl @@ -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"; + diff --git a/Tools/schnitt/schnitt6.pl b/Tools/schnitt/schnitt6.pl new file mode 100755 index 0000000..92d9eb4 --- /dev/null +++ b/Tools/schnitt/schnitt6.pl @@ -0,0 +1,30 @@ +#!/usr/bin/perl + +open (FI,"a"); + +while () +{ + open (SCH,"/usr/local/bin/my/schnitt5.pl $_|"); + $files = ; + 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); diff --git a/Tools/schnitt/schnittcommon.pli b/Tools/schnitt/schnittcommon.pli new file mode 100755 index 0000000..f221f41 --- /dev/null +++ b/Tools/schnitt/schnittcommon.pli @@ -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; diff --git a/Tools/schnitt/show b/Tools/schnitt/show new file mode 100755 index 0000000..afed79b --- /dev/null +++ b/Tools/schnitt/show @@ -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 diff --git a/Tools/schnitt/unsort b/Tools/schnitt/unsort new file mode 100755 index 0000000..83adfb6 --- /dev/null +++ b/Tools/schnitt/unsort @@ -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; + } +} + diff --git a/Tools/schnitt/vdr-remote.pl b/Tools/schnitt/vdr-remote.pl new file mode 100755 index 0000000..32d408e --- /dev/null +++ b/Tools/schnitt/vdr-remote.pl @@ -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=; + +for (;;) + { + open (FI,"/tmp/vdr-keys"); + while () + { + chomp; + print "$_\r\n"; + $a=; + } + close (FI); + } + +print "quit\r\n"; +$a=; +close (SOCK) || Error("close: $!"); + +sub Error +{ + print STDERR "@_\n"; + exit 0; +} diff --git a/Tools/schnitt/vdr2 b/Tools/schnitt/vdr2 new file mode 100755 index 0000000..96557bf --- /dev/null +++ b/Tools/schnitt/vdr2 @@ -0,0 +1,2 @@ +#!/bin/sh +irpty ~/.lircrc-vdr -- vdr -c /home/ms/.vdr -v /video/video0 diff --git a/Tools/schnitt/vmount b/Tools/schnitt/vmount new file mode 100755 index 0000000..6b79064 --- /dev/null +++ b/Tools/schnitt/vmount @@ -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 -- cgit v1.2.3