• Advertisement
Sign in to follow this  

DirectShow: adding audio to avi file

This topic is 4792 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I'm interested to add audio which I get as an input file to an existing Avi file, all this using DirectShow - How can I do this ?? If you can supply an example it would be great! Thanks.

Share this post


Link to post
Share on other sites
Advertisement
You should check out the information in the SDK and have a play with graph edit.

Basically you have a video source filter and a sound source filter (these can be from a file on disk, a stream across a network, straight out of a capture device, programatically created etc). These are then connected to the input filters of the AVI Muxer filter which basically combines the two into a single stream. From the output of the MUXER you can go to output devices, or out to a network stream, or onto disk etc.

You will have to have a read around, I am not sure what happens if sound already exists in the AVI etc, but all the information is there you just have to find it.

The SDK documentation combined with the samples is very informative if you are patient, but whatever you do avoid the Texture3D sample like the plague. If you need to draw to a Direct3D texture from a video stream post back here and I will tell you how.

Have a mess around with Graphedit, once understood it is an incredibly useful tool.

If you have any more specific question then there are lots of people on this board who will be able to help.

Kind regards.

Mark Coleman

Note to moderator: Could we get something in the FAQ about avoiding the Texture3D sample and using a Sample Grabber technique instead?

Share this post


Link to post
Share on other sites
Thanks for answering.

I quite new with Direct-X so everything is very hard for me...anyway,
let me describe for you what I have in my program:

I have an Avi created by my program and I already managed to use the DirectShow in order to compress it, so I have a graph and in my graph I have a
'File Source' aconnected to an 'Avi-Splitter', the Splitter is connected to a 'Compression Filter' and from there to the 'Mux' and to a 'File Writer'
That's how I get a compressed Avi, if I understand you correctly - I need to add another 'File Source' object that will get the audio file and connect it directly to the 'Mux' ??

Thanks alot!!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement