自定义文件格式和codeC? [英] Custom File Format And Codec?

查看:156
本文介绍了自定义文件格式和codeC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搞砸了codeC问题的天,还是没能看到大局呢。这是我第一次做处理音频/视频格式和codeCS。所以,我真的需要有关一些帮助。
这里的工作。

我写几部分组成,它负责编码和解码MPEG定制文件。在非标准德/ COM pression过程的顶部(用于音频和视频),我将实施一些自定义的DE /加密。写作这两个codeC和软件库。事情我想不通上市。


  • 对于WMP,什么是codeC的定位策略。

  • 如何differantiate例如从MPEG-3格式的我的自定义文件格式。什么是这个standarts和编程结构。 (我搞砸了真正的部分是这样的。容器格式,视频格式,FOURCC codeS ...等开车送我到死)

  • 对于Windows上的这项工作你建议写codeC(DMO或过滤器),什么方法

我希望能配合你的帮助上市的问题。相关信息和有用的一些环节将美联社preciated。除了MSDN :)因为我无法找到我搜索就可以了。


解决方案

  

有关WMP,什么是codeC定位
  策略。


此之前的Windows Media Player 7.0,这只是一个纯粹的DirectShow的球员。 7.0以来,微软已经开始处理不同的不同的文件类型。这主要是与WMV文件的情况下。 WMP现在将使用在Vista中MediaFoundation媒体管线和7某些文件类型。


  

我如何differantiate我的自定义文件
  例如从MPEG-3格式的格式。
  什么是standarts和编程
  结构这一点。 (实部我
  搞砸了是这样的。容器格式,
  视频格式,FOURCC codeS ...等
  开车送我到死)


能做到这一点(笑,遗憾的MSDN链接),如果要创建自己的自定义容器格式,但是如果你想对自己的生活更轻松,我会选择一个现有的和/或开放源码的容器,如AVI或MKV。当您在任何这些格式的流,你会提供一个codeC code,如视频fourcc值或音频格式标签。既然你做你自己的自定义格式,你应该弥补自己的fourcc或格式标记值,但注意不要挑选一个人已经在使用。

假设你正在使用的AVI。内置的AVI解复用会读取AVI头,并期待在元数据文件中的每个流。它可能会发现与FOURCC DX50和WAVE_FORMAT_PCM的格式标签的音频流的视频流。 DirectShow中会枚举注册的过滤器和查询其引脚,以了解他们是否支持采取DX50视频或音频WAVE_FORMAT_PCM。所以,如果你有AVI XXXX的fourcc值,将DirectShow的过滤器枚举寻找那个拿XXXX类型。这样,你会做一个转换筛选器将接受FOURCC XXXX。你改造过滤器将取消code中的视频和输出uncom pressed格式。也许RGB24。 DirectShow中会检测你的输出引脚输出,介质类型和可能会直接连接到渲染器。这个过程是音频一样的,只不过我们处理的格式标记而不是fourccs(你处理WAVEFORMATEX和VIDEOINFOHEADER)。

 对于Windows上的这项工作你建议写codeC(DMO或过滤器),什么方法

我从来没有写过一篇DMO个人,但我会强烈建议寻找到它。我听说有少锅炉板COM的东西,IIRC,MediaFoundation有DMO包装,所以你可能会得到自动MediaFoundation支持。

除了DSHOW SDK样品,你可能要检查出这个。可以帮助你上手。此外本网站有很大的样品也,但可能不是正是你想要的。

I'm messed up with codec issue for days, and still couldn't see the big picture yet. It is my first time do deal with audio/video formats and codecs. So I really need some help about that. Here is the work.

I'm writing several components that is responsible for encoding and decoding customized mpeg files. On top of standart de/compression process (for both audio and video) i will implement some custom de/encryption. Writing both codec and software libraries for this. Things i can't figure out are listed.

  • For WMP, what is the codec locating policy.
  • How do I differantiate my custom file format from mpeg-3 format for example. What is the standarts and programming structs for this. (The real part I'm messed up is this. Container formats, video formats, fourcc codes...etc drive me to the death)
  • For this work on Windows what method do you suggest to write codec(DMO or Filter)

I'm hoping to cope with listed problems by your helps. Infos and some usefull links will be appreciated. Except MSDN :) because i couldn't find what i'm searching on it.

解决方案

For WMP, what is the codec locating policy.

Until Windows Media Player 7.0, it was just a pure DirectShow player. Since 7.0, Microsoft has started handling different file types differently. This was mostly the case with WMV files. WMP now will use MediaFoundation media pipeline in Vista and 7 for some file types.

How do I differantiate my custom file format from mpeg-3 format for example. What is the standarts and programming structs for this. (The real part I'm messed up is this. Container formats, video formats, fourcc codes...etc drive me to the death)

You could do this (lol, sorry for the MSDN link), if you are creating your own custom container format, but if you want to make life easier on yourself, I'd choose an existing and/or open-source container, such as AVI or MKV. When you create a stream in either of these formats, you'd provide a codec code, such as a fourcc for video or a format tag for audio. Since you are doing your own custom format, you should just make up your own fourcc or format tag values, but careful not to pick one people already use.

Lets say you were using an AVI. The built in avi demux would read the AVI headers and look at the meta data for each stream within the file. It might find a video stream with the fourcc DX50 and an audio stream with the format tag of WAVE_FORMAT_PCM. DirectShow will enum registered filters and query their pins to see if they support taking a DX50 video or a WAVE_FORMAT_PCM audio. So if you AVI had a fourcc of XXXX, DirectShow would enum filters looking for types that take XXXX. You would then make a transform filter that will accept fourcc XXXX. Your transformation filter will decode the video and output an uncompressed format. Maybe RGB24. DirectShow will detect that your output pin outputs that media type and will probably connect it directly to the renderer. The process is the same for audio, except we deal with format tags instead of fourccs (and you deal with WAVEFORMATEX and VIDEOINFOHEADER).

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

I've never written an DMO personally, but I would highly recommend looking into it. I've heard there is less boiler plate COM stuff and IIRC, MediaFoundation has a DMO wrapper, so you may get automatic MediaFoundation support.

Besides the DShow SDK samples, you may want to check out this. May help you get started. Also this website has great samples also, but might not be exactly what you want.

这篇关于自定义文件格式和codeC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆