bytedeco/javacv

Merge two videos files side by side horizontally

Open

#2,286 创建于 2024年9月25日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)Java (1,583 fork)batch import
help wantedquestion

仓库指标

Star
 (6,985 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

I have two webm files a.webm and b.webm having same dimensions and framerate. Purpose is to merge both videos side by side horizontally and get MP4 as output. For the same, I took reference code given in https://github.com/bytedeco/javacv/issues/955 post. But that did not work. I am not able to understand how the below code snippet working: while ((frame2 = grabber.grab()) != null) { if (frame2.image != null) { a++; } if (frame2.samples != null) { b++; } filter.push(0, frame2); filter.push(1, frame2); Frame frame3; while ((frame3 = filter.pull()) != null) { if (frame3.image != null) { c++; assertEquals(640, frame3.imageWidth); assertEquals(200, frame3.imageHeight); assertEquals(3, frame3.imageChannels); } if (frame3.samples != null) { d++; assertEquals(2, frame3.audioChannels); assertEquals(1, frame3.samples.length); assertTrue(frame3.samples[0] instanceof ByteBuffer); assertEquals(frame2.samples.length, frame3.samples.length); assertEquals(frame2.samples[0].limit(), frame3.samples[0].limit()); } } }

Please assist for the same.

贡献者指南