abi>>forums

abi>>forums (http://www.anythingbutipod.com/forum/index.php)
-   Insignia NS-DV (http://www.anythingbutipod.com/forum/forumdisplay.php?f=122)
-   -   Converting Video on OS X (http://www.anythingbutipod.com/forum/showthread.php?t=34696)

Pheonix23 09-22-2008 08:20 PM

Converting Video on OS X
 
Ok I have had my NS-DV 4G for almost 2 years and one thing that kills me everytime is the lack of compatibility with an OS other than windows, I run Mac OSX 10.4 and have been trying to find alternatives for converting video and i recently attempted iriverter which i have read works but for me it doesn't, so could someone please post how instructions for iriverter cuz i just can't get it to work or if there is some other working alternative to convert video because i am frustrated out of my mind.

erinspice 09-23-2008 10:58 AM

I use Linux and I have a script that has worked for me. I have it set to use the following settings, but I'm not sure which ones (except the dimensions) are required. Just start with this using your favorite encoding program.

$video_bitrate = 200;
$audio_bitrate = 96;
$audio_samplerate = 22050;
$audio_samplesize = 16;
$audio_channels = 1; #mono
$width_out = 320; #default
$height_out = 240; #default

If you have mplayer installed or are willing to install it from source (which may require installing a compiler like gcc), I'd be happy to share my script.

dfkt 09-23-2008 12:15 PM

Handbrake should work fine on OS X as well.

Pheonix23 09-23-2008 03:06 PM

erinspice ya i have mplayer and mencoder on my computer but i haven't found a sufficient explanation as to how to use it, if you would be willing to share your code and tell me how to use it i would definitely try it. and dfkt handbrake works on OSX but it is a dvd converter to MP4 so it doesnt work on insignia.

erinspice 09-24-2008 08:51 AM

1 Attachment(s)
Sure, here it is! Just change the extension to .pl and give it execute permissions. Execute on command line like this:

Quote:

Useage: encode-for-insignia.pl -i <infile> -o <outfile> [-s <widthxheight>] [-hq] [-a]

Pheonix23 09-27-2008 11:01 AM

erinspice idk what is wrong with this forum but for some reason i can't access your text file so if you could write it out or somethin cuz i don't see why abi won't let me see it.

dfkt 09-27-2008 11:09 AM

There's nothing wrong with the forums - the file downloads fine for me.

erinspice 09-28-2008 03:23 PM

Code:

#!/usr/bin/perl

#$tcprobe = "/usr/bin/tcprobe";
#$transcode = "/usr/bin/transcode";
$mencoder = "/usr/bin/mencoder";
$mplayer = "/usr/bin/mplayer";
#$video_bitrate = 400; #normal
$video_bitrate = 200;
$audio_bitrate = 96;
$audio_samplerate = 22050;
$audio_samplesize = 16;
$audio_channels = 1; #mono
$width_out = "320"; #default
$height_out = "240"; #default


##############################################################################
# do not edit below this line ################################################
##############################################################################

# parse command line
$count = 0;
foreach (@ARGV){
    #print "processing $_\n";
    if($_ eq "-i"){
        $infile = $ARGV[$count+1];   
    }
    if($_ eq "-o"){
        $outfile = $ARGV[$count+1];   
    }
    if($_ eq "-s"){
        if($ARGV[$count+1] =~ /(\d+)x(\d+)/){
            $width_out = $1;
            $height_out = $2;
        }
    }
    if($_ eq "-a"){
        $preserve_aspect = 'yes';
    }
    if($_ eq "-hq"){
        $quality = 'high';
    }
    $count++;
}


# uncomment for transcode method
#$tcprobe_output = `$tcprobe -i $infile 2>/dev/null`;
#if($tcprobe_output =~ /-g (\d+)x(\d+)/){
#    $width_in = $1;   
#    $height_in = $2;   
#}

# uncomment for mplayer method
$probe_output = `$mplayer  -identify -frames 0 "$infile" 2>/dev/null`;
if($probe_output =~ /ID_VIDEO_WIDTH=(\d+)/){
    $width_in = $1;
}
if($probe_output =~ /ID_VIDEO_HEIGHT=(\d+)/){
    $height_in = $1;
}

if ($infile && !(-e $infile)) {
    die "Could not find file $infile.  $!\n";
}

if ($infile && !($outfile)) {
    $outfile = $infile;
    $outfile =~ s/\..{3,5}$/-insignia.avi/;   
}

# do we have all of our required information?
unless($infile && $outfile && $width_out && $height_out && $width_in && $height_in){
    print("Useage: encode-for-insignia.pl -i <infile> -o <outfile> [-s <widthxheight>] [-hq] [-a]\n");
    print "You put infile=$infile, outfile=$outfile, width_in=$width_in, height_in=$height_in, width_out=$width_out, height_out=$height_out\n";
    exit(0);
}

# verify that the input file exists
unless(-e "$infile"){
    die("encode-for-insignia: Could not find $infile: $!\n");
}

if($quality =~ /high/i){
    print "Setting to high quality\n";
    $video_bitrate = 800;
    $audio_bitrate = 128;
    $audio_samplerate = 44100;
    $audio_samplesize = 16;
}else{
    #nothing these are set above ... maybe someday I will set it here.
}

# Input aspect ratio is greater than the output aspect ratio
if(($width_in/$height_in) > ($width_out/$height_out)){
    # for transcode
    $pixels_to_crop = ($width_in - (($width_out/$height_out)*$height_in))/2;
    $crop_options = "-j 0,$pixels_to_crop";

    # for mencoder
    $width_new = int(($width_out/$height_out)*$height_in);
    $mencoder_crop_options = "crop=$width_new:$height_in,";
   
    print "cropping the width by $pixels_to_crop pixels on each side to $width_new.\n";
}

# output aspect ratio is greater than the input aspect ratio
if(($width_in/$height_in) <= ($width_out/$height_out)){
    if($preserve_aspect =~ /yes/i){ # keep aspect
        $crop_options = "";
    }else{ # maximize screensize for palm
        # for transcode
        $pixels_to_crop = int(($height_in - (($height_out/$width_out)*$width_in))/2);
        $crop_options = "-j $pixels_to_crop,0";

        # for mencoder
        $height_new = int(($height_out/$width_out)*$width_in);
        $mencoder_crop_options = "crop=$width_in:$height_new,";
       
        print "cropping the height by $pixels_to_crop pixels on each side to $height_new.\n";
    }
}

print "$infile ($width_in x $height_in) -> $outfile ($width_out x $height_out) $crop_options\n\n";

# uncomment to use transcode
#$command = "$transcode -i $infile -y ffmpeg -F mpeg4 -w $video_bitrate -N 0x55 -b $audio_bitrate -E $audio_samplerate,$audio_samplesize,$audio_channels $crop_options -Z $width_out" . "x" . "$height_out -o $outfile";

# uncomment to use mencoder
$command = "$mencoder \"$infile\" -oac mp3lame -lameopts cbr=0:br=$audio_bitrate:mode=3 -ovc lavc -srate $audio_samplerate -lavcopts vcodec=mpeg4:vbitrate=$video_bitrate:autoaspect:trell -vf $mencoder_crop_options\scale=$width_out:$height_out -ffourcc XVID -o \"$outfile\"";

print "######################################################\n$command\n###############################################\n";
print `$command 2>/dev/null`;


Pheonix23 09-30-2008 07:34 PM

woah that's a lot of stuff, you think you could give me some instructions on how to use that cause I don't really of a really profound comprehension of using a shell or terminal other than basic stuff so if you could give some help with that it would be cool. :)

erinspice 10-01-2008 09:03 AM

Sure.

Quote:

Originally Posted by erinspice (Post 285674)
Sure, here it is! Just change the extension to .pl and give it execute permissions. Execute on command line like this:

Quote:
Useage: encode-for-insignia.pl -i <infile> -o <outfile> [-s <widthxheight>] [-hq] [-a]


Pheonix23 10-03-2008 09:21 PM

Thanks :o i think i get most of it, but what do you mean by executing priveleges and could you give me a sample line from one of your video converts just to use as a template to make sure i get it right.

erinspice 10-04-2008 01:47 PM

To give a file execute permissions, open a terminal (command line) and type:

Code:

chmod 755 /whatever/path/to/encode-for-insignia.pl
Here's a sample command to use the script:

Code:

./encode-for-insignia.pl -i original-file.avi -o new-file.avi

Pheonix23 10-10-2008 10:35 AM

alright so i did what you said i gave the file execute permission and then i ran the code and it didn't convert anything it just gave me what looks like
a status report of what i told it to do.

Quote:

casa:~ joseph$ ./Desktop/Mp3Conversion\ Soft/encode-for-insignia.pl -i ./Documents/Azureus\ Downloads/Wanted.TS.XViD-mVs/mvs-wanted/mvs-wanted.avi -o ./Desktop/wanted.avi
Useage: encode-for-insignia.pl -i <infile> -o <outfile> [-s <widthxheight>] [-hq] [-a]
You put infile=./Documents/Azureus Downloads/Wanted.TS.XViD-mVs/mvs-wanted/mvs-wanted.avi, outfile=./Desktop/wanted.avi, width_in=, height_in=, width_out=320, height_out=240
so i don't know what that means because i did exactly what you gave
sorry to keep askin you to help debug and one other thing can this
convert from mp4 to avi or other formats other than avi to avi

Tobey 10-10-2008 11:55 AM

I'm no Unix guy, but try this:

Quote:

./Desktop/Mp3Conversion/Soft/encode-for-insignia.pl -i ./Documents/Azureus/Downloads/Wanted.TS.XViD-mVs/mvs-wanted/mvs-wanted.avi -o ./Desktop/wanted.avi

Pheonix23 10-10-2008 09:33 PM

it took me a second to figure out what you'd changed tobey but those \ are to signify a space in a file name :) i just wish i could figure out how to get this to work.

Tobey 10-10-2008 11:34 PM

D'oh! That's painfully obvious now.

erinspice 10-11-2008 12:41 PM

The problem is that the script can't find the width and height of your input file. See how width_in and height_in are blank in that output? Try running this and see what happens. This is how the script gets the width and height for the infile.

Code:

mplayer  -identify -frames 0 ./Documents/Azureus/Downloads/Wanted.TS.XViD-mVs/mvs-wanted/mvs-wanted.avi


All times are GMT -5. The time now is 07:51 AM.