Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
21st February 2012, 18:00 | #1 | Link |
Registered User
Join Date: Dec 2011
Posts: 6
|
Trouble extracting audio from avi file with AviSynth
Hi All,
I'm fairly new to using FFMpeg and AviSynth and I've been encountering one issue over and over again without resolution for a few weeks now, any assistance or advice would be greatly appreciated.. http://www.martinjkelly.co.uk/audio.avi <2Mb I have attached a link to a file called audio.avi (right click, save target as), This file is from a DVR device that records video and audio. I am building some software to merge 4 of these video files together into a single file and take the audio stream from the first file only. the problem i am having is when i try to extract the audio (using AviSource, FFMpegSource2, WAVSource etc) for some reason it plays the audio for a couple of seconds and then the audio stops. When this happens in windows media player, if i stop the file playing and then start it again it works as you would expect. I just cant get it to read the full audio stream on the first attempt Anyone have any ideas? Thanks PS... Please ignore the radio music in background - dunno where that come from lol Last edited by martinjkelly; 22nd February 2012 at 10:13. |
22nd February 2012, 00:33 | #2 | Link |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
The audio stored in your .avi is PCM (uncompressed)
BitDepth: 16 bit int Channels: 1 SampleRate: 8000 Hz Duration: 17.68 sec. You can use VirtualDubMod to extract (Streams -> Stream list... -> Save WAV) Also work with a audio.avs: AviSource("D:\audio.avi") and wavi audio.avs audio.wav Or using SoundOut() plugin.
__________________
BeHappy, AviSynth audio transcoder. |
22nd February 2012, 10:09 | #3 | Link |
Registered User
Join Date: Dec 2011
Posts: 6
|
Hi,
Thanks for your help, as already stated I have already tried to use AviSource and WAVSource get the audio stream. It does seem to read the audio but only plays the first few seconds the first time I play it. If I replay the file it seems to work. I do need it to work on the first attempt though, as I am generating and running these avs scripts on the fly and merging these files in a batch. I will have a play with SoundOut and see if that helps but I'm not actually trying to extract it. I am trying to merge 4 video streams into one and only use the audio stream from the first one Thanks again |
22nd February 2012, 10:57 | #4 | Link |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,890
|
Please put your avs script and batch file to try reproduce your problem.
Maybe some players have troubles with audio Samplerate 8 KHz or H264 video in avi container.
__________________
BeHappy, AviSynth audio transcoder. |
22nd February 2012, 11:13 | #5 | Link |
Registered User
Join Date: Dec 2011
Posts: 6
|
I am currently playing with AviSource and WavSource and applying various and random filters and settings etc to try and resolved the problem. The best way to replicate this issue is to simply use either of these in your avs script....
Code:
audio = WavSource("c:\audio.avi") return audio The code for the main project is something like this..... Code:
LoadCPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll") audio = WavSource("C:\audio1.avi") a = FFMpegSource2("C:\audio1.avi").BicubicResize (352,288) b = FFMpegSource2("C:\audio2.avi").BicubicResize (352,288) c = FFMpegSource2("C:\audio3.avi").BicubicResize (352,288) d = FFMpegSource2("C:\audio4.avi").BicubicResize (352,288) row1 = StackVertical(a,c) row2 = StackVertical(b,d) mosaic = stackhorizontal (row1, row2) video = AudioDub(mosaic, audio) return video PS.. This project will be running on Windows Server 2008 and is being developed on Windows 7. AviSource does not seem to work on either for me. DirectShowSource does not work on the Win Server machine (I think it may be because its a VPS without dedicated hardware) Last edited by martinjkelly; 22nd February 2012 at 14:07. |
22nd February 2012, 16:31 | #6 | Link |
Registered User
Join Date: Dec 2011
Posts: 6
|
Just a quick update...
I've been trying allsorts today to resolve this issue and am no further unfortunately. I've tried loads of different methods of reading the audio stream and tried multiple settings/filters in avisynth to get it work and all have failed, It's very strange. Any help would be greatly appreciated. |
22nd February 2012, 19:40 | #7 | Link | |
Unavailable
Join Date: Mar 2009
Location: offline
Posts: 1,480
|
Quote:
Code:
WavSource("audio.avi") Only WMP11 finished the playback before it could even start. |
|
23rd February 2012, 14:15 | #10 | Link |
Registered User
Join Date: Dec 2011
Posts: 6
|
Yeah it plays the AVS perfectly every time now, thanks alot for you help everyone...
I dont suppose anyone knows how i can get my avs file to a avi or even better a flv file with audio do they? i cant seem to get audio working with avs2avi. Someone advised me that it doesnt do audio at all |
Tags |
audio |
Thread Tools | Search this Thread |
Display Modes | |
|
|