A script development tool for AviSynth with built in video viewer / player and instant script output properties or error details.
A tool born from my laziness and inspired by the extraordinary software written by Nic, Hank315 and others whom hang out at Doom9's forum, you may post comments to the AviSynth usage forum "avsFilmCutter a new tool for AviSynth thread" or you can email your remarks directly to the following.
This dialog window allows the user to changes some options.
The script editor used by FilmCutter is called "Scintilla" © 1998-2003 by Neil Hodgson, it provides many features found in the best text / script editing software such as Notepad++.
All menus in FilmCutter are pop ups. Right clicking when the mouse pointer is over the script edit window will display a menu for that window. Right clicking over the border that surrounds the editor will display the main menu. Right clicking the "Encode" button or a Tool button for example opens a dialog box for adjusting settings or setting up something. You do not have to hunt thought the menus to change a setting always. If there are adjustable options for a button, they are under your right mouse button finger.
This document can be launched from within FilmCutter, select Help - Open User Guide in the main window menu.
AviSynth documentation is also available as noted above and if the user (that's you) highlights or selects a function name and then presses F1. It sort of works, the problem is that the help.html file for, lets use "Mpeg2Source" as an example, a filter or plug-in function may not use the same name as the function or filter called in a script i.e. DGDecode.dll and Mpeg2Source. This will be addressed in a future version with a redirect list customizable by you, the user.
Another example of this problem with directing you to the correct help page is "Animate / ApplyRange", ApplyRange is found in the html file for Animate(animate.htm). In the interim FilmCutter will open a windows search window for the AviSynth documentation folder. You can then paste the function name into the "find in file" box and click search.
Selecting the complete function name and argument list yields another option. This one is explained in more detail below.
If you select the whole funciton " trim(155, 156) " and press F1 FilmCutter will open the filter/function parameter dialog window and try to fill the parameter cells with the argument values. This kind of works for some filters and funcitons and for others not so well. Anyone out there really like writing parsing code, I could use some algorythm help.
Filter/Function lookup is available, sort of an autocomplete thing. Goes something like this.
To view the filter/function list you have the following choices:
Repeatedly pressing Ctrl+Tab will open and close the filter/function drop down list. When open you may use the arrow keys to look though the list for a function or filter. Press enter to add to your script. Press Tab to open the parameter help dialog window.
When open scroll down with the wheel or scroll bar and just click or hold the mouse over the filter/function and press Tab to open the parameter help dialog window
Alternatively you can type the beginning letters of the filter/function name and watch the list highlight jump to the first match it finds. Backspace works if you type an incorrect letter. And the statusbar's far right column shows "Filter search = " as you type so you can see if you make an error.
When the filter you are looking for is showing you may do one of the following:
When the filter/function parameter dialog box is open you can tab through the data cells adding parameters as you wish. You can right click on a cell and select insert filename or from the keyboard press Ctrl+Shift+O to open the filename dialog box. The bottom window shows the parameter definition string that avisynth.dll provides. The window above that shows the parameters you will be adding for the function. Press enter to insert the function into the script or click Ok.
This little goodie will not keep you away from the AviSynth and plug-in documentation but it might make it a little easier.
This parameter lookup feature of AviSynth's is broken to some extent in all versions prior to 2.57. See the appendix for more details.
Please note, all internal AviSynth filters and functions make it to the list which is created when FilmCutter is first opened. However the plug-in functions in the list are only from those Dlls that reside in AviSynth's plug-in folder. There is no provision in avsFilmCutter to list functions from Dlls that reside elsewhere on you computer, yet.
The editor has a six button toolbar that is programmable. Right click to setup each button. If you like an external video viewer use button six. Button six is shared by the trim edit window. Also when a script is launched with button six from the script edit toolbar the viewed script displayed in the window will be sent to the external viewer not the saved script. Only button six the one on the bottom right will gather the script from the window without you having to saving the file. Tool button setup is like encoder setup except no "%ofile.ext"(out-filename) in the command line for tools. For tool buttons 1-5 when using programs like "AVSEdit", that edit and save the script when closed, FilmCutter will reload the file after the external tool has been closed.
You may encode your saved scripts directly from the script editor (more details here), press F7 or use the Encoding section of the script editor menu.
At any time during the script writing process press F8 or select "Show Script Output Properties" from the script editor menu. Some of the items displayed are shown below. For scripts loaded into the editor FilmCutter will load the script file or a file(windat.avs) it creates from the text in the editor window, into AviSynth and collect the data or error information, which it then displays. For media files loaded into the media viewer the files are run though a common interface that provides data for some but not all types of files.
FilmCutter will display, if it detects AviSynth is outputting error information, details about the error AviSynth is reporting.
If you want to view your script press F5 or alternately select Preview Script from the script editor menu, the internal video preview window will load up the unsaved text from the editor and display the first frame, display an error message or crash (see the appendix). Alternately you may press F6 which will switch to the preview window and begin to play. While working in the preview window F6 will play or stop the video. Press F5 to return to the script editor or alternately select Script Edit Window from any menu. If you choose to switch back to the script editor to make some changes and again switch to Preview, the frame number last displayed from the previous visit to preview will be displayed, but there is more.
All preview modes show a track bar for scanning the video, a " jump to frame window " and a frame number display with little arrows which advance and reverse the frame count by one (the keyboard shortcuts should work as well).
If at any time the "Info" line in the menu is checked, FilmCutter will display a list of properties for the clip being viewed. This data is collected directly from AviSynth and the color space data should be more correct when using RGB. Field parity is also shown but will display ??? unless the user has defined the field order using either "AssumeTFF" or "AssumeBFF" in their script.
Same script editor, same menu, just smaller showing only a few lines which will increase and decrease as the window size is increased or decreased. You get another button " update " or press F4 which updates the video window with your changes to the script.
Once again these modes can be set by using either "Script Options" -> "Preview Options" in the script editor menu or on the fly during the preview session using the video window's menu "Preview Mode". A third option is the preview window frame menu contains Info, No Script Editor and w/Script Editor
Note that when using the script editor in preview an Update F4 button is shown which allows the user to update the video window after changes have been made to the scirpt. Update does not save the script.
Again, the bottom tool button (number six) will launch the window text just as the internal viewer does.
This little window displays information that may be more important to me than the average user. It shows the version information and current error information related to AviSynth and also provides information about the last error reported to the user.
This dumb idea is just a development tool I am too lazy to remove from the user's reach, it will trash the script in the editor and display all the filters and functions that AviSynth can access. So if you want to see all the AviSynth functions both internal and those in the plug-in directory select this little goodie. You will also see how slow I can make your computer run.
If your encoding solution includes a trip through the internals of a version of VirtualDub to save out the audio portion of your script as a wave file, stop, FilmCutter will save that wave. It will save lots of waves.
What ever audio format your AviSynth script is using, select 'Save Audio as Wave" from the main or script editor menus to open the save wave dialog window which should show you some details concerning the wave file that would result from you clicking on the save button. Input and output files are shown and the output filename can be changed. Also you will find a check box at the top left, "Save each channel a wave file", which when checked will cause FilmCutter to break the channels out as individuals and then save them as individuals, the naming convention is shown below. Also the maximum file size for a correctly formatted wave file is 4 GB, if your resulting multi-channel file will exceed 4 GB FilmCutter will automatically switch to the individual file mode. When using this feature the files will have the channel ordering that AviSynth uses.
Channel Number | Description | Out-file Name |
---|---|---|
1 | front left channel | YourFile_FL.wav |
2 | front right channel | YourFile_FR.wav |
3 | front center channel | YourFile_C.wav |
4 | LFE (Subwoofer) | YourFile_LFE.wav |
5 | rear left channel | YourFile_SL.wav |
6 | rear right channel | YourFile_SR.wav |
7 | not yet | |
8 | not yet |
You have created your script adding filters and have tweaked them to your pleasure, cut out the junk or the commercials, now it is time to encode your work. FilmCutter has an interface for launching your scripts into another application with the emphasis being encoding.
A very simple example would be starting VirtualDub with a single click of the mouse or starting VirtualDub with your script loaded (no need to leave FilmCutter). A very complex example would be setting up a encoding configuration where FilmCutter would launch an audio encoder then a video encoder and when finished multiplex the audio and video together while you sleep, work or watch. FilmCutter does not multiplex yet but does the other things pretty well.
Applications like VirtualDub encode using a codex (compressor/decompressor) installed on your computer. FilmCutter needs the application to connect to these codexs. Encoding applications like QuEnc and HC are devoted to encoding in one or a small number of formats related to a given task, both are setup to use AviSynth scripts as the source.
To setup encoding from FilmCutter see the included help file, Encoder dialog help.
Additional information about using the script editor can be found on the web site or go directly to fcwebguide1.html
Here is the meat and potatoes of the program, the reason I started this project.
I wanted a simpler way of collecting the frame numbers needed to use the trim function in AviSynth. Load your source script, navigate though your video click the FilmCutter icon button and you will soon have a list of frame numbers. It may not be just that easy, but it is close to that easy.
In simple terms.
Output script or project script generation is somewhat automatic, the file is written with the naming conventions shown below. To make sure the file is written you must only switch from the source to the project mode in the editor. Each time you switch to project the file is written.
" weddingvideo.jfc "
" weddingvideo_fcprj.avs "
The scene list window has buttons on the left side that represent the rows of the list, click the row number to edit a row. If you other click the row buttons a short menu list appears (insert row, delete).
When the user has a project open in FilmCutter the script editor switches to a tab view. The tabs at the top allow the user to switch between the source and project scripts. The rest of the program tracks the change just as if you had clicked the source/project check box in the video editor window.
If you wish to edit the project script from the script editor window please save it under a different file name as FilmCutter will write over it the first time it is called to be used.
You can find a more details about the video editor on the web site at fcwebguide2.htmlThis is just the video window (aspect ratio corrected) without the other buttons and windows. FilmCutter contains a not so complete implementation of DirectShow.
The DirectX viewer works very well with AviSynth scripts and mpeg1+2 ac3, wmv, wma, and wav files as well. The focus when using this player is to view and play an avs script for AviSynth, other media types will play depending on your system and the installed decoders.
Of note is the following example.
The system that avsFilmCutter is being developed on today is a Pentium 4 Media Center machine made by HP, its nice. Microsoft as I remember it, no longer provides an Mpeg 2 decoder with Windows, even their Media Center versions. This machine came with a copy of InterVideo's WinDVD. I do not know if this combination of Media Center and WinDVD is common but Media Center will not play dvds if you remove WinDVD. Attempts to install a decoder, for example the famous "Ligos" decoder were unsuccessful, my point follows.
With the ligos decoder installed the seek functions in FilmCutter work well as long as you don't seek the next frame, the direct show functions fail, crashing the program, the WinDVD decoder behaves differently locking up just the player, but only after seeking wildly beyond a few frames.
Your results will differ I am sure, nevertheless the direct show viewer/player is here to stay and will work much better as I tune the interface.
Tip: Leave the filters out of your script or better comment them out until you have your trim statements done then save the project remove the number signs and encode away.
Play / Stop | |||||||||||||||
Forward one frame
| Reverse one frame
| Forward framerate * two
| Reverse framerate * two
| Reverse framerate * ten
| Forward framerate * ten
| Reverse framerate * one hundred
| Forward framerate * one hundred
| |
Some of you know that AviSynth reports syntax and other errors in the video
window of the player/viewer. That information is available to FilmCutter
directly and will be displayed in a dialog or message window. Some
errors, not related to your script, can cause FilmCutter to receive error
information when loading function names at program start.
If avsFilmCutter starts up without error it is likely that the only error
information you will encounter will be script or plug-in function usage errors.
If the error is system related (caused by other that your script errors),
avsFilmCutter tries to provide some info about the nature and persistence of
the error. One example of a system type error is a syntax error in an
avsi file. This type of error prevents all usage of AviSynth across the
board; Media Player Classic may lock up and not close properly, VirtualDub
reports the error correctly with version 2.58 but not with 2.57 and
earlier. FilmCutter should be more tolerant now (Thank you Ian) and
display the reported error.
The following list of error codes are provided by FilmCutter.
Can not find or can not load "avisynth.dll". AviSynth must be installed on your computer or most features of avsFilmCutter will not be available.
Install or reinstall AviSynth. Without AviSynth, FilmCutter is a poor text editor. And a very limited video viewer.
AviSynth failed to load the required lib function. The AviSynth interface is not available.
Either avsFilmCutter or AviSynth has a corrupted installation. Download clean copies and reinstall one or both.
This is the first attempt at getting an script environment pointer.
An attempt to get a script environment pointer from AviSynth has failed. The following details are available.
- "Cannot get a pointer to a script environment." Maybe AviSynth version is to old.
- "Your computer is so screwed, loadFunction(CreateScriptEnvironment) failed and you got here anyway, prior error should prevent this call." The function that returns the pointer is not loaded, AVSERR_02.
- Message provided by AviSynth.
- "AvisynthError err.msg corrupted" AviSynth is talking, garbage.
- Serious fatal error.
An attempt to determine the version of AviSynth has failed. If your installation is functional, it is older than 2.07 and is not supported. The following details are available.
- "This version of AviSynth does not have a version string." The attempt to Invoke the VersionString returned "not found".
- "There is no script environment." Can not talk to AviSynth.
- AviSynth describes the error.
- "AvisynthError err.msg corrupted" AviSynth is talking, garbage.
- Serious fatal error.
An attempt to look up internal function names and keywords has failed. Available details follow.
- "GetVar: Var "InternalFunctions" Not Found." You need a later version of AviSynth.
- 3. 4. 5. see AVSERR_04
An attempt to look up plug-in function names has failed. Available details follow.
- "GetVar: Var "PluginFunctions" Not Found." You need a later version of AviSynth.
- 3. 4. 5. see AVSERR_04
An attempt to get a script environment pointer for parameter look up has failed. The following details are available.
See AVSERR_03 the reporting is the same.
An attempt to look up a parameter string has failed. The following details are available.
- "GetVar: Var "$Plugin!%s!Param$" Not Found." This error should be trapped out by version checking.
- 3. 4. 5. see ASVERR_04
An attempt to look up a paramenter string has returned data that is not valid.
The wrong data type was returned.
An attempt to get a script environment pointer for script properties look up has failed. The following details are available.
See AVSERR_03 the reporting is the same.
AviSynth reports an error in your script.
- Invoke: The funcition "Import" was not found. If you see this nothing on your computer should be working right.
- 3. 4. 5. see ASVERR_04
All script syntax errors will show up as AVSERR_11.
An error was detected while testing your script for "OPT_AllowFloatAudio". The following details are available.
- Here, not found is not a error.
- 3. 4. 5. see ASVERR_04
Starting with version 2.55 of AviSynth, avisynth.dll reports both the plug-ins function name and it's alternate name. In other words functions such as Mpeg2Source will have more than one name. In the filter / function list you will find both Mpeg2Source and DGDecode_Mpeg2Source listed. This means that all externals / plug-in function names are listed twice, this issue is on the list and is not that difficult to deal with except that it gives me a headache and from a cold start gathering the filter names makes FilmCutter seem slow to start now.
avsFilmCutter supports all versions of AviSynth that provide this filter / function information starting with 2.52.
As I write this the powers that be are hard at work finishing version 2.58 of AviSynth, the latest information can be found here.
I have removed the specal build of AviSynth 2.56 built by Fizick as 2.57 from the web site because of the release of 2.57. Anyone needing this build can email me I will help you get it.
I believe that FilmCutter is stable but it is under heavy development.
Mistakes do get made, and generally they get fixed quickly. An issues
and bug list is here.
There is a but. It appears that if AviSynth crashes so goes FilmCutter
though not so much these days. I have on occasion created a script that
closes or crashes programs like Media Player Classic. So I have setup
FilmCutter to not load scripts into the video viewer under all circumstances,
this prevents a really bad script from preventing trouble shooting.
Starting with version 0.0.2.0 even a bad AviSynth installation shouldn't take
FilmCutter down, exhaustive testing has been done, but please drop me note
if your lucky enough to find a crasher.
The following should explain.
So if she is crashing, check the script with another program. If
FilmCutter continues to crash when other programs don't, please send me the
script.
Every time FilmCutter opens it tries to collect the version string and the
internal and plug-in function names. If FilmCutter opens without
complaining about AviSynth then your AviSynth installation should be in good
order. Also syntax errors are not uncommon least not for me and those
errors are appropriately marked, system error also labeled as such are mostly
going to be fatal. Which means that something is wrong with FilmCutter
or AviSynth, maybe a plug-in.
A project script file will be saved as "[your project filename]_fcprj.avs" in the project directory.
## Project Script Created by FilmCutter ## Import("E:\P_BellyDance\AirShowDance_FC.avs") t1 = trim(46471,52985) t2 = trim(23332,29611) t1+t2 |
filmcutter.ini
#### filmcutter.ini #### ######################## avisynth path C:\Program Files\AviSynth 2.5\Docs\english\ (your path if different) project path (blank) last font Terminal (font name) -12 0 0 0 400 0 0 0 ff 1 2 1 31 Terminal (font data) last view 3 2 0 1 9 1 (six digits "lastview" "preview" "information" "syntax" "tooltip levels" "line numbers") last ar 1 jump 300 (scene / video editor jump button frame count you may ajust here) main window 1 148 65 728 488 (placeholder, HorzPosition, VertPosition, HSize, VSize) write script 1 0 (SpliceType 1 or 2, edChoice Not used ) button 1 C:\Program Files\VDubMOD\VirtualDubMod.exe %filename button 2 button 3 button 4 button 5 button 6 end filmcutter.ini |
encoder.ini
#### encoder.ini #### ##################### default encoder 02 encoder 01 path C:\Program Files\HC_15\HCbatch_015.exe file HCbatch_015.exe 1 command line -i %filename -o %ofilename encoder 02 path C:\Program Files\QuEnc59b2\QuEnc59b2.exe file QuEnc59b2.exe 1 command line -i %filename -o %ofilename end encoder.ini |
avsFilmCutter © 2005 - 2007 Robert Clark.
www.avsFilmCutter.com
AviSynth © 2002 - 2007 Ben Rudiak-Gould et al.
www.avisynth.org
Scintilla © 1998-2003 by Neil Hodgson
scintilla.org