summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2010-09-21 12:22:34 +0000
committerPetter Reinholdtsen <pere@hungry.com>2010-09-21 12:22:34 +0000
commita5f8f8f21ebbae6e7c43906772a41582ddd6b7fd (patch)
tree96fea7a033268c8ca958e93756a09bc50bf13fa0 /tools
parenta27864ea4d1dccd24ee412e668424c48ad3ad8e8 (diff)
Whitespace cleaning.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/gen_frikanalen_video.pl70
1 files changed, 35 insertions, 35 deletions
diff --git a/tools/gen_frikanalen_video.pl b/tools/gen_frikanalen_video.pl
index 84a3a66..f65d350 100755
--- a/tools/gen_frikanalen_video.pl
+++ b/tools/gen_frikanalen_video.pl
@@ -2,11 +2,11 @@
# Script for adding start/end poster and convert to frikanalen acceptable avi format anamporphic PAL with pillarboxing
# Script is work in progress 2010-09-04 /JB
-# standard backggrund for NUUG is in ./lib/graphic/tv-bg.png (relative to script location in svn-tree)
+# standard backggrund for NUUG is in ./lib/graphic/tv-bg.png (relative to script location in svn-tree)
# metafile format is like this:
#
#presenter=Jørgen Fjeld
-#title=Ruby on Rails enterprise behov , en velidg lang tittel som jeg lurer på hvordan vil se ut på forsiden av NUUGS video sldf lsdkfms msf
+#title=Ruby on Rails enterprise behov , en velidg lang tittel som jeg lurer på hvordan vil se ut på forsiden av NUUGS video sldf lsdkfms msf
#date=2010-03-09
#place=Oslo
#url=http://www.nuug.no
@@ -14,7 +14,7 @@
#endnote2=NUUG
#endnote3=
#endnote4=email: sekretariat@nuug.no
-#
+#
use strict;
use warnings;
@@ -45,18 +45,18 @@ my $normalize_cmd = "/usr/bin/normalize-audio";
my $soundlevel_dbfs = '-18dBFS';
#foreach (keys %opts ) { print "$_\n"; };
-if ( $opts{'m'} ) {
- $metafile = $opts{'m'} ;
-} else {
+if ( $opts{'m'} ) {
+ $metafile = $opts{'m'} ;
+} else {
usage();
exit 1;
}
my $meta = read_meta();
-if ( $opts{'b'} ) {
- $bgfile = $opts{'b'} ;
-} else {
+if ( $opts{'b'} ) {
+ $bgfile = $opts{'b'} ;
+} else {
usage();
exit 1;
}
@@ -65,27 +65,27 @@ if ( $opts{'b'} ) {
`mkdir -p $workdir`;
if ( $ARGV[0] && $ARGV[0] eq 'front' ) {
- create_startposter_png($startposter,$bgfile);
+ create_startposter_png($startposter,$bgfile);
print "Frontpage in $startposter\n";
print "Check it out !\n";
exit ;
}
-if ( $opts{'o'} ) {
- $outputfile = $opts{'o'} ;
-} else {
+if ( $opts{'o'} ) {
+ $outputfile = $opts{'o'} ;
+} else {
usage();
exit 1;
}
-if ( $opts{'i'} ) {
- $srcfile = $opts{'i'} ;
-} else {
+if ( $opts{'i'} ) {
+ $srcfile = $opts{'i'} ;
+} else {
usage();
exit 1;
}
-if ( $opts{'s'} ) {
+if ( $opts{'s'} ) {
$srtfile = getsrtfile();
}
@@ -96,7 +96,7 @@ create_startposter_png($startposter,$bgfile);
create_endposter_png($endposter,$bgfile);
gen_dv_from_png($startposter,3,$startposter_dv);
gen_dv_from_png($endposter,3,$endposter_dv);
-my $normalized_video_body = gen_video_body($srcfile);
+my $normalized_video_body = gen_video_body($srcfile);
glue_dv($opts{'o'},$startposter_dv,$normalized_video_body,$endposter_dv);
#### Functions #########
@@ -122,7 +122,7 @@ sub read_meta {
sub count_words_n_space {
my $word = shift;
my $count = 0;
- while ( $word =~ /(.)/g ) { $count++; }
+ while ( $word =~ /(.)/g ) { $count++; }
$count++;
return $count;
}
@@ -131,8 +131,8 @@ sub break_title {
my $title = shift;
print $title;
my $cols = 30;
- my $count = 0 ;
- my $ln = 0;
+ my $count = 0 ;
+ my $ln = 0;
my @lines;
my @words = split(" ",$title);
foreach my $word (@words) {
@@ -148,7 +148,7 @@ sub break_title {
}
}
return \@lines;
-}
+}
sub create_startposter_png {
my $name = shift;
@@ -160,15 +160,15 @@ sub create_startposter_png {
sub create_endposter_png {
# $cmd_body .= " -draw "text $left_margin,$pos \'$n: $meta->{$n}\'"
- my %keyword_map = (
- "introduction" => "Introdusert av",
- "editor" => "Redaktor",
- "email" => "E-post",
- "organizer" => "Organisert av",
- "camera" => "Kamera-ansvarlig",
- "sound" => "Lyd-ansvarlig",
- "videomixer" => "Videomixer-ansvarlig",
- );
+ my %keyword_map = (
+ "introduction" => "Introdusert av",
+ "editor" => "Redaktor",
+ "email" => "E-post",
+ "organizer" => "Organisert av",
+ "camera" => "Kamera-ansvarlig",
+ "sound" => "Lyd-ansvarlig",
+ "videomixer" => "Videomixer-ansvarlig",
+ );
my $line_distance = 52;
my $text_size = 40;
my $pos = 180;
@@ -179,7 +179,7 @@ sub create_endposter_png {
foreach my $n ( @endnote_tags ) {
if ($meta->{$n} ) {
push(@endnotes,"$keyword_map{$n}: $meta->{$n}");
- }
+ }
}
foreach my $line ( @endnotes ) {
$cmd_body .= " -draw \"text $left_margin,$pos \'$line \'\"";
@@ -201,7 +201,7 @@ my $f = `ffmpeg -loop_input -t $length -i $png_file -f image2 -f s16le -i /de
}
sub gen_video_body {
- my $source = shift;
+ my $source = shift;
my $mod_dv;
if ( $meta->{'aspect'} eq "4:3" || $opts{'s'} ) {
my $cmd ;
@@ -209,7 +209,7 @@ sub gen_video_body {
$cmd = "mencoder -oac pcm -of lavf -ovc lavc -lavcopts vcodec=dvvideo:vhq:vqmin=2:vqmax=2:vme=1:keyint=25:vbitrate=2140:vpass=1 ";
if ( $meta->{'aspect'} eq "4:3" ) {
$cmd .= "-vf-add expand=1000::::: -vf-add scale=720:576 ";
- }
+ }
if ( $srtfile ) {
$cmd .= " -sub $srtfile -utf8 ";
}
@@ -219,7 +219,7 @@ sub gen_video_body {
if ( $f eq -1 ) { die "Failed to execute system command in" . (caller(0))[3] ."\n"; }
$source = $mod_dv;
}
- my $dest = normalize_sound($source);
+ my $dest = normalize_sound($source);
return $dest;
}