-
Notifications
You must be signed in to change notification settings - Fork 386
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
MP4Muxer and FragmentedMP4Muxer throwing illegal state exception at random times causing crash #1781
Comments
Tried running the code again, and received this crash today (also at a random interval), possibly related:
I'm using a Handler for video frames, but not for audio frames. |
Hey @GhostCoder7 , The muxer APIs are expected to work on a single threaded model only. Since you are feeding audio and video from different threads, there could be some synchronisation issues. If you need to feed data from different threads then may be you could create some |
Version
Media3 1.4.1
More version details
No response
Devices that reproduce the issue
Samsung Galaxy S20
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
I'm migrating to media3. I'm encountering an
IllegalStateException
when I use Mp4Muxer or FragmentedMP4Muxer to mux a video with two tracks - one video from the camera, one audio from the mic. I'm using the following format parameters:video format parameters:
frame rate: 30
container mime type: MimeTypes.VIDEO_H264
sample mime type: MimeTypes.VIDEO_H264
audio format parameters:
channels: 1
sample rate: 44100
bit rate: 128000
Expected result
If you record a video before the
IllegalStateException
is thrown, the video records fine and can be played back - I've successfully recorded short 15second videos. It is expected that this would also be the case for long videos.Actual result
If you record a video before the
IllegalStateException
is thrown, the video records fine and can be played back. But eventually after between 30 - 60 seconds, anIllegalStateException
is thrown due to the following assertion and causes a crash:It's not immediately clear why the sizes between
pendingSamplesbyteBuffer
andpendingSamplesBufferInfo
would ever differ and therefore why the IllegalStateException would ever be thrown. There are no comments or documentation that explains why this would occur and how to avoid it.Example stack trace:
Media
N/A
Bug Report
adb bugreport
to [email protected] after filing this issue.The text was updated successfully, but these errors were encountered: