SegmentedAviSource

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (one more touch-up)
m (typo)
Line 111: Line 111:
 
::In other words, if {{FuncArg|pixel_type}}="AUTO", it will try to output [[YV24]]; if that isn't possible it tries [[YV16]], and if that isn't possible it tries [[YV12]], etc...
 
::In other words, if {{FuncArg|pixel_type}}="AUTO", it will try to output [[YV24]]; if that isn't possible it tries [[YV16]], and if that isn't possible it tries [[YV12]], etc...
  
::For [[Planar|planar]] color formats, adding a '''<tt>'+'</tt>''' prefix, ''e.g.'' <code>AviSource(..., pixel_type="'''+'''YV12")</code>, tells AviSynth the video rows are DWORD aligned in memory instead of packed. '''This can fix skew or tearing of the decoded video''' when the width of the picture is not divisible by 4.
+
::For [[Planar|planar]] color formats, adding a '''<tt>'+'</tt>''' prefix, ''e.g.'' <code>SegmentedDirectShowSource(..., pixel_type="'''+'''YV12")</code>, tells AviSynth the video rows are DWORD aligned in memory instead of packed. '''This can fix skew or tearing of the decoded video''' when the width of the picture is not divisible by 4.
 
::[[TODO]] please confirm this information
 
::[[TODO]] please confirm this information
  

Revision as of 04:56, 10 January 2016

SegmentedAviSource automatically loads up to 100 AVI files per base_filename using AviSource and splices them together using UnalignedSplice.

If base_filename="d:\filename.ext", this filter will load the files d:\filename.00.ext, d:\filename.01.ext and so on, through d:\filename.99.ext. Any files in this sequence that don't exist will be skipped.
As with AviSource there is built-in Audio Compression Manager support for decoding compressed audio tracks (MP3, AAC, AC3, etc).


SegmentedDirectShowSource works the same way, but calling DirectShowSource in place of AviSource.


Contents

Syntax and Parameters

SegmentedAviSource

SegmentedAviSource(string base_filename [, ... ]
      [, bool audio, string pixel_type, int vtrack, int atrack ] )

string  base_filename =
If base_filename="d:\filename.avi", this filter will load the files d:\filename.00.avi, d:\filename.01.avi and so on, through d:\filename.99.avi. Any files in this sequence that don't exist will be skipped.
bool  audio = true
Enable audio on the resulting clip.
string  pixel_type = "RGB32"
Request a color format from the decompressor. Allowed values are:
YV24 YV16 YV12 YV411 YUY2 RGB32 RGB24 Y8
int  vtrack = 0
Specifies a numbered video track. Track numbers start from zero, and are guaranteed to be continuous (i.e. there must be a track 1 if there is a track 0 and a track 2). If no video stream numbered vtrack exists, an error will be raised.
int  atrack = 0
Specifies a numbered audio track. Track numbers start from zero, and are guaranteed to be continuous (i.e. there must be a track 1 if there is a track 0 and a track 2). If no audio stream numbered atrack exists, no error will be raised, and no audio will be returned.


SegmentedDirectShowSource

SegmentedDirectShowSource(string base_filename [, ... ]
      [, float fps, bool seek, bool audio, bool video ]
      [,bool convertfps, bool seekzero, int timeout, string pixel_type ] )

string  base_filename =
If base_filename="d:\filename.mov", this filter will load the files d:\filename.00.mov, d:\filename.01.mov and so on, through d:\filename.99.mov. Any files in this sequence that don't exist will be skipped.
float  fps = 24
Frames Per Second of the resulting clip.
bool  seek = true
There is full seeking support available on most file formats. If problems occur, try setting seekzero=true first. If seeking still causes problems, disable seeking completely with seek=false. With seeking disabled and trying to seek backwards, the audio stream returns silence, and the video stream returns the most recently rendered frame. Note the Avisynth cache may provide limited access to the previous few frames, but beyond that the most recently frame rendered will be returned.
bool  audio = true
Enable audio on the resulting clip.
bool  video = true
Enable video on the resulting clip.
bool  convertfps = false
If true, it turns VFR (variable framerate) video into CFR (constant framerate) video by adding frames. This allows you to open VFR video in AviSynth. It is most useful when fps is set to the least common multiple of the component frame rates, e.g. 120 or 119.880.
bool  seekzero = false
If true, restrict backwards seeking only to the beginning, and seeking forwards is done the hard way (by reading all samples). Limited backwards seeking is allowed with non-indexed ASF.
TODO please confirm this information
int  timeout = 2000
Set time (in milliseconds) to wait when DirectShow refuses to render. When the timeout period has expired and the frame has not been rendered, AviSynth returns a blank frame and/or silence. Negative timeout values will result in an error message.
TODO please confirm this information
string  pixel_type = "RGB32"
Request a color format from the decompressor. Valid values are listed in the table below, plus "AUTO" and "FULL".
pixel_type="AUTO" negotiates to use all relevant official formats, YUV plus RGB.
pixel_type="FULL" includes the non-standard pixel types listed in addition to those supported by "AUTO". See DirectShowSource
pixel_type   Color formats, listed by decoding priority (high to low)
FULL YV24 YV16 YV12 I420 NV12 YUY2 AYUV Y41P Y411 ARGB RGB32 RGB24
AUTO YV24 YV12 YUY2 Y41P RGB32 RGB24
In other words, if pixel_type="AUTO", it will try to output YV24; if that isn't possible it tries YV16, and if that isn't possible it tries YV12, etc...
For planar color formats, adding a '+' prefix, e.g. SegmentedDirectShowSource(..., pixel_type="+YV12"), tells AviSynth the video rows are DWORD aligned in memory instead of packed. This can fix skew or tearing of the decoded video when the width of the picture is not divisible by 4.
TODO please confirm this information


Notes

Helpful hints

  • If you get an Unrecognized Exception while reading a VirtualDub-generated segmented AVI, delete the small final .avi file.
 
  • If segments are spanned across multiple drives/folders, they can be loaded provided the folders are given in the correct order.
For example, if you have capture files arrange across several folders like this:
Directory tree; capture files in folders t1, t2 & t3
To load all segments in order, call this:
SegmentedAviSource("F:\t1\cap.avi", "F:\t2\cap.avi", "F:\t3\cap.avi")
Personal tools