Log in

View Full Version : avisynth in wine


smok3
7th December 2015, 13:45
Trying to run avisynth via wine, using avs2yuv as a pipe to linux ffmpeg. The questions:

a. What xysource plugin is known to work great for opening various media files? (ffmpegsource doesn't seem to cooperate for some reason)
b. Is there something other tnan avs2yuv that would pipe out audio as well?

(Running 32bit avisynth on 64bit Debian Jessie if that makes any difference)

Notes so far:
https://github.com/brontosaurusrex/postbang/blob/master/misc/avisynthOnLinux.md

StainlessS
7th December 2015, 13:52
b) There is something called avs2Wav/Wavi, I've never used it though.

EDIT: From Wavi

WAVI v1.06 and SILENCE v1.04 - (c) 2007 Tamas Kurucsai
Licensed under the terms of the GNU General Public License

Homepage: http://sourceforge.net/projects/wavi-avi2wav

Start the .exe files without any parameters to get some help.

Changelog:

2007.08.16:
WAVI v1.06: option to write extended WAV header with channel mask (thanks to tebasuna51)

2007.08.06:
WAVI v1.05: optimized performance

2007.06.26:
WAVI v1.04: added support for floating-point samples (thanks to tebasuna51)
SILENCE v1.04: added support for floating-point samples (thanks to tebasuna51)
SILENCE v1.04: added support fot files > 4G; use Win32 API

2007.06.24:
WAVI + SILENCE v1.03: fixed size field in data chunk header (thanks to tebasuna51)
WAVI v1.03: don't expect that AVIStreamRead stops at the end of the stream (thanks to tebasuna51)
SILENCE v1.03: removed annoying debug message


EDIT: From WAVI output

WAVI v1.06 - (c) 2007 Tamas Kurucsai, with lots of help from tebasuna51
Licensed under the terms of the GNU General Public License.

This utility extracts the first uncompressed PCM audio track
from an AVI file and saves it to a WAV file. This is not quite
useful for most AVI files since they usually contain some kind
of compressed audio, but it can come handy when it's needed to
save an audio track from AviSynth.

Usage: WAVI <avi-file> [ <wav-file> [ /R | /X | /M <mask> ] ]

If <avi-file> is a valid AVI file which contains PCM audio,
the audio track will be written to <wav-file> as a WAV file.
If '-' is passed as <wav-file>, the WAV file will be written
to the standard output.
If <wav-file> is not given, only information will be printed
about the audio track.

On success, the exit code will be 0 and the first line printed
to the standard error will look like the following:

Found PCM audio: <c> channels, <r> Hz, <b> bits, <l> seconds.

where <c> is the number of audio channels, <r> is the sampling
rate, <b> is the number of bits per sample and <l> is the length
of the track in seconds.

If the audio track contains floating-point samples, the next line
printed to the standard error will be:
Audio track contains floating-point samples.

If an error occurs, the exit code will be 1 and some useful error
message will be printed to the standard error.

WAV files larger than 4 GB may be created. However, such WAV files
are non-standard and may not be handled correctly by some players
and encoders. A warning will be printed to the standard error when
such a WAV file is created.

WAVI accepts the following options:

/R - Write a raw file of samples without the WAV header.

/X - Write an extended WAV header containing the default
channel mask for multi-channel audio.

/M <mask> - Write an extended WAV header containing the
specified channel mask for multi-channel audio.

The default channel masks are:

Mask Chan. MS channels Description
---- ----- ------------------------- ----------------
4 1 FC Mono
3 2 FL FR Stereo
259 3 FL FR BC First Surround
51 4 FL FR BL BR Quadro
55 5 FL FR FC BL BR like Dpl II (without LFE)
63 6 FL FR FC LF BL BR Standard Surround
319 7 FL FR FC LF BL BR BC With back center
255 8 FL FR FC LF BL BR FLC FRC With front center left/right

Some other common channel masks:

Mask Chan. MS channels Description
---- ----- ------------------------- ----------------
7 3 FL FR FC
263 4 FL FR FC BC like Dpl I
271 5 FL FR FC BC LF
59 5 FL FR BL BR LF


From avs2wav output

avs2wav v1.0 by Jory Stone <jcsston@toughguy.net>
Usage: -n <input filename> <output filename>
-n Normalize Audio
<input filename> Input AVS Script
<output filename> Output PCM WAV, can be - for stdout output

The Default Output file is the input filename appended with .wav


EDIT: Zip I have containing both above, has avs2wav dated (in zip) as 8/7/2009, and Wavi 16/8/2007.

Reel.Deel
7th December 2015, 14:55
a) LSMASHSource (http://avisynth.nl/index.php/LSMASHSource) is a great alternative to FFMS2.

b) avs2pipemod (http://avisynth.nl/index.php/Avs2pipemod) (here's the latest Avs2YUV (http://avisynth.nl/index.php/Avs2YUV), it still doesn't support audio but supports additional planar colorspaces and other features not available in the original).

On a side note, I see you're recommending the QTGMC plugins package, be aware that a handful of those plugins are outdated and mt_masktools-26.dll iscompletely incompatible with AviSynth 2.6. Read here (http://forum.doom9.org/showthread.php?t=156028&page=93#post1699950) for more information.

smok3
7th December 2015, 21:18
StainlessS, Reel.Deel: Thanks, have something to work on now :)

StainlessS
7th December 2015, 21:31
Smok3,

Dont know if this can assist at all but TWriteAVI v2.0 allows for writing of WAV files, (http://forum.doom9.org/showthread.php?t=172837)


TwriteWAV(src,Filename="test.wav",Overwrite=true) # Requires Play all the way though to write audio
ForceProcessWAV() # Removes need to play all the way though, on return from function, WAV exists
return Last # on exit, WAV exists.



Function TWriteWAV(clip c,String filename,bool "overwrite"=false,int "dwChannelMask"=-1)
c, clip with audio.
Filename: NOT optional. Output filename.
Overwrite: Fails on existing unless overwrite==True.
dwChannelMask: Default -1.
-1 = No Override, Use standard mapping as for v2.6 OPT_dwChannelMask.
0 = Non Located ie multiple MONAURAL channels.
Otherwise, need 1 bit set for each valid channel.

Writes audio from clip to filename returning original clip.
Audio 8, 16, 24 and 32 bit, also Float. Up to 8 channels (7.1), written as uncompressed PCM or IEEE 32 bit Float format.
Will auto close on last sample, will write only strictly sequential audio samples (ie no jumping about).

#######

ForceProcessWAV(clip c)
Force Process clip c audio only, ie read from first to last audio sample, for TWriteWAV writes the WAV file (Audio) without having to play clip.

#######

Default channel Mappings when dwChannelMask = Default -1:
0x00004, // 1 -- -- Cf
0x00003, // 2 Lf Rf
0x00007, // 3 Lf Rf Cf
0x00033, // 4 Lf Rf -- -- Lr Rr
0x00037, // 5 Lf Rf Cf -- Lr Rr
0x0003F, // 5.1 Lf Rf Cf Sw Lr Rr
0x0013F, // 6.1 Lf Rf Cf Sw Lr Rr -- -- Cr
0x0063F, // 7.1 Lf Rf Cf Sw Lr Rr -- -- -- Ls Rs

Speaker_Location:-
SPEAKER_FRONT_LEFT 0x1
SPEAKER_FRONT_RIGHT 0x2
SPEAKER_FRONT_CENTER 0x4
SPEAKER_LOW_FREQUENCY 0x8 # Shown above as Sw (Sub Woofer)
SPEAKER_BACK_LEFT 0x10
SPEAKER_BACK_RIGHT 0x20
SPEAKER_FRONT_LEFT_OF_CENTER 0x40
SPEAKER_FRONT_RIGHT_OF_CENTER 0x80
SPEAKER_BACK_CENTER 0x100
SPEAKER_SIDE_LEFT 0x200
SPEAKER_SIDE_RIGHT 0x400

Not used by Default Mappings:
SPEAKER_TOP_CENTER 0x800
SPEAKER_TOP_FRONT_LEFT 0x1000
SPEAKER_TOP_FRONT_CENTER 0x2000
SPEAKER_TOP_FRONT_RIGHT 0x4000
SPEAKER_TOP_BACK_LEFT 0x8000
SPEAKER_TOP_BACK_CENTER 0x10000
SPEAKER_TOP_BACK_RIGHT 0x20000


EDIT: You could also call audio encoder from within script (following ForceProcessWAV) using CallCmd:- http://forum.doom9.org/showthread.php?t=166063&highlight=callcmd