Giter VIP home page Giter VIP logo

Comments (16)

blueberryCoder avatar blueberryCoder commented on June 2, 2024

就是实时的

from livestream.

27988301 avatar 27988301 commented on June 2, 2024

不能用,跑不起来,少文件吧,能把里面的jni文件整理一下吗,感觉好乱

from livestream.

27988301 avatar 27988301 commented on June 2, 2024

尽快回复看看能不能用了

from livestream.

blueberryCoder avatar blueberryCoder commented on June 2, 2024

我查看了下,没有少文件啊,你确定你的环境配好了吗?报什么错?

from livestream.

27988301 avatar 27988301 commented on June 2, 2024

Process: com.blueberry.media, PID: 7532
java.lang.RuntimeException: 打开摄像头失败
at com.blueberry.media.VideoGatherer.openCamera(VideoGatherer.java:280)
at com.blueberry.media.VideoGatherer.initCamera(VideoGatherer.java:82)
at com.blueberry.media.MediaPublisher.initVideoGatherer(MediaPublisher.java:93)
at com.blueberry.media.MainActivity.surfaceChanged(MainActivity.java:113)一直在保这个错误,说我的Camer打不开

from livestream.

blueberryCoder avatar blueberryCoder commented on June 2, 2024

系统版本多少?什么手机

from livestream.

27988301 avatar 27988301 commented on June 2, 2024

和系统版本有关系吗? 手机是联想,手机系统是5.0.1

from livestream.

27988301 avatar 27988301 commented on June 2, 2024

还有一个问题我设置parameters.setPreviewSize(previewSize.width, previewSize.height);这句话之后就报错。
知道这个原因吗

from livestream.

blueberryCoder avatar blueberryCoder commented on June 2, 2024

我这个只在小米2s和三星A8000上测试过。
1.关于摄像头打不开的问题,检查一下这个应用是否成功获取了摄像头权限。
2.parameters.setPreviewSize(previewSize.width, previewSize.height),这句话报错,你能把错误信息发一下吗

from livestream.

27988301 avatar 27988301 commented on June 2, 2024

Process: com.blueberry.media, PID: 18072
java.lang.RuntimeException: setParameters failed
at android.hardware.Camera.native_setParameters(Native Method)
at android.hardware.Camera.setParameters(Camera.java:1876)
at com.blueberry.media.VideoGatherer.setCameraParameters(VideoGatherer.java:230)
at com.blueberry.media.VideoGatherer.initCamera(VideoGatherer.java:83)
at com.blueberry.media.MediaPublisher.initVideoGatherer(MediaPublisher.java:93)
at com.blueberry.media.MainActivity.surfaceChanged(MainActivity.java:113)能看到吗? 代码行数你应该可以看的到

from livestream.

blueberryCoder avatar blueberryCoder commented on June 2, 2024

这个很有可能是因为没有找打合适的尺寸,引起的,
for (Camera.Size size : supportedPreviewSizes
) {
if (size.width >= 320 && size.width <= 720) {
previewSize = size;
Log.i(TAG, String.format("find preview size width=%d,height=%d", previewSize.width,
previewSize.height));
break;
}
}

我设置的找尺寸,是在 320 - 720 之间,你可以扩大一下范围找找,比如设置 160 --1980 试试看
你打个断点,看看previewSize.width,previewSize.Height是不是没取到值

from livestream.

27988301 avatar 27988301 commented on June 2, 2024

parameters.setPreviewSize(1280, 720);
parameters.setPreviewFpsRange(destRange[PREVIEW_FPS_MIN_INDEX],destRange[PREVIEW_FPS_MAX_INDEX]);
// parameters.setFocusMode(FOCUS_MODE_AUTO);
parameters.setPreviewFormat(ImageFormat.NV21);
我是这样写的。把这个注释掉了,应该没问题。开始推送了,但是我用网页接收不到流。

有这样一堆log 看一下哦
4-11 17:11:32.639 7657-7687/com.blueberry.media D/PUBLISH: send packet body[0]=af,body[1]=1
04-11 17:11:32.662 7657-7687/com.blueberry.media D/PUBLISH: send packet body[0]=af,body[1]=1
04-11 17:11:32.686 7657-7687/com.blueberry.media D/PUBLISH: send packet body[0]=af,body[1]=1
04-11 17:11:32.694 178-7719/? E/CameraHal_Marvin: OV2680: Sensor_IsiExposureControlIss: set: g=6.375000, Ti=0.030008, skip=0
04-11 17:11:32.711 7657-7687/com.blueberry.media D/PUBLISH: send packet body[0]=af,body[1]=1
04-11 17:11:32.734 7657-7687/com.blueberry.media D/PUBLISH: send packet body[0]=af,body[1]=1
04-11 17:11:32.757 7657-7687/com.blueberry.media D/PUBLISH: send packet body[0]=af,body[1]=1
04-11 17:11:32.780 7657-7687/com.blueberry.media D/PUBLISH: send packet body[0]=af,body[1]=1
04-11 17:11:32.804 7657-7687/com.blueberry.media D/PUBLISH: send packet body[0]=af,body[1]=1
04-11 17:11:32.827 7657-7687/com.blueberry.media D/PUBLISH: send packet body[0]=af,body[1]=1
04-11 17:11:32.850 7657-7687/com.blueberry.media D/PUBLISH: send packet body[0]=af,body[1]=1

from livestream.

27988301 avatar 27988301 commented on June 2, 2024

279883011我的QQ,加我qq聊一下

from livestream.

blueberryCoder avatar blueberryCoder commented on June 2, 2024

这种情况是发送成功了,网页机收不到,要检查一下播放端喽

from livestream.

27988301 avatar 27988301 commented on June 2, 2024

点击“开始”的时候报出了这个。
04-11 17:17:04.678 7657-7657/com.blueberry.media E/MediaPublisher: 初始化音频编码器失败

from livestream.

blueberryCoder avatar blueberryCoder commented on June 2, 2024

这个没关系的,我打印语句写错位置了。。。

调整一下:
public void initEncoders() {
try {
mMediaEncoder.initAudioEncoder(audioParams.sampleRate, audioParams.channelCount);
} catch (IOException e) {
e.printStackTrace();
Log.e(TAG, "初始化音频编码器失败");

    }

    try {
        int colorFormat = mMediaEncoder.initVideoEncoder(videoParams.previewWidth, videoParams.previewHeight, FPS);
        mVideoGatherer.setColorFormat(colorFormat);
    } catch (IOException e) {
        e.printStackTrace();
    }
}

from livestream.

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.