-
-
Notifications
You must be signed in to change notification settings - Fork 757
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
Recording video with multiple part, screen stuck #1479
Comments
HI @pedroSG94 We are getting bitrate every second in the method of OnNewBitrate() when we are connecting with rtmp url. In my case, I am not connecting with url. When recording how could I get the bitrate every second ?? Is there any way to get the current bitrate while recording only? |
Hello, Currently I haven't a way to get bitrate of the file record. This is because the bitrate should be always the same (you are recording in local disk) because you haven't external problems involved like internet connection so you haven't a reason to reduce or increase the bitrate depend of your current bitrate. I can implement it. Do you have any reason to need it? It should be constant |
Hi @pedroSG94 Thanks!. I record the video every 10sec and upload it into s3 bucket. So the video takes more time to upload, in my case i need to reduce the video quality of next chunk of video based on upload time. If we have better internet connection again needs to restore the bitrate into high quality. Is there any way to improve the video Quality using AB logic?? |
Bitrate callback for record was added here: implementation 'com.github.pedroSG94.RootEncoder:library:b3e3675511'
Did you test using threading or coroutines? For example: CoroutineScope(Dispatchers.IO).launch {
genericStream.stopRecord()
//if you are using Camera1Base or Camera2Base you will need call prepare methods here
genericStream.startRecord(path)
}
I think it is not totally possible because you are stopping and starting the record again. This produce that you lose a bit of frames in the time you start again and a keyframe is detected (you need a keyframe to start recording a video). The best way you have is create a large video and after finish chunk this video in multiple videos and then upload it but i'm not sure if this is useful for you.
This is a question that you need to solve for your case. Maybe you can try check your current bandwidth and modify the bitrate on fly depend of the current bandwith. |
Thanks @pedroSG94 I will look into it. |
Hi @pedroSG94 When I am starting the record without connecting with RTMP URL. OnNewBitrate is not worked in my activity class. Only I am connecting with RTMP URL this method working fine. May I know the reason, why OnNewBitrate is not working while recording? Do I need to change anything? |
Hello, Did you try using the callback provided in RecordController.Listener used in startRecord method? |
Yes @pedroSG94 I am using Recordcontroller.Listener in startRecord method. Also tried with implements callback also. It is not working. |
Can you share me the code used in startRecord using RecordController.Listener? |
Here is the code: @pedroSG94
|
That is the problem. Replace with this: rtmpCamera2.startRecord(FILE_PATH, new RecordController.Listener() {
@Override
public void onStatusChange(RecordController.Status status) {
System.out.println("record state: " + status.name());
}
@Override
public void onNewBitrate(long bitrate) {
}
}); Remember use the gradle shared: implementation 'com.github.pedroSG94.RootEncoder:library:b3e3675511' |
Thanks @pedroSG94 It's working fine now. |
Closing as completed. |
The text was updated successfully, but these errors were encountered: