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
A VideoCapturer must provide at least one supported VideoFormat #126
Comments
Hey @samneolab Unfortunately this stack trace is misleading. We typically see this stack trace when connection to the Camera fails. Do you only see this issue on certain devices? Are you interacting with the Camera API anytime before creating a LocalVideoTrack? Thanks! |
@aaalaniz We're seeing this same stacktrace as well. We dont appear to be doing anything besides initializing the CameraCapturer before attaching to the LocalVideoTrack. Our most problematic devices seem to be the LG G Vista and LG L70. Its also worth noting we use custom |
Thanks for writing in @erito Do you see this crash occur every time or intermittently on these devices? I also noticed you mentioned local media. What version of the SDK are you using? |
We're running 1.0.2. That was incorrect when I mentioned LocalMedia, we're attaching the |
Hey @erito This is all very helpful information. We have seen this crash occur intermittently on some devices. I will have one of these devices ordered and see if I can reproduce and come up with a bug fix or suitable workaround. Do you mind sharing a snippet of how you are setting customer Thanks! |
Sure, heres the function that initializes the LocalVideoTrack. private fun constructVideoTrack(initCamera: Boolean) : LocalVideoTrack {
if (initCamera) {
val source = cameraCapture.cameraSource
cameraCapture = CameraCapturer(context, source)
}
val constraints = VideoConstraints.Builder()
.maxFps(40)
.minFps(10)
.maxVideoDimensions(VideoDimensions.HD_960P_VIDEO_DIMENSIONS)
.build()
return LocalVideoTrack.create(context, enabled, cameraCapture, constraints)
} |
Kotlin! Nice Thanks @erito ! |
We are running into this sporadically as well. We were on 1.0.0 when the errors occurred, but we have just upgraded to the latest so we will find out if it is still a problem. We saw this on these two devices: If there are any effective mitigation strategies, let us know. Could we catch and retry the create? |
Hey @samneolab @erito and @mcorner I'm working on this issue this week. Expect either a fix in Thanks! |
I am now able to reproduce this issue. I am still putting together a workaround. We went ahead and released Appreciate everyone's patience. |
Any estimated release date for 1.1.2? :) |
One more update.... I think I have a fix for this issue. I deprecated a method in this sprint so going to skip a Release will be as early as tomorrow and no later than Friday. Thanks everyone. |
Amazing @aaalaniz !! Thank you for your help and keeping us posted |
|
@aaalaniz I am seeing the issue even after upgrading the version to 1.2.0. I am facing the error after the phone goes to background and comes to foreground. When the phone goes to background I am releasing the localVideoTrack and I am making it null and then I am trying to create the localVideoTrack when phone comes back by using the following code: LocalVideoTrack.create(mContext, true, va.cameraCapturer); Let me know how can I solve this issue. |
Hey @kesh-1139 What device are you seeing this on and can you provide a full log? Thanks |
@aaalaniz I am able to get the log only with one device that is moto e1 and the crash log is as follows java.lang.IllegalStateException: A VideoCapturer must provide at least one supported VideoFormat For all my other devices (moto g3, Asus zenfone1 etc ) its crashing and I am not getting the log in Android studio. Its just crashing. Please help me out with this. |
@aaalaniz if I do not make localVideoTrack null before going to background, the app does not crash but video does not start and it freezes in the previous state. |
@kesh-1139 Can you provide the following information:
I also want to confirm the reproduction steps. Tell me if this is correct. Steps to Reproduce
Expected Result Actual Result Again...any logs you can grab are incredibly helpful. |
@aaalaniz Please find the information asked below:
I have written the following code in onStop instead of onPause:
I have written the following code in onResume():
|
@aaalaniz Please let me know if you need more details. Steps,expected and actual results are same. Home button for making the application go to background |
Hey @kesh-1139 I have two recommendations.
Hope this helps. |
@aaalaniz I will update my code with your recommendations and will update you. Thanks for your help. |
@aaalaniz I have tried your recommendations. I have tried releasing in onPause and creating it in onResume. But its still crashing. |
Hey @kesh-1139 At this point I absolutely need a log because I see nothing wrong with the snippets you provided. Have you tried using |
Hey @aaalaniz I have tried with everything possible I am not getting the crash log. I will update you with some more details sooner. |
@aaalaniz Great! Will update in our next minor release. Did the problem stem from not releasing the LocalMediaTrack? |
Hey @erito There was a race between the teardown of the video track and the releasing of the camera. There were some cases where the camera was not properly released while tearing down the track. The problem would then manifest as a failure to connect to the camera service. The changes in |
Closing for now. If anyone continues experiencing this issue after upgrading to Thanks! |
@aaalaniz I am getting crash when starting video second time, after I stop video for the first time, Below is my code which is producing crash:
Below are the logs:
Can you please help me with this one and let me know what wrong am I doing.. |
Hey @kesh-1139 Can you share how you are stopping video? Are you calling Thanks |
Hey @kesh-1139 Sorry, I mixed up users who have commented. Based on your previous snippets it does appear that you are calling
|
@aaalaniz I am calling release when stopping video. When I start the video the camera capturer starts with front camera only and not from back camera |
Hey @aaalaniz I am facing an issue in camera capturer, its not related to the above issue... |
Hey @aaalaniz I have fixed the second one. Thanks for your help. |
Hey @kesh-1139 I have this issue in my sprint. I appreciate your patience as I figure out the problem. I have a pretty nasty workaround you can try Execute this right after being granted CAMERA permission from user but before creating a LocalVideoTrack.
|
Hey @aaalaniz Thanks a lot for the work around. Mentioned work around is for the crash right? |
@kesh-1139 yes |
@aaalaniz ok Thank you. Can you please provide me insights on the following crash:
Below is the code which is causing this crash and this is observed while closing the room
|
Hey @kesh-1139 Does this crash occur every time and on every device your app runs on? |
Hey @aaalaniz Yes it happens every time and on all devices. |
Hey @kesh-1139 I'm investigating the original issue you reported about the failure to connect to the camera service. I'm having trouble reproducing the issue. Can you provide the exact steps that reproduce this issue. Code snippets are always helpful and if it is a lot of code I recommend posting as a Github Gist. Also can you share the logic happening in this method call?
Based on the stack trace that you provided, our SDK is not able to connect to the Camera service. This can be caused by either a race condition in our SDK or external code not properly releasing the camera resource. |
Hey @aaalaniz Following is the logic in the method call
Before stopping video I am switching to back camera by the following method
Then when again I start the video I am getting this crash. Video is released properly. The thread itself has my video release code in the above discussions. If you need more details please let me know |
Hey @kesh-1139 This is the test case that I have written. This test is currently passing on my devices and I think it is an accurate representation of the steps you are describing. A couple follow-up questions:
|
Also please post a full log so that I can trace the sequence of events @kesh-1139 Thanks! |
Turn up the log level using the following snippet and post a log @kesh-1139
|
@aaalaniz I am making another change along with your steps, after releasing the video track I am making |
Hey @aaalaniz The work around is not working I am getting the same exception in the method cameraCapturer.getSupportedFormats |
Hey @kesh-1139 Please post a complete log of when you are observing the crash. I cannot provide any further guidance until I see a log. Thanks |
I am closing this bug due to inactivity. Please reopen with a complete log. Thanks! |
@aaalaniz Hello.. I am also experiencing the same error. What i have done is that created the local video track in onResume and released it in onPause. But when i open another activity trying to use camera, it crashes |
Hey @rishabhja1994 Can you open a separate issue for the problem you are describing and provide snippets of how you are using the camera in the other activity? Thanks! |
Hi Thanks for your reply. Should i share my complete code with you? |
Hey @rishabhja1994 Open a separate Github issue and share your code there. Thanks! |
Hi, sometimes I faced this exception and it caused crash. Could you help me to solve this one. Thanks a lot
Caused by java.lang.IllegalStateException: A VideoCapturer must provide at least one supported VideoFormat at com.twilio.video.Preconditions.checkState(Preconditions.java:453) at com.twilio.video.LocalVideoTrack.create(LocalVideoTrack.java:70) at com.twilio.video.LocalVideoTrack.create(LocalVideoTrack.java:44) at com.neo_lab.calling.presentation.ui.video_calling_channel.VideoCallingChannelActivity.channelConferenceConfigureAudioInitAudioAndVideoTracks(VideoCallingChannelActivity.java:670) at com.neo_lab.calling.presentation.ui.video_calling_channel.VideoCallingChannelActivity.onRequestPermissionsResult(VideoCallingChannelActivity.java:593) at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:6582) at android.app.Activity.dispatchActivityResult(Activity.java:6460) at android.app.ActivityThread.deliverResults(ActivityThread.java:3695) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742) at android.app.ActivityThread.-wrap16(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
The text was updated successfully, but these errors were encountered: