[File] LSMASHSource.dll : A source plugin for AviSynth [LSMASHSource.dll: LSMASHSource] [Functions] [LSMASHVideoSource] LSMASHVideoSource(string source, int track = 0, int threads = 0, int seek_mode = 0, int seek_threshold = 10, bool dr = false, int fpsnum = 0, int fpsden = 1, bool stacked = false, string format = "", string decoder = "") * This function uses libavcodec as video decoder and L-SMASH as demuxer. * RAP is an abbreviation of random accessible point. [Arguments] + source The path of the source file. + track (default : 0) The track number to open in the source file. The value 0 means trying to get the first detected video stream. + threads (default : 0) The number of threads to decode a stream by libavcodec. The value 0 means the number of threads is determined automatically and then the maximum value will be up to 16. + seek_mode (default : 0) How to process when any error occurs during decoding a video frame. - 0 : Normal This mode retries sequential decoding from the next closest RAP up to 3 cycles when any decoding error occurs. If all 3 trial failed, retry sequential decoding from the last RAP by ignoring trivial errors. Still error occurs, then return the last returned frame. - 1 : Unsafe This mode retries sequential decoding from the next closest RAP up to 3 cycles when any fatal decoding error occurs. If all 3 trial failed, then return the last returned frame. - 2 : Aggressive This mode returns the last returned frame when any fatal decoding error occurs. + seek_threshold (default : 10) The threshold to decide whether a decoding starts from the closest RAP to get the requested video frame or doesn't. Let's say - the threshold is T, and - you request to seek the M-th frame called f(M) from the N-th frame called f(N). If M > N and M - N <= T, then the decoder tries to get f(M) by decoding frames from f(N) sequentially. If M < N or M - N > T, then check the closest RAP at the first. After the check, if the closest RAP is identical with the last RAP, do the same as the case M > N and M - N <= T. Otherwise, the decoder tries to get f(M) by decoding frames from the frame which is the closest RAP sequentially. + dr (default : false) Try direct rendering from the video decoder if set to true. The output resolution will be aligned to be mod16-width and mod32-height by assuming two vertical 16x16 macroblock. For H.264 streams, in addition, 2 lines could be added because of the optimized chroma MC. + fpsnum (default : 0) Output frame rate numerator for VFR->CFR (Variable Frame Rate to Constant Frame Rate) conversion. If frame rate is set to a valid value, the conversion is achieved by padding and/or dropping frames at the specified frame rate. Otherwise, output frame rate is set to a computed average frame rate and the output process is performed by actual frame-by-frame. + fpsden (default : 1) Output frame rate denominator for VFR->CFR (Variable Frame Rate to Constant Frame Rate) conversion. See 'fpsnum' in details. + stacked (default : false) Use the stacked format for a hack of AviSynth high bit-depth support if set to true. The stacked format splits MSB and LSB into vertically, and MSB comes on top of output image. Note: direct rendering is not available at all if stacked format is used. + format (default : "") Force specified output pixel format if 'format' is specified. The following formats are available currently. "YUV420P8" "YUV422P8" "YUV444P8" "YUV410P8" "YUV411P8" "YUV420P9" "YUV422P9" "YUV444P9" "YUV420P10" "YUV422P10" "YUV444P10" "YUV420P12" (ffmpeg only) "YUV422P12" (ffmpeg only) "YUV444P12" (ffmpeg only) "YUV420P14" (ffmpeg only) "YUV422P14" (ffmpeg only) "YUV444P14" (ffmpeg only) "YUV420P16" "YUV422P16" "YUV444P16" "YUY2" "Y8" "RGB24" "RGB32" Note: direct rendering is not available at all if pixel format is forced. + decoder (defalut : "") Names of preferred decoder candidates separated by comma. For instance, if you prefer to use the 'h264_qsv' and 'mpeg2_qsv' decoders instead of the generally used 'h264' and 'mpeg2video' decoder, then specify as "h264_qsv,mpeg2_qsv". The evaluations are done in the written order and the first matched decoder is used if any. [LSMASHAudioSource] LSMASHAudioSource(string source, int track = 0, bool skip_priming = true, string layout = "", int rate = 0, string decoder = "") * This function uses libavcodec as audio decoder and L-SMASH as demuxer. [Arguments] + source The path of the source file. + track (default : 0) The track number to open in the source file. The value 0 means trying to get the first detected audio stream. + skip_priming (default : true) Whether skip priming samples or not. Priming samples is detected from iTunSMPB or the first non-empty edit. If any priming samples, do pre-roll whenever any seek of audio stream occurs. + layout (default : "") Output audio channel layout. If unspecified, audio stream is output to the buffer from the decoder via the resampler at the channel layout which is the first maximum number of channels in audio stream. You can specify channel layout by combination of the name of a channel layout with separator (+) as follows. - the name or mask of a single channel. FL (0x1) = Front Left FR (0x2) = Front Right FC (0x4) = Front Center LFE (0x8) = Low Frequency Effect BL (0x10) = Back Left BR (0x20) = Back Right FLC (0x40) = Front Left of Center FRC (0x80) = Front Right of Center BC (0x100) = Back Center SL (0x200) = Side Left SR (0x400) = Side Right TC (0x800) = Top Center TFL (0x1000) = Top Front Left TFC (0x2000) = Top Front Center TFR (0x4000) = Top Front Right TBL (0x8000) = Top Back Left TBC (0x10000) = Top Back Center TBR (0x20000) = Top Back Right DL (0x20000000) = Stereo Downmixed Left DR (0x40000000) = Stereo Downmixed Right WL (0x80000000) = Wide Left WR (0x100000000) = Wide Right SDL (0x200000000) = Surround Direct Left SDR (0x400000000) = Surround Direct Right LFE2 (0x800000000) = Low Frequency Effect 2 $ Example: standard ffmpeg based 5.1ch surround layout : FL+FR+FC+LFE+BL+BR = 0x3f - the name of an usual channel layout. libav | ffmpeg mono = FC | FC stereo = FL+FR | FL+FR 2.1 = FL+FR+LFE | FL+FR+LFE 3.0 = FL+FR+FC | FL+FR+FC 3.0(back) = FL+FR+BC | FL+FR+BC 3.1 = FL+FR+FC+LFE | FL+FR+FC+LFE 4.0 = FL+FR+FC+BC | FL+FR+FC+BC quad = FL+FR+BL+BR | FL+FR+BL+BR quad(side) = FL+FR+SL+SR | FL+FR+SL+SR 5.0 = FL+FR+FC+SL+SR | FL+FR+FC+BL+BR 5.1 = FL+FR+FC+LFE+SL+SR | FL+FR+FC+LFE+BL+BR 6.0 = FL+FR+FC+BC+SL+SR | FL+FR+FC+BC+SL+SR 6.0(front) = FL+FR+FLC+FRC+SL+SR | FL+FR+FLC+FRC+SL+SR hexagonal = FL+FR+FC+BL+BR+BC | FL+FR+FC+BL+BR+BC 6.1 = FL+FR+FC+LFE+BC+SL+SR | FL+FR+FC+LFE+BC+SL+SR 6.1(front) = FL+FR+LFE+FLC+FRC+SL+SR | FL+FR+LFE+FLC+FRC+SL+SR 7.0 = FL+FR+FC+BL+BR+SL+SR | FL+FR+FC+BL+BR+SL+SR 7.0(front) = FL+FR+FC+FLC+FRC+SL+SR | FL+FR+FC+FLC+FRC+SL+SR 7.1 = FL+FR+FC+LFE+BL+BR+SL+SR | FL+FR+FC+LFE+BL+BR+SL+SR 7.1(wide) = FL+FR+FC+LFE+FLC+FRC+SL+SR | FL+FR+FC+LFE+BL+BR+FLC+FRC 7.1(wide-side) = N/A | FL+FR+FC+LFE+FLC+FRC+SL+SR octagonal = FL+FR+FC+BL+BR+BC+SL+SR | FL+FR+FC+BL+BR+BC+SL+SR downmix = DL+DR | DL+DR - a number of channels. libav | ffmpeg 1 = FC | FC 2 = FL+FR | FL+FR 3 = FL+FR+FC | FL+FR+LFE 4 = FL+FR+BL+BR | FL+FR+FC+BC 5 = FL+FR+FC+SL+SR | FL+FR+FC+BL+BR 6 = FL+FR+FC+LFE+SL+SR | FL+FR+FC+LFE+BL+BR 7 = FL+FR+FC+LFE+BC+SL+SR | FL+FR+FC+LFE+BC+SL+SR 8 = FL+FR+FC+LFE+BL+BR+SL+SR | FL+FR+FC+LFE+BL+BR+SL+SR Note: the above listed notations are the present things. In the future, they might be changed. + rate (default : 0) Audio sampling rate or sampling frequency in units of Hz. The value 0 means audio stream is output to the buffer via the resampler at the maximum sampling rate in audio stream. Otherwise, audio stream is output to the buffer via the resampler at specified sampling rate. + decoder (defalut : "") Same as 'decoder' of LSMASHVideoSource(). [LWLibavVideoSource] LWLibavVideoSource(string source, int stream_index = -1, int threads = 0, bool cache = true, int seek_mode = 0, int seek_threshold = 10, bool dr = false, int fpsnum = 0, int fpsden = 1, bool repeat = false, int dominance = 0, bool stacked = false, string format = "", string decoder = "") * This function uses libavcodec as video decoder and libavformat as demuxer. [Arguments] + source The path of the source file. + stream_index (default : -1) The stream index to open in the source file. The value -1 means trying to get the video stream which has the largest resolution. + threads (default : 0) Same as 'threads' of LSMASHVideoSource(). + cache (default : true) Create the index file (.lwi) to the same directory as the source file if set to true. The index file avoids parsing all frames in the source file at the next or later access. Parsing all frames is very important for frame accurate seek. + seek_mode (default : 0) Same as 'seek_mode' of LSMASHVideoSource(). + seek_threshold (default : 10) Same as 'seek_threshold' of LSMASHVideoSource(). + dr (default : false) Same as 'dr' of LSMASHVideoSource(). + fpsnum (default : 0) Same as 'fpsnum' of LSMASHVideoSource(). + fpsden (default : 1) Same as 'fpsden' of LSMASHVideoSource(). + repeat (default : false) Reconstruct frames by the flags specified in video stream and then treat all frames as interlaced if set to true and usable. Note that this option is ignored when VFR->CFR conversion is enabled. + dominance : (default : 0) Which field, top or bottom, is displayed first. - 0 : Obey source flags - 1 : TFF i.e. Top -> Bottom - 2 : BFF i.e. Bottom -> Top This option is enabled only if one or more of the following conditions is true. - 'repeat' is set to true. - There is a video frame consisting of two separated field coded pictures. + stacked (default : false) Same as 'stacked' of LSMASHVideoSource(). + format (default : "") Same as 'format' of LSMASHVideoSource(). + decoder (defalut : "") Same as 'decoder' of LSMASHVideoSource(). [LWLibavAudioSource] LWLibavAudioSource(string source, int stream_index = -1, bool cache = true, bool av_sync = false, string layout = "", int rate = 0, string decoder = "") * This function uses libavcodec as audio decoder and libavformat as demuxer. * If audio stream can be coded as lossy, do pre-roll whenever any seek of audio stream occurs. [Arguments] + source The path of the source file. + stream_index (default : -1) The stream index to open in the source file. The value -1 means trying to get the first detected audio stream. + cache (default : true) Same as 'cache' of LWLibavVideoSource(). + av_sync (default : false) Try Audio/Visual synchronization at the first video frame of the video stream activated in the index file if set to true. + layout (defalut : "") Same as 'layout' of LSMASHAudioSource(). + rate (default : 0) Same as 'rate' of LSMASHAudioSource(). + decoder (defalut : "") Same as 'decoder' of LSMASHVideoSource().