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

Playing multiple video tracks in Exoplayer. #6652

Closed
swastik52 opened this issue Nov 14, 2019 · 3 comments
Closed

Playing multiple video tracks in Exoplayer. #6652

swastik52 opened this issue Nov 14, 2019 · 3 comments
Assignees

Comments

@swastik52
Copy link

Hi Developer,

I have an mp4 container file that contains two video tack and an audio track in it. I have to play the two tracks side by side in two SimpleExoplayer instances how to do it by, passing the tracks to the corresponding instances for playing side by side.

@marcbaechinger
Copy link
Contributor

Can you provide a bit more context on what you are trying to achieve?
Are you asking how you can keep two instances of ExoPlayer in A/V sync accurately to timestamps?

In general it feels that if you have these tracks in one file, you need to download it twice which does not seem to be efficient specfically if one video track is not used in one or the other player. So besides the A/V sync problem, having these tracks separately would be more efficient for users.

@swastik52
Copy link
Author

Hi Developer,

I use the bellow command to merge two videos:
ffmpeg -i video1.mp4 -i video2.mp4 -map 0 -map 1 -codec copy -f mp4 Result.mp4

The Result.mp4 basically contains two videos in it so I have to play the video side by side in two instances of SimpleExoplayer.

Now I extract the video by ffmpeg and create two new video file by:
ffmpeg -i Result.mp4-map 0:v:0 -c copy newvideo1.mp4 -map 0:v:1 -c copy newvideo2.mp4

Then pass these videos uri to play side by side and it works fine. But, my requirement is to play the video side by side without extracting the videos form Result.mp4. So in my Result.mp4 in trackindex[0]
video1.mp4 is present and in trackindex[1] video2.mp4 is present, how can I pass these tracks to play these video in SimpleExoplayer side by side.

@tonihei
Copy link
Collaborator

tonihei commented Nov 20, 2019

You can also use multiple video renderers and a custom track selection to assign tracks to these renderers. See this issue comment for a similar question for multiple audio tracks. No need to do use special overrides without clocks for video renderers though.

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

4 participants