Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concateneting multi mp4 media onto a single surface #7435

Closed
nbourdin opened this issue May 28, 2020 · 3 comments
Closed

Concateneting multi mp4 media onto a single surface #7435

nbourdin opened this issue May 28, 2020 · 3 comments

Comments

@nbourdin
Copy link

Hello,
Is there any way to concatenate multiple mp4 media ​​from server and display them onto a single surface as a big one media (with one timeline in the controller)?

@andrewlewis
Copy link
Collaborator

There isn't an easy way to do this, but it is possible. Giving detailed guidance is beyond the scope of this tracker. Here are some pointers that may be useful:

  • If it's a requirement to show both videos on the same Surface instance, I think you will need to have the video decoders output to off-screen SurfaceTextures then take care of compositing them onto the final Surface in the right places yourself. There is some information in Mix couple videos #6617. See also the gldemo which shows how to render video to a SurfaceTexture and process the output using GLES.
  • You could use two separate player instances, and keep them synchronized (either roughly synchronizing by playing/pausing as needed, or by using the same MediaClock instance for both players). Or you could try merging the two MP4s using MergingMediaSource (I think durations need to match for that), and then customize track selection like Simplify/allow selection of multiple renderers of the same type in DefaultTrackSelector. #6589 (comment) to have multiple renderers of the same time (that comment relates to audio not video but it should be similar for video).

@nbourdin
Copy link
Author

Thanks for you answer,
But if i understand well, your solution is for display 2 videos in the same time (which i need to do too in a second case).
My question was about the concatenation (not merging) of 2 videos on the same window and in the same concatenated timeline .
So basically , if I have 1 video of 30s and 1 video of 15s, my progress bar in the control view can reach 45s in the same window.

@andrewlewis andrewlewis reopened this May 28, 2020
@andrewlewis
Copy link
Collaborator

Sorry for the confusion. Please see #5093 but note the caveat in #4727.

@google google locked and limited conversation to collaborators Jul 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants