开发者

DirectShow - what is it?

What is Microsoft's DirectShow, and how does it relate to:

  • codecs?
  • containers?

And what is the exact difference between codecs and c开发者_开发问答ontainers?


In plain English:

Codec is a piece of algorithm and/or code that will transform audio or video from RAW format to coded format and back; encoder and decoder.

In case of video, RAW format will be pixels in the memory, and in case of audio it will be samples.

Containers are a way to write encoded data into a file on the hard drive. Or a way to write encoded data into the stream for internet transmission.


PART 1: DirectShow

DirectShow is a COM based multimedia framework developed by Microsoft. The filter aspect of the DirectShow architecture is similar to Unix Pipes in that you process multimedia content by sending it through a configurable pipeline which includes:

  1. source filter (required)
  2. transform filter (optional)
  3. renderer filter (required)

Generally speaking, DirectShow framework supports the following features:

  • audio/video playback
  • audio/video capture
  • video editing
  • video mixing
  • DVD related features

In the past, software developers used C++ and the DirectShow SDK to develop solutions. With that said, COM compatible programming languages can also be used.

PART 2: Formats, Containers, Compression and Codecs

Having read numerous articles on the subject, the one thing I can say for certain is that these terms are not used consistently throughout the industry! It is my understanding that...

container {format}

A container or container format could be thought of as an envelope - different types of content (e.g. audio, video, meta data, etc.) can be stored within the same envelope. For example: last summer you may have received an envelope which included a letter and photographs from your uncle Bob about his latest fishing trip.

Just as an envelop is independent of the content contained within it, so too is the container. For example: H.264 encoded video and AAC encoded audio could be stored within the same *.MP4 container file. Alternatively an *.MP4 container file could hold MP3 encoded audio."

compression {format} (a.k.a.compression scheme)

From a software development perspective, the compression format can be thought of as the specification that describes how the data is being persisted. In other words, the data structure that is being used to represent the serialized data.

Depending on a number of factors, compression formats will either by lossless or lossey.

codec (a.k.a. compressor-decompressor, coder-decoder)

A codec is a hardware device or software application that uses a complex algorithm to encode or decode multimedia content (e.g. audio, video, closed captioning, etc.).

Be advised: the term codec is frequently misused to refer to either the compression format (e.g. H.264) or a container format (e.g. MP4).

Examples

  • Container formats

    • AVI, FLV, F4V, MOV, MP4, MKV, etc.
  • Compression formats

    • JPEG, PNG, MP3, AAC, H.264, H.262, MPEG2 part 2, MPEG4 part 2, etc.
  • Codec

    • The DivX H.264 codec and the Xvid H.264 codec both use different algorithms to encode video in the H.264 compression format.

ADDITIONAL NOTES

  • DirectX refers to a group or collection of Microsoft APIs (e.g. Direct3D, DirectDraw, DirectSound, etc.) that happens to include the DirectShow API. That is, until DirectShow was moved to the Microsoft Platform SDK in April 2005.

REFERENCES

  • The Digital Media Zone: Understanding Codecs
  • A Guide to Common Video Formats, Containers, Compression and Codecs
  • Microsoft: DirectShow
  • Wikipedia: Video Compression Format
  • DivX
  • Xvid
  • SourceForge: DirectShow.net


From wikipedia:

DirectShow (sometimes abbreviated as DS or DShow), codename Quartz, is a multimedia framework and API produced by Microsoft for software developers to perform various operations with media files or streams.

It is an API and framework. Not codecs or containers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜