GDCL Mpeg-4多路复用器问题 [英] GDCL Mpeg-4 Multiplexor Problem

查看:103
本文介绍了GDCL Mpeg-4多路复用器问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是创建一个简单的图形

I just create a simple graph

SourceFilter(*.mp4 file format) ---> GDCL MPEG 4 Mux Filter ---> File writer Filter

工作正常。但是,当源采用h264文件格式

It works fine. But when the source is in h264 file format

SourceFilter( *.h264 file format) ---> GDCL MPEG 4 Mux Filter---> File writer Filter

它记录文件,但记录的文件无法在VLC Player,QuickTime,BS中播放播放器,WM播放器。
我在做什么错?有什么想法来录制h264视频源吗?我需要H264多路复用器吗?

It record a file but the recorded file does not play in VLC Player, QuickTime, BS Player, WM Player. What i am doing wrong? Any ideas to record h264 video source? Do i need H264 Mux?

最美好的祝愿

PS:我只是想录制视频。 ..为什么我需要一个多路复用器?

PS: i JUST want to record video by the way...Why i need a mux?

推荐答案

DirectShow过滤器使用两种H.264格式。一种是字节流格式,其中每个NALU前面都有一个起始码00 0001。另一种是MP4文件内使用的格式,其中每个起始代码前都有一个长度(媒体类型或MP4文件元数据指定长度字段中使用了多少个字节)。问题在于,某些FOURCC用于两种格式。

There are two H.264 formats used by DirectShow filters. One is Byte Stream Format, in which each NALU is preceded by a start code 00 00 01. The other is the format used within MP4 files, in which each start code is preceded by a length (the media type or the MP4 file metadata specifies how many bytes are used in the length field). The problem is that some FOURCCs are used for both formats.

MP4多路复用器样本接受BSF或长度为先的数据,具体取决于给定的子类型。它不会尝试找出实际情况。最有可能的是,当您馈送H.264基本流时,在提供BSF数据时,您将给多路复用器一个FOURCC或媒体类型,该类型被多路复用器认为是长度前缀。签入TypeHandler :: CanSupport。

The MP4 mux sample accepts either BSF or length-preceded data, depending on the subtype give. It does not attempt to work out which it is. Most likely, when you are feeding the H.264 elementary stream, you are giving the mux a FOURCC or media type that the mux thinks means length-prepended, when you are giving BSF data. Check in TypeHandler::CanSupport.

如果只想将H.264视频保存到文件中,则可以使用转储过滤器将位写入文件中。如果要保存BSF,则这是有效的H.264基本流文件。如果要为大多数播放器提供支持,或者要寻求支持,则需要将基本流写入具有索引的容器中,例如MP4。在这种情况下,您需要一个多路复用器,而不是用于复用,而是用于索引和元数据创建。

If you just want to save H.264 video to a file, you can use a Dump filter to just write the bits to a file. If you are saving BSF, this is a valid H.264 elementary stream file. If you want support for the majority of players, or if you want seeking support, then you will want to write the elementary stream into a container with an index, such as MP4. In this case, you need a mux, not for the multiplexing, but for the indexing and metadata creation.

G

这篇关于GDCL Mpeg-4多路复用器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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