Skip to content

Synchronizing Multiple ExoPlayers #2855

@jtabor

Description

@jtabor

Hello,

I'm working on using ExoPlayer for a custom VR video streaming application. I want to be able to play media from multiple DASH sources to different SurfaceTextures, which will be put into an OpenGL shader to be warped and displayed in VR (I know how to do the OpenGL part already). Each DASH source corresponds to a different tile or quadrant of the VR video.

I've been able to play my tiles using separate SimpleExoPlayer instances, but there isn't a way to synchronize those so the tiles would be out of sync. I've tried a couple things to get this working:

  • I setup a DashMediaSource and tried to read samples directly from the sample streams and put them into MediaCodec on my own. I did this by creating a MediaPeriod from the DashMediaSource, and once it was prepared, I selected a track from it. Whenever there is data available, I read it into the decoder and set the right flags. This didn't work. In fact, it was so bad that the phone would reset whenever I ran the code. I think there might have been a problem with the initialization of the MediaCodec, but the debugger wasn't too useful, so after a week of trying to debug it, I gave up. (I can paste some code, if that idea has promise, and it's just a matter of debugging)
  • I tried modifying MediaCodecVideoRenderer to keep DecoderOutputBuffers around until I wanted to render them. This also didn't work.

What I want to know is, is there a way I can either synchronize SimpleExoPlayer (or ExoPlayer) instances? If I can't do that, I'd like to be able to get a sample stream that I can put into a MediaCodec instance myself, and handle the playback and synchronization myself.

Thanks in advance for any help!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions