简体   繁体   中英

MediaMuxer playback issue with ExoPlayer

I am using the MediaMuxer class to edit a video file for playback with the ExoPlayer library. Basically what I am doing is extracting video frames from an mp4 decoding those frames, re-encoding those frames and muxing using muxer.writeSampleData(..)

This is all fine and well and I can successfully playback a video after this is done with my ExoPlayer implementation, UNTIL the duration of the video is >= 20 seconds. When I attempt to use a video(.mp4) that is at least 20 seconds long is when the playback issue occurs. There are no errors thrown in the logs or any other exceptions for either the MediaMuxer or the ExoPlayer objects.

The issue with playback is strange, but happens in the exact same manner regardless of video length >= 20 seconds. When the playback hits the 11 seconds mark (11 seconds into the video) the frame freezes and the ExoPlayer logs indicate that the state of the player has gone from "Ready" to "Buffering" and it remains in that state indefinitely. No other errors or other relevant information is logged.

ExoPlayer logs print nothing helpful in tracking down the issue and because of this I am not sure where the issue lies. Somewhere in the video editing code where I extract the frames, decode the frames, encode the frames and mux them or in the ExoPlayer library? (the original video plays fine regardless of length) The videos that get stuck at the 11 second mark in my ExoPlayer implementation play fine on my devices default MediaPlayer.

Has anyone any experience in doing something similar? Have any ideas on where the issue might be with the experienced issues or have any any further ideas on how to debug this?

问题是在某些情况下解码器会写入大量样本,而我的exoplayer实现由于我设置的最大样本量太小而无法处理它,这是通过调整解码器的最大样本量来解决的或exoplayer实现。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM