确定连续的视频剪辑
我有一个很长的视频流,但不幸的是,它的形式是 1000 个 15 秒长的随机命名的剪辑。我想根据两个这样的 15 秒剪辑的“相似性”的某种衡量标准来重建原始视频,回答“剪辑 2 中的活动似乎是剪辑 1 的延伸”的问题。剪辑之间有很小的间隙——每个间隙大约几百毫秒。如果结果足够好,我还可以手动修复结果,因此结果不必是完美的。
I a long video stream, but unfortunately, it's in the form of 1000 15-second long randomly-named clips. I'd like to reconstruct the original video based on some measure of "similarity" of two such 15s clips, something answering the question of "the activity in clip 2 seems like an extension of clip 1". There are small gaps between clips --- a few hundred milliseconds or so each. I can also manually fix up the results if they're sufficiently good, so results needn't be perfect.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个非常简单的方法可以是:
(a) 创建一个自动化过程,以已知图像格式(例如 JPG)提取每个视频剪辑的第一帧和最后一帧,并根据视频剪辑命名它们名称,例如,如果您有视频剪辑:
clipA.avi、clipB.avi、clipC.avi,
您可以创建以下帧图像:
clipA_first.jpg、clipA_last.jpg、clipB_first.jpg、 ClipB_last.jpg,clipC_first.jpg,clipC_last.jpg
(b) 排序“算法”:
非常简单......但我认为它可以有效......
PS1 :关于ImageDif()函数:可以新建一个DifImage,它是ClipX.last-frame.jpg、ClipY.first_frame.jpg图片的差值,然后对所有像素求和DifImage 为单个浮点 ImageDif 值。如果您的总和大于某个限制,您还可以优化该过程以中止差异(或求和过程):您实际上对小差异感兴趣。大于(实验)限制的 ImageDif 值意味着 2 个图像差异很大,以至于 2 个剪辑不能彼此相邻。
PS2:排序算法的复杂度必须约为 O(n*log(n)),因此对于 1000 个视频剪辑,它将执行大约 3000 次图像比较(或者如果您优化算法并且允许它找不到一些剪辑的匹配)
A very simplistic approach can be:
(a) Create an automated process to extract the first and last frame of each video-clip in a known image format (e.g. JPG) and name them according to video-clip names, e.g. if you have the video clips:
clipA.avi, clipB.avi, clipC.avi
you may create the following frame-images:
clipA_first.jpg, clipA_last.jpg, clipB_first.jpg, clipB_last.jpg, clipC_first.jpg, clipC_last.jpg
(b) The sorting "algorithm":
Very simplistic... but I think it can be effective...
PS1: Regarding the ImageDif() function: You can create a new DifImage, which is the difference of Images ClipX.last-frame.jpg, ClipY.first_frame.jpg and then then sum all pixels of DifImage to a single floating point ImageDif value. You can also optimize the process to abort the difference (or sum process) if your sum is bigger than some limit: You are actually interested in small differences. A ImageDif value which is larger than an (experimental) limit, means that the 2 images differs so much that the 2 clips cannot be one next each other.
PS2: The sorting algorithm order of complexity must be approximately O(n*log(n)), therefore for 1000 video clips it will perform about 3000 image comparisons (or a little more if you optimize the algorithm and you allow it to not find a match for some clips)