Tiger_&_Dragon
1 2 3 4 5
# Shell system("./extern $do $what $ever") == 0 or die "system() failed: $!\n"; # no Shell system("./extern", $do, $what, $ever) == 0 or die "system() failed: $!\n";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
sub _runexternal {
my ($shelf,$args) = @_;
my $dbg = \$args->{'debug'} ;
my $l=\$args->{'line'} ;
my $line = ${$l} ;
#$line =~ s/\&/\\\&/smx ;
if ( not ( $line ) ) { return ('255')};
my @response = ();
my @errors = ();
my $childpid = open3(\*CHLD_IN,\*CHLD_OUT, \*CHLD_ERR, $line);
use Symbol 'gensym'; #$err = gensym;
if ( ${$dbg} ) {
while (<CHLD_OUT>) {
$shelf->message({msg=>"[_runexternal]$_",debug=>${$dbg},v=>'vvvvvvv',});
push @response,$_;
}
} else {
@response = <CHLD_OUT>;
}
@errors = <CHLD_ERR>;
waitpid $childpid,0 or croak $ERRNO;
my $exitcode = $CHILD_ERROR >> ACHT;
push @response,$exitcode;
close CHLD_OUT or croak $ERRNO;
close CHLD_ERR or croak $ERRNO;
foreach my $r (@response) {
$shelf->message({msg=>"[_runexternal]$r",debug=>${$dbg},v=>'vvvvvvv',});
}
return (@response);
} # end sub _runexternal
2011-07-03T17:15:34 lichtkindOT: guter film :)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ touch "foo&bar"
$ perl -wE'
system("mv", "foo&bar", "/tmp/foo&bar");
'
$ ls /tmp/foo\&bar
/tmp/foo&bar
$ rm /tmp/foo\&bar
touch "foo&bar"
$ perl -wE'
use File::Copy qw/ move /; move("foo&bar", "/tmp/foo&bar")
'
$ ls /tmp/foo\&bar
/tmp/foo&bar
$
use File::Copy
1
2
move '/opt/video.00/Tiger_&_Dragon/transcodiert.m4v',
'/opt/video.00/film/Tiger_&_Dragon.m4v';
2011-07-04T11:19:35 topegSie doch auch. Schau mal weiter unten.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
sub _rename_and_move {
my $dir = shift;
my $vdrinfo = \$vdrtranscode->getfromxml({file=>"$dir/vdrtranscode.xml",field=>'ALL',debug=>$tracoenv->{'debug_flag'},});
my $w_x_h = ${$vdrinfo}->{'w_x_h'};
my $fps = ${$vdrinfo}->{'transcode_with_fps'};
my $title = ${$vdrinfo}->{'title'};
my $container = ${$vdrinfo}->{'container'};
my $dd_hd_sd = ${$vdrinfo}->{'dd_hd_sd'};
my $workfile = q{};
my $mytime = \$vdrtranscode->_preparedtime({timeformat=>2,}); ;
my $target_dimension_preset = {};
$vdrtranscode->message({msg=>"_rename_and_move|$dir|took w_x_h = $w_x_h ,dd_hd_sd = $dd_hd_sd and fps = $fps from xmlfile",v=>'vvv',});
my $wrkfile = q{};
my @flist = \$vdrtranscode->_get_files_in_dir({dir=>$dir,});
foreach my $f (@flist) {
if (${$f} =~ /vdrtranscode_tmp[.](?:mp4|m4v|mkv)/smx ) {
$wrkfile = ${$f};
}
}
$vdrtranscode->message({msg=>"_rename_and_move|work with $wrkfile",v=>'vvv',});
# include Videoformat on HD Targets
if ( ${$config}->{'Name_incl_Videoformat'} ) {
# origf size is in $w_x_h
my ( $orig_w , undef ) = split /x/smx , $w_x_h ;
$target_dimension_preset->{EINSNEUNZWEINULL} = '1080';
$target_dimension_preset->{EINSZWEIACHTNULL} = '720' ;
$target_dimension_preset->{SIEBENZWEINULL} = '480' ;
$workfile = "${$mytime}-$title-$target_dimension_preset->{$orig_w}p$fps.$container" ; #result in "date-Filename-1080p25.container"
}
$vdrtranscode->message({msg=>"_rename_and_move|copy $dir/$wrkfile to $tracoenv->{'outdir'}/$workfile",v=>'v',});
#copy $wrkfile,"$tracoenv->{'outdir'}/$workfile";
move $wrkfile,"$tracoenv->{'outdir'}/$workfile";
return ('_rename_and_copy_done');
} # end sub _renamefinishedvid
1 2 3
$vdrtranscode->message({msg=>"_rename_and_move|copy $dir/$wrkfile to $tracoenv->{'outdir'}/$workfile",v=>'v',}); #copy $wrkfile,"$tracoenv->{'outdir'}/$workfile"; move $wrkfile,"$tracoenv->{'outdir'}/$workfile";