LSMASHSource

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (bump version number)
(Archived Downloads: add r935+34-20190829)
(23 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
{{Filter3
 
{{Filter3
 
| {{Author/VFR-maniac}}
 
| {{Author/VFR-maniac}}
| r736
+
| r929 (24-Feb-2017)
 
| {{Plugin/LSMASHSource}}
 
| {{Plugin/LSMASHSource}}
 
| Source filters  
 
| Source filters  
Line 9: Line 9:
 
<br>
 
<br>
 
== Description ==
 
== Description ==
LSMASHSource is a source plugin for AviSynth. It uses [http://en.wikipedia.org/wiki/FFmpeg FFmpeg] ([http://en.wikipedia.org/wiki/Libavcodec libavcodec]) to decode [http://en.wikipedia.org/wiki/FFmpeg#Codecs.2C_formats_and_protocols_supported all supported audio and video formats.]
+
LSMASHSource is a source plugin for AviSynth/AviSynth+. It uses [http://en.wikipedia.org/wiki/FFmpeg FFmpeg] ([http://en.wikipedia.org/wiki/Libavcodec libavcodec]) to decode [http://en.wikipedia.org/wiki/FFmpeg#Codecs.2C_formats_and_protocols_supported all supported audio and video formats.] For a complete list see official [http://www.ffmpeg.org/general.html#Supported-File-Formats_002c-Codecs-or-Features FFmpeg documentation].
 
<br>
 
<br>
 
<br>
 
<br>
 
== Requirements ==
 
== Requirements ==
* [http://forum.doom9.org/showthread.php?t=168764 AviSynth 2.6.0 Alpha5] or later
+
* [http://sourceforge.net/projects/avisynth2/ AviSynth 2.6.0] or greater | [[AviSynth+]]
* Supported color formats: [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]]<span style="color:red">*</span>, [[YV12]], [[YV16]]<span style="color:red">*</span>, [[YV24]]<span style="color:red">*</span>, [[YV411]]<span style="color:red">*</span>
+
* Supported color formats: [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
: <span style="color:red">*</span> These additional [[planar]] colorspaces are not available in AviSynth 2.5.8.
+
 
<br>
 
<br>
 
* [http://www.microsoft.com/en-us/download/details.aspx?id=40784 Microsoft Visual C++ 2013 Redistributable Package (x86 / x64)]
 
* [http://www.microsoft.com/en-us/download/details.aspx?id=40784 Microsoft Visual C++ 2013 Redistributable Package (x86 / x64)]
Line 26: Line 25:
 
{{PluginFilterTable2}}
 
{{PluginFilterTable2}}
 
{{PluginFilterRow|LSMASHSource|LSMASHAudioSource|
 
{{PluginFilterRow|LSMASHSource|LSMASHAudioSource|
This function uses libavcodec as an audio decoder and L-SMASH as a demuxer. Recommended for MP4, MOV, [http://en.wikipedia.org/wiki/ISO_base_media_file_format ISO Base Media] and its derived file formats.<br>
+
Uses libavcodec as an audio decoder and L-SMASH as a demuxer. Recommended for MP4, MOV, [http://en.wikipedia.org/wiki/ISO_base_media_file_format ISO Base Media] and its derived file formats.<br>
One advantage of LSMASHAudioSource is that it doesn't need to create an index file for its supported formats.
+
One advantage over '''LWLibavVideoSource''' and [[FFmpegSource]] is that it doesn't need to create an index file for its supported formats.
 
|
 
|
 
}}  
 
}}  
 
{{PluginFilterRow|LSMASHSource|LSMASHVideoSource|
 
{{PluginFilterRow|LSMASHSource|LSMASHVideoSource|
This function uses libavcodec as a video decoder and L-SMASH as a demuxer. Recommended for MP4, MOV, [http://en.wikipedia.org/wiki/ISO_base_media_file_format ISO Base Media] and its derived file formats.<br>
+
Uses libavcodec as a video decoder and L-SMASH as a demuxer. Recommended for MP4, MOV, [http://en.wikipedia.org/wiki/ISO_base_media_file_format ISO Base Media] and its derived file formats.<br>
One advantage of LSMASHVideoSource is that it doesn't need to create an index file for its supported formats.
+
One advantage over '''LWLibavAudioSource''' and [[FFmpegSource]] is that it doesn't need to create an index file for its supported formats.
 
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
 
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
 
}}
 
}}
 
{{PluginFilterRow|LSMASHSource|LWLibavAudioSource|
 
{{PluginFilterRow|LSMASHSource|LWLibavAudioSource|
This function uses libavcodec as an audio decoder and libavformat as a demuxer.
+
Uses libavcodec as an audio decoder and libavformat as a demuxer.
 
|  
 
|  
 
}}
 
}}
 
{{PluginFilterRow|LSMASHSource|LWLibavVideoSource|
 
{{PluginFilterRow|LSMASHSource|LWLibavVideoSource|
This function uses libavcodec as a video decoder and libavformat as a demuxer.
+
Uses libavcodec as a video decoder and libavformat as a demuxer.<br>
 +
Supports video codecs '''LSMASHVideoSource''' does not &ndash; for example MPEG-4, UT Video, Lagarith, and animated GIF and PNG.
 
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
 
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
 
}}
 
}}
 +
|}
 +
<br>
 +
== Examples ==
 +
* Combining '''LSMASHVideoSource''' + '''LSMASHAudioSource'''
 +
<div {{BoxWidthIndent|56|1}} >
 +
#LoadPlugin("LSMASHSource.dll")
 +
##################################
 +
## @ atrack  - audio track number. Default auto. If -2, ignore audio.
 +
## @ fpsnum, fpsden - framerate. Default auto.
 +
## @ stacked - if true, return [[Stack16]] format.
 +
##    (note, stacked=true requires a 16-bit color format)
 +
## @ format  - force specified output pixel format. Default auto.
 +
##    (see [[LSMASHSource/LSMASHVideoSource|documentation]] for valid color formats)
 +
##    (if stacked = true, default "YUV420P16")
 +
##
 +
function LSmashSource2(string path, int "atrack",
 +
\          int "fpsnum", int "fpsden",
 +
\          string "format", bool "stacked")
 +
{
 +
    atrack  = Default(atrack, 0)
 +
    fpsnum  = Default(fpsnum, 0)
 +
    fpsden  = Default(fpsden,  1)
 +
    stacked  = Default(stacked, false)
 +
 +
    format  = Default(format, "")
 +
    format  = (format=="" && stacked==true) ? "YUV420P16" : ""
 +
 +
    video = LSMASHVideoSource(path,
 +
    \              fpsnum=fpsnum, fpsden=fpsden,
 +
    \              format=format, stacked=stacked)
 +
    return (atrack==-2) ? video: AudioDub(video,
 +
    \    LSMASHAudioSource(path, track=atrack))
 +
}
 +
</div>
 +
* Combining '''LWLibavVideoSource''' + '''LWLibavAudioSource'''
 +
<div {{BoxWidthIndent|56|1}} >
 +
#LoadPlugin("LSMASHSource.dll")
 +
##################################
 +
## @ atrack  - audio track number. Default auto. If -2, ignore audio.
 +
## @ fpsnum, fpsden - framerate. Default auto.
 +
## @ stacked - if true, return [[Stack16]] format.
 +
##    (note, stacked=true requires a 16-bit color format)
 +
## @ format  - force specified output pixel format. Default auto.
 +
##    (see [[LSMASHSource/LWLibavVideoSource|documentation]] for valid color formats)
 +
##    (if stacked = true, default "YUV420P16")
 +
## @ cache - if true (the default), create an index file.
 +
##
 +
function LibavSource2(string path, int "atrack",
 +
\          int "fpsnum", int "fpsden",
 +
\          string "format", bool "stacked", bool "cache")
 +
{
 +
    atrack  = Default(atrack, -1)
 +
    fpsnum  = Default(fpsnum, 0)
 +
    fpsden  = Default(fpsden,  1)
 +
    stacked  = Default(stacked, false)
 +
    cache    = Default(cache, true)
 +
 +
    format  = Default(format, "")
 +
    format  = (format=="" && stacked==true) ? "YUV420P16" : ""
 +
 +
    video = LWLibavVideoSource(path,
 +
    \              fpsnum=fpsnum, fpsden=fpsden, format=format,
 +
    \              stacked=stacked, cache=cache)
 +
    return (atrack==-2) ? video: AudioDub(video,
 +
    \    LWLibavAudioSource(path, stream_index=atrack, cache=cache))
 +
}
 +
</div>
 +
<br>
 +
== Archived Downloads ==
 +
<span style="color:red">'''Note:'''</span> the following versions are dual interface, they support both AviSynth and [[VapourSynth]]. Also, it now supports [[Avisynthplus_color_formats|native high bit-depth]] in [[AviSynth+]], the <tt>"stacked"</tt> parameter has been removed. Starting with r935+26-20190811, parameter <tt>"cachefile"</tt> has been added to both LWLibavAudioSource and LWLibavVideoSource.
 +
 +
<div style="max-width:82em; min-width:42em;" >
 +
{|class="wikitable sortable" style="height:100px; width:100%" border="1" cellpadding="4"
 +
|-
 +
!class="unsortable" width=12%| Version
 +
!class="unsortable" width=25%| Download
 +
!class="unsortable" width=25%| Mirror
 +
!class="unsortable"| Comments
 +
|-
 +
|r935+34-20190829
 +
|[https://down.7086.in/AviSynthPlus%20Filters/LSMASHSource-r935%2B34.zip LSMASHSource-Release_r935+34.zip]
 +
|
 +
|
 +
*Stop indexing progress spamming
 +
**-- Now only refresh at every 1%.
 +
*Compiled by [https://forum.doom9.org/showthread.php?p=1883670#post1883670 MeteorRain]
 +
|-
 +
|r935+33-20190826
 +
|[https://down.7086.in/AviSynthPlus%20Filters/LSMASHSource-Release_r935%2B33.zip LSMASHSource-Release_r935+33.zip]
 +
|
 +
|
 +
*I have changed the logic. If size and timestamp match, assume unchanged. If size matches but not timestamp, hash (first 1MiB + last 1MiB) and compare with recorded hash. If file is too small, only first up to 1MiB counts. Hash method is xxhash which is extremely fast.
 +
*A missing hash record will not force regenerating the index file as long as size and timestamp match.
 +
*Compiled by [https://forum.doom9.org/showthread.php?p=1883201#post1883201 MeteorRain]
 +
|-
 +
|r935+31-20190820
 +
|[https://www.mediafire.com/file/o5clk4p049srbs5/L-SMASH-Works-r935+31-20190820.7z/file L-SMASH-Works-r935+31-20190820.7z]
 +
|
 +
|
 +
*LWLibavVideoSource no longer indexes audio streams. It reduces both the file size and parsing time of the index file. LWLibavAudioSource will re-create the index file for the source file which was already indexed by LWLibavVideoSource so as to index audio streams.
 +
*Print indexing progress to stdout.
 +
*Tell lavf to discard unwanted packets so they needn't be demuxed.
 +
*Remove InputFilePath field from the index file. It's unnecessary and troublesome when users rename or move the source file.
 +
*Automatically re-create the index file when the file size of the source file doesn't match.[https://forum.doom9.org/showthread.php?p=1882459#post1882459]
 +
*Change the printing of index progress from stdout to stderr so as to avoid corrupting pipe data accidentally[https://forum.doom9.org/showthread.php?p=1882223#post1882223]
 +
*Compiled by [https://forum.doom9.org/showthread.php?p=1882167#post1882167 HolyWu] | Modifications are [https://gist.github.com/HolyWu/7a627710ee93a042c5ba3414eba09370 here]
 +
|-
 +
|r935+26-20190811
 +
|L-SMASH-Works-r935+26-20190811.7z
 +
|
 +
|
 +
* Update to FFmpeg 4.2.
 +
* Add parameter <tt>cachefile</tt>.
 +
* Compiled by [https://forum.doom9.org/showthread.php?p=1881332#post1881332 HolyWu]
 +
|-
 +
|r935+26-20190712
 +
|[https://down.7086.in/AviSynthPlus%20Filters/LSMASHSource-Release_r935%2B26.zip LSMASHSource-Release_r935+26.zip]
 +
|
 +
|
 +
*Integrated patches from multiple forks. The same patch set HolyWu used, which was copied from enccc, and one more patch to use swresample instead of avresample, which was copied from l33tmeatwad.[https://forum.doom9.org/showthread.php?p=1879042#post1879042]
 +
*Compiled by [https://forum.doom9.org/showthread.php?p=1879029#post1879029 MeteorRain]
 
|}
 
|}
 
<br>
 
<br>
Line 49: Line 170:
 
*[http://forum.doom9.org/showthread.php?t=167435 Doom9 Forum] - LSMASHSource discussion.
 
*[http://forum.doom9.org/showthread.php?t=167435 Doom9 Forum] - LSMASHSource discussion.
 
*[http://github.com/VFR-maniac/L-SMASH-Works/tree/master/AviSynth GitHub] - Source code repository.
 
*[http://github.com/VFR-maniac/L-SMASH-Works/tree/master/AviSynth GitHub] - Source code repository.
*[http://www.dropbox.com/sh/3i81ttxf028m1eh/AAABkQn4Y5w1k-toVhYLasmwa?dl=0 Dropbox] - Download repository by [http://forum.doom9.org/showpost.php?p=1689573&postcount=250 the_weirdo], also includes LSMASHSource compiled against Libav, see [http://forum.doom9.org/showpost.php?p=1693941&postcount=263 here] for more information.
+
*[http://www.dropbox.com/sh/3i81ttxf028m1eh/AAABkQn4Y5w1k-toVhYLasmwa?dl=0 Dropbox] - Download repository by [http://forum.doom9.org/showpost.php?p=1689573&postcount=250 the_weirdo], <strike>also includes LSMASHSource compiled against Libav, see [http://forum.doom9.org/showpost.php?p=1693941&postcount=263 here] for more information (no longer updated).</strike>
 +
*[http://www.mediafire.com/folder/17q7t31dib18t/LSMASH-Works MediaFire] - LSMASHSource for Windows XP [http://forum.doom9.org/showthread.php?t=167435&page=19#post1713408].
  
<br>
 
 
<br>
 
<br>
 
<br>
 
<br>
 
-----------------------------------------------
 
-----------------------------------------------
 
'''Back to [[External_filters#Source_Filters|External Filters]] &larr;'''
 
'''Back to [[External_filters#Source_Filters|External Filters]] &larr;'''

Revision as of 14:47, 31 August 2019

Abstract
Author VFR-maniac
Version r929 (24-Feb-2017)
Download L-SMASH-Works
Category Source filters
License ISC / binaries are GPL or LGPL
Discussion Doom9 Thread


Contents

Description

LSMASHSource is a source plugin for AviSynth/AviSynth+. It uses FFmpeg (libavcodec) to decode all supported audio and video formats. For a complete list see official FFmpeg documentation.

Requirements


** vcredist_x86.exe is required for L-SMASH-Works-32bit
** vcredist_x64.exe is required for L-SMASH-Works-64bit


Filters

Filter Description Color format
LSMASHAudioSource

Uses libavcodec as an audio decoder and L-SMASH as a demuxer. Recommended for MP4, MOV, ISO Base Media and its derived file formats.
One advantage over LWLibavVideoSource and FFmpegSource is that it doesn't need to create an index file for its supported formats.

LSMASHVideoSource

Uses libavcodec as a video decoder and L-SMASH as a demuxer. Recommended for MP4, MOV, ISO Base Media and its derived file formats.
One advantage over LWLibavAudioSource and FFmpegSource is that it doesn't need to create an index file for its supported formats.

RGB24, RGB32, YUY2, Y8, YV12, YV16, YV24, YV411
LWLibavAudioSource

Uses libavcodec as an audio decoder and libavformat as a demuxer.

LWLibavVideoSource

Uses libavcodec as a video decoder and libavformat as a demuxer.
Supports video codecs LSMASHVideoSource does not – for example MPEG-4, UT Video, Lagarith, and animated GIF and PNG.

RGB24, RGB32, YUY2, Y8, YV12, YV16, YV24, YV411


Examples

  • Combining LSMASHVideoSource + LSMASHAudioSource
#LoadPlugin("LSMASHSource.dll")
##################################
## @ atrack  - audio track number. Default auto. If -2, ignore audio.
## @ fpsnum, fpsden - framerate. Default auto.
## @ stacked - if true, return Stack16 format.
##    (note, stacked=true requires a 16-bit color format)
## @ format  - force specified output pixel format. Default auto.
##    (see documentation for valid color formats)
##    (if stacked = true, default "YUV420P16")
##
function LSmashSource2(string path, int "atrack", 
\          int "fpsnum", int "fpsden",
\          string "format", bool "stacked") 
{
    atrack   = Default(atrack, 0)
    fpsnum   = Default(fpsnum, 0)
    fpsden   = Default(fpsden,  1)
    stacked  = Default(stacked, false)

    format   = Default(format, "")
    format   = (format=="" && stacked==true) ? "YUV420P16" : ""

    video = LSMASHVideoSource(path, 
    \               fpsnum=fpsnum, fpsden=fpsden, 
    \               format=format, stacked=stacked)
    return (atrack==-2) ? video: AudioDub(video, 
   \    LSMASHAudioSource(path, track=atrack))
}
  • Combining LWLibavVideoSource + LWLibavAudioSource
#LoadPlugin("LSMASHSource.dll")
##################################
## @ atrack  - audio track number. Default auto. If -2, ignore audio.
## @ fpsnum, fpsden - framerate. Default auto.
## @ stacked - if true, return Stack16 format.
##    (note, stacked=true requires a 16-bit color format)
## @ format  - force specified output pixel format. Default auto.
##    (see documentation for valid color formats)
##    (if stacked = true, default "YUV420P16")
## @ cache - if true (the default), create an index file.
##
function LibavSource2(string path, int "atrack", 
\          int "fpsnum", int "fpsden",
\          string "format", bool "stacked", bool "cache") 
{
    atrack   = Default(atrack, -1)
    fpsnum   = Default(fpsnum, 0)
    fpsden   = Default(fpsden,  1)
    stacked  = Default(stacked, false)
    cache    = Default(cache, true)

    format   = Default(format, "")
    format   = (format=="" && stacked==true) ? "YUV420P16" : ""

    video = LWLibavVideoSource(path, 
    \               fpsnum=fpsnum, fpsden=fpsden, format=format,
    \               stacked=stacked, cache=cache)
    return (atrack==-2) ? video: AudioDub(video, 
   \    LWLibavAudioSource(path, stream_index=atrack, cache=cache))
}


Archived Downloads

Note: the following versions are dual interface, they support both AviSynth and VapourSynth. Also, it now supports native high bit-depth in AviSynth+, the "stacked" parameter has been removed. Starting with r935+26-20190811, parameter "cachefile" has been added to both LWLibavAudioSource and LWLibavVideoSource.

Version Download Mirror Comments
r935+34-20190829 LSMASHSource-Release_r935+34.zip
  • Stop indexing progress spamming
    • -- Now only refresh at every 1%.
  • Compiled by MeteorRain
r935+33-20190826 LSMASHSource-Release_r935+33.zip
  • I have changed the logic. If size and timestamp match, assume unchanged. If size matches but not timestamp, hash (first 1MiB + last 1MiB) and compare with recorded hash. If file is too small, only first up to 1MiB counts. Hash method is xxhash which is extremely fast.
  • A missing hash record will not force regenerating the index file as long as size and timestamp match.
  • Compiled by MeteorRain
r935+31-20190820 L-SMASH-Works-r935+31-20190820.7z
  • LWLibavVideoSource no longer indexes audio streams. It reduces both the file size and parsing time of the index file. LWLibavAudioSource will re-create the index file for the source file which was already indexed by LWLibavVideoSource so as to index audio streams.
  • Print indexing progress to stdout.
  • Tell lavf to discard unwanted packets so they needn't be demuxed.
  • Remove InputFilePath field from the index file. It's unnecessary and troublesome when users rename or move the source file.
  • Automatically re-create the index file when the file size of the source file doesn't match.[1]
  • Change the printing of index progress from stdout to stderr so as to avoid corrupting pipe data accidentally[2]
  • Compiled by HolyWu | Modifications are here
r935+26-20190811 L-SMASH-Works-r935+26-20190811.7z
  • Update to FFmpeg 4.2.
  • Add parameter cachefile.
  • Compiled by HolyWu
r935+26-20190712 LSMASHSource-Release_r935+26.zip
  • Integrated patches from multiple forks. The same patch set HolyWu used, which was copied from enccc, and one more patch to use swresample instead of avresample, which was copied from l33tmeatwad.[3]
  • Compiled by MeteorRain


External Links

  • Doom9 Forum - LSMASHSource discussion.
  • GitHub - Source code repository.
  • Dropbox - Download repository by the_weirdo, also includes LSMASHSource compiled against Libav, see here for more information (no longer updated).
  • MediaFire - LSMASHSource for Windows XP [4].




Back to External Filters
Personal tools