views:

347

answers:

2

Hi all. I'm trying to create an ASF file and instead of using sound or video data I want to create a stream made of custom packets with binary data.

Can someone provide a code example of a couple of things : 1) setting up a profile. 2) configuring a custom stream 3) inserting custom packets into the stream.

Much appreciated. Thanks!

Thanks Roey

A: 

It's been years since I did this, but I'll give it a shot.

Using the Windows Media Format SDK, you would create a IWMWriter and configure how many streams it has. You would set the input properties for each stream to NULL, which tells it not to compress each sample. After that, you just do a IWMWriter::WriteSample(...).

I'm sorry I don't remember all the rest of the details.

Jeremiah Morrill
A: 

For pre-compressed data you need to use IWMWriterAdvanced::WriteStreamSample Note your bit rate setting may cause data loss.

Sheng Jiang 蒋晟