#!/usr/bin/perl 

# Update this with a package name relivant to your new config, make sure it matches with the file name (without the extension).
package PortableH264HighRes;

use ExportBase;

our @ISA = qw(ExportBase);

#Example strings, replace with something relivant to your new config.
my $description = "High Resolution (800x400) Portable H264 Settings.";
my $devices = "High Resolution Android Devices (example Droid, Evo, N1), iPod Touch, iPhone, iPad";
my $notes = "Requires AAC, activate Medibuntu";
my $version = "1.0";

#Inherit our base class.
sub new{
    my $class = shift;
    my $self = $class->SUPER::new(shift, shift, $description, $devices, $notes, $version);
    bless $self, $class;
    return $self;
}

sub export{
    my( $self ) = @_;

    # Any command can go here, below is an example of ffmpeg, but you can use anything you would like.
    # Available variables are inputFile, outputFile, and extension
    system("ffmpeg -i \'$self->{_inputFile}\' -y -pass 1 -an -vcodec libx264 -vpre slowfirstpass -vpre ipod640 -b 1500kb -bt 1000kb -threads 0 -s 800x480 -aspect 16:9 -f ipod \'$self->{_outputFile}$self->{_extension}\' && ffmpeg -i \'$self->{_inputFile}\' -y -pass 2 -vcodec libx264 -vpre hq -vpre ipod640 -b 1500kb -bt 1000kb -threads 0 -s 800x480 -acodec libfaac -ab 192kb -ac 2 -aspect 16:9 -f ipod \'$self->{_outputFile}$self->{_extension}\'");

}

#Feel free to use or extend anything from the base class.

1;
