如何生成“moov before mdat” MP4视频文件与Media Foundation [英] How to generate "moov before mdat" MP4 video files with Media Foundation

查看:330
本文介绍了如何生成“moov before mdat” MP4视频文件与Media Foundation的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现Microsoft Media Foundation会生成MPEG4文件,其中MDAT原子位于MOOV原子之前。流式传输需要MDAT之前的MOOV。我假设解决我的问题是使用 MF_MPEG4SINK_MOOV_BEFORE_MDAT 属性,但我似乎无法得到它的效果。我的代码在很大程度上与 http://blogs.msdn.com/b/eternalcoding/archive/2013/03/06/developing-a-winrt-component-to-create -a-video-file-using-media-foundation.aspx

I've discovered that Microsoft Media Foundation generates MPEG4 file in which the MDAT atom comes before the MOOV atom. MOOV before MDAT is required for streaming. I assumed the solution to my problem would be to use the MF_MPEG4SINK_MOOV_BEFORE_MDAT attribute when creating the sink, but I can't seem to get it to have an effect. My code is largely the same as that http://blogs.msdn.com/b/eternalcoding/archive/2013/03/06/developing-a-winrt-component-to-create-a-video-file-using-media-foundation.aspx . I'm setting the attribute as a UINT32 TRUE just before MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS is set, in that example.

推荐答案

如果你不能设置属性,我将属性设置为一个UINT32 TRUE就是在设置MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS之前。得到编码器输出一个文件与moov原子在开始,你可以总是只是纠正该文件后。这两个实用程序应该运行在Windows上,并做的伎俩。 (他们都处理.mp4文件没有问题,尽管在名称中的'qt')

If you can't get the encoder to output a file with the moov atom at the beginning, you could always just correct the file afterward. Both of these utilities should run on Windows, and do the trick. (They both handle.mp4 files without issue, in spite of the 'qt' in the names)

https://github.com/danielgtaylor/qtfaststart

http://ffmpeg.zeranoe.com/blog/?p=59

这篇关于如何生成“moov before mdat” MP4视频文件与Media Foundation的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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