Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Record Camera Video and Display youtube video at the same time

I want is to record reactions of user while watching youtube video, so there will be two videos on screen that will be recorded at the same time . one is Camera Video (Reaction video) and other one on top of it is youtube video(reacted on).

below should be recorded as one video
__________________________
|                         |
|        Camera Video     |
|                         |
|               __________|
|               | Youtube |
|               |   Video |
---------------------------

My R&D:

  • Cannot use SurfaceView for dual purpose play and record video at the same time.
  • TextureView usually is used to show camera previews not record anything.
  • I can play preview in textureview and overlap youtube player on top of it and play the video , and at the same time record the whole screen , but it is overkill and i cannot record particular area of screen i think.

Some similar questions that are not related to my question but answer some of the key points mentioned in my question. Q1 , Q2 , Q3

Kindly suggest some method to workaround this problem and how can i achieve it.

like image 899
Zulqurnain Jutt Avatar asked Feb 21 '18 07:02

Zulqurnain Jutt


People also ask

How do I record a video while watching YouTube?

The simplest is probably just to use YouTube's webcam capture feature to record a video directly to YouTube. To do this, locate and select the Upload button near the top-right corner of any YouTube page, locate Webcam capture, and select Record.

How do you record yourself and your screen at the same time on YouTube?

To record yourself while recording your screen, just turn the camera on in the settings. Then, you can simply hit record to start recording once you're set. You can also adjust your microphone volume to match the volume of the sounds in your presentation on the screen.

Can you record webcam and screen at the same time?

If you want to record your computer screen and a webcam video at the same time, that's easy. And the best part, if you're on Windows, you only need one program to do it all: VSDC Free Screen Recorder. This tool will be a great fit for software tutorials, reaction videos, gameplays, and such.


2 Answers

you can put the video on top of other video using FFmpeg. see here Mix 2 videos with FFmpeg (overlay one on top of other) for putting the video on top of another video. you also need youtube video into a device for merging with local video. for downloading youtube video into device you can use this library.

like image 165
asim Avatar answered Nov 14 '22 23:11

asim


I have used https://github.com/INDExOS/media-for-mobile the Intel media pack for recording video from multiple sources, with layering to cut out views we don't want to see.

With some work you can hook into the texture you want (i.e. the camera preview)

like image 26
Dean Marcussen Avatar answered Nov 14 '22 23:11

Dean Marcussen