Although in the example above I have explicitly forced indexing with the ffindex(MTS) line, this is not necessary with recent versions of FFMS2. Fortunately, once an index file has been created it is recycled in further operations and will no longer slow things down. In the above example you’ll see in your folder the files and appear. This is just the indexing process working in the background, and separate from AvsP itself. You might even get a ‘not responding’ message within AvsP after you nudged its slider bar. With a large video file (and a slow PC), you might be wondering why nothing is happening at first. The indexing step mentioned earlier takes place automatically the first time the AVS script is activated. However, the main point of using a script is the potential for adding more complex video effects. For example you could feed it into VirtualDub and come out with an AVI (XviD) result. But with a script you have the flexibility to feed the result into a recipient program of your choice.
That would have resulted in another MTS file (renamed from M2TS). Of course you could have joined the files more easily with tsMuxerGUI. Note also that although the AVCHD Lite audio is stereo AC3, it will become stereo PCM audio when it emerges from the script. Again note that the file extension of the script is AVS and not TXT. If the above script was saved as mtsJoined.avs and put into the same folder as files 00236.mts and 00240a.mts then here we have a working AviSynth script where the two video clips have been appended. The MTS files can be raw AVCHD Lite footage taken from your camera, or footage that has already been trimmed with tsMuxerGUI. And if you move the slider bar at the bottom of the AvsP window you will see images from the resulting video. You can run your script within AvsP and any error messages are easily pinpointed. One of the many advantages of AvsP is that the script lines are numbered.
It’s recommended that you install AvsP and associate it with AVS files. This was provided automatically by AvsP, a very useful text editor that is tailored for AviSynth scripts. Take the following script (note that MTS, V236 and V240a are arbitrarily chosen variable names) …
The Haali Media Splitter may also need to be installed if you encounter an ‘Invalid initial pts and dts’ error when you run the script. The vital requirement for MTS file handling is that the FFMS2 plugin is located within the AviSynth plugins folder. In practice this means that, whereas an AVI file could be declared in one line, an MTS file needs three. An indexing process has to take place to ensure that the audio and video maintain synchronisation. Test3 6 - Fixes the channel mask variable that was previously almost always wrong in AviSynth.Bringing the MTS files of AVCHD Lite into an AviSynth script is a little more complicated than the AVI example we saw last week.
Test4 9 - Update for latest audio api revision Test5 3 - Properly export the number of bits per sample Test6 3 - Fixes clips with more than 2^31 samples in VS and adds 24 bit output to AviSynth. Test7 2 - VapourSynth: update for V4 api again fixed all known bugs and should be fairly stable Test8 7 - Updated with several new options, including drc_scale. Everything except automatic delay adjustment implemented. Soft sounds are enhanced.Įxamples BestAudioSource("blah.mp4", track=-1, adjustdelay=-1, exactsamples=false, enable_drefs=false, use_absolute_path=false, drc_scale=0) There are 3 notable scale factor ranges:ĭRC enabled. The factor to apply to dynamic range values from the AC-3 stream. If you prefer, you can produce a DVD-compliant MPG file with your own generic installation of ffmpeg and use a batch file as the front end. Set to true if you want opening files to be really slow but for some reason need a completely sample exact length.Įnable loading of external tracks, disabled by default.Īllows loading of external tracks via absolute paths, disabled by default.ĭynamic Range Scale Factor. Always remember that if your AviSynth script reads in MTS files from AVCHD Lite, you must also have the FFMS2 plugin for AviSynth installed. Negative numbers refer to the nth audio track with -1 being the first. Positive track numbers refer to the FFmpeg given stream number. Path can be omitted if the script is in the same folder as the audio file. Syntax and Parameters BestAudioSource (string "source", int "track", int "adjustdelay", bool "exactsamples", bool "enable_drefs", bool "use_absolute_path", float "drc_scale", string "varprefix") A new sample accurate but somewhat slow FFmpeg based audio source filter for AviSynth.