-
Notifications
You must be signed in to change notification settings - Fork 529
Adds support for fragmented mp4 with multiple sidx boxes #2186
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
base: main
Are you sure you want to change the base?
Adds support for fragmented mp4 with multiple sidx boxes #2186
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
476504f
to
ef35943
Compare
We can take a look once the CLA check is passing. |
@anthonybajoua Hey, a reminder to complete the CLA instruction if you want us to look at your code :) |
…ultiple-sidx-seek-squashed
This comment was marked as resolved.
This comment was marked as resolved.
Seems like the CLA issue is finally resolved. @icbaker Would you be able to take a look? |
Details
|
libraries/extractor/src/main/java/androidx/media3/extractor/mp4/FragmentedMp4Extractor.java
Outdated
Show resolved
Hide resolved
713b9cd
to
2e0d21a
Compare
8e41a84
to
d7534e9
Compare
d7534e9
to
8b681a8
Compare
ca0912d
to
0d55dd3
Compare
libraries/extractor/src/main/java/androidx/media3/extractor/mp4/FragmentedMp4Extractor.java
Outdated
Show resolved
Hide resolved
b51c5ea
to
69c7f54
Compare
69c7f54
to
2559cf7
Compare
seekPositionBeforeSidxProcessing = inputPosition; | ||
haveOutputSeekMapFromMultipleSidx = true; | ||
} finally { | ||
extractorOutput.seekMap(chunkIndexMerger.merge()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anthonybajoua Same with this finally block, why do we need to emit seekMap ( which may be incomplete ), when an IO error occurs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed in the case where when processing the final sidx
atom in a track, and processRemainingSidxAtoms
throws an IOException
reading the next atom header.
The issue is when an IOException
is thrown, there's no clear way to tell that this is the final sidx
atom. Does progressively outputting the seek map upon each IOException
pose problems?
Summary:
Addresses Github issue #9373
Implements solution 1 proposed by Google maintainer.
ffmpeg -i short_1080p_videoonly_lowbitrate.mp4 -c copy -movflags frag_keyframe+delay_moov+empty_moov+dash sample_fragmented_seekable_multi_sidx.mp4
(Above movflags flags actually result in an unplayable file on this player until this fix.)Algorithm/Solution
Retry above on I/O failures.