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