[Windows] Post Processing Scripts

Come up with a useful post-processing script? Share it here!
tzortst
Newbie
Newbie
Posts: 8
Joined: August 18th, 2010, 6:58 am

Re: [Windows] Post Processing Scripts

Post by tzortst »

Bad news, downloaded something and it returned this error

Any ideas?

This was a 2 CD file

edit: I should also add i did install smplayer but i don't think that is the correct media encoder, got it from this site http://www.mplayerhq.hu/design7/dload.html i couldn't find mencoder anywhere

Code: Select all

The Union 2009 DOCU DVDRip XviD aAF

Unhandled Exception: System.ComponentModel.Win32Exception: The system cannot find the file specified
   at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start(String fileName, String arguments)
   at Movies.Program.Main(String[] args)

Last edited by tzortst on August 20th, 2010, 3:30 am, edited 1 time in total.
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: [Windows] Post Processing Scripts

Post by markus101 »

Grab the 7z file from here:
http://sourceforge.net/projects/mplayer ... on%2031878

It has mencoder.exe (a whopping 15MB).

You will need to unzip it and move it to either the script directory or another permanent directory and add that location to the PATH variable on your system.

The link the Mplayer with Mencoder is here: http://oss.netfarm.it/mplayer-win32.php

So many packages with different bits available, I should just include Mencoder going forward, just need to do some testing with that, it is released under the GPLv2, I I see no issues with including it.

Hope this helps.

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
tzortst
Newbie
Newbie
Posts: 8
Joined: August 18th, 2010, 6:58 am

Re: [Windows] Post Processing Scripts

Post by tzortst »

markus101 wrote: Grab the 7z file from here:
http://sourceforge.net/projects/mplayer ... on%2031878

It has mencoder.exe (a whopping 15MB).

You will need to unzip it and move it to either the script directory or another permanent directory and add that location to the PATH variable on your system.

The link the Mplayer with Mencoder is here: http://oss.netfarm.it/mplayer-win32.php

So many packages with different bits available, I should just include Mencoder going forward, just need to do some testing with that, it is released under the GPLv2, I I see no issues with including it.

Hope this helps.

-Markus
Hey Mate,

Only recently had a chance to try it all out and all seems to be running well.

Thanks very much for you time :)
triod
Newbie
Newbie
Posts: 3
Joined: October 1st, 2008, 4:46 pm

Re: [Windows] Post Processing Scripts

Post by triod »

Ive installed NET v4, and the programs you wrote all crash...is that a by product of the update, or is it just not compatible with the newer version...I guess I will have to find an older version and reinstall....  :(
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: [Windows] Post Processing Scripts

Post by markus101 »

SABSync requires 4.0 the other should only require 2.0, do you have 2.0 installed? Do you have an error message that you can supply me or provide more details in how they "crash"?

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
jeneral
Newbie
Newbie
Posts: 5
Joined: November 12th, 2010, 11:44 am

Re: [Windows] Post Processing Scripts

Post by jeneral »

I'm trying to use your Movies.exe script on Windows 7 x64 (.NET 4.0 because it wouldn't let me install 2.0) with no success. Initially, I was using a small sample and after reading this thread I saw it was being discarded. Now, I'm using a larger file but even running the program from the command line, it just deletes the files in the 'Movies' folder and generates no log. Any ideas?

Here is the command I'm using:

movies "d:\videos\movies" 2 "test.avi"

Here is my .config file:



 
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
 
jeneral
Newbie
Newbie
Posts: 5
Joined: November 12th, 2010, 11:44 am

Re: [Windows] Post Processing Scripts

Post by jeneral »

markus101 wrote: Do you have an error message that you can supply me or provide more details in how they "crash"?
I tried your scripts on a Windows 7 x86 PC with similar results. Here is the output from the command window:

C:\Users\jeneral\Documents\SABnzbd>movies E:\Videos\Movies 2 test.avi

Unhandled Exception: System.IO.IOException: The device is not ready.

  at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
  at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity dirSecurity)
  at System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity)
  at Movies.Program.Main(String[] args)
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: [Windows] Post Processing Scripts

Post by markus101 »

I see the problem (running the script through SABnzbd would overcome this issue), but here is the explanation.

This script (Movies.exe) is designed to run against a single movie in a folder, not a bunch of movies in a folder, while it would work fine if you only had a test movie in there, anything more would either cause it to fail or to combine a bunch of movies into a single file.

To manually run Movies.exe you could pass it a path to the movie you would like to process.

Code: Select all

Movies.exe "D:\Temp\New Movie (2010)" 2 "New Movie (2010)"
Your config looks good and since you have set "deleteFolder" to false you would end up with your movie like so:

Code: Select all

D:\Videos\Movies\New Movie (2010)\New Movie (2010).ext
(where ext is avi/mkv/wmv or mp4).

If you wish to have all video files under "D:\Videos\Movies\" without subfolders, you would just change deleteFolder to true.

If you have anymore questions, please let me know.

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
jeneral
Newbie
Newbie
Posts: 5
Joined: November 12th, 2010, 11:44 am

Re: [Windows] Post Processing Scripts

Post by jeneral »

markus101 wrote: This script (Movies.exe) is designed to run against a single movie in a folder, not a bunch of movies in a folder, while it would work fine if you only had a test movie in there, anything more would either cause it to fail or to combine a bunch of movies into a single file.
Thank you for the reply. I only have one movie in the folder I'm running my tests on. I also tried putting the test movie in a subfolder of E:\videos\movies.

Unfortunately, the only other way to test this is to download an NZB that when extracted is named incorrectly yet is larger than 100MB. I uploaded a 10MB file to alt.binaries.test for this purpose before I found out your script ignores small files. Do you know any such test files I could download?

I will try your suggestions when I get home and post the results.
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: [Windows] Post Processing Scripts

Post by markus101 »

You could try a TV episode, set to the movie category (or any non-tv category) and ensure it is assigned to run the Movies.exe script.

A possible cause of the error you posted is permissions, not sure if you have ensured that the account running Movies.exe has permissions to the folder(s) you are working with.

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
jeneral
Newbie
Newbie
Posts: 5
Joined: November 12th, 2010, 11:44 am

Re: [Windows] Post Processing Scripts

Post by jeneral »

OK, I played around a bit with this and I think I figured it out. In the process I may have found a nasty bug.

The reason my Windows 7 x86 install was having issues was due to my not modifying the config file. My x64 uses D: while my x86 use E:. Doh! Once that was out of the way, I managed to figure how to use this program.

New config:


 
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
 


Here was my test scenario. One movie called test.avi in e:\temp\movies\dummy (a.k.a. e:\temp\movies\dummy\test.avi).

The following command renames the 'dummy' folder to "New Movie (2010)" and the avi to "New Movie (2010).avi":
Movies.exe "E:\Temp\Movies\Dummy" 2 "New Movie (2010)"

This command erases EVERYTHING in the folder INCLUDING the Movies folder:
Movies.exe "E:\Temp\Movies" 2 "New Movie (2010)"

Neither of the above commands creates any log file. I'm assuming the second command sees the empty folder as 'empty' and deletes it. Isn't it possible that a nested Movie might be extracted?
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: [Windows] Post Processing Scripts

Post by markus101 »

Movies shouldn't delete anything until it processes a proper sized movie (except for small files, such as samples, nfo, sfv etc). It won't delete folders and it will actually look into nested folder for video files.

Your first example is the command that should be run, the second is not supposed to do anything, but it could cause some issues given that the folder is your root movie folder and could contain any number of files, and do to that also being your destination directory for those files, I can see it being problematic. SABnzbd will never run a script on the root of your downloads, it will always point to the sub-folder and the issue will not arise.

What the second command actually told movies.exe to do is (also adjusted further by "useFolderName" being set to true), was get a list of all files, and determine if it is AVI, MKV, WMV or MP4, based on that it would create a sub-folder under Movies, called Movies, act on the proper video file found (move, or combine multiple files) then delete "E:\Temp\Movies" including all files and folder contained within.

If your movieDir/hdMovieDir was set to "E:\Videos\Movies" it would have created the folder there, moved the file and then deleted "E:\Temp\Movies" and your video file would be like so "E:\Videos\Movies\Movies\Movies.avi".

I hope this clears up what you were experiencing, if you need further clarification, please let me know.

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
nyquist
Newbie
Newbie
Posts: 3
Joined: December 31st, 2010, 11:27 am

Transcode

Post by nyquist »

First off, love the script. Works great.

I had been using avimerge for years on Linux - it was fast and quality was great because it didn't re-encode. Unfortunately until recently it wasn't available for windows and didn't compile properly for cygwin, until this guy figured it out.
http://binaryinspirations.blogspot.com/ ... n-115.html
It comes with the dlls to run standalone (without installing full cygwin).  You just need to add whatever path you unpack it into to your path statement. 

How difficult would it be to use this in your script instead?
Last edited by nyquist on December 31st, 2010, 11:38 am, edited 1 time in total.
Current Setup__
Download/Storage Box: Lenovo D400 WHS (non RAID) |7TB | SABnzbd | supernews | CouchPotato | SickBeard | NZBmatrix
Player: AMD Athlon 64 X2 4/DDR2 | 500GB | Ubuntu Meerkat | XBMC Dharma | XBMC app for iPhone
Network: SMCD3GN | Procurve 1800-8g | Netgear GS105
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: [Windows] Post Processing Scripts

Post by markus101 »

Wow, this is tiny, especially when compared to mplayer. Looks like this should be pretty simple to implement, might even leave support for mplayer in there with a configuration switch, but it'll be easy to package this up as opposed to mplayer and use it by default I think. I'll try to get to it soon, but no promises.

Happy New Year!

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
markus101
Release Testers
Release Testers
Posts: 406
Joined: August 13th, 2008, 2:51 am

Re: [Windows] Post Processing Scripts

Post by markus101 »

Maybe I'm just doing it wrong, but on a video file I converted only the first half had audio (I combined two episodes of a TV show that both have sound when I play them individually). This is the command I used:

Code: Select all

avimerge.exe -o "C:\Test\avimerge\Test Movie (2011).avi" -i "C:\Test\1.avi" "C:\Test\2.avi"
Trying to skip ahead seemed pretty slow (slower than on the individual files, but I haven't compared that to a video that I combined with mencoder).

Any thoughts? I'd love to implement this since it is so tiny in comparison.

-Markus
Co-developer of NzbDrone (.Net NNTP PVR) - http://www.nzbdrone.com
Locked