ReScene is a command-line utility written in C# and requires the Microsoft .NET Framework 2.0 or greater to run. It has also been tested (thx Antioch) on the multi-platform mono framework version 1.9.1 under linux.
You can get the current source here. I'm leaving the source code for Beta 6 (the last version from the old monolithic codebase) here as well. Some of you might find it a bit easier to follow than the newer, more object oriented code.
I have also removed the information about the platform-independent C port that was previously listed here. That version has been left behind by improvements in the .NET version and has not been updated (it was functionally equivalent to ReScene .NET Beta 2). If you're interested in looking at the code anyway, you can download it here.
If you have bug reports, feature requests, questions, or just want to chat about all things rescene, you can find all the world's leading ReScene experts in our IRC channel
ReScene .NET 1.2 (Jun 9 2010)
Changes in 1.2:
- Added support for archives with Unicode (actually UTF-8) encoded file names.
- Fixed a bug that caused errors when reconstructing archives with extra data (or padding) in their File Blocks. Specifically, if an archive contains a file that has a packed size larger than its original size (something that shouldn't ever happen with m0 compression), older versions of ReScene would repeat the last valid buffer of data to fill the difference, resulting in CRC (and SFV) errors on the last reconstructed file. This build fills the difference with null bytes instead and does not include the extra data in the CRC calculation. Note that although this change seems to have fixed all known issues with such archives, since there's no reason for the situation to occur in the first place, there's no guarantee this fix will handle all such archives in future.
ReScene .NET 1.1 (Mar 19 2010)
Changes in 1.1:
- Added -r switch to enable support for auto-locating renamed files. When this switch is used, if a file needed for reconstruction cannot be located in the input directory, the program will look for another file with the same extension and file size and attempt to use it instead.
- Added archived file list to the output when using the -l switch.
- Fixed a bug that caused an error when reconstructing a release that had directory structure preserved in the RAR archive. Now no attempt is made to open directories or 0-byte files during reconstruction since no data would be needed from them anyway.
ReScene .NET 1.0 (Oct 14 2009)
Changes in 1.0:
- Added -p switch to enable support for saving/restoring path information to/from SRR files. During SRR creation, the -p switch will enable saving relative path information with the file names stored in the SRR. During reconstruction the -p switch will allow ReScene to re-create a sub-folder structure for the release (e.g. CD1, CD2) provided the SRR file has the paths stored.
- Added -h switch to allow you to specify rename hints during reconstruction. If you renamed one or more of the original files after extracting them, this feature will allow you to tell ReScene the new name of the file so it can locate it and use it. Hints are given as a pair, separated by a colon (e.g. original.mkv:newname.mkv).
- Added -y switch to assume Yes to all prompts to overwrite files.
- Added automatic CRC checking during reconstruction. RAR files now have their stored data checked against the CRC value from the RAR header when they are rebuilt. This allows ReScene to detect and warn you if a file from which you are reconstructing is corrupt. Since this check only validates the data inside the RAR, it is still recommended you sfv check the release after reconstruction. If you do intend to sfv check, you can disable the automatic CRC check with the -u switch to make the process run a little faster.
- Added -u switch to disable automatic CRC checking. See previous change entry for details.
- Improved error handling for invalid commandline parameters.
- Improved handling of invalid records in sfv files.
- ReScene is now 'officially' released! Woo! This doesn't mean anything other that I consider it to be reliable and stable at this point (as it has been for a long time). The files you created with the Beta versions will work just fine. We'll just have real version numbers from now on…
ReScene .NET Beta 11 (Jul 18 2009)
Changes in Beta 11:
- Fixed a bug that caused an out of memory (or other unexpected) error when processing RAR files without the LARGE_BLOCK flag set on the RAR File blocks.
ReScene .NET Beta 10 (Jun 11 2009)
Changes in Beta 10:
- Fixed a bug that caused an error when running ReScene from the root of a drive.
ReScene .NET Beta 9 (Jun 1 2009)
Changes in Beta 9:
- Fixed a bug that might caused an error when creating an SRR file on a RAR set with no SFV. Specifically, if the RAR set used the new-style naming and there was only a single RAR file in the set, ReScene would return an 'index out of bounds' error.
- Added logic to correct the case of the working directory when a cd command had been used with the wrong case. This would have resulted in the SRR file name having the incorrect case when using the -d switch.
- Added serveral performance optimizations to code that is shared with ReSample (e.g. CRC32 calculations).
ReScene .NET Beta 8 (May 12 2009)
Changes in Beta 8:
- Added support for old-style RAR Recovery Records. Previous ReScene versions only recognized the new (NewSub) type.
ReScene .NET Beta 7 (May 10 2009)
Changes in Beta 7:
- Added support for RAR sets with no SFV. Pass the first RAR from the set to ReScene, and it will find all remaining RARs from the set.
ex: srr release.rar
- Added support for mutiple multiple input files (RAR or SFV) to be processed into a single SRR file.
ex: srr releasepart1.sfv releasepart2.sfv -s *.nfo
- Added -l switch to list info about the files contained in an SRR file
ex: srr release.srr -l
- Added -x switch to extract all stored files contained in an SRR file without reconstructing the RARs.
ex: srr release.srr -x
- Changed all file handles to use shared read-only locks when possible. This will allow ReScene to be run against read-only media or file systems. It may also allow you to open files in use by other programs (provided those programs open the files with shared locks as well)
- Changed the way relative paths are handled. In previous ReScene versions, all paths were considered relative to the one and only input file (first argument). For example, in the command line 'c:\srr.exe d:\stuff\release.sfv -s *.nfo', when looking for .nfo files to store, ReScene would look for them in the same folder as release.sfv. It was rather counterintuitive, and is incompatible with the new ability to use multiple input files. In the new version, all relative paths are considered relative to the working directory, or if the -i switch is used, relative to the input folder. To get the equivalent behavior of the example command in the new version, you would need to use: 'c:\srr.exe d:\stuff\release.sfv -s *.nfo -i d:\stuff' or 'c:\srr.exe d:\stuff\release.sfv -s d:\stuff\*.nfo'. In most cases, use of the -i or -o swicthes should clear up any differences in the behavior between the old and new versions.
- Removed handling for switches beginning with / to improve linux compatibility. All switches must be prefixed with - rather than / (as the documentation has always indicated)
ReScene .NET Beta 6 (Jan 31 2009)
Changes in Beta 6:
- Added support for RAR files with .001, .002, etc naming scheme.
- Added ability to add stored files to an existing SRR file.
ex: srr release.srr -s afile.txt
- Added -o switch to specify output file or directory path. Can be combined with -d.
ex: srr release.sfv -d -o c:\srrfiles
- Added -i switch to specify input path for extracted files.
ex: srr release.srr -i c:\extractedfiles -o d:\reconstructedrelease
ReScene .NET Beta 5 (Jan 17 2009)
Changes in Beta 5:
- Fixed a bug that would cause the RAR block parser to enter an infinite loop if a block header is corrupted. Rare case, but I fixed it anyway.
- Updated the Usage info (-? switch) with better syntax guide, examples, and a version message.
ReScene .NET Beta 4 (Jan 14 2009)
Changes in Beta 4:
- Fixed a bug that saved incorrect file name length in stored files in certain situations. Specifically, if the SFV file name was a different length than the other stored file name(s), the lengths of the other stored file name(s) would be wrong in the header. (thanks to BudSmoker for alerting me to the problem)
ReScene .NET Beta 3 (Jan 12 2009)
Changes in Beta 3:
- Fixed a bug in the SFV parser that didn't handle empty/undersized lines correctly.
- Added a check for unknown flags in SRR file blocks. The application will now warn if it encounters a flag it doesn't understand.
- Added a generating application name field to the SRR header block. Now that there is more than one application, this will tell you which one created a given SRR
- Added -s switch to allow for storing arbitrary (e.g. .nfo) files in the SRR
- Added -d switch to force the name of the SRR file to come from its parent directory name rather than the SFV name
ReScene .NET Beta 2 (Jan 3 2009)
Changes in Beta 2:
- Added support for rebuilding RAR Recovery Records, resulting in smaller file sizes for SRR files
ReScene .NET Beta 1 (Dec 22 2008)
- Initial public release
Version 1.3.3 beta (2011-09-13)
- Fixed -c switch
- srr tab:
- storing additional files improved
- -check for proof dir
- -create .srr for extras
- .srs is stored in Sample/ relative path
- batch srr:
- fixed bug with appending jobs
- fixed bug with log, when Form wasn't active
- search for .001 extensions, too
- added checkbox for search on hidden folders
- store .sfv files from subdirs (subs/extras)
- added final log with failed releases
- added ETA (estimated time available)
- various fixes
Version 1.3.2 beta (2010-11-19)
- .srs tab: checkbox to put sample on release folder w/o asking
- .srs tab: added support with working dir
- batch .srr tab: respects the .srs tab
- fixes in store dialog
- various bugfixes
Version 1.3.1 beta (2010-10-14)
Based on ReScene .NET 1.2.
Includes batch mode and ReSample functionality.
Version 1.3 beta (2010-09-28)
- Added: Mass Reconstuction
Download MKV/AVI ReSample
Big News! Yes, you read that right, ReSample now works with AVI as well as MKV files! Usage is the same, file extension is the same. You just get two formats for the price of one.
Similar to ReScene, ReSample is initially available only as a command-line application and requires either the Microsoft .NET Framework 2.0 or the mono framework 1.9.1 or greater.
I've (finally!) finished the rewrite of ReSample I had been planning, so we finally have a codebase readable by (some, at least) humans. You can get the current version of the source (C#) here. If you do get the source code, note that ReSample now uses ReScene as a library for some of its features. If you want to build the code, you'll need to either copy the corresponding classes from the ReScene code, or better yet, add a reference to srr.exe. I used ILMerge to bake srr.exe into ReSample, so there are still no external dependencies for the compiled version.
If you have bug reports, feature requests, questions, or just want to chat about all things rescene, you can find all the world's leading ReScene/ReSample experts in our IRC channel
MKV/AVI ReSample .NET 1.2 (Jun 9 2010)
Changes in 1.2:
- Fixed a couple of bugs introduced by the additional error checking added to version 1.1. The new error handling is now active only when profiling a sample file, meaning corrupt sample detection is the same as 1.1, but handling of files during reconstruction is the same as 1.0. This fix restores the ability to reconstruct a sample from an incomplete MKV/AVI file or RAR set and resolves the issue of some AVI SRS files failing to load.
MKV/AVI ReSample .NET 1.1 (Mar 19 2010)
Changes in 1.1:
- Improved the behavior of the -o switch when reconstructing a sample. If the path used in -o is a folder that doesn't exist, it will be created and the sample will be placed inside.
- Improved error handling/detection when reading a corrupted sample. Older builds would attempt to read beyond a corrupted portion of the file, sometimes resulting in excessive processor or memory usage. The new build will immediately abort when a parsing error occurs and report the location and type of the error. The only exception to this is errors near the file header. Those are processed as before so ReSample can tell you the expected size of a truncated sample.
- Fixed a bug that would cause an IndexOutOfRange exception or other unexpected error when parsing an MKV or AVI file with 0-length elements/chunks.
MKV/AVI ReSample .NET 1.0 (Oct 14 2009)
Changes in 1.0:
- No changes to speak of, I'm afraid. I've just done a new build that includes ReScene 1.0 for the shared functionality and upgraded the version number to reflect release state.
MKV/AVI ReSample .NET Beta 9 (Sep 28 2009)
Changes in Beta 9:
- Added -b switch to enable support for sample files larger than 2GB. Not that I think anyone will have an actual sample over 2GB, but this change allows ReSample to be used to remux full video files. Files created with the -b switch will not work with previous versions of ReSample.
- Added -c switch to force ReSample to check that all sample tracks can be located in the referenced full file before saving the .srs. Since the check step performs the same search that the track location step during reconstruction would perform, that step can be skipped on reconstruction if it was done during .srs creation. So while this switch makes it take longer to create the .srs, it will take less time to reconstruct the sample later. This change is backwards compatible with previous versions, although they won't benefit from the saved step.
ex: srs sample.mkv -c full.mkv
- Improved support for reconstructing samples directly from RAR archives. Previous versions would sometimes erroneously report that you had not supplied the first RAR in the set when you had. As far as I know, this only affected RAR sets created with very old versions of WinRAR.
- Improved performance of both the .srs creation and sample reconstruction processes. Previous versions performed the CRC calculations separately, which meant reading the sample file one additional time. During .srs creation, the CRC is now calculated simultaneously with the parsing of the sample. During sample reconstruction, the CRC is calculated as the file is written. This doesn't have a huge impact on smaller samples since the file was likely cached for the extra passes anyway, but with the new large file support, it makes a significant difference.
- Improved general error handling/reporting.
MKV/AVI ReSample .NET Beta 8 (Jun 11 2009)
Changes in Beta 8:
- Added -l switch to list SRS file info.
ex: srs sample.srs -l
- Fixed a bug that caused an error when running ReSample from the root of a drive.
- Fixed a bug that caused ReSample to report that it had created an SRS file when the user had answered 'No' to a file overwrite prompt (the file wasn't actually created in that case).
MKV/AVI ReSample .NET Beta 7 (Jun 1 2009)
Changes in Beta 7:
- Added support for AVI files (for all the whiners — you know who you are).
- Improved the logic used when locating sample tracks within the full MKV or AVI file. In certain cases, a false positive match early in the file would prohibit ReSample from finding the track later in the file (this would really only happen in a subtitle track in an MKV). I only ever saw one file that was affected by this, but it's nice to have it fixed anyway.
- Changed the default track signature (the fingerprint of a track used to locate it in the full MKV/AVI) length from 128 bytes to 256 bytes in new SRS files. This was necessary to prevent false positives with XviD/DivX tracks.
- Changed the way paths are handled when creating files. Previous ReSample versions created the SRS file in the same folder as the input sample unless the -o switch was used. The default is now to create the SRS file in the working directory unless -o is used. The same applies for reconstructing samples. The reconstructed sample file will now be created in the working directory unless the -o switch is used. And finally, previous versions created temp files used by the reconstruction process in the same folder as the input full MKV file. The new version will create those temp files in the same folder in which the sample will eventually be created.
Note: This release is an almost complete rewrite from the last version. There are really too many changes to mention, but functionality should be the same except for the changes noted above. You can expect slightly better performance from the new version as well. File format is unchanged, so all existing SRS files should work fine with this build.
Download - Source
MKV ReSample .NET Beta 6 (Apr 27 2009)
Changes in Beta 6:
- ReSample now removes attached files from the information stored in the SRS file. Some MKVs (particularly those with ASS subtitle tracks) contain attached files. Any attached files present in the sample will also be in the full MKV, so they are now removed along with the track data and restored during sample reconstruction. This will result in smaller SRS files for those samples that contain attached files.
MKV ReSample .NET Beta 5 (Apr 25 2009)
Changes in Beta 5:
- Added support for track data stored in Matroska "SimpleBlock" Structures (used by default by mkvmerge starting with v2.7.0). In earlier ReSample versions, this data would have been recognized as metadata rather than track data, resulting in very large SRS files.
- Fixed an error that might occur when trying to reconstruct a sample from an incomplete RAR set. Reconstruction should work with an incomplete RAR set, provided enough of the RARs are present to locate the sample track data.
Note: In the case of samples using the new SimpleBlock structure, I have chosen not to build in backward compatibility for existing SRS files that have them stored (as I would normally do when I add a feature to ReSample). The reason for this is that if you use ReSample on a sample file that uses SimpleBlocks, the SRS file will be larger than the sample, making it totally useless. If for some reason, you created an SRS file like that and then deleted the sample, simply use an older build of ReSample to reconstruct the sample and then use a newer build to get a "proper" SRS file.
MKV ReSample .NET Beta 4 (Apr 24 2009)
Changes in Beta 4:
- Added support for .mkv.avi file extension for MKV samples
- Added the ability to recontruct a sample directly from a RAR set containing an MVK file. (e.g. srs sample.srs release.rar)
Note: If you have issues reconstructing directly from RAR, simply extract the MKV and use as before. This functionality works as far as I know, but it hasn't been tested as thouroughly as the base functionality.
MKV ReSample .NET Beta 3 (Mar 23 2009)
Changes in Beta 3:
- Original sample file name is now stored UTF8 encoded in the .srs file to allow for non-English characters
MKV ReSample .NET Beta 2 (Jan 24 2009)
Changes in Beta 2:
- Fixed a bug that caused a file not found error when attempting to validate a sample after reconstruction.
- Added -o switch to specify output path for .srs file
MKV ReSample .NET Beta 1 (Jan 17 2009)
Initial Public Release:
- Pass in .mkv (sample) file to create .srs
- Pass in .srs and .mkv (full) to re-create the sample
- File verification is included
Awescript - SRR/SRS + Directory Creation + Moving + Extraction + more
Download Download source
What is Awescript?
Awescript is a handy little for tidying your rarred scene releases. It's main use in the context of ReScene, is that it can generate SRR and SRS files automatically, and move them wherever you specify. However, it also unrars files, moves samples, extras, subs etc. into their correct folders, and (of course optionally) deletes anything un-necessary like NZB, SFV, samples, par2 and the rars themselves.
Installing and using Awescript
Before we start, you'll need a few things:
Python - the programming language that Awescript is written in.
Awescript - awescript.py, and necessary files.
ReScene and ReSample - these are included in AweScript package already.
.NET Framework - required for SRR and SRS to work at all!
Having downloaded and installed/extracted these files, you need to append the extracted folder location to your PATH variable [how?]. When that's done, paste the following into the command line (Win+R > "cmd" > OK):
[path_to_python] is usually "C:\Python31\", and [path_to_awescript] is the directory where you extracted the files earlier.
This ought to pump out all the help info about awescript. Have a brief read, then get cracking, or keep reading to integrate it into AltBinz.
Need help yet? Ask in the ReScene IRC channel on EFNET: #x264.rescene.info.
Integration with Alt.Binz
Alt.Binz, the popular "usenet proggy" can, as of v0.26.1 (a non-free version), execute another application or file upon completion of each download, after any PAR checking, unrarring etc. has occured [more info]. By using this feature to execute Awescript, we can tidy up our releases automatically, as and when they finish downloading.
It is important to check your settings in Alt.Binz, or the program may well not work. Click "Setup", and under the "PAR2" submenu, select the first four checkboxes. Under "Unrar", you probably want to check the "Auto Unrar" box, too.
Under the "NZB #2" tab, you add your execute command in the "Default Execute Command" box*. This should take the form..
[path_to_python]\python.exe "[path_to_awescript]\awescript.py" --altbinz --[your_switches_here] "$d".
*If you don't have this option, you're using an old version of Alt.Binz - you need to buy a later version.
If you didn't read the help information displayed when you ran awescript.py, you're probably the sort of person who'd rather just get the answer directly. Well, here's a "worked example":
C:\Python31\python.exe "C:\awescript\awescript.py" --altbinz --ignore-subs --ignore-cds --srs-namep --srr-dir=O:\SRR "$d"
This command will check that no par2 files exist (--altbinz), then create an SRS file called [release_name].srs instead of [sample-filename].srs (--srs_namep) and embed it into an srr. It will then delete the srs (lack of --keep-srs), and put the SRR file in the "O:\SRR" folder (--srr-dir). Sample file will be moved to the "Sample" folder (lack of --ignore-sample), but the subs and CDs will not be moved anywhere (--ignore-subs and --ignore-cds). The "%d" is essential - it is replaced by the release directory when alt.binz runs the command.
To test the execution works okay before changing the alt.binz settings, just replace the "%d" with the full path to the release directory you want to fix.
FAQ / Troubleshooting
Q: I have a problem with "UnRAR" not being recognised/found, (or similar).
A: You've probably made a mistake adding the relevant directory to your PATH variable. Also ensure the "unrar.exe" file resides in the same folder as awescript.py, (or in the folder you added to the PATH variable). Having changed the PATH, you need to restart the command window!
Q: When i test-run the script, i'm told there are PAR2 files present, and it quits.
A: This is probably because you haven't selected all the right options (to delete PAR2 files) in the alt.binz preferences. Delete all .par2 files in the directory in question, and retry. This error happens when you use the "--altbinz" switch with a folder containing par2 files.
Big thanks to guber for coding Awescript!
I appreciate that this is a very dumbed-down tutorial, so for any more advanced questions, make your way onto IRC! Needless to say, umlaut will never update this page again.
rescepy is a cross-platform Python script for automated ReScene reconstruction.
- Zero user intervention required - entirely automated.
- Grabs the latest srrs from srrdb.com.
- Option to process samples only.
The second release is out! The latest version can be downloaded from https://bitbucket.org/Gfy/pyrescene/downloads.
pyReScene is a port of ReScene .NET to the Python programming language. pyReSample has support for MP4 and WMV samples and pyReScene Auto is a one stop solution for creating SRR files of your releases.
pyReScene 0.4 (2013-02-28)
- pyReScene Auto: Fixing.Frank.2002.DVDRip.XviD-EXViD srr could not create
- pyReScene Auto: infinite loop on The.Haunting.1963.DVDRip.XviD-FRAGMENT
- pyReScene Auto: OS X issue fixed
- pyReScene Auto: more subfolder detection fixes
- pyReScene Auto: only store proof RAR files when they contain image files
- ReSample: No sample recreation for MKV files with attachments (bug #2)
- ReSample: Die.Simpsons.S04E02…..iNTERNAL-UTOPiA main AVI file with multiple audio tracks: the sample could not rebuild
- ReSample: ASAP MP4 sample failed reconstruction
- ReScene: Reconstruction support for compressed RAR files!
- ReScene: -t switch to choose your own (empty) temporary directory
pyReScene 0.3 (2013-02-07)
- pyReScene Auto: -l parameter added to report sample issues
- pyReScene Auto: CD1.srr files were created in certain cases
- pyReScene Auto: Subservience.2007.BDRip.XviD-DOCUMENT wasn't detected as a release
- pyReScene Auto: -c flag works again
- pyReScene Auto: FIX-release inside release dir made it fail
- ReScene: -e output bug for RAR end block fixed
pyReScene 0.2 (2013-02-05)
- ReScene: OpenSubtitles.org hashes are stored while creating SRR files
- BUG: reconstructing RARs with old style recovery records works
- PyPy support: it runs faster than with CPython
- EXE files for Windows available
pyReScene 0.1 (2013-01-14)
pyReScene Auto: (pyrescene.py)
- Initial version. It can automatically create a complete SRR file.
- No write access to the release directory is required. This means it works with DVDs. It also guarantees that nothing in the processed directories will change. (not a guarantee of awescript)
- -s parameter verifies sample against main movie files. If this fails it will still try to create an SRS file.
- -r parameter to recursively create SRR files.
- -c parameter will create SRRs for compressed RAR files.
- .ext.txt text files for corrupt samples. They show the error and the file size.
- Initial version. Changes since ReScene .NET 1.2:
- Asks for confirmation before overwriting an SRR file.
- Ability to replace missing file data with zero bytes when reconstructing: reconstruct with missing files.
- -l option lists file sizes and CRCs too.
- -e option lists detailed SRR information.
- Add, remove, rename stored files API available.
- Able to locate more data files in Linux.
- Able to write the corrupt end block of certain P0W4 releases. e.g. Psych.S06E02.HDTV.XviD-P0W4
- Separate script for fixing merged SRR files (fccleanup.py) copy /b cd1.srr+cd2.srr cdALL.srr The merged SRR file contains two application names and not all files are at the start of the SRR file.
- -q parameter to verify an extracted release is valid.
- Initial version. Changes since ReSample .NET 1.2:
- MP4 support: SRS construction and sample reconstruction.
- WMV support: SRS construction and sample reconstruction.
- SRS creation of a rarred sample failed: Corruption detected: Invalid FourCC value (Rar!) at 0x00000000. Aborting.
- -y, yes to all, option added.
- System.NullReferenceException from the .NET version is fixed.
- See srr_usenet.py
PHP implementation for reading and editing ReScene .srr and ReSample .srs files.