GDCL Mpeg-4 Multiplexor Problem

别来无恙 提交于 2019-12-11 07:30:34

问题


I just create a simple graph

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

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

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

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?

Best Wishes

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


回答1:


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.

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.

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



来源:https://stackoverflow.com/questions/6174149/gdcl-mpeg-4-multiplexor-problem

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!