AndroidFFmpeg
AndroidFFmpeg copied to clipboard
Live video (m3u8) lagging fixing suggestion
Inside player_wait_for_frame:
Comment out: /* if (sleep_time < -300000ll) { // 300 ms late int64_t new_value = player->start_time - sleep_time;
LOGI(4,
"player_wait_for_frame[%d] correcting %lld to %lld because late",
capture_stream_no, (av_gettime() - player->start_time),
(av_gettime() - new_value));
player->start_time = new_value;
pthread_cond_broadcast(&player->cond_queue);
}
*/
I suggest that this video start time correction is not needed for live videos, because streams may delay and go faster sometimes. From my observation, without this fix, video plays much smoothly and does not freeze.