逐帧创建运动JPEG帧率可变 [英] Creating a Motion JPEG frame by frame with variable frame-rate

查看:398
本文介绍了逐帧创建运动JPEG帧率可变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在分析一些我手头存在的问题的解决方案:我正在从设备接收图像,我需要从中创建一个视频文件。然而,图像到达之间有一些随机的延迟,我正在寻找最好的方法来编码这个。我必须逐帧创建这个视频,并且在每一帧之后,我必须有一个新的视频文件与新的帧,替换旧的视频文件。

I'm analyzing a number of solutions to the problem that I have in hand: I'm receiving images from a device and I need to make a video file out of it. However, the images arrive with a somewhat random delay between them and I'm looking for the best way to encode this. I have to create this video frame by frame, and after each frame I must have a new video file with the new frame, replacing the old video file.

我在想将帧速率固定在比我可能得到的最小延迟稍微更快,并重复最后一帧,直到新的帧到达,但我猜这个解决方案不是最优的。

I was thinking of fixating the frame-rate a little "faster" than the minimum delay that I might get and just repeat the last frame until a new one arrives, but I guess that this solution is not optimal.

此外,这个项目是用Delphi制作的(不,我不能改变),我需要手段在每帧后将这些帧转换成视频文件。我正在考虑使用 mencoder 作为外部工具,但我正在阅读文档和仍然没有找到一个选项,使其在已编码的Motion JPEG视频文件中插入一帧。由于我的图像以JPEG格式输入,我认为使用Motion JPEG是合理的,但即使这样也是确定的。此外,我不知道mencoder是否可以用作图书馆。

Also, this project is made with Delphi (no, I cannot change that) and I need means to turn these frames into a video file after each frame. I was thinking about using mencoder as an external tool, but I'm reading the documentation and still haven't found an option to make it insert a frame in an already encoded Motion JPEG video file. As my images come in as JPEG, I thought that it would be reasonable to use Motion JPEG, but not even this is certain yet. Also, I don't know if mencoder can be used as a library. It would help a lot if it did.

你会建议什么?

推荐答案

有些媒体容器格式支持可变帧速率,但我不认为MJPEG是一个很好的选择,因为存储开销。我相信最好的办法是使用I帧和P帧将JPEG帧转码为MP4格式。

There are some media container formats that support variable frame rate, but I don't think MJPEG is good choice because of the storage overhead. I believe the best way would be to transcode JPEG frames to MP4 format using both I-frames and P-frames.

您可以使用用于转码的FFMPEG Delphi / FP头文件

编辑:

最新版本的FFMPEG头文件可以在。要查看文件,您可以使用此链接

The most up to date version of FFMPEG headers can be found at GLScene repository on SourceForge.net. To view the files you can use this link

这篇关于逐帧创建运动JPEG帧率可变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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