add bat 4 install LAVFilters and update requestments

parent f8dc8db5
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type='win32' name='LAVFilters.Dependencies' version='1.0.0.0' />
<file name="avutil-lav-57.dll" />
<file name="swresample-lav-4.dll" />
<file name="avcodec-lav-59.dll" />
<file name="avformat-lav-59.dll" />
<file name="swscale-lav-6.dll" />
<file name="avfilter-lav-8.dll" />
<file name="libbluray.dll" />
</assembly>
LAV Filters - ffmpeg based DirectShow Splitter and Decoders
LAV Filters are a set of DirectShow filters based on the libavformat and libavcodec libraries
from the ffmpeg project, which will allow you to play virtually any format in a DirectShow player.
The filters are still under development, so not every feature is finished, or every format supported.
Install
=============================
- Unpack
- Register (install_*.bat files)
Registering requires administrative rights, and an elevated shell ("Run as Administrator")
Using it
=============================
By default, the splitter will register for all media formats that have been
tested and found working at least partially.
This currently includes (but is not limited to)
MKV/WebM, AVI, MP4/MOV, TS/M2TS/MPG, FLV, OGG, BluRay (.bdmv and .mpls)
However, some other splitters register in a "bad" way and force all players
to use them. The Haali Media Splitter is one of those, and to give priority
to the LAVFSplitter you have to either uninstall Haali or rename its .ax file
at least temporarily.
The Audio and Video Decoder will register with relatively high merit, which should make
it the preferred decoder by default. Most players offer a way to choose the preferred
decoder however.
Automatic Stream Selection
=============================
LAV Splitter offers different ways to pre-select streams when opening a file.
The selection of video streams is not configurable, and LAV Splitter will quite simply
pick the one with the best quality.
Audio stream selection offers some flexibility, specifically you can configure your preferred languages.
The language configuration is straightforward. Just enter a list of 3-letter language codes (ISO 639-2),
separated by comma or space.
For example: "eng ger fre". This would try to select a stream matching one of these languages,
in the order you specified them. First, check if an English track is present, and only if not,
go to German, and after that, go to French.
If multiple audio tracks match one language, the choice is based on the quality. The primary attribute here
is the number of channels, and after that is the codec used. PCM and lossless codecs have a higher priority
than lossy codecs.
Subtitle selection offers the most flexibility.
There are 4 distinct modes of subtitle selection.
"No Subtitles"
This mode is simple, by default subtitles will be off.
"Only Forced Subtitles"
This mode will only pre-select subtitles flagged with the "forced" flag. It'll also obey the language preferences, of course.
"Default"
The default mode will select subtitles matching your language preference. If there is no match, or you didn't configure
languages, no subtitles will be activated. In addition, subtitles flagged "default" or "forced" will always be used.
"Advanced"
The advanced mode lets you write your own combinations of rules with a special syntax. It also allows selecting subtitles
based on the audio language of the file.
The base syntax is simple, it always requires a pair of audio and subtitle language, separated by a colon, for example: "eng:ger"
In this example, LAV Splitter would select German subtitles if English audio was found.
Instead of language codes, the advanced mode supports two special cases: "*" and "off".
When you specify "*" for a language code, it'll match everything. For example "*:eng" will activate English subtitles, independent
of the audio language. The reverse is also possible: "eng:*" will activate any subtitles when the audio is English.
The "off" flag is only valid for the subtitle language, and it instructs LAV Splitter to turn the subtitles off.
So "eng:off" means that when the audio is English, the subtitles will be deactivated.
Additionally to the syntax above, the following flags can be appended to the subtitle token separated by a pipe symbol ("|"):
- "d" for default subtitles
- "f" for forced subtitles
- "h" for hearing impaired
- "n" for normal streams (not default, forced, or impaired).
In addition, you can also check for the absence of flags by preceding the flags with a "!".
The advanced rules can be combined into a complete logic for subtitle selection by just appending them, separated with a comma or a space.
The rules will always be parsed from left to right, the first match taking precedence.
Example: (basic flag usage)
"*:*|f"
Explanation:
On any audio language, load any subtitles that are flagged forced.
Example: (basic ruleset)
"eng:eng|f eng:ger|f eng:off *:eng *:ger"
Explanation:
If the audio is English, load an English or a German forced subtitle track, otherwise, turn subtitles off.
If the audio is not English, load English or German subtitles.
Example: (flag usage with negation)
"jpn:ger|d!f"
Explanation:
In the Japanese language, load German subtitles that have the default-flag but not together with forced-flag.
This is useful when you have files where the default and forced flags are set together.
Example: (advanced ruleset for files with multiple audio and subtitle-tracks)
"jpn:ger|d!f jpn:ger|!f jpn:ger ger:ger|f ger:eng|f ger:*|f"
Explanation:
On Japanese audio, try to load German full subs (default but not forced), then unforced, and at last any german subs if there are no unforced subs.
On German audio load only forced subs in the following order: German, English, any.
BluRay Support
=============================
To play a BluRay, simply open the index.bdmv file in the BDMV folder on the BluRay disc.
LAV Splitter will then automatically detect the longest track on the disc (usually the main movie),
and start playing.
Alternatively, you can also open a playlist file (*.mpls, located in BDMV/PLAYLIST), and LAV Splitter
will then play that specific title.
In future versions, you'll be able to choose the title from within the player, as well.
Compiling
=============================
Compiling is pretty straightforward using VS2019 (included project files).
Older versions of Visual Studio are not officially supported, but may still work.
It does, however, require that you build your own ffmpeg and libbluray.
You need to place the full ffmpeg package in a directory called "ffmpeg" in the
main source directory (the directory this file was in). There are scripts to
build a proper ffmpeg included.
I recommend using my fork of ffmpeg, as it includes additional patches for
media compatibility:
https://git.1f0.de/gitweb?p=ffmpeg.git;a=summary
libbluray is compiled with the MSVC project files, however, a specially modified
version of libbluray is required. Similar to ffmpeg, just place the full tree
inside the "libbluray" directory in the main directory.
You can get the modified version here:
https://git.1f0.de/gitweb?p=libbluray.git;a=summary
Feedback
=============================
GitHub Project: https://github.com/Nevcairiel/LAVFilters
Doom9: https://forum.doom9.org/showthread.php?t=156191
/*
* (C) 2003-2006 Gabest
* (C) 2006-2013 MPC-HC Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
interface __declspec(uuid("EB2CD9E6-BA08-4acb-AA0F-3D8D0DD521CA"))
IBitRateInfo :
public IUnknown {
STDMETHOD_(DWORD, GetCurrentBitRate)() PURE;
STDMETHOD_(DWORD, GetAverageBitRate)() PURE;
};
/*
* $Id: IBufferInfo.h 2786 2010-12-17 16:42:55Z XhmikosR $
*
* (C) 2003-2006 Gabest
* (C) 2006-2010 see AUTHORS
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
#pragma once
interface __declspec(uuid("46070104-1318-4A82-8822-E99AB7CD15C1")) IBufferInfo : public IUnknown
{
// Number of Buffers
STDMETHOD_(int, GetCount()) = 0;
// Get Info about Buffer "i" (0-based index up to count)
// samples: number of frames in the buffer
// size: total size in bytes of the buffer
STDMETHOD(GetStatus(int i, int &samples, int &size)) = 0;
// Get priority of the demuxing thread
STDMETHOD_(DWORD, GetPriority()) = 0;
};
// -----------------------------------------------------------------
// ID3DVideoMemoryConfiguration interface and data structure definitions
// -----------------------------------------------------------------
#pragma once
// -----------------------------------------------------------------
// Control D3D11 Hardware Decoding between decoder and renderer
// -----------------------------------------------------------------
// A video renderer can implement this interface on its input pin
// to signal to a decoder that its capable of accepting D3D11 texture
// samples directly, without copying to system memory.
//
// The decoder will create the D3D11 device and a mutex to protect it,
// and share it with the renderer in this interface.
//
// To facilitate dynamic switching of the adapter used for decoding, the
// renderer should disconnect the decoder and re-connect it. At that
// point the decoder should query GetD3D11AdapterIndex() again and
// create a new decoder on the new device, as appropriate.
interface __declspec(uuid("2BB66002-46B7-4F13-9036-7053328742BE")) ID3D11DecoderConfiguration : public IUnknown
{
// Set the surface format the decoder is going to send.
// If the renderer is not ready to accept this format, an error will be returned.
virtual HRESULT STDMETHODCALLTYPE ActivateD3D11Decoding(ID3D11Device * pDevice, ID3D11DeviceContext * pContext,
HANDLE hMutex, UINT nFlags) = 0;
// Get the currently preferred D3D11 adapter index (to be used with IDXGIFactory1::EnumAdapters1)
virtual UINT STDMETHODCALLTYPE GetD3D11AdapterIndex() = 0;
};
// -----------------------------------------------------------------
// Media Sample to hold a D3D11 texture
// -----------------------------------------------------------------
// D3D11 textures used for decoding are typically array-textures,
// a single ID3D11Texture2D object containing an array of textures
// individually addressable by the ArraySlice index.
//
// The texture lifetime is bound to the media samples lifetime. The
// media sample can only be released when the texture is no longer in
// use, otherwise the texture will be re-used by the decoder.
//
// The texture is AddRef'ed when retrieved through this interface,
// and should be Released when no longer needed.
interface __declspec(uuid("BC8753F5-0AC8-4806-8E5F-A12B2AFE153E")) IMediaSampleD3D11 : public IUnknown
{
// Get the D3D11 texture for the specified view.
// 2D images with only one view always use view 0. For 3D, view 0 specifies the base view, view 1 the extension
// view.
virtual HRESULT STDMETHODCALLTYPE GetD3D11Texture(int nView, ID3D11Texture2D **ppTexture, UINT *pArraySlice) = 0;
};
/*
* Copyright (C) 2003-2006 Gabest
* Copyright (C) 2010-2021 Hendrik Leppkes
* http://www.1f0.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
interface __declspec(uuid("EBAFBCBE-BDE0-489A-9789-05D5692E3A93")) IDSMResourceBag : public IUnknown
{
STDMETHOD_(DWORD, ResGetCount)() PURE;
STDMETHOD(ResGet)(DWORD iIndex, BSTR * ppName, BSTR * ppDesc, BSTR * ppMime, BYTE * *ppData, DWORD * pDataLen, DWORD_PTR * pTag) PURE;
STDMETHOD(ResSet)(DWORD iIndex, LPCWSTR pName, LPCWSTR pDesc, LPCWSTR pMime, const BYTE *pData, DWORD len, DWORD_PTR tag) PURE;
STDMETHOD(ResAppend)(LPCWSTR pName, LPCWSTR pDesc, LPCWSTR pMime, BYTE * pData, DWORD len, DWORD_PTR tag) PURE;
STDMETHOD(ResRemoveAt)(DWORD iIndex) PURE;
STDMETHOD(ResRemoveAll)(DWORD_PTR tag) PURE;
};
/*
* Copyright (C) 2010-2021 Hendrik Leppkes
* http://www.1f0.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
// {17989414-C927-4D73-AB6C-19DF37602AC4}
DEFINE_GUID(IID_IGraphRebuildDelegate, 0x17989414, 0xc927, 0x4d73, 0xab, 0x6c, 0x19, 0xdf, 0x37, 0x60, 0x2a, 0xc4);
interface __declspec(uuid("17989414-C927-4D73-AB6C-19DF37602AC4")) IGraphRebuildDelegate : public IUnknown
{
// Called by the splitter to let the player know that a certain pin needs to be rebuild.
//
// This function is called on any stream or title changes that would cause the content of the pin to change.
// The Splitter will stop the graph prior to this call, and it will return the graph to its previous state
// afterwards.
//
// When this function is called, the pin will already have the new media types set, so the usual functions to query
// the media types can be used. EnmuMediaTypes is OK (or any wrappers of this in the base classes),
// ConnectionMediaType is not OK, for obvious reasons.
//
// Following return values are supported:
// S_OK - The player took complete control over the rebuild, the splitter will do no further actions regarding
// the pin S_FALSE - The player may or may not have changed the pin, and the splitter is instructed to send a media
// type with the next packet. E_FAIL - The player failed, and the splitter should try to rebuild the pin
STDMETHOD(RebuildPin)(IFilterGraph * pGraph, IPin * pPin) = 0;
};
/*
* Copyright (C) 2003-2006 Gabest
* Copyright (C) 2010-2021 Hendrik Leppkes
* http://www.1f0.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
interface __declspec(uuid("01A5BBD3-FE71-487C-A2EC-F585918A8724")) IKeyFrameInfo : public IUnknown
{
// Get the number of (known) keyframes in the file
STDMETHOD(GetKeyFrameCount)(UINT & nKFs) = 0; // returns S_FALSE when every frame is a keyframe
// Get the times of the key frames, if available.
//
// pFormat: GUID of the time format (see http://msdn.microsoft.com/en-us/library/dd407205(v=vs.85).aspx, usually
// TIME_FORMAT_MEDIA_TIME) pKFs: Caller allocated memory for the timestamps of the keyframes (should be
// sizeof(REFERENCE_TIME) * nKFs at least!) nKF: Number of keyframes requested/returned - no more then nKFs key
// frames will be returned.
STDMETHOD(GetKeyFrames)(const GUID *pFormat, REFERENCE_TIME *pKFs, UINT &nKFs /* in, out*/) = 0;
};
\ No newline at end of file
/*
* Copyright (C) 2010-2021 Hendrik Leppkes
* http://www.1f0.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
// {8FBB906B-D1DB-4528-9498-563241CCD43D}
DEFINE_GUID(IID_ILAVDynamicAllocator, 0x8fbb906b, 0xd1db, 0x4528, 0x94, 0x98, 0x56, 0x32, 0x41, 0xcc, 0xd4, 0x3d);
interface __declspec(uuid("8FBB906B-D1DB-4528-9498-563241CCD43D")) ILAVDynamicAllocator : public IUnknown
{
// Query wether this allocator is using dynamic allocation of samples and will not run out of samples
STDMETHOD_(BOOL, IsDynamicAllocator)() PURE;
};
// -----------------------------------------------------------------
// IMediaSample3D interface and data structure definitions
// -----------------------------------------------------------------
#pragma once
interface __declspec(uuid("E92D790E-BF54-43C4-B394-8CA0A41BF9EC")) IMediaSample3D : public IMediaSample2
{
STDMETHOD(Enable3D)() = 0;
STDMETHOD(GetPointer3D)(BYTE **ppBuffer) = 0;
};
This diff is collapsed.
#pragma once
// -----------------------------------------------------------------
// IPin Segmenting Extension
// -----------------------------------------------------------------
// This extension allows upstream filters to cleanly terminate segments,
// indicating to downstream components that any data should be flushed
// to the renderer.
// This call should be followed by a call to IPin::NewSegment to start a
// new segment afterwards.
interface __declspec(uuid("8B81E022-52C7-4B89-9F11-ACFD063AABB4")) IPinSegmentEx : public IUnknown
{
virtual HRESULT STDMETHODCALLTYPE EndOfSegment(void) = 0;
};
/*
* (C) 2003-2006 Gabest
* (C) 2006-2010 MPC-HC Authors
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
#pragma once
#include <OCIdl.h>
interface __declspec(uuid("03481710-D73E-4674-839F-03EDE2D60ED8")) ISpecifyPropertyPages2 : public ISpecifyPropertyPages
{
STDMETHOD(CreatePage)(const GUID &guid, IPropertyPage **ppPage) = 0;
};
/*
* Copyright (C) 2010-2021 Hendrik Leppkes
* http://www.1f0.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
// NOTICE: This interface is still experimental and may change in the future. Do NOT use it yet unless you absolutely
// know what you are doing.
// Interface for high-level streaming source filters
// The source can implement proper seeking and duration retrieval based on its underlying protocol.
// This interface should be exposed on the output pin or the filter itself of the streaming source, similar to the
// IAsyncReader interface
// {C0BE9565-4C05-4644-9492-57547A4048DC}
DEFINE_GUID(IID_IStreamSourceControl, 0xc0be9565, 0x4c05, 0x4644, 0x94, 0x92, 0x57, 0x54, 0x7a, 0x40, 0x48, 0xdc);
interface __declspec(uuid("C0BE9565-4C05-4644-9492-57547A4048DC")) IStreamSourceControl : public IUnknown
{
// Get the duration of the stream being played.
// Duration is in DirectShow reference time, 100ns units.
STDMETHOD(GetStreamDuration)(REFERENCE_TIME * prtDuration) PURE;
// Seek the stream to a specified time
//
// Position is in DirectShow reference time, 100ns units.
//
// If the source returns a failure code, the demuxer will do byte-based seeking itself (ie. when the stream supports
// this) On success, it'll re-open the stream and start reading from the start (byte position 0).
STDMETHOD(SeekStream)(REFERENCE_TIME rtPosition) PURE;
};
/*
* Copyright (C) 2003-2006 Gabest
* Copyright (C) 2010-2021 Hendrik Leppkes
* http://www.1f0.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
typedef enum TrackType
{
TypeVideo = 1,
TypeAudio = 2,
TypeComplex = 3,
TypeLogo = 0x10,
TypeSubtitle = 0x11,
TypeControl = 0x20
} TrackType;
#pragma pack(push, 1)
struct TrackElement
{
WORD Size; // Size of this structure
BYTE Type; // See TrackType
BOOL FlagDefault; // Set if the track is the default for its TrackType.
BOOL FlagForced; // Set if that track MUST be used during playback.
BOOL FlagLacing; // Set if the track may contain blocks using lacing.
UINT MinCache; // The minimum number of frames a player should be able to cache during playback.
UINT MaxCache; // The maximum cache size required to store referenced frames in and the current frame. 0 means no
// cache is needed.
CHAR Language[4]; // Specifies the language of the track, in the ISO-639-2 form. (end with '\0')
};
struct TrackExtendedInfoVideo
{
WORD Size; // Size of this structure
BOOL Interlaced; // Set if the video is interlaced.
UINT PixelWidth; // Width of the encoded video frames in pixels.
UINT PixelHeight; // Height of the encoded video frames in pixels.
UINT DisplayWidth; // Width of the video frames to display.
UINT DisplayHeight; // Height of the video frames to display.
BYTE DisplayUnit; // Type of the unit for DisplayWidth/Height (0: pixels, 1: centimeters, 2: inches).
BYTE AspectRatioType; // Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect
// ratio, 2: fixed).
};
struct TrackExtendedInfoAudio
{
WORD Size; // Size of this structure
FLOAT SamplingFreq; // Sampling frequency in Hz.
FLOAT OutputSamplingFrequency; // Real output sampling frequency in Hz (used for SBR techniques).
UINT Channels; // Numbers of channels in the track.
UINT BitDepth; // Bits per sample, mostly used for PCM.
};
#pragma pack(pop)
interface __declspec(uuid("03E98D51-DDE7-43aa-B70C-42EF84A3A23D")) ITrackInfo : public IUnknown
{
STDMETHOD_(UINT, GetTrackCount)() = 0;
// \param aTrackIdx the track index (from 0 to GetTrackCount()-1)
STDMETHOD_(BOOL, GetTrackInfo)(UINT aTrackIdx, struct TrackElement * pStructureToFill) = 0;
// Get an extended information struct relative to the track type
STDMETHOD_(BOOL, GetTrackExtendedInfo)(UINT aTrackIdx, void *pStructureToFill) = 0;
STDMETHOD_(BSTR, GetTrackCodecID)(UINT aTrackIdx) = 0;
STDMETHOD_(BSTR, GetTrackName)(UINT aTrackIdx) = 0;
STDMETHOD_(BSTR, GetTrackCodecName)(UINT aTrackIdx) = 0;
STDMETHOD_(BSTR, GetTrackCodecInfoURL)(UINT aTrackIdx) = 0;
STDMETHOD_(BSTR, GetTrackCodecDownloadURL)(UINT aTrackIdx) = 0;
};
/*
* Copyright (C) 2010-2021 Hendrik Leppkes
* http://www.1f0.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
// {4158A22B-6553-45D0-8069-24716F8FF171}
DEFINE_GUID(IID_ILAVAudioSettings, 0x4158a22b, 0x6553, 0x45d0, 0x80, 0x69, 0x24, 0x71, 0x6f, 0x8f, 0xf1, 0x71);
// {A668B8F2-BA87-4F63-9D41-768F7DE9C50E}
DEFINE_GUID(IID_ILAVAudioStatus, 0xa668b8f2, 0xba87, 0x4f63, 0x9d, 0x41, 0x76, 0x8f, 0x7d, 0xe9, 0xc5, 0xe);
// Codecs supported in the LAV Audio configuration
// Codecs not listed here cannot be turned off. You can request codecs to be added to this list, if you wish.
typedef enum LAVAudioCodec
{
Codec_AAC,
Codec_AC3,
Codec_EAC3,
Codec_DTS,
Codec_MP2,
Codec_MP3,
Codec_TRUEHD,
Codec_FLAC,
Codec_VORBIS,
Codec_LPCM,
Codec_PCM,
Codec_WAVPACK,
Codec_TTA,
Codec_WMA2,
Codec_WMAPRO,
Codec_Cook,
Codec_RealAudio,
Codec_WMALL,
Codec_ALAC,
Codec_Opus,
Codec_AMR,
Codec_Nellymoser,
Codec_MSPCM,
Codec_Truespeech,
Codec_TAK,
Codec_ATRAC,
Codec_AudioNB // Number of entries (do not use when dynamically linking)
} LAVAudioCodec;
// Bitstreaming Codecs supported in LAV Audio
typedef enum LAVBitstreamCodec
{
Bitstream_AC3,
Bitstream_EAC3,
Bitstream_TRUEHD,
Bitstream_DTS,
Bitstream_DTSHD,
Bitstream_NB // Number of entries (do not use when dynamically linking)
} LAVBitstreamCodec;
// Supported Sample Formats in LAV Audio
typedef enum LAVAudioSampleFormat
{
SampleFormat_None = -1,
SampleFormat_16,
SampleFormat_24,
SampleFormat_32,
SampleFormat_U8,
SampleFormat_FP32,
SampleFormat_Bitstream,
SampleFormat_NB // Number of entries (do not use when dynamically linking)
} LAVAudioSampleFormat;
typedef enum LAVAudioMixingMode
{
MatrixEncoding_None,
MatrixEncoding_Dolby,
MatrixEncoding_DPLII,
MatrixEncoding_NB
} LAVAudioMixingMode;
// LAV Audio configuration interface
interface __declspec(uuid("4158A22B-6553-45D0-8069-24716F8FF171")) ILAVAudioSettings : public IUnknown
{
// Switch to Runtime Config mode. This will reset all settings to default, and no changes to the settings will be
// saved You can use this to programmatically configure LAV Audio without interfering with the users settings in the
// registry. Subsequent calls to this function will reset all settings back to defaults, even if the mode does not
// change.
//
// Note that calling this function during playback is not supported and may exhibit undocumented behaviour.
// For smooth operations, it must be called before LAV Audio is connected to other filters.
STDMETHOD(SetRuntimeConfig)(BOOL bRuntimeConfig) = 0;
// Dynamic Range Compression
// pbDRCEnabled: The state of DRC
// piDRCLevel: The DRC strength (0-100, 100 is maximum)
STDMETHOD(GetDRC)(BOOL * pbDRCEnabled, int *piDRCLevel) = 0;
STDMETHOD(SetDRC)(BOOL bDRCEnabled, int iDRCLevel) = 0;
// Configure which codecs are enabled
// If aCodec is invalid (possibly a version difference), Get will return FALSE, and Set E_FAIL.
STDMETHOD_(BOOL, GetFormatConfiguration)(LAVAudioCodec aCodec) = 0;
STDMETHOD(SetFormatConfiguration)(LAVAudioCodec aCodec, BOOL bEnabled) = 0;
// Control Bitstreaming
// If bsCodec is invalid (possibly a version difference), Get will return FALSE, and Set E_FAIL.
STDMETHOD_(BOOL, GetBitstreamConfig)(LAVBitstreamCodec bsCodec) = 0;
STDMETHOD(SetBitstreamConfig)(LAVBitstreamCodec bsCodec, BOOL bEnabled) = 0;
// Should "normal" DTS frames be encapsulated in DTS-HD frames when bitstreaming?
STDMETHOD_(BOOL, GetDTSHDFraming)() = 0;
STDMETHOD(SetDTSHDFraming)(BOOL bHDFraming) = 0;
// Control Auto A/V syncing
STDMETHOD_(BOOL, GetAutoAVSync)() = 0;
STDMETHOD(SetAutoAVSync)(BOOL bAutoSync) = 0;
// Convert all Channel Layouts to standard layouts
// Standard are: Mono, Stereo, 5.1, 6.1, 7.1
STDMETHOD_(BOOL, GetOutputStandardLayout)() = 0;
STDMETHOD(SetOutputStandardLayout)(BOOL bStdLayout) = 0;
// Expand Mono to Stereo by simply doubling the audio
STDMETHOD_(BOOL, GetExpandMono)() = 0;
STDMETHOD(SetExpandMono)(BOOL bExpandMono) = 0;
// Expand 6.1 to 7.1 by doubling the back center
STDMETHOD_(BOOL, GetExpand61)() = 0;
STDMETHOD(SetExpand61)(BOOL bExpand61) = 0;
// Allow Raw PCM and SPDIF encoded input
STDMETHOD_(BOOL, GetAllowRawSPDIFInput)() = 0;
STDMETHOD(SetAllowRawSPDIFInput)(BOOL bAllow) = 0;
// Configure which sample formats are enabled
// Note: SampleFormat_Bitstream cannot be controlled by this
STDMETHOD_(BOOL, GetSampleFormat)(LAVAudioSampleFormat format) = 0;
STDMETHOD(SetSampleFormat)(LAVAudioSampleFormat format, BOOL bEnabled) = 0;
// Configure a delay for the audio
STDMETHOD(GetAudioDelay)(BOOL * pbEnabled, int *pDelay) = 0;
STDMETHOD(SetAudioDelay)(BOOL bEnabled, int delay) = 0;
// Enable/Disable Mixing
STDMETHOD(SetMixingEnabled)(BOOL bEnabled) = 0;
STDMETHOD_(BOOL, GetMixingEnabled)() = 0;
// Control Mixing Layout
STDMETHOD(SetMixingLayout)(DWORD dwLayout) = 0;
STDMETHOD_(DWORD, GetMixingLayout)() = 0;
#define LAV_MIXING_FLAG_UNTOUCHED_STEREO 0x0001
#define LAV_MIXING_FLAG_NORMALIZE_MATRIX 0x0002
#define LAV_MIXING_FLAG_CLIP_PROTECTION 0x0004
// Set Mixing Flags
STDMETHOD(SetMixingFlags)(DWORD dwFlags) = 0;
STDMETHOD_(DWORD, GetMixingFlags)() = 0;
// Set Mixing Mode
STDMETHOD(SetMixingMode)(LAVAudioMixingMode mixingMode) = 0;
STDMETHOD_(LAVAudioMixingMode, GetMixingMode)() = 0;
// Set Mixing Levels
STDMETHOD(SetMixingLevels)(DWORD dwCenterLevel, DWORD dwSurroundLevel, DWORD dwLFELevel) = 0;
STDMETHOD(GetMixingLevels)(DWORD * dwCenterLevel, DWORD * dwSurroundLevel, DWORD * dwLFELevel) = 0;
// Toggle Tray Icon
STDMETHOD(SetTrayIcon)(BOOL bEnabled) = 0;
STDMETHOD_(BOOL, GetTrayIcon)() = 0;
// Toggle Dithering for sample format conversion
STDMETHOD(SetSampleConvertDithering)(BOOL bEnabled) = 0;
STDMETHOD_(BOOL, GetSampleConvertDithering)() = 0;
// Suppress sample format changes. This will allow channel count to increase, but not to reduce, instead adding
// empty channels This option is NOT persistent
STDMETHOD(SetSuppressFormatChanges)(BOOL bEnabled) = 0;
STDMETHOD_(BOOL, GetSuppressFormatChanges)() = 0;
// Use 5.1 legacy layout (using back channels instead of side)
STDMETHOD_(BOOL, GetOutput51LegacyLayout)() = 0;
STDMETHOD(SetOutput51LegacyLayout)(BOOL b51Legacy) = 0;
// Fallback to audio decoding if bitstreaming is not supported by the audio renderer/hardware
STDMETHOD_(BOOL, GetBitstreamingFallback)() = 0;
STDMETHOD(SetBitstreamingFallback)(BOOL bBitstreamingFallback) = 0;
};
// LAV Audio Status Interface
// Get the current playback stats
interface __declspec(uuid("A668B8F2-BA87-4F63-9D41-768F7DE9C50E")) ILAVAudioStatus : public IUnknown
{
// Check if the given sample format is supported by the current playback chain
STDMETHOD_(BOOL, IsSampleFormatSupported)(LAVAudioSampleFormat sfCheck) = 0;
// Get details about the current decoding format
STDMETHOD(GetDecodeDetails)
(LPCSTR * pCodec, LPCSTR * pDecodeFormat, int *pnChannels, int *pSampleRate, DWORD *pChannelMask) = 0;
// Get details about the current output format
STDMETHOD(GetOutputDetails)(LPCSTR * pOutputFormat, int *pnChannels, int *pSampleRate, DWORD *pChannelMask) = 0;
// Enable Volume measurements
STDMETHOD(EnableVolumeStats)() = 0;
// Disable Volume measurements
STDMETHOD(DisableVolumeStats)() = 0;
// Get Volume Average for the given channel
STDMETHOD(GetChannelVolumeAverage)(WORD nChannel, float *pfDb) = 0;
};
/*
* Copyright (C) 2010-2021 Hendrik Leppkes
* http://www.1f0.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#include <Unknwn.h> // IUnknown and GUID Macros
// {774A919D-EA95-4A87-8A1E-F48ABE8499C7}
DEFINE_GUID(IID_ILAVFSettings, 0x774a919d, 0xea95, 0x4a87, 0x8a, 0x1e, 0xf4, 0x8a, 0xbe, 0x84, 0x99, 0xc7);
typedef enum LAVSubtitleMode
{
LAVSubtitleMode_NoSubs,
LAVSubtitleMode_ForcedOnly,
LAVSubtitleMode_Default,
LAVSubtitleMode_Advanced
} LAVSubtitleMode;
interface __declspec(uuid("774A919D-EA95-4A87-8A1E-F48ABE8499C7")) ILAVFSettings : public IUnknown
{
// Switch to Runtime Config mode. This will reset all settings to default, and no changes to the settings will be
// saved You can use this to programmatically configure LAV Splitter without interfering with the users settings in
// the registry. Subsequent calls to this function will reset all settings back to defaults, even if the mode does
// not change.
//
// Note that calling this function during playback is not supported and may exhibit undocumented behaviour.
// For smooth operations, it must be called before LAV Splitter opens a file.
STDMETHOD(SetRuntimeConfig)(BOOL bRuntimeConfig) = 0;
// Retrieve the preferred languages as ISO 639-2 language codes, comma separated
// If the result is NULL, no language has been set
// Memory for the string will be allocated, and has to be free'ed by the caller with CoTaskMemFree
STDMETHOD(GetPreferredLanguages)(LPWSTR * ppLanguages) = 0;
// Set the preferred languages as ISO 639-2 language codes, comma separated
// To reset to no preferred language, pass NULL or the empty string
STDMETHOD(SetPreferredLanguages)(LPCWSTR pLanguages) = 0;
// Retrieve the preferred subtitle languages as ISO 639-2 language codes, comma separated
// If the result is NULL, no language has been set
// If no subtitle language is set, the main language preference is used.
// Memory for the string will be allocated, and has to be free'ed by the caller with CoTaskMemFree
STDMETHOD(GetPreferredSubtitleLanguages)(LPWSTR * ppLanguages) = 0;
// Set the preferred subtitle languages as ISO 639-2 language codes, comma separated
// To reset to no preferred language, pass NULL or the empty string
// If no subtitle language is set, the main language preference is used.
STDMETHOD(SetPreferredSubtitleLanguages)(LPCWSTR pLanguages) = 0;
// Get the current subtitle mode
// See enum for possible values
STDMETHOD_(LAVSubtitleMode, GetSubtitleMode)() = 0;
// Set the current subtitle mode
// See enum for possible values
STDMETHOD(SetSubtitleMode)(LAVSubtitleMode mode) = 0;
// Get the subtitle matching language flag
// TRUE = Only subtitles with a language in the preferred list will be used; FALSE = All subtitles will be used
// @deprecated - do not use anymore, deprecated and non-functional, replaced by advanced subtitle mode
STDMETHOD_(BOOL, GetSubtitleMatchingLanguage)() = 0;
// Set the subtitle matching language flag
// TRUE = Only subtitles with a language in the preferred list will be used; FALSE = All subtitles will be used
// @deprecated - do not use anymore, deprecated and non-functional, replaced by advanced subtitle mode
STDMETHOD(SetSubtitleMatchingLanguage)(BOOL dwMode) = 0;
// Control whether a special "Forced Subtitles" stream will be created for PGS subs
STDMETHOD_(BOOL, GetPGSForcedStream)() = 0;
// Control whether a special "Forced Subtitles" stream will be created for PGS subs
STDMETHOD(SetPGSForcedStream)(BOOL bFlag) = 0;
// Get the PGS forced subs config
// TRUE = only forced PGS frames will be shown, FALSE = all frames will be shown
STDMETHOD_(BOOL, GetPGSOnlyForced)() = 0;
// Set the PGS forced subs config
// TRUE = only forced PGS frames will be shown, FALSE = all frames will be shown
STDMETHOD(SetPGSOnlyForced)(BOOL bForced) = 0;
// Get the VC-1 Timestamp Processing mode
// 0 - No Timestamp Correction, 1 - Always Timestamp Correction, 2 - Auto (Correction for Decoders that need it)
STDMETHOD_(int, GetVC1TimestampMode)() = 0;
// Set the VC-1 Timestamp Processing mode
// 0 - No Timestamp Correction, 1 - Always Timestamp Correction, 2 - Auto (Correction for Decoders that need it)
STDMETHOD(SetVC1TimestampMode)(int iMode) = 0;
// Set whether substreams (AC3 in TrueHD, for example) should be shown as a separate stream
STDMETHOD(SetSubstreamsEnabled)(BOOL bSubStreams) = 0;
// Check whether substreams (AC3 in TrueHD, for example) should be shown as a separate stream
STDMETHOD_(BOOL, GetSubstreamsEnabled)() = 0;
// @deprecated - no longer required
STDMETHOD(SetVideoParsingEnabled)(BOOL bEnabled) = 0;
// @deprecated - no longer required
STDMETHOD_(BOOL, GetVideoParsingEnabled)() = 0;
// Set if LAV Splitter should try to fix broken HD-PVR streams
// @deprecated - no longer required
STDMETHOD(SetFixBrokenHDPVR)(BOOL bEnabled) = 0;
// Query if LAV Splitter should try to fix broken HD-PVR streams
// @deprecated - no longer required
STDMETHOD_(BOOL, GetFixBrokenHDPVR)() = 0;
// Control whether the given format is enabled
STDMETHOD_(HRESULT, SetFormatEnabled)(LPCSTR strFormat, BOOL bEnabled) = 0;
// Check if the given format is enabled
STDMETHOD_(BOOL, IsFormatEnabled)(LPCSTR strFormat) = 0;
// Set if LAV Splitter should always completely remove the filter connected to its Audio Pin when the audio stream
// is changed
STDMETHOD(SetStreamSwitchRemoveAudio)(BOOL bEnabled) = 0;
// Query if LAV Splitter should always completely remove the filter connected to its Audio Pin when the audio stream
// is changed
STDMETHOD_(BOOL, GetStreamSwitchRemoveAudio)() = 0;
// Advanced Subtitle configuration. Refer to the documentation for details.
// If no advanced config exists, will be NULL.
// Memory for the string will be allocated, and has to be free'ed by the caller with CoTaskMemFree
STDMETHOD(GetAdvancedSubtitleConfig)(LPWSTR * ppAdvancedConfig) = 0;
// Advanced Subtitle configuration. Refer to the documentation for details.
// To reset the config, pass NULL or the empty string.
// If no subtitle language is set, the main language preference is used.
STDMETHOD(SetAdvancedSubtitleConfig)(LPCWSTR pAdvancedConfig) = 0;
// Set if LAV Splitter should prefer audio streams for the hearing or visually impaired
STDMETHOD(SetUseAudioForHearingVisuallyImpaired)(BOOL bEnabled) = 0;
// Get if LAV Splitter should prefer audio streams for the hearing or visually impaired
STDMETHOD_(BOOL, GetUseAudioForHearingVisuallyImpaired)() = 0;
// Set the maximum queue size, in megabytes
STDMETHOD(SetMaxQueueMemSize)(DWORD dwMaxSize) = 0;
// Get the maximum queue size, in megabytes
STDMETHOD_(DWORD, GetMaxQueueMemSize)() = 0;
// Toggle Tray Icon
STDMETHOD(SetTrayIcon)(BOOL bEnabled) = 0;
// Get Tray Icon
STDMETHOD_(BOOL, GetTrayIcon)() = 0;
// Toggle whether higher quality audio streams are preferred
STDMETHOD(SetPreferHighQualityAudioStreams)(BOOL bEnabled) = 0;
// Toggle whether higher quality audio streams are preferred
STDMETHOD_(BOOL, GetPreferHighQualityAudioStreams)() = 0;
// Toggle whether Matroska Linked Segments should be loaded from other files
STDMETHOD(SetLoadMatroskaExternalSegments)(BOOL bEnabled) = 0;
// Get whether Matroska Linked Segments should be loaded from other files
STDMETHOD_(BOOL, GetLoadMatroskaExternalSegments)() = 0;
// Get the list of available formats
// Memory for the string array will be allocated, and has to be free'ed by the caller with CoTaskMemFree
STDMETHOD(GetFormats)(LPSTR * *formats, UINT * nFormats) = 0;
// Set the duration (in ms) of analysis for network streams (to find the streams and codec parameters)
STDMETHOD(SetNetworkStreamAnalysisDuration)(DWORD dwDuration) = 0;
// Get the duration (in ms) of analysis for network streams (to find the streams and codec parameters)
STDMETHOD_(DWORD, GetNetworkStreamAnalysisDuration)() = 0;
// Set the maximum queue size, in number of packets
STDMETHOD(SetMaxQueueSize)(DWORD dwMaxSize) = 0;
// Get the maximum queue size, in number of packets
STDMETHOD_(DWORD, GetMaxQueueSize)() = 0;
// Set if LAV Splitter should reselect subs based on given rules when audio stream is changed
STDMETHOD(SetStreamSwitchReselectSubtitles)(BOOL bEnabled) = 0;
// Query if LAV Splitter should reselect subs based on given rules when audio stream is changed
STDMETHOD_(BOOL, GetStreamSwitchReselectSubtitles)() = 0;
};
This diff is collapsed.
This directory contains header files of non-standard Interfaces that LAV Filters support.
---------------------------------------------------------------------------------------------
----------------------------------------------
IKeyFrameInfo - implemented by LAV Splitter
---------------------------------------------
IKeyFrameInfo allows players to query the position of keyframes, so they can redirect seeking
requests to those positions for very smooth seek events. Only fully supported on MKV files.
----------------------------------------------
ITrackInfo - implemented by LAV Splitter
---------------------------------------------
ITrackInfo is an interface to obtain additional information about the streams in a file.
The order to query the streams is the same as returned by IAMStreamSelect::Info
----------------------------------------------
IGraphRebuildDelegate
---------------------------------------------
IGraphRebuildDelegate is not an interface implemented by LAV Splitter itself.
It is designed to offer the ability to take over the graph-building process from the player's side.
It only exports one function which LAV Splitter will call when a stream change happens on the user's requests,
and then the player can take care of the graph changes itself instead of relying on LAV Splitter to do it.
To use IGraphRebuildDelegate, the player needs to implement it, and share the implementing class with LAV Splitter
through the "IObjectWithSite" interface, which is implemented by LAV Splitter.
----------------------------------------------
LAVSplitterSettings / LAVAudioSettings
----------------------------------------------
These interfaces are used to configure LAV programmatically, so the player can do configuration changes.
cd /d "%~dp0"
regsvr32.exe LAVAudio.ax
\ No newline at end of file
cd /d "%~dp0"
regsvr32.exe LAVSplitter.ax
\ No newline at end of file
cd /d "%~dp0"
regsvr32.exe LAVVideo.ax
\ No newline at end of file
cd /d "%~dp0"
regsvr32.exe /u LAVAudio.ax
\ No newline at end of file
cd /d "%~dp0"
regsvr32.exe /u LAVSplitter.ax
\ No newline at end of file
cd /d "%~dp0"
regsvr32.exe /u LAVVideo.ax
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment