SegmentedAviSource
From Avisynth wiki
(Difference between revisions)
Raffriff42 (Talk | contribs) (formatting, links, phrasing ** TODO please confirm some information here **) |
|||
Line 1: | Line 1: | ||
− | + | '''SegmentedAviSource''' automatically loads up to 100 [[AVI]] files per {{FuncArg|base_filename}} using [[AviSource]] and splices them together using [[UnalignedSplice]]. | |
+ | :If {{FuncArg|base_filename}}="d:\filename.ext", '''SegmentedAviSource''' 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 [http://en.wikipedia.org/wiki/Windows_legacy_audio_components#Audio_Compression_Manager ''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]]. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | == Syntax and Parameters == | |
+ | {{FuncDefH4|SegmentedAviSource}} | ||
+ | {{FuncDef | ||
+ | |SegmentedAviSource(string ''base_filename'' [, ... ]<br> | ||
+ | [, bool ''audio'', string ''pixel_type'', int ''vtrack'', int ''atrack'' ] ) | ||
+ | }} | ||
− | + | :{{Par2|base_filename|string|}} | |
+ | ::If {{FuncArg|base_filename}}="d:\filename.avi", '''SegmentedAviSource''' will load the files d:\filename''.00''.avi, d:\filename''.01''.aviand so on, through d:\filename''.99''.avi. Any files in this sequence that don't exist will be skipped. | ||
− | If | + | :{{Par2|audio|bool|true}} |
+ | ::Enable audio on the resulting clip. | ||
+ | |||
+ | :{{Par2|pixel_type|string|"RGB32"}} | ||
+ | ::Request a color format from the decompressor. Allowed values are: | ||
+ | :::{|class="wikitable" | ||
+ | |style="width:5em; text-align:center;"|[[YV24]] | ||
+ | |style="width:5em; text-align:center;"|[[YV16]] | ||
+ | |style="width:5em; text-align:center;"|[[YV12]] | ||
+ | |style="width:5em; text-align:center;"|[[YV411]] | ||
+ | |style="width:5em; text-align:center;"|[[YUY2]] | ||
+ | |style="width:5em; text-align:center;"|[[RGB32]] | ||
+ | |style="width:5em; text-align:center;"|[[RGB24]] | ||
+ | |style="width:5em; text-align:center;"|[[Y8]] | ||
+ | |} | ||
+ | |||
+ | :{{Par2|vtrack|int|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 {{FuncArg|vtrack}} exists, an error will be raised. | ||
+ | |||
+ | :{{Par2|atrack|int|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 {{FuncArg|atrack}} exists, no error will be raised, and no audio will be returned. | ||
+ | |||
+ | |||
+ | {{FuncDefH4|SegmentedDirectShowSource}} | ||
+ | {{FuncDef | ||
+ | |SegmentedDirectShowSource(string ''base_filename'' [, ... ]<br> | ||
+ | [, float ''fps'', bool ''seek'', bool ''audio'', bool ''video'' ]<br> | ||
+ | [,bool ''convertfps'', bool ''seekzero'', int ''timeout'', string ''pixel_type'' ] ) | ||
+ | }} | ||
+ | |||
+ | :{{Par2|base_filename|string|}} | ||
+ | ::If {{FuncArg|base_filename}}="d:\filename.mov", '''SegmentedDirectShowSource''' will load the files d:\filename''.00''.mov, d:\filename''.01''.movand so on, through d:\filename''.99''.mov. Any files in this sequence that don't exist will be skipped. | ||
+ | |||
+ | :{{Par2|fps|float|24}} | ||
+ | ::Frames Per Second of the resulting clip. | ||
+ | |||
+ | :{{Par2|seek|bool|true}} | ||
+ | ::There is full seeking support available on most file formats. If problems occur, try setting {{FuncArg|seekzero}}=true first. If seeking still causes problems, disable seeking completely with {{FuncArg|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. | ||
+ | |||
+ | :{{Par2|audio|bool|true}} | ||
+ | ::Enable audio on the resulting clip. | ||
+ | |||
+ | :{{Par2|video|bool|true}} | ||
+ | ::Enable video on the resulting clip. | ||
+ | |||
+ | :{{Par2|convertfps|bool|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 {{FuncArg|fps}} is set to the least common multiple of the component frame rates, e.g. 120 or 119.880. | ||
+ | |||
+ | :{{Par2|seekzero|bool|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 [http://en.wikipedia.org/wiki/Advanced_Systems_Format ASF]. | ||
+ | ::[[TODO]] please confirm this information | ||
+ | |||
+ | :{{Par2|timeout|int|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 {{FuncArg|timeout}} values will result in an error message. | ||
+ | ::[[TODO]] please confirm this information | ||
+ | |||
+ | :{{Par2|pixel_type|string|"RGB32"}} | ||
+ | ::Request a color format from the decompressor. Valid values are listed in the table below, plus "AUTO" and "FULL". | ||
+ | :::{{FuncArg|pixel_type}}="AUTO" negotiates to use all relevant official formats, YUV plus RGB. | ||
+ | :::{{FuncArg|pixel_type}}="FULL" includes the non-standard pixel types listed in addition to those supported by "AUTO". See [[DirectShowSource]] | ||
+ | ::{|class="wikitable" | ||
+ | !pixel_type | ||
+ | !colspan="8" style="text-align:left;"| Color formats, listed by decoding priority (high to low) | ||
+ | |- | ||
+ | !style="width:5em; text-align:center;"|''FULL'' | ||
+ | |style="width:5em; text-align:center;"|[[YV24]] | ||
+ | |style="width:5em; text-align:center;"|[[YV16]] | ||
+ | |style="width:5em; text-align:center;"|[[YV12]] | ||
+ | |style="width:5em; text-align:center;"|[[I420]] | ||
+ | |style="width:5em; text-align:center;"|[[NV12]] | ||
+ | |style="width:5em; text-align:center;"|[[YUY2]] | ||
+ | |style="width:5em; text-align:center;"|[[AYUV]] | ||
+ | |style="width:5em; text-align:center;"|[[Y41P]] | ||
+ | |style="width:5em; text-align:center;"|[[Y411]] | ||
+ | |style="width:5em; text-align:center;"|[[ARGB]] | ||
+ | |style="width:5em; text-align:center;"|[[RGB32]] | ||
+ | |style="width:5em; text-align:center;"|[[RGB24]] | ||
+ | |- | ||
+ | !style="width:5em; text-align:center;"|''AUTO'' | ||
+ | |style="width:5em; text-align:center;"|[[YV24]] | ||
+ | |style="width:5em; text-align:center;"| | ||
+ | |style="width:5em; text-align:center;"|[[YV12]] | ||
+ | |style="width:5em; text-align:center;"| | ||
+ | |style="width:5em; text-align:center;"| | ||
+ | |style="width:5em; text-align:center;"|[[YUY2]] | ||
+ | |style="width:5em; text-align:center;"| | ||
+ | |style="width:5em; text-align:center;"|[[Y41P]] | ||
+ | |style="width:5em; text-align:center;"| | ||
+ | |style="width:5em; text-align:center;"| | ||
+ | |style="width:5em; text-align:center;"|[[RGB32]] | ||
+ | |style="width:5em; text-align:center;"|[[RGB24]] | ||
+ | |} | ||
+ | ::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. | ||
+ | ::[[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. | ||
+ | {{HalfBreak}} | ||
+ | *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: | ||
+ | :[[File:SegmentedAviSource-img1.png|alt=Directory tree; capture files in folders t1, t2 & t3]] | ||
+ | :To load all segments in order, call this: | ||
+ | <div {{BoxWidthIndent|56|3}} > | ||
+ | SegmentedAviSource("F:\t1\cap.avi", "F:\t2\cap.avi", "F:\t3\cap.avi") | ||
+ | </div> | ||
{{FilterCat|Internal filters|Media file filters|Source_filters}} | {{FilterCat|Internal filters|Media file filters|Source_filters}} |
Revision as of 04:27, 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", SegmentedAviSource 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(string base_filename [, ... ]
[, bool audio, string pixel_type, int vtrack, int atrack ] )
- string base_filename =
- If base_filename="d:\filename.avi", SegmentedAviSource will load the files d:\filename.00.avi, d:\filename.01.aviand 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:
- 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(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", SegmentedDirectShowSource will load the files d:\filename.00.mov, d:\filename.01.movand 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
- 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
- Request a color format from the decompressor. Valid values are listed in the table below, plus "AUTO" and "FULL".
- For planar color formats, adding a '+' prefix, e.g.
AviSource(..., 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
- For planar color formats, adding a '+' prefix, e.g.
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:
- To load all segments in order, call this:
SegmentedAviSource("F:\t1\cap.avi", "F:\t2\cap.avi", "F:\t3\cap.avi")