Giter Club home page Giter Club logo

Comments (7)

pedroSG94 avatar pedroSG94 commented on May 18, 2024
  1. First of all, are you using custom activity?
    If not, use it and check with 1280x720 or bellow resolution. Let me know if the stream work with it.

  2. Are you using a custom room? Remember that could be bugged.

  3. rtmpBUilder.getResolutions() only get all camera resolutions that your device can display in the camera. You can go to your default camera app, check video resolutions and use it hardcoding in the preparevideo method.

If it doesn't work, show me the error.
I will fix to dont show resolutions more high in that method, that should prevent show resolutions above max encoder capacity.

from rootencoder.

pedroSG94 avatar pedroSG94 commented on May 18, 2024

I did a little fix that should discard resolutions don't supported for your encoder, this should discard 1872x1120 or 1920x1088 in your huawei:
094b08f

This fix need API21+

from rootencoder.

nicfedor avatar nicfedor commented on May 18, 2024

No. man. Something wrong. my app crashes when i change library to 1.0.9 Something wrong with collections.

FATAL EXCEPTION: main
Process: flru.fotonick.videostream, PID: 27658
java.lang.RuntimeException: Unable to start activity ComponentInfo{flru.fotonick.videostream/flru.fotonick.videostream.VideoActivity}: java.util.ConcurrentModificationException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2648)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2728)
at android.app.ActivityThread.access$1200(ActivityThread.java:188)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1539)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5938)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:987)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)
Caused by: java.util.ConcurrentModificationException
at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:573)
at com.pedro.encoder.input.video.Camera1ApiManager.getPreviewSize(Camera1ApiManager.java:238)
at com.pedro.builder.base.BuilderBase.getResolutions(BuilderBase.java:132)
at flru.fotonick.videostream.VideoActivity.onCreate(VideoActivity.java:144)
at android.app.Activity.performCreate(Activity.java:6151)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2595)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2728) 
at android.app.ActivityThread.access$1200(ActivityThread.java:188) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1539) 
at android.os.Handler.dispatchMessage(Handler.java:111) 
at android.os.Looper.loop(Looper.java:194) 
at android.app.ActivityThread.main(ActivityThread.java:5938) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:987) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782) 

from rootencoder.

nicfedor avatar nicfedor commented on May 18, 2024

What i found out about my phone camera. I did

    List<Camera.Size> sizesVideoCamera = parameters.getSupportedVideoSizes();
    List<Camera.Size> sizesPhotoCamera = parameters.getSupportedPictureSizes();
    List<Camera.Size> sizesPreviewCamera = parameters.getSupportedPreviewSizes();

videosizes
176x144
320x240
352x288
480x320
640x480
864x480
1280x720
1920x1080
720x480
1280x736
1920x1088
3840x2160
3840x2176

Photosizes
320x240
640x480
1024x768
1280x720
1280x768
1280x960
1600x1200
1920x1088
2048x1536
2560x1920
3264x1840
3264x2448
3104x3104
4160x2336
4160x3120

Previewsizes (this is the same what rtmpbuilder.getresolutions give me)
1872x1120
1920x1088
1920x1080
1440x1080
1280x720
960x540
800x800
864x480
800x480
720x480
640x480
480x368
480x320
352x288
320x240
176x144

BUT! I checked also supported camcoder formats
String carmcoder = "176144 " + String.valueOf(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_QCIF) + "\n") +
"320
240 " + String.valueOf(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_QVGA) + "\n") +
"352288 " + String.valueOf(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_CIF) + "\n") +
"720
480 " + String.valueOf(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_480P) + "\n") +
"720p " + String.valueOf(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_720P) + "\n") +
"1080p " + String.valueOf(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_1080P) + "\n") +
"2160p " + String.valueOf(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_2160P) + "\n") +

and got this

176144 true
320
240 false
352288 true
720
480 true
720p true
1080p false
2160p false

So, you see, any resolution more than maximum supported by camcoder cause crash. And as i understand you check preview sizes, not camcoder sizes

at com.pedro.encoder.input.video.Camera1ApiManager.getPreviewSize(Camera1ApiManager.java:238)

from rootencoder.

pedroSG94 avatar pedroSG94 commented on May 18, 2024

Yes I see preview sizes because you need set it to camera in this line:
https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/encoder/src/main/java/com/pedro/encoder/input/video/Camera1ApiManager.java#L83

I fixed the error in the last commit and should work now, try with version 1.1.0

from rootencoder.

nicfedor avatar nicfedor commented on May 18, 2024

Perfect, man) Ain't one unsupported resolutions in new version. Thanks.

from rootencoder.

pedroSG94 avatar pedroSG94 commented on May 18, 2024

Closing issue. Thank for report, open other issue if you have other question or problem :)

from rootencoder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.