#!/usr/bin/perl -w use strict; use Term::ReadLine; my %p_crop = ("drwho", "522:572:98:4", "erope", "692:572:8:4", "armadillo", "696:572:12:4"); my @h_infile = (); my @h_vbitrate = ("700"); my @h_abitrate = ("128"); my @h_scale = ("480:360","480:270"); my @h_crop = ("drwho","erope","armadillo"); my @h_vopts = ("vhq","vlelim=-4:vcelim=9:lumi_mask=0.05:dark_mask=0.01:vhq"); my @h_pvas = ("yes", "no"); my $term = new Term::ReadLine "thing"; my $encfile = $term->readline("Encode spec file name: "); open (ENCFILE,">$encfile"); while (0 == 0) { $term->SetHistory(@h_infile); my $infile = $term->readline("Input file: "); last if !defined($infile); if ($infile =~ / $/) { chop($infile); } my $outfile = $infile . ".avi"; @h_infile = $term->GetHistory(); $term->SetHistory(@h_vbitrate); my $vbitrate = $term->readline("Video bitrate: "); @h_vbitrate = $term->GetHistory(); $term->SetHistory(@h_abitrate); my $abitrate = $term->readline("Audio bitrate: "); @h_abitrate = $term->GetHistory(); $term->SetHistory(@h_scale); my $scale = $term->readline("Video size: "); @h_scale = $term->GetHistory(); $term->SetHistory(@h_crop); my $crop = $term->readline("Video crop spec: "); @h_crop = $term->GetHistory(); if (defined($p_crop{"$crop"})) { $crop = $p_crop{"$crop"}; } $term->SetHistory(@h_vopts); my $vopts = $term->readline("Video encode options: "); @h_vopts = $term->GetHistory(); $term->SetHistory(@h_pvas); my $pvas = $term->readline("Run PVAstrumento? "); @h_pvas = $term->GetHistory(); print ENCFILE "$infile\@\@$outfile\@\@$vbitrate\@\@$abitrate\@\@$scale\@\@$crop\@\@$vopts\@\@$pvas\n"; } close ENCFILE;