Comments (7)
-
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. -
Are you using a custom room? Remember that could be bugged.
-
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.
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.
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.
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") +
"320240 " + String.valueOf(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_QVGA) + "\n") +
"352288 " + String.valueOf(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_CIF) + "\n") +
"720480 " + 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
320240 false
352288 true
720480 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.
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.
Perfect, man) Ain't one unsupported resolutions in new version. Thanks.
from rootencoder.
Closing issue. Thank for report, open other issue if you have other question or problem :)
from rootencoder.
Related Issues (20)
- How to apply new resolution when camera switched HOT 2
- how to add Dynamic Watermark HOT 1
- How can i stream images obtained from TextureView HOT 14
- Is MediaCodec.BufferInfo‘s size is length, not endIndex ? HOT 4
- sample app rtmp stream contains buffered video before clicking Start Stream button HOT 4
- setLogs() removed? HOT 2
- Play videos with 90 degree rotation when 'Surface filter' is used HOT 4
- rtp add fec algorithm or congestion control algorithm HOT 2
- rtspFromFile always show dropping frame that's going backward in time HOT 6
- switching between displayService and rtspFromFile with continuous timestamp HOT 4
- Unimplemented message type: null HOT 1
- Different resolution in stream and local recording ? HOT 2
- The streaming quality varies significantly when using different models of phones HOT 10
- Camera screen black when turn on device after switch off. HOT 16
- RTS stream url pattern failed HOT 1
- Fast moving objects are blurred HOT 1
- The issue when using RtmpFromFile and SurfaceFilterRender together. HOT 3
- cannot set bitrate in displayBase to increase the video quality HOT 4
- IPv4 and IPv6 HOT 3
- RtmpCamera2 seems to have a critical memory leak issue. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rootencoder.