View Full Version : Audio (AC3/DTS/MPEG/LPCM) and Video (MPEG2) plugins
opsis81
8th February 2005, 03:35
Download FilmShrink from
http://filmshrink.sourceforge.net/
FilmShrink is a DVD-Video backup software for Windows, which transcodes video titles into the RealMedia format (RealVideo / RealAudio 10) powered by the Helix DNA platform.
BUT!! it includes some new avisynth filters
MPEG-2 Video Decoder Plugin for AviSynth 2.5 (m2input.dll)
AC-3 Audio Decoder Plugin for AviSynth 2.5 (ac3input.dll)
DTS Audio Decoder Plugin for AviSynth 2.5 (dtsinput.dll)
MPEG Audio Decoder Plugin for AviSynth 2.5 (mpainput.dll)
LPCM Audio Decoder Plugin for AviSynth 2.5 (lpcminput.dll)
Wilbert
8th February 2005, 22:47
Sounds very promising! The site is a bit slow/down :(
I changed the title a bit :)
edit: I can't get AC3Source or DTSSource to work. Did someone have any luck?
opsis81
9th February 2005, 00:25
You should change the title:).
FilmShrink seems to indexes the vob first.Something like d2a cration :D
These filters seem to be the m2tools pack.The source code of m2tools can be downloaded from http://filmshrink.sourceforge.net/dl.html.
Have a look at it.
Sirber
9th February 2005, 17:36
What input does the m2input.dll plugin supports?
Wilbert
9th February 2005, 21:36
I'm not sure. If you look at mpeg2dec.c it says * Jun 20, 2004: Derived from "DGIndex 1.0.12" by Attila Afra. Perhaps "it's" just dgdecode 1.0.12. I do know it should be called with mpeg2source(blabla).
I will mail him about this.
Sirber
9th February 2005, 21:50
ok, so it takes D2V files. Thanks for the info :D
a_afra
9th February 2005, 22:41
Hi,
My name is Attila Afra, and I'm the developer of FilmShrink. I've noticed that a few people are interested in the new AviSynth plugins used by FilmShrink. These plugins are part of m2tools, which can be downloaded (full source code) from FilmShrink's homepage. m2input is a slightly modified version of DGDecode (it accepts M2I files, which are VERY similar to D2V files, but there are a few differences, so it's NOT compatible with those) and ac3input/dtsinput/lpcminput/mpainput were written by me using different decoder libraries (liba52, libdts/libdca, MAD). The cause of your problems is that the video/audio plugins can ONLY accept files generated by m2index, the main indexer library, which is based on DGIndex. m2index first creates a "full" video/audio/subpic index, from which you can later rebuild (using the m2rebuild function) the index of a single PGC/angle, usable by the plugins. I will soon (this weekend :)) write a detailed description on how to use this package, and I will release a sample command-line tool (with source) which uses m2index. Until then I recommand experimenting with the files located in the hidden ".fskj" directory of the jobs created by FilmShrink. :) And don't forget to check out "m2index.h" and "m2index_info.h" from the m2tools source package! I'm awaiting all your questions and suggestions...
Attila
Wilbert
10th February 2005, 14:51
Welcome on this forum!
I will soon (this weekend ) write a detailed description on how to use this package, and I will release a sample command-line tool (with source) which uses m2index.
Does the latter mean we can open dts/ac3/etc in AviSynth by using the index file created with m2index (and the command-line tool)?
a_afra
10th February 2005, 19:50
Yes, you can! In fact, there will be two tiny tools: one (simply m2index) for creating the main (full) index, and the other (m2rebuild) for rebuilding it to get the index of the desired PGC/angle. Both will use "m2index.dll". Note that the AviSynth plugins included in m2tools can only accept the rebuilt index, which is NOT compatible with any other plugins! By using m2rebuild, you can immediately decode any PGC/angle without extracting it from the DVD using a tool like vstrip, DVD Decrypter or IfoEdit. Also you don't have to demux the audio streams: the only things you need are the index files. m2tools supports multi-angle and seamless branching DVDs too, so it's quite powerful (I've tested it with "The Matrix" and it works fine)!
Wilbert
1st March 2005, 22:18
Any news?
a_afra
3rd March 2005, 20:09
m2DecPak 1.1.1 SDK is available for download! I had to rename m2tools because I've noticed that there is already an m2_tools. Sorry for this huge delay, but I have very little spare time and I had to concentrate on the development of FilmShrink's main module. You can download this package from FilmShrink's download page. The SDK contains the include files, the compiled libraries, examples (the sample command-line tools) and a detailed description about the usage of this package outside FilmShrink. You should also download the source code and the latest version of FilmShrink (0.2.8). Looking forward to feedback...
Backwoods
4th March 2005, 03:05
I just tried out your AC3 filter, it's perfect. Only problem is the CMD stuff. I used Filmshrink instead and copied the temp files it made and used those. Otherwise I couldn't get it to work.
E-Male
4th March 2005, 05:27
does this only work on DVDs, or can i also create indexes for already demuxed streams?
Backwoods
4th March 2005, 05:42
I'm pretty sure it's only VOBs and IFOs.
a_afra
4th March 2005, 09:31
Yes, it can index only DVDs (demuxed ones aren't accepted)! Also make sure to copy "m2index.dll" into the directory from where you launch the command-line tools! It should work without any problems.
Example usage:
m2index.exe "VTS_02_1.VOB|VTS_02_2.VOB|VTS_02_3.VOB" main true true
m2rebuild.exe main VTS_02_0.IFO movie 1 0 true true true
E-Male
4th March 2005, 10:44
i see, but could it be modified to work with demuxed files?
a_afra
4th March 2005, 19:27
No. It is possible to index the demuxed video stream with m2Index but you won't be able to use m2Rebuild and decode the video using m2Video. But you can decode a demuxed audio track if you manually create a .VFM file. It should look like this (without < >):
VirtualFileMap10
1
<full path of the demuxed audio file>
0 <length of the file in hex>
.
Pass this file to the proper decoder filter.
E-Male
4th March 2005, 19:46
thx, i'll look into that
Nic
30th March 2005, 18:52
Is anyone interested in these filters as standalones for loading raw audio files such as AC3, DTS, etc?
It's very easy to convert them, (I'm thinking someone else has
already done it, but I can't find it with a search).
(I could just join them all into one DLL pretty easily)
Here's an AC3 one for example:
http://nic.dnsalias.com/m2audio_ac3.zip
-Nic
Kurtnoise
30th March 2005, 19:45
Originally posted by Nic
Is anyone interested in these filters as standalones for loading raw audio files such as AC3, DTS, etc?
Yes,me...I'm interested. ;)
Nic
30th March 2005, 19:45
Ok,
I went ahead and did it anyway:
http://nic.dnsalias.com/NicAudio.zip
That includes the filter NicAudio.dll
This filter has the following functions:
Syntax:
AC3: NicAC3Source("FileName.ac3", int "Downmix")
DTS: NicDTSSource("FileName.dts", int "Downmix")
MPA: NicMPASource("FileName.mpa", int "Downmix")
LPCM: NicLPCMSource("FileName.lpcm", int "SampleRate", int "SampleBits", int "Channels")
Note: "Downmix" specifies the maximum number of channels to output. This is
the only optional parameter.
Example:
LoadPlugin("NicAudio.dll")
NicAC3Source("c:\File.AC3")
Hope someone finds it useful, can be extended, etc. I've built a VC6 project for it, included in the zip.
Cheers,
-Nic
ps
All credit goes to the creator of filmshrink for his excellent work. It really is a nice project (i've never run it, or used it, but the coding is excellent)
Dark-Cracker
30th March 2005, 21:04
Nic you are my hero thank for your work :)
i am sure this will help a lot of people who have actually hard time with DTS for exemple.
Bye.
Morpheus_xx
1st April 2005, 10:48
One question, is it also possible to pass through the "raw" ac3 stream in AviSynth ? I mean not to decode or downmix.
I would need it for my video conversions with ac3 audio, i.e. use Trim() inside the avs.
E-Male
1st April 2005, 11:35
there was an experimental version of avisynth that allowed direct stream copy
just do a search
maybe that'll do what you want
eswrite
5th April 2005, 20:43
I just installed Filmshrink, and I can't find any of the listed plugins:
MPEG-2 Video Decoder Plugin for AviSynth 2.5 (m2input.dll)
AC-3 Audio Decoder Plugin for AviSynth 2.5 (ac3input.dll)
DTS Audio Decoder Plugin for AviSynth 2.5 (dtsinput.dll)
MPEG Audio Decoder Plugin for AviSynth 2.5 (mpainput.dll)
LPCM Audio Decoder Plugin for AviSynth 2.5 (lpcminput.dll)
However, I do see the following files:
m2audio_ac3.dll
m2audio_dts.dll
m2audio_lpcm.dll
m2audio_mpa.dll
m2video.dll
Has the naming convention changes (this soon!) and these are the plugin DLLs?
EDIT: Well, yes indeed, at least for m2audio_mpa.dll. I loaded it in place of mpasource.dll, and I was able to use MPASource() on my audio clip.
Wilbert
5th April 2005, 21:57
EDIT: Well, yes indeed, at least for m2audio_mpa.dll. I loaded it in place of mpasource.dll, and I was able to use MPASource() on my audio clip.
No. I bet your mpasource.dll is still located in your avs plugin dir (correct me if i'm wrong). If that's the case MPASource.dll is still being used in your case. The dlls you get when installing Filmshrink can't be used directly in AviSynth. Luckely, Nic changed them a bit so that they can be used in AviSynth (see few posts back how to do this).
eswrite
5th April 2005, 22:52
I bet your mpasource.dll is still located in your avs plugin dir (correct me if i'm wrong).
You are right, but my script wasn't loading mpasource.dll, so... Anyway, the real test is if I remove it, right? Okay... I renamed both mpasource.dll and NicAudio.dll, and MPASource() does not work with m2audio_mpa.dll loaded. Once I rename mpasource.dll to its original name, it works again, even though my script doesn't load it! How did that happen?
Wilbert
5th April 2005, 23:01
The plugins in the plugin dir of AviSynth are automatically loaded (so you don't need to do that manually).
Jerry_Sm@rt
14th April 2005, 04:43
any mirrors?it's weird,nic's link led me to koolina.com.
Nic
14th April 2005, 09:04
Is the link still not working for you? Still works fine here for me. If not, you could always bug WarpEnterprises to add it to the AviSynth external filters site to mirror it ;)
-Nic
Jerry_Sm@rt
14th April 2005, 11:43
Originally posted by Nic
Is the link still not working for you? Still works fine here for me. If not, you could always bug WarpEnterprises to add it to the AviSynth external filters site to mirror it ;)
-Nic
Still no luck :( ,seems to be my proxy problem.
guavahalf
10th June 2005, 09:40
This my first post after 3 weeks of lurking. I have already learnt a lot by simply watching and reading the activity on the various forum but have encountered a problem that I am afraid that I could not immediately find any support for. Equal apologies if I have jumped into the wrong forum and should have posted to Newbies but I thought the direct relevance to Nic's nicaudio.dll plugin allowed me to start in this thread.
The basic scenario is that I am trying to rip a DVD, create a .d2v index file in DGIndex 1.3.0 with all audio tracks demuxed (to pick up the AC3 component) and then run an AVISynth (version 2.5x) into VirtualDub to check audio/video synchronisation before passing the same AVISynth script into my H264 encoder.
The point I may have missed in all the "how to guides" is how to bring the demuxed 5.1 soundtrack back in alongside the video so apologies if I have gone down the completely wrong path with what follows. I ended up taking Nic's AVISynth plugin NicAudio.dll from this thread and wrote the following AVISynth Script -
loadplugin("\\.......path....\DGDecode.dll")
loadplugin("\\...path....\m2audio_ac3.dll")
video = mpeg2source("\\...path...\AC3 Project file.d2v")
audio = m2audioac3source("\\..path...\AC3 file.ac3")
Audiodub(video,audio)
When I play this .avs file in VirtualDub, I get video but no sound. However, when I play the .avs into my encoder, the encoder recognizes that there is an audio track and encodes both the video and audio OK.
Any ideas why I do not hear any audio in VirtualDub? I would like to be able to hear the audio in VirtualDub before encoding to manage delays, check synchronisation, etc.
Any help or redirection to another forum would be greatly appreciated.
Edit - the AVISynth script above actually called Nic's earlier post with the m2audio_ac3.dll plugin. I have tried both this and the Nicaudio.dll but get the same results, no audio in VirtualDub, in both cases.
Wilbert
10th June 2005, 10:21
You should use nicaudio.dll. Try the following
video = ...
audio = NicAC3Source("FileName.ac3", 2)
AudioDub(video,audio)
# the delay xxx in seconds can be found in the filename of the demuxed audio
DelayAudio(xxx)
It will downmix the audio otherwise VDub might not play it.
guavahalf
11th June 2005, 01:38
Wilbert - I had read about delays and was expecting to have to compensate for them once I got the video and audio working together, i.e. I thought that I had to hear/see how far out of sync the sound was in VDub before compensating for the delay. I had never expected that I would have to get the delay right before hearing any sound in VDub though!
Your suggestion of DelayAudio worked - I will continue experimenting.
Thanks to you (and Nic for the plugin).
Wilbert
11th June 2005, 13:01
I messed up. The delay can be found in the filename of the audio IF it is demuxed with dvd2avi/dgindex. Sorry about that.
Wilbert - I had read about delays and was expecting to have to compensate for them once I got the video and audio working together, i.e. I thought that I had to hear/see how far out of sync the sound was in VDub before compensating for the delay. I had never expected that I would have to get the delay right before hearing any sound in VDub though!
I don't get what you mean here. You don't need to get the delay right when you want to hear any sound in VDub. You can also set the delay in VDub. But you don't need to find the delay manually, just read it of the filename (of the demuxed audio in dvd2avi).
guavahalf
12th June 2005, 14:07
I apologize for the confusion. I recognize (although don't yet fully understand why) that dvd2avi/dgindex can demux the .ac3 component with a delay - in my specific case the delay on the .ac3 I wanted to use was 288 ms.
What I meant with my comment was that I would have expected if I ran the script without Delayaudio(0.288) that I would have gotten both video and sound but that the sound would be out of sync. What seemed to happen in my specific case was that without Delayaudio(0.288) I got no sound at all (only video) when running the file in VDub - which I found surprising.
I need to run some further tests to double check these results so no need to analyse the situation any further. Thanks again for your help.
iNFO-DVD
4th July 2005, 13:04
Syntax:
AC3: NicAC3Source("FileName.ac3", int "Downmix")
DTS: NicDTSSource("FileName.dts", int "Downmix")
MPA: NicMPASource("FileName.mpa", int "Downmix")
LPCM: NicLPCMSource("FileName.lpcm", int "SampleRate", int "SampleBits", int "Channels")
Your plugin works great for except for one thing... The LPCM!
Can you give me an example line for this file:
VTS_01_PGC_05_1 T01 48K 16bit 2ch.lpcm
audio=NicLPCMSource(FileName,48000,16,2)
I've tried every combination I can think of, like 48,16,2 48,16000,2 48,16384,2
The above example does actually play but it's all a massive hiss.
Hmm, Weird. I don't have a LPCM file at present and won't be able to get one for sometime. Do you know of or could upload a small piece so I could test?
Cheers,
-Nic
iNFO-DVD
4th July 2005, 14:32
I've 'rared' it up and it's about 18MB, just uploading it now to my web site, will take 15mins but I have a feeling I don't have enough room? You know somewhere I can upload to if it fails?
Get back to you in a few mins
Fast reply indeed...... ;)
Cool, shout me when ya ready. Swede can provide a little temporary FTP space...I'll see if I can find him.
-Nic
Wilbert
4th July 2005, 14:48
@Nic,
Here's a bunch of lpcm streams:
http://forum.doom9.org/showthread.php?p=679213#post679213
iNFO-DVD
4th July 2005, 14:54
Link sent in PM
I think the trouble is that you are using a WAV LPCM file rather than a raw LPCM stream from a DVD.
I should really compensate for that in the AviSynth plugin, but it's a bit of a hassle..... ;) I'll see what I can do though.
-Nic
Ok, download NicAudio from nic.dnsalias.com again ( http://nic.dnsalias.com/NicAudio.zip (look in the readme to make sure you don't have a cached version))
This now supports LPCM Wav files with 2 channel audio (but no more than two channels, don't have the time to add support in for the rest right now)
-Nic
iNFO-DVD
4th July 2005, 15:25
Wow that was quick. Just gonna test it now.
iNFO-DVD
4th July 2005, 15:37
Ok, download NicAudio from nic.dnsalias.com again ( http://nic.dnsalias.com/NicAudio.zip (look in the readme to make sure you don't have a cached version))
This now supports LPCM Wav files with 2 channel audio (but no more than two channels, don't have the time to add support in for the rest right now)
-Nic
Excellent :D
I only use it for the preview in my program so it wouldn't matter to me if it was whatever bitrate or channels as long as I could hear it, just re-updated with the v1.1 dll and everything is great, phew, glad you was online and thanks again.
Cheers! :goodpost:
LigH
29th August 2005, 11:40
@ Nic:
Does it also support 20 bit LPCM? I don't have it - I just solved the interleaved format in "Twen"...
LigH
1st September 2005, 17:10
And another idea (I hope, you are still out there somewhere, Nic?):
It would be great if you could support loading custom downmix matrices and gain settings as they can be exported out of AC3Filter.
Nic
1st September 2005, 22:56
Hey LigH. Yup, still alive & kicking....inbetween trying to get my wavelet codec to work, making my AVI->EXE program, actually getting around to deciding what i'm going to do with QuEnc, oh and spraining my ankle yesterday playing football (my right foot is now twice the size of the other)...i'm quite busy and active.
The main problem is that I can't visit this forum easily anymore. Something's changed, and i've not had time to work out the problem, but the proxy at work doesn't like, nor does my home connection (using IE at least, firefox normally works fine)
Anyway, I digress.
I don't have many LPCM streams and when I do download LPCM samples, without having more than two speakers and a need to use them, I haven't had the patience to work out what's needed. One day I'll find the time. On the plus side the source code is very easy to read, understand and change so maybe someone else can do it.
The only real difficulty is the way the samples are interleaved. I don't have that info (without looking through lots of source), but I know folks like MPUCoder, DVD Lightning, neuron2, etc have more info on it.
-Nic
LigH
1st September 2005, 23:17
http://www.ligh.de/software/Twen!.rar
contains a document which shall explain how the 20-bit interleaving in stereo streams works, and how you could change it to 16 or 24 bit samples acceptable in WAV files.
MPUCoder instead will know more about any possible channel mode for 20 bit LPCM. I read some details about the MuxMan development (katjarella always informed me about interresting news).
__
About football: http://www.cosgan.de/images/smilie/muede/s015.gif Get well soon! ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.