Tuesday, February 28, 2006

all2theora

here is my all2theora script

(Thanks to my friend Zaher for fixing the Divx problem "-vf harddup")
(based on Florian Schilhabel dvd2divx script Licence: GPL)

#!/usr/bin/perl

use Getopt::Long;

GetOptions( "help" => \$help,
"i=s" => \$input,
"divx=s" => \$divx, );

if ($help) {
print "Welcome to the ALL2theora Helper Script\n";
print "\n";
print "this script encodes a all file to theora\n";
print "Usage:\n";
print "--help show this text\n";
print " this will only be possible if you are root\n";
print "--i Specify the Name of your Video file\n";
exit;
}

if ($input eq "") {
print "No Input file selected - You must specify one with: --i filename.\n";
print "\n";
print "this script encodes a all file to theora\n";
print "Usage:\n";
print "--help show this text\n";
print " this will only be possible if you are root\n";
print "--i Specify the Name of your Video file\n";
exit;
}

if ($divx eq "on") {

system ("mkfifo stream.yuv && chmod 777 stream.yuv && mencoder $input -ovc lavc -oac copy -o tmp.avi -lavcopts vcodec=mpeg1video:vbitrate=1200 -vf harddup -of mpeg && mplayer -vc dummy -vo null -ao pcm:file=stream.wav tmp.avi && encoder_example stream.wav stream.yuv > theora.ogg | mplayer -ao null -nosound -vo yuv4mpeg tmp.avi - 1>/dev/tty7 8>/dev/tty7 && rm stream.yuv && rm stream.wav && rm tmp.avi");
exit;
}

if ($divx eq "off") {
system ("mkfifo stream.yuv && chmod 777 stream.yuv && mplayer -vc dummy -vo null -ao pcm:file=stream.wav $input && encoder_example stream.wav stream.yuv > theora.ogg | mplayer -ao null -nosound -vo yuv4mpeg $input - 1>/dev/tty7 8>/dev/tty7 && rm stream.yuv && rm stream.wav");
exit;
}

if ($divx eq "") {
system ("mkfifo stream.yuv && chmod 777 stream.yuv && mplayer -vc dummy -vo null -ao pcm:file=stream.wav $input && encoder_example stream.wav stream.yuv > theora.ogg | mplayer -ao null -nosound -vo yuv4mpeg $input - 1>/dev/tty7 8>/dev/tty7 && rm stream.yuv && rm stream.wav");
exit;
}

print "Video Filename: $input\n";
print "working...\n";

exit;

Licence: GPL

No comments: