7

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.

Zulqurnain Jutt
  • 1,077
  • 1
  • 9
  • 21
  • Thats quite a lot of work for a mobile device to do - could you alternatively record and display the user reaction in the small window on the phone,while playing the main YouTube video and then send it back to the server to merge the two videos? Also you probably want to check you have the rights to record and modify the YouTube video if this is for a commercial service - it may be easier from a rights point of view if you want to display the result on Youtube anyway, although not necessarily. – Mick Feb 27 '18 at 17:29
  • i still want to give it a try and look at its performance , and how to improve it. – Zulqurnain Jutt Feb 28 '18 at 09:45

3 Answers3

1

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.

asim
  • 310
  • 1
  • 8
1

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)

Dean Marcussen
  • 597
  • 4
  • 15
0

I think its not a good idea to use multiple Media API's for this purpose , but it should be achievable only recording screen and showing two separate views , but technically this answer is still unanswered.

Zulqurnain Jutt
  • 1,077
  • 1
  • 9
  • 21