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
Pause status on RecordController.Listener #1447
Comments
Hello, When you pause/resume the video, the status is send inmediately: So, I don't understand that 2 seconds. |
Anyway you can try this. 1- Create a custom recordController: class ExtendedRecordController: AndroidMuxerRecordController() {
//in micro seconds
fun getVideoTs(): Long {
return this.videoInfo.presentationTimeUs
}
//in micro seconds
fun getAudioTs(): Long {
return this.audioInfo.presentationTimeUs
}
} 2- Set record controller: val recordController = ExtendedRecordController()
genericStream.setRecordController(recordController) 3 - Get ts on Pause callback: genericStream.startRecord(path) {
when (it) {
RecordController.Status.STARTED -> TODO()
RecordController.Status.STOPPED -> TODO()
RecordController.Status.RECORDING -> TODO()
RecordController.Status.PAUSED -> {
recordController.getVideoTs()
recordController.getAudioTs()
}
RecordController.Status.RESUMED -> TODO()
}
} |
I'm not sure exactly why there is such a shift. I start and stop my own timer when the RecordController.Listener event occurs. But when I look at the recorded video, I see that it is 2 seconds or more long. I tested on Samsung Note10+, Redmi Note 9 Pro, Xiaomi 10 Pro devices. I had the same problem with all of them.
} When the Pause or Stop actions are triggered, I stop my own timer. But the video recording does not stop immediately, it continues recording. For this reason, there is a difference of 2-3 seconds between my own timer and the real video. By the way, I'll try your suggestion. |
Hello Pedro,
I am developing an application where I stream along with video recording. In this application, the user can mark certain periods of the video and use it later. In order to show this time during the flow, I use a different timer and increase it every second. Therefore, I need the recorded video duration to also be exactly equal to the time information I advance. In order to do this, I need to capture the exact moments when the video recording starts, the exact moments it pauses, or the exact moments the recording ends. Using RecordListener, I can capture the exact moment when video recording starts with the RECORDING status. However, the PAUSED status that is triggered when I pause the video recording, is not triggering at the exact moment. The recording continues 2 or more seconds and then pauses. Therefore, the time variable I manage does not match the actual video duration. Serious shifts occur when rendering the moments marked by the user.
I need to clearly capture the moment when video recording is paused or stopped completely. Is there any way to do this?
The text was updated successfully, but these errors were encountered: