Help with Windows script

Come up with a useful post-processing script? Share it here!
Post Reply
vdown
Release Testers
Release Testers
Posts: 38
Joined: January 30th, 2008, 8:01 am

Help with Windows script

Post by vdown »

I dont really know what Im doing with scripts. This is on a Vista Ultimate box.

I just want to run a Mencoder single line script file on my x264 downloads, create an HR avi and delete the mkv file.

I thought just replacing the file name with %3 would do the trick but that doesnt seem to work.

Any help greatly appreciated.

BTW Sab is the most fantastic program thanks to all the developers.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Help with Windows script

Post by shypike »

Post the script here or email it to bugs at sabnzbd.org.
It's probably something trivial.
vdown
Release Testers
Release Testers
Posts: 38
Joined: January 30th, 2008, 8:01 am

Re: Help with Windows script

Post by vdown »

Thanks a lot email sent.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Help with Windows script

Post by shypike »

There are some incorrect assumptions in your script.

The current directory of the script is not the download directory.
You need to do a "cd /d %1" first

Parameter %3 is the name of the download directory (without the path part).
You assume that it is also the name of the MKV file, that's not a sure thing!
I think your script should find out what the MKV file is.
Or create a for-loop to handle all MKV files.

You make assumptions about the way the uploader creates the directory structure.
SABnzbd only creates the %3 folder, but what's underneath is completely determined
by the uploader.
vdown
Release Testers
Release Testers
Posts: 38
Joined: January 30th, 2008, 8:01 am

Re: Help with Windows script

Post by vdown »

Thanks got it working, combined with an RSS feed and the Sorting folders option the automation is incredible.

Thanks
User avatar
rascalli
Moderator
Moderator
Posts: 656
Joined: January 18th, 2008, 12:30 am
Location: Bossche bollen land

Re: Help with Windows script

Post by rascalli »

if it's a nice script .. maybe you can post it for other users ?
vdown
Release Testers
Release Testers
Posts: 38
Joined: January 30th, 2008, 8:01 am

Re: Help with Windows script

Post by vdown »

OK here it is. The idea is to give me an old style HR Xvid (960x540) from a 720p mkv file which works on my Xbox1 with xbmc and an SD TV.

It will leave the new xvid and delete everything else.

The mencoder command line, which I got from the BitmeTV forums, has certain limitations. The file size is quite variable and the audio is re-encoded to 2.0, not sure how to fix that and of course even on a Quad Core PC it takes 30 mins to transcode a 42 min episode.

Mencoder needs to be added to the path variable or added to a folder already in it, eg c:\windows for the script to work.

Taking all that into account with folder sorting and a TV NZB RSS it serves my needs perfectly and is a tribute to the incredible functionality of SAB.

Code: Select all

cd /d %1
for /F %%a in ('dir /b *.mkv') do set FileName=%%~na
mencoder %FileName%.mkv -aid 0 -o %FileName%.RECODE.avi -ovc lavc -oac lavc -lavcopts acodec=ac3:abitrate=384:vcodec=mpeg4:vbitrate=2048:vpass=1 -ffourcc xvid -vf scale=960:540
DEL %FileName%.mkv /q
del *.nfo /q
del *.sfv /q
del *.log /q
del *.nzb /q
Last edited by vdown on August 29th, 2008, 3:05 pm, edited 1 time in total.
Post Reply