Skip to content
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

部分机型写入muxer 写入video 的时候,presentationTimeUs混乱 #20

Open
chezi008 opened this issue Nov 29, 2019 · 1 comment

Comments

@chezi008
Copy link

2019-11-29 15:48:43.747 9147-9355/com.lmy.sample E/MuxerImpl: writeAudioSample(13, 521541): 259
2019-11-29 15:48:43.768 9147-9355/com.lmy.sample E/MuxerImpl: writeAudioSample(13, 544217): 255
2019-11-29 15:48:43.786 9147-9355/com.lmy.sample E/MuxerImpl: writeAudioSample(14, 566893): 263
2019-11-29 15:48:43.811 9147-9355/com.lmy.sample E/MuxerImpl: writeAudioSample(14, 589569): 270
2019-11-29 15:48:43.828 9147-9355/com.lmy.sample E/MuxerImpl: writeAudioSample(15, 612244): 263
2019-11-29 15:48:43.852 9147-9355/com.lmy.sample E/MuxerImpl: writeAudioSample(16, 634920): 290
2019-11-29 15:48:43.886 9147-9355/com.lmy.sample E/MuxerImpl: writeAudioSample(17, 657596): 247
2019-11-29 15:48:43.907 9147-9355/com.lmy.sample E/MuxerImpl: writeAudioSample(17, 680272): 260
2019-11-29 15:48:43.940 9147-9355/com.lmy.sample E/MuxerImpl: writeAudioSample(18, 702947): 264
2019-11-29 15:48:43.958 9147-9355/com.lmy.sample E/MuxerImpl: writeAudioSample(19, 725623): 249
2019-11-29 15:48:43.979 9147-9355/com.lmy.sample E/MuxerImpl: writeAudioSample(19, 748299): 252
2019-11-29 15:48:43.982 9147-9356/com.lmy.sample E/MuxerImpl: writeVideoSample(20, 598474): 8944
2019-11-29 15:48:43.982 9147-9356/com.lmy.sample E/MediaAdapter: pushBuffer called before start
2019-11-29 15:48:43.997 9147-9355/com.lmy.sample E/MuxerImpl: writeAudioSample(20, 770975): 250
2019-11-29 15:48:43.998 9147-9356/com.lmy.sample V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@148ed9a
2019-11-29 15:48:43.998 9147-9356/com.lmy.sample V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@38e46cb
2019-11-29 15:48:44.003 9147-9356/com.lmy.sample V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@2433dc1
2019-11-29 15:48:44.003 9147-9356/com.lmy.sample V/BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@7b84966
2019-11-29 15:48:44.018 9147-9355/com.lmy.sample E/MuxerImpl: writeAudioSample(21, 793650): 248
2019-11-29 15:48:44.019 9147-9356/com.lmy.sample W/System.err: java.lang.IllegalStateException: writeSampleData returned an error
2019-11-29 15:48:44.019 9147-9356/com.lmy.sample W/System.err:     at android.media.MediaMuxer.nativeWriteSampleData(Native Method)
2019-11-29 15:48:44.019 9147-9356/com.lmy.sample W/System.err:     at android.media.MediaMuxer.writeSampleData(MediaMuxer.java:473)
2019-11-29 15:48:44.020 9147-9356/com.lmy.sample W/System.err:     at com.lmy.codec.muxer.impl.MuxerImpl.writeSample(MuxerImpl.kt:150)
2019-11-29 15:48:44.020 9147-9356/com.lmy.sample W/System.err:     at com.lmy.codec.muxer.impl.MuxerImpl.access$writeSample(MuxerImpl.kt:27)
2019-11-29 15:48:44.020 9147-9356/com.lmy.sample W/System.err:     at com.lmy.codec.muxer.impl.MuxerImpl$writeVideoSample$2.run(MuxerImpl.kt:132)
2019-11-29 15:48:44.020 9147-9356/com.lmy.sample W/System.err:     at com.lmy.codec.pipeline.impl.EventPipeline$1.handleMessage(EventPipeline.kt:36)
2019-11-29 15:48:44.020 9147-9356/com.lmy.sample W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
2019-11-29 15:48:44.020 9147-9356/com.lmy.sample W/System.err:     at android.os.Looper.loop(Looper.java:165)
2019-11-29 15:48:44.020 9147-9356/com.lmy.sample W/System.err:     at android.os.HandlerThread.run(HandlerThread.java:61)

解决方案:使用自己统计的presentationTimeUs

mBufferInfo.presentationTimeUs = pTimer.presentationTimeUs/1000
@chezi008
Copy link
Author

chezi008 commented Dec 5, 2019

VideoEncoderImpl 类中

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant