Page 1 of 1
Help with Windows script
Posted: August 19th, 2008, 1:11 am
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.
Re: Help with Windows script
Posted: August 19th, 2008, 4:45 am
by shypike
Post the script here or email it to bugs at sabnzbd.org.
It's probably something trivial.
Re: Help with Windows script
Posted: August 19th, 2008, 4:56 am
by vdown
Thanks a lot email sent.
Re: Help with Windows script
Posted: August 19th, 2008, 6:22 am
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.
Re: Help with Windows script
Posted: August 20th, 2008, 3:46 am
by vdown
Thanks got it working, combined with an RSS feed and the Sorting folders option the automation is incredible.
Thanks
Re: Help with Windows script
Posted: August 21st, 2008, 12:42 pm
by rascalli
if it's a nice script .. maybe you can post it for other users ?
Re: Help with Windows script
Posted: August 29th, 2008, 2:52 pm
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