View Full Version : How to use Audio from source file using avisynth
top_ramen
18th September 2008, 06:32
hi, i started using avisynth recently and im trying ot import a .mkv file into vdub mod
i used this:
FFmpegSource("H:\v.mkv")
and the video imports perfectly without any prbs.
but how do i use the audio from the same file ?
the file has an ac3 audio
i tried this:
LoadPlugin("D:\Program Files\AviSynth 2.5\plugins\NicAudio.dll")
NicAC3Source("h:\v.mkv")
but it didnt work.
my question is hwo do i feed the audio stream into vdub mod directly without demuxing the mkv file ?
thetoof
18th September 2008, 07:13
ffaudiosource("H:\v.mkv")
Check FFmpegSource's docs for more info. Never tried it with AC3 though...
tebasuna51
18th September 2008, 11:06
ffaudiosource() is still in beta stage.
To use NicAc3Source() you need extract the desired ac3 file from the mkv container.
- Open the mkv in mkvMergeGUI and find the desired audio track (maybe there are more than one).
See the track number and check if have a delay ('Format specifics options').
- Open the mkvExtractGUI and extract the track or use a command line like (if 3 is the desired audio track):
mkvextract tracks "H:\v.mkv" 3:"H:\v.ac3"
- If you have a -327ms delay you must use:
NicAC3Source("H:\v.ac3")
DelayAudio(-0.327)
top_ramen
19th September 2008, 19:30
Thank you both for the replies.
I am specifically looking for a way to use audio WITHOUT extracting it as a seperate file,i.e directly from the MKV file.
ill try ffaudiosource.
thanks again, if there are any other methods plz let me know
top_ramen
19th September 2008, 19:38
just tried ffmpeg v1.21 and beta 2.0 and i get the error no such function FFAudioSource.
any suggestions ?
this is my script
LoadPlugin("D:\Program Files\Avisynth 2.5\Plugins\FFMpegSource.dll")
FFmpegSource("G:\TMP\Beauties.mkv")
FFAudioSource("G:\TMP\Beauties.mkv")
poisondeathray
19th September 2008, 19:51
vid=FFmpegSource("H:\v.mkv")
aud=DirectShowSource("H:\v.mkv",video=false)
audiodub(vid,aud)
(or FFVideoSource() depending on the version)
matrix
20th September 2008, 23:04
FFmpegSource("H:\v.mkv", vtrack=-1, atrack=-1)
Should work this way, but don't expect ac3. It'll give you uncompress pcm
tebasuna51
21st September 2008, 13:34
FFmpegSource("H:\v.mkv", vtrack=-1, atrack=-1)
Should work this way, but don't expect ac3. It'll give you uncompress pcm
Don't work (FFmpegSource function don't exist) with last version, with v1.19 work, but remember use for ac3 source:
Audiochannels()== 6 ? Getchannel(1,3,2,6,4,5):last #ac3 ffmpeg remap.
to correct the wrong ffmpeg channel mapping.
Remember also than you can lose precission because the output is always 16 bits and ac3 can support until 24 bits.
At last, FFmpegSource don't extract the ac3 from the container, decode and extract the full audio writing a huge temporal uncompressed audio file (take a while).
tebasuna51
21st September 2008, 13:41
...
aud=DirectShowSource("H:\v.mkv",video=false)
audiodub(vid,aud)
Remember adjust your directshow filter (Ac3Filter, ffdshow, ...),
if you want transcode maybe don't want DialNorm, Dynamic Range Compression, downmix, ...)
top_ramen
21st September 2008, 16:53
just tried it.
vid=FFmpegSource("g:\tmp\be.mkv")
aud=DirectShowSource("g:\tmp\be.mkv",video=false)
audiodub(vid,aud)
thats the avs file
im getting the error
DIrectShowSource: couldnt open the file: g:\tmp\be.mkv
Cannot playback the file. the format is not supported.
I have ac3 filter installed and the same file plays normally in windows media player.
what am i doing wrong ?
top_ramen
24th September 2008, 15:48
Bump
Bump
Comatose
24th September 2008, 18:11
Why don't you try tebasuna's suggestion (NicAC3Source)...?
Alex_ander
24th September 2008, 18:12
If WMP plays it, you'll probably be able to open the mkv file in GraphEdit. Remove video branch and the default audio rendering device from the graph and save .grf file, then open it as DirectShowSource() instead of .mkv. Of course, something else is not configured on your system, but that trick might work.
poisondeathray
24th September 2008, 18:36
I think some filters might be conflicting, or something is setup incorrectly on your system if you are getting that error, top_ramen
You could try FFAudioSource() which was added today in the 2.00 beta 2 for FFmpegSource
Readded FFAudioSource (only matroska supported for now)
Good luck
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.