Java - 从视频中提取关键帧

发布于 2024-11-14 20:44:56 字数 267 浏览 2 评论 0原文

我想从视频中提取关键帧。 现在我使用一个循环将一帧的样本与前一帧的样本进行比较,但这种方法不是很好。

让我解释一下:我有一个监控视频,我必须选择有变化的帧(一个人出现,另一个人出现,一个人消失等)现在我使用此类来比较帧:< a href="http://mindmeat.blogspot.com/2008/07/java-image-comparison.html" rel="nofollow">Java图像比较/运动检测类

你还知道其他方法吗?

谢谢!!

I want to extract keyframes from a video.
Now I'm using a loop that compare the samples of one frame with the samples of the preceding frame, but this method isn't very good.

Let me explain: I have a surveillance video and I have to select the frames where there is a change (a person appears, another person appears, a person goes away, etc.) Now I'm using this class to compare frames: Java Image Comparison / Motion Detection Class

Do you know other ways?

Thanks!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

滿滿的愛 2024-11-21 20:44:56

我不确定你所说的“关键帧”。您的方法只允许您找到场景过渡,但这并不是视频解码中“关键帧”通常的含义:它通常是 I-frame(可以自行解码的帧,无需参考其他帧)。 (通常场景转换是关键帧,但不一定是其他方式)。当然,这个概念与视频编解码器相关,但大多数现代编解码器(来自 MPEG-1)都实现了这个概念。但请注意,这与原始图片本身无关,而是与编解码器有关。

如果您想检测这些关键帧(I 帧),那么您必须查看视频解码 API 内部,看看它是否允许您获取此信息。似乎 xuggle 为您提供了 IVideoPicture.getPictureType() 方法,但我没有使用过。

I'm not sure what you call a "keyframe". Your method would allow you only to find scene transitions, but that is not what is usually meant by a "keyframe" in video decoding: it's rather usually an I-frame (a frame which can be decoded on its own, without reference to other frames). (Frequently scene transitions are keyframes, but no necessarily the other way). This concept it tied to the video codec, of course, but most modern codecs (from MPEG-1) implement this concept. But notice that this is not related to the raw pictures in themselves, but with the codec.

If you want to detect these keyframes (I-frames), then you must look inside your video decoding API, to see if it allows you to get this information. It seems that xuggle provides you the IVideoPicture.getPictureType() method, but I have not used it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文