Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display two videos together then output as a merged video on a single screen

This question may sound a little bit complex or ambiguous, but I'll try to make it as clear as I can. I have done lots of Googling and spent lots of time but didn't find anything relevant for windows.

I want to play two videos on a single screen. One as full screen in background and one on top of it in a small window or small width/height in the right corner. Then I want an output which consists of both videos playing together on a single screen.

So basically one video overlays another and then I want that streamed as output so the user can play that stream later.

I am not asking you to write the whole code, just tell me what to do or how to do it or which tool or third party SDK I have to use to make it happen.

update: Tried a lots of solution.

1.Xuggler- doesn't support Android.

2.JavaCV or JJMPEG- not able to find any tutorial which suggested how to do it?

Now looking for FFMPEG- searched for a long time but not able to find any tutorial which suggest the coding way to do it. I found command line way to how to fix it. So can anyone suggest or point the tutorial of FFMPEG or tell any other way to

like image 493
Anil Avatar asked Mar 19 '13 10:03

Anil


People also ask

Can two videos be merged?

Add videos to the timeline To merge videos together, you must add them to the timeline in the order you want them to appear. To add videos to the timeline, click and drag them from the media bin to the timeline.


1 Answers

I would start with JavaCV. It's quite good and flexible. It should allow you to grab frames, composite them and write them back to a file. Use FFmpegFrameGrabber and Recorder classes. The composition can be done manually.

The rest of the answer depends on few things:

  • do you want to read from a file/mem/url?
  • do you want to save to a file/mem/url?
  • do you need realtime processing?
  • do you need something more than simple picture-in-picture?
like image 162
Zielony Avatar answered Sep 28 '22 07:09

Zielony