C# - Encode ASF with a custom data stream

1.2k views Asked by At

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

2

There are 2 answers

0
Jeremiah Morrill On

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.

0
Sheng Jiang 蒋晟 On

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