在mancoder,VLC和FFMpeg中使用的Mjpeg编解码器的文档在哪里? [英] Where is the documentation for the Mjpeg codec used in mencoder, VLC and FFMpeg?

查看:428
本文介绍了在mancoder,VLC和FFMpeg中使用的Mjpeg编解码器的文档在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Mencoder有一个可爱的选择,用于将mjpeg文件转换为使用VLC播放的MJPG编解码器的avi文件。



执行此操作的命令行为:



mencoder filename.mjpeg -oac copy -ovc copy -o outputfile.avi -speed 0.3



其中0.3是所需播放帧率与默认25 fps的比例。所有这些都是制作mjpeg文件的副本,将avi标题放在顶部和末尾,似乎是文件中框架位置的索引。



我想在我自己的代码中复制这个,但是我找不到任何文档。索引部分的确切格式是什么?由于某些原因,标题中有额外的填充字节 - 这是什么?



任何人都知道我在哪里可以找到文档? mencoder和vlc似乎都内置了这个编解码器。

解决方案

在HxD和RiffPad的工作,我终于弄清楚了。这将需要一个漫长的博客条目来解释这一切,但基本上没有真正的MJPG编解码器 - mjpg只是使用一些技巧和avi标准的不寻常的部分来生成索引文件。



关键是将00dc和Int32长度标签放在每个Jpeg打开标签前8个字节。如果您希望avi是随机访问的,那么您需要在最后指向每个00dc标签位置的索引。



VLC将本机播放。如果您安装了ffmpeg,则Windows Media Player会使用它来解码这些类型的mjpg文件。


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.

解决方案

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.

这篇关于在mancoder,VLC和FFMpeg中使用的Mjpeg编解码器的文档在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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