mencoder、VLC 和 FFMpeg 中使用的 Mjpeg 编解码器的文档在哪里?
Mencoder 有一个可爱的选项,可以使用可在 VLC 中播放的“MJPG”编解码器将 mjpeg 文件转换为 avi 文件。
执行此操作的命令行为:
mencoder filename.mjpeg -oac copy -ovc copy -o outputfile.avi -speed 0.3
其中 0.3 是所需播放帧速率与默认 25 fps 的比率。这一切所做的就是制作 mjpeg 文件的副本,在顶部和末尾放置一个 avi 标头,这似乎是文件中帧位置的索引。
我想在我自己的代码中复制它,但我在任何地方都找不到文档。索引部分的确切格式是什么?由于某种原因,标头中有额外的填充字节 - 这是怎么回事?
有人知道在哪里可以找到文档吗? mencoder 和 vlc 似乎都内置了这个编解码器。
Mencoder has a lovely option for converting a mjpeg file into an avi file with an 'MJPG' codec that plays in VLC.
The command line to do this is:
mencoder filename.mjpeg -oac copy -ovc copy -o outputfile.avi -speed 0.3
where 0.3 is the ratio of the desired play framerate to the default 25 fps. All this does is make a copy of the mjpeg file, put an avi header on top and at the end, what seems to be an index of the frame positions in the file.
I want to replicate this in my own code, but I can't find documentation anywhere. What is the exact format of the index section? The header has extra filler bytes in it for some reason - whats this about?
Anyone know where I can find documentation? Both mencoder and vlc seem to have this codec built in.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过大量工作、研究和摆弄 HxD 和 RiffPad,我终于弄清楚了。要解释这一切需要很长的博客文章,但基本上并没有真正的“MJPG”编解码器 - mjpg 只是使用 avi 标准的一些技巧和不寻常的部分来生成索引文件。
关键是在每个 Jpeg 打开标记前面放置 '00dc' 和一个 Int32 长度标记 8 个字节。如果您希望 avi 是随机访问的,那么您需要在末尾有一个索引,该索引指向每个“00dc”标签位置。
VLC 将在本机播放此内容。如果您安装了 ffmpeg,Windows Media Player 将使用它来解码这些类型的 mjpg 文件。
After much work, study and fiddling around with HxD and RiffPad, I finally figured it out. It would take a long blog entry to explain it all, but basically there isn't really an 'MJPG' codec out there - mjpg just uses a few tricks and unusual parts of the avi standard to produce an indexed file.
The key is to place '00dc' and an Int32 length tag 8 bytes in front of each Jpeg open tag. If you want the avi to be random access, then you need an index at the end which points to each of the '00dc' tag positions.
VLC will play this natively. If you have ffmpeg installed, then Windows Media Player uses that to decode these types of mjpg files.