google / google/ExoPlayer

Gap between videos when playing fragmented mp4 files in ConcatenatingMediaSource

Open
#3,526 7 comments 0 reactions 1 assignee Claimed by @andrewlewis View on GitHub
enhancement low priority
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

### Issue description
I have to play several videos seamlessly in a playlist. Unfortunately when playing fragmented mp4 files there are gaps between them. When I use normal mp4 files there are no gaps between them.

As described here (https://medium.com/google-exoplayer/exoplayer-2-x-new-audio-features-cfb26c2883a) gapless playback is possible for mp4 files which are extracted using the MP4Extractor. As we have to use fragmented mp4 files I was looking at the FragmentedMp4Extractor and I noticed it does not parse the udta-boxes provided by the fragmented mp4 file. Could this be the reason for the gaps between the individual videos? How can I get rid of these gaps?

### Reproduction steps
I provided a sample app which downloads four videos, the first two are normal mp4 files and the other two are fragmented mp4 files. Just start the app and the files will be downloaded and played using the ExoPlayer. You will then see there is no gap between the first two videos but between the third and the fourth one.

### Link to test content
[GaplessPlaybackDemo.zip](https://github.com/google/ExoPlayer/files/1517863/GaplessPlaybackDemo.zip)

I attached the demo application with which you should be able to reproduce the issue.

### Version of ExoPlayer being used
I use the ExoPlayer in the following version.
compile 'com.google.android.exoplayer:exoplayer:2.6.0'

### Device(s) and version(s) of Android being used
Unfortunately this happens on all smartphones and emulators I and several other people tested. It can be reproduced very simple by just playing two fragmented mp4 files in a ConcatenatingMediaSource.

### A full bug report captured from the device
There is nothing special in the logcat with this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.