Skip to content

MPEG4Writer: do not support out of order frames #1880

Description

@TroyTheGod

Hi,

I've noticed that some videos recorded with this library are missing their audio tracks. After checking the logs for all the affected recordings, I found the same error message in each one:

`MPEG4Writer: do not support out of order frames (timestamp: 876377301 < last: 876405908 for Audio track
MPEG4Writer: 0 frames to dump timeStamps in Audio track
MediaWriter: Track event err/info msg:100, trackId:0, type:1,val:-1007
MPEG4Writer: Received total/0-length (37399/0) buffers and encoded 37398 frames. - Audio
MPEG4Writer: Audio track drift time: 0 us
MediaAdapter: pushBuffer called before start
PipelineWatcher: onInputBufferReleased: frameIndex not found (32461); ignored
RecordController: Write error
RecordController: java.lang.IllegalStateException: writeSampleData returned an error
RecordController: at android.media.MediaMuxer.nativeWriteSampleData(Native Method)
RecordController: at android.media.MediaMuxer.writeSampleData(MediaMuxer.java:723)
RecordController: at ze.m(Unknown Source:6)
RecordController: at ze.b(Unknown Source:15)
RecordController: at mz7$b.b(Unknown Source:21)
RecordController: at ks.w(Unknown Source:2)
RecordController: at o00.s(Unknown Source:3)
RecordController: at o00.p(Unknown Source:4)
RecordController: at o00$a.onOutputBufferAvailable(Unknown Source:2)
RecordController: at android.media.MediaCodec$EventHandler.handleCallback(MediaCodec.java:1953)
RecordController: at android.media.MediaCodec$EventHandler.handleMessage(MediaCodec.java:1851)
RecordController: at android.os.Handler.dispatchMessage(Handler.java:107)
RecordController: at android.os.Looper.loopOnce(Looper.java:257)
RecordController: at android.os.Looper.loop(Looper.java:342)
RecordController: at android.os.HandlerThread.run(HandlerThread.java:85)
PipelineWatcher: onInputBufferReleased: frameIndex not found (32462); ignored
MediaAdapter: pushBuffer called before start
RecordController: Write error
RecordController: java.lang.IllegalStateException: writeSampleData returned an error
RecordController: at android.media.MediaMuxer.nativeWriteSampleData(Native Method)
RecordController: at android.media.MediaMuxer.writeSampleData(MediaMuxer.java:723)
RecordController: at ze.m(Unknown Source:6)
RecordController: at ze.b(Unknown Source:15)
RecordController: at mz7$b.b(Unknown Source:21)
RecordController: at ks.w(Unknown Source:2)
RecordController: at o00.s(Unknown Source:3)
RecordController: at o00.p(Unknown Source:4)
RecordController: at o00$a.onOutputBufferAvailable(Unknown Source:2)
RecordController: at android.media.MediaCodec$EventHandler.handleCallback(MediaCodec.java:1953)
RecordController: at android.media.MediaCodec$EventHandler.handleMessage(MediaCodec.java:1851)
RecordController: at android.os.Handler.dispatchMessage(Handler.java:107)
RecordController: at android.os.Looper.loopOnce(Looper.java:257)
RecordController: at android.os.Looper.loop(Looper.java:342)
RecordController: at android.os.HandlerThread.run(HandlerThread.java:85)

and the RecordController log just keeps printing over and over until the recording stop.
`

It seems this might be an issue originating from an underlying Android library.
I've looked through the existing issues and saw that #702 reported the same error. It appears that this problem still occurs from time to time.
Unfortunately, I haven't found a consistent way to reproduce it, as it seems to happen randomly.
I'm wondering if there are any known workarounds or potential solutions for this issue. Any help or suggestions would be greatly appreciated.
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions