| Author |
Message |
Roland
Guest
|
Posted:
Tue Oct 05, 2004 8:37 am Post subject:
Merge a WMV file and wav file |
|
|
hi
I have a WMV file with only video stream compressed with Window Media
9 codec and a uncompressed(PCM) wave file. I want to merge these 2
files into one wmv file and compress the wav file while merging with
Windows Media 9 codec. Can this be done. I cannot use direct show. I
am new to WMF SDK any pointers to any kind of documentation or source
code will be really helpful.
Roland
|
|
| Back to top |
|
 |
Becky Weiss [MS]
Guest
|
Posted:
Sat Oct 09, 2004 4:33 am Post subject:
RE: Merge a WMV file and wav file |
|
|
Roland,
The WMFormat SDK does provide a way to do this. Here's the outline of what
you'd want to do (and I'll refer you to the docs/samples for more info):
1) Compress your WAV file into a (temporary) WMA file. For this, look at
the UncompAVIToWMV sample in the WMFSDK (that does audio + video; of course,
your code is going to be simpler, because you'll be doing only audio.
2) From your existing WMV and the temporary WMA file you created in step #1,
create your output file by writing compressed samples. To read each of the
input files, you'll need a separate instance of an IWMSyncReader. You'll
read through the compressed samples from the input files and pass the
compressed samples to a single instance of IWMWriter::WriteStreamSample. The
WMVCopy sample will give you some direction on doing this, though of course
you'll need to merge the audio and video streams into one profile and
synchronize the samples between the streams yourself.
Becky
This posting is provided AS IS with no warranties and confers no rights.
"Roland" wrote:
| Quote: | hi
I have a WMV file with only video stream compressed with Window Media
9 codec and a uncompressed(PCM) wave file. I want to merge these 2
files into one wmv file and compress the wav file while merging with
Windows Media 9 codec. Can this be done. I cannot use direct show. I
am new to WMF SDK any pointers to any kind of documentation or source
code will be really helpful.
Roland
|
|
|
| Back to top |
|
 |
Roland
Guest
|
Posted:
Sun Oct 10, 2004 7:11 pm Post subject:
Re: Merge a WMV file and wav file |
|
|
hi
Thanks for your reply Becky. It was really helpful. But I have one
doubt. Is it necessary to do the first step. Can't I just write
compressed samples from the video file using the
IWMWriter::WriteStreamSample and the WAVE file using
IWMWriter::WriteSample into the the third file. Will this be possible
or it is not possible to write compressed video samples and
uncompressed audio samples(being compressed with windows media 9
codec) simultanously.
Roland.
"Becky Weiss [MS]" <BeckyWeissMS@discussions.microsoft.com> wrote in message news:<0892D201-465E-4F1E-8251-804B46D316A8@microsoft.com>...
| Quote: | Roland,
The WMFormat SDK does provide a way to do this. Here's the outline of what
you'd want to do (and I'll refer you to the docs/samples for more info):
1) Compress your WAV file into a (temporary) WMA file. For this, look at
the UncompAVIToWMV sample in the WMFSDK (that does audio + video; of course,
your code is going to be simpler, because you'll be doing only audio.
2) From your existing WMV and the temporary WMA file you created in step #1,
create your output file by writing compressed samples. To read each of the
input files, you'll need a separate instance of an IWMSyncReader. You'll
read through the compressed samples from the input files and pass the
compressed samples to a single instance of IWMWriter::WriteStreamSample. The
WMVCopy sample will give you some direction on doing this, though of course
you'll need to merge the audio and video streams into one profile and
synchronize the samples between the streams yourself.
Becky
This posting is provided AS IS with no warranties and confers no rights.
|
|
|
| Back to top |
|
 |
|
|
|
|