Custom file format and codec?

I've been confused with the codec issue for a few days, but still don't see the big picture. This is my first time dealing with audio / video formats and codecs. So I really need help. Here's the job.

I am writing several components that are responsible for encoding and decoding custom mpeg files. Apart from the standard de-compression process (for both audio and video), I am implementing some custom de / encryption. Writing both codecs and software libraries for this. Things I cannot figure out are listed.

  • For WMP, what is the codec detection policy.
  • How can I distinguish the custom file format from mpeg-3 format for example. What are the programming standards and frameworks for this. (The real part I'm screwed up is this: container formats, video formats, 4ccc codes ... etc lead me to death)
  • For this work on Windows, what method do you suggest to write a codec (DMO or Filter)

I hope to cope with the listed problems with you. Information and some helpful links would be appreciated. Except MSDN :) because I couldn't find what I'm looking for on it.

+2


source to share


2 answers


For WMP, what is the definition of a codec policy.

Before Windows Media Player 7.0, it was just a pure DirectShow player. Starting with version 7.0, Microsoft started to handle different file types differently. This mainly concerns WMV files. WMP will now use MediaFoundation media content in Vista and 7 for some file types.

How can I distinguish my file format from mpeg-3 format eg. What are the standards and programming structures for this. (The real part, I messed it up. Container formats, video formats, 4ccc codes ... etc lead me to death)

You could do this (lol, sorry for the MSDN link) if you create your own container format, but if you want to make life easier for yourself, I would go with an existing and / or open container like AVI or MKV. When you create a stream in any of these formats, you must provide a codec code, such as a quad for video or a format tag for audio. Since you are making your own format, you should just create your own 4-part or formatted tag values, but try not to choose what people are already using.



Let's say you used AVI. Built-in avi demux will read AVI headers and view metadata for each stream in the file. It can find a video stream with four DX50s and an audio stream with a WAVE_FORMAT_PCM format tag. DirectShow will list the registered filters and ask their contacts to see if they support using DX50 video or WAVE_FORMAT_PCM audio. So if your AVI had a quadruple XXXX, DirectShow will list the filters looking for types that accept XXXX. Then you will create a transform filter that will accept a quarter of XXXX. Your conversion filter will decode the video and output uncompressed format. Perhaps RGB24. DirectShow will detect that your output is outputting this media type and will probably plug it directly into the renderer. The process is the same for audio,except we're using format tags instead of fourcc (and you're dealing with WAVEFORMATEX and VIDEOINFOHEADER).

For this work on Windows what method do you suggest to write codec(DMO or Filter)

      

I have never written DMO personally, but I highly recommend learning it. I heard there are less COM stuff for boilers and IIRC, MediaFoundation has a DMO wrapper so you can get automatic support for MediaFoundation.

Besides the DShow SDK samples, you can check from this . Can help you get started. Also, this site has great designs, but it might not be exactly what you want.

+2


source


Not enough space for comments I guess :)

I had some understanding about filters and directshow by your answers and graphedit program. I will be using an AVI container for audio and video. And internally I will use mpeg format, which will be encrypted by my algorithm. I will be using a transform filter or DMO. (Probably DMO)



I am wondering how AVI Splitter will transfer data to my registered codecs. I mean what format the data will be in. I think there must be some kind of standard. I made a world with MSDN on my research, but couldn't find information on the actual buffer formats in the data stream for the individual formats. (AVI in my case)

0


source







All Articles