Skip to content
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

Caused by java.lang.IllegalStateException: BaseEncoder.start in BaseEncoder.java #1568

Open
ChiragAtharva opened this issue Sep 4, 2024 · 1 comment

Comments

@ChiragAtharva
Copy link

Describe the bug
A RuntimeException occurs when attempting to start streaming using the RootEncoder library version 2.4.5. The error is related to the BaseEncoder class and seems to happen during the initialization of the encoder.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the streaming feature in the app.
  2. Click on the "Start Stream" button.
  3. The app crashes with a RuntimeException.

Expected behavior
The streaming should start successfully without causing any exceptions.

Screenshots
N/A

Smartphone (please complete the following information):

  • Library version: 2.4.5
  • Device: Samsung A10, Samsung On7xelte
  • OS: Android 8.1 (SDK 27), Android 9 (SDK 28)
  • Media server: SRS, version 5.0
  • Class used: RtmpCamera1

Additional context
The exception occurs with the following error:

Exception java.lang.RuntimeException:
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4519)
  at android.app.ActivityThread.handleSendResult (ActivityThread.java:4563)
  at android.app.ActivityThread.-wrap21
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1779)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:7000)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:441)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1408)
Caused by java.lang.IllegalStateException:
  at com.pedro.encoder.BaseEncoder.start (BaseEncoder.java:78)
  at com.pedro.library.base.StreamBase.startSources (StreamBase.kt:379)
  at com.pedro.library.base.StreamBase.startStream (StreamBase.kt:152)

Environment details

  • Android Versions: 8.1 (SDK 27), 9 (SDK 28)
  • Devices: Samsung A10, Samsung On7xelte
  • Library: com.github.pedroSG94.RootEncoder:library:2.4.5

@pedroSG94
Copy link
Owner

Hello,

This seems an error in your code because this crash happens when you fail prepareVideo or prepareAudio methods call:
https://github.com/pedroSG94/RootEncoder/blob/2.4.5/encoder/src/main/java/com/pedro/encoder/BaseEncoder.java#L78

Are you sure that prepareVideo and prepareAudio returned true and you called it before startStream?
Using StreamBase you only need call it the first time to configure parameters. After that, StreamBase automatically do it for you when it is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants