GithubHelp home page GithubHelp logo

pili-engineering / pldroidmediastreaming Goto Github PK

View Code? Open in Web Editor NEW
1.4K 103.0 459.0 64.72 MB

PLDroidMediaStreaming 是七牛推出的一款适用于 Android 平台的推流 SDK,支持 RTMP 推流,h.264 和 AAC 编码,硬编、软编支持。具有丰富的数据和状态回调,方便用户根据自己的业务定制化开发。具有直播场景下的重要功能,如:美颜、背景音乐、水印等功能。PLDroidMediaStreaming 是现在目前重点维护的版本,自带采集模块也支持用户自己做采集端。

Home Page: https://github.com/pili-engineering/PLDroidMediaStreaming/wiki

License: Apache License 2.0

Java 97.40% GLSL 2.60%

pldroidmediastreaming's Introduction

PLDroidCameraStreaming

PLDroidCameraStreaming 是一个适用于 Android 的 RTMP 直播推流 SDK,可高度定制化和二次开发。特色是同时支持 H.264 软编/硬编和 AAC 软编/硬编。支持 Android Camera 画面捕获,并进行 H.264 编码,以及支持 Android 麦克风音频采样并进行 AAC 编码;还实现了一套可供开发者选择的编码参数集合,以便灵活调节相应的分辨率和码率;同时,SDK 提供数据源回调接口,用户可进行 Filter 处理。借助 PLDroidCameraStreaming ,开发者可以快速构建一款类似 MeerkatPeriscope 的 Android 直播应用。

功能特性

  • 支持 H.264 和 AAC 软编(推荐)
  • 支持 H.264、H.265 和 AAC 硬编
  • 软编支持 Android Min API 15(Android 4.0.3)及其以上版本
  • 硬编支持 Android Min API 18(Android 4.3)及其以上版本
  • 支持构造带安全授权凭证的 RTMP 推流地址
  • 支持 RTMP 封包及推流
  • 支持 RTMP 推流自适应网络质量动态切换码率或自定义策略
  • 支持内置美颜,以及可动态调节美颜效果
  • 支持数据源回调接口,可自定义 Filter (滤镜) 特效处理
  • 支持前后置摄像头,以及动态切换
  • 支持自动对焦
  • 支持手动对焦
  • 支持 Encoding Mirror 设置
  • 支持 Zoom 操作
  • 支持 Mute/Unmute
  • 支持闪光灯操作
  • 支持纯音频推流,以及后台运行
  • 支持截帧功能
  • 支持动态更改 Encoding Orientation
  • 支持动态切换横竖屏
  • 支持动态水印
  • 支持动态文字与贴图
  • 支持蓝牙麦克风
  • 支持后台推流
  • 支持双声道立体声
  • 支持 QUIC 推流
  • 支持 ARM, ARMv7a, ARM64v8a, X86 主流芯片体系架构
  • 支持 SEI 信息发送
  • 支持 SRT 推流

PLDroidCameraStreaming 文档

详细的开发指南请参考官方文档

设备以及系统要求

  • 设备要求:搭载 Android 系统的设备
  • 系统要求:Android 4.3(API 18) 及其以上

版本升级须知

v3.1.5

  • 从 v3.1.5 版本开始,将不再支持 armeabi 架构

v3.1.3

  • 从 v3.1.3 版本开始,HappyDNS 库务必升级到 1.0.0 版本

v3.1.2

  • 从 v3.1.2 版本开始,SDK 将不再强制要求获取 READ_PHONE_STATE 和 ACCESS_FINE_LOCATION 的权限

v3.1.1

  • 从 v3.1.1 版本开始,HappyDNS 库务必升级到 0.2.18 版本

v3.0.2

  • 从 v3.0.2 版本开始,请务必添加 android.arch.lifecycle:extensions:x.y.z 的依赖
  • 从 v3.0.2 版本开始,StreamingEnv.init(Context context) 已被弃用,请更新到 StreamingEnv.init(Context contex, String userId) 进行环境的初始化,其中,userId 代表用户的唯一标识符,用于区分不同的用户

v3.0.1

  • 从 v3.0.1 版本开始,如果您使用了 Happy DNS 库,请务必升级到 0.2.17 版本

v3.0.0

  • 从 v3.0.0 版本开始,七牛直播推流 SDK 需要先获取授权才能使用。授权分为试用版和正式版,可通过 400-808-9176 转 2 号线联系七牛商务咨询,或者 通过工单 联系七牛的技术支持。
  • v3.0.0 之前的版本不受影响,请继续放心使用。
  • 老客户升级 v3.0.0 版本之前,请先联系七牛获取相应授权,以免发生鉴权不通过的现象。
  • 基于 114 dns 解析的不确定性,使用该解析可能会导致解析的网络 ip 无法做到最大的优化策略,进而出现推流质量不佳的现象。因此建议使用非 114 dns 解析

v2.4.1

  • 从 v2.4.1 开始,VideoProfile 对 H264 格式配置的参数由 annexb 改为 avcc,之前设置为 false 的客户,需要将配置改为 true。

例如目前设有如下配置的客户:

StreamingProfile.VideoProfile vProfile =
	new StreamingProfile.VideoProfile(20, 1000 * 1024, 60, false);

需将参数调整为:

StreamingProfile.VideoProfile vProfile =
	new StreamingProfile.VideoProfile(20, 1000 * 1024, 60, true);

v2.3.0

  • 从 v2.3.0 版本开始,增加 libpldroid_streaming_puic.so 库
  • libpldroid_streaming_core.so 依赖于 libpldroid_streaming_puic.so,无论是否启用 QUIC 推流,都需要包含 libpldroid_streaming_puic.so 库

v2.2.0

  • 从 v2.2.0 版本开始,须要在 build.gradle 中删除 QoS 依赖
dependencies {
    ...
    compile 'com.qiniu.pili:pili-android-qos:0.8.+'
    ...
}

v2.1.0

  • 使用录屏功能前,须要在 AndroidManifest.xml 中注册 SDK 内置的 Activity:
<activity
        android:name="com.qiniu.pili.droid.streaming.screen.ScreenCaptureRequestActivity"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" >
</activity>
  • pili-android-qos 最新版本为 0.8.13

  • 更新 StreamingPreviewCallback#onPreviewFrame

StreamingPreviewCallback#onPreviewFrame(byte[] data, int width, int height)

调整为

/**
* Called if the {@link StreamingPreviewCallback} registered.
*
* @param data the contents of the preview frame in fmt format
* @param width the width of the frame
* @param height the height of the frame
* @param rotation set the clockwise rotation of frame in degrees to achieve the same effect of preview display.
* @param fmt the format of the frame. See also {@link com.qiniu.pili.droid.streaming.av.common.PLFourCC}
* @param tsInNanoTime the timestamp of the frame
*
* */
boolean StreamingPreviewCallback#onPreviewFrame(byte[] data, int width, int height, int rotation, int fmt, long tsInNanoTime);

v2.0.1

从 v2.0.1 开始:

  • 删掉废弃的 CameraStreamingManager,可使用 MediaStreamingManager
  • 须在宿主项目中的 build.gradle 中加入如下语句:
dependencies {
    ...
    compile 'com.qiniu:happy-dns:0.2.+'
    compile 'com.qiniu.pili:pili-android-qos:0.8.+'
    ...
}
  • 废弃的 StreamingPreviewCallback#onPreviewFrame(byte[] bytes, Camera camera) 被删掉,可使用 StreamingPreviewCallback#onPreviewFrame(byte[] bytes, int width, int height)

  • AudioSourceCallback#onAudioSourceAvailable(ByteBuffer byteBuffer, int size, boolean eof) 接口回调中增加时间戳信息,更改为 AudioSourceCallback#onAudioSourceAvailable(ByteBuffer byteBuffer, int size, long tsInNanoTime, boolean eof)

v2.0.0 Beta

v2.0.0 Beta 开始,SDK 由 PLDroidCameraStreaming 更名为 PLDroidMediaStreaming,将会提供更丰富的功能接口。有如下重大更新:

  • 新增 MediaStreamingManager,废弃 CameraStreamingManager 且不再被维护
  • 新增一些辅助类并废弃相关的类
    • 新增 StreamingStateChangedListener,并废弃 CameraStreamingManager#StreamingStateListener
    • 新增 StreamingState,并废弃 CameraStreamingManager#STATE
    • 新增 StreamingSessionListener,并废弃 CameraStreamingManager#StreamingSessionListener
    • 新增 AVCodecType,并废弃 CameraStreamingManager#EncodingType
  • 包名更新为 com.qiniu.pili.droid.streaming.*;,因此需要更新混淆相关代码

v1.6.1

v1.6.1 开始,为了便于用户更好地定制化,将 TransformMatrix 信息加入到 SurfaceTextureCallback#onDrawFrame。因此更新到 v1.6.1 版本之后,若实现了 SurfaceTextureCallback 接口,需要将

int onDrawFrame(int texId, int texWidth, int texHeight);

更改为:

int onDrawFrame(int texId, int texWidth, int texHeight, float[] transformMatrix);

v1.6.0

v1.6.0 开始,在使用 SDK 之前,需要保证 StreamingEnv 被正确初始化 ,否则在构造核心类 CameraStreamingManager 的阶段会抛出异常。具体可参看 Demo

StreamingEnv.init(getApplicationContext());

v1.4.6

从 v1.4.6 版本开始,需要在宿主项目中的 build.gradle 中加入如下语句:

dependencies {
    ...
    compile 'com.qiniu:happy-dns:0.2.7'
    ...
}

否则,在运行时会发生找不到 happydns 相关类的错误。

v1.6.0

v1.6.0 开始,在使用 SDK 之前,需要保证 StreamingEnv 被正确初始化 ,否则在构造核心类 CameraStreamingManager 的阶段会抛出异常。具体可参看 Demo

StreamingEnv.init(getApplicationContext());

v1.6.1

v1.6.1 开始,为了便于用户更好地定制化,将 TransformMatrix 信息加入到 SurfaceTextureCallback#onDrawFrame。因此更新到 v1.6.1 版本之后,若实现了 SurfaceTextureCallback 接口,需要将

int onDrawFrame(int texId, int texWidth, int texHeight);

更改为:

int onDrawFrame(int texId, int texWidth, int texHeight, float[] transformMatrix);

反馈及意见

当你遇到任何问题时,可以通过在 GitHub 的 repo 提交 issues 来反馈问题,请尽可能的描述清楚遇到的问题,如果有错误信息也一同附带,并且在 Labels 中指明类型为 bug 或者其他。

通过这里查看已有的 issues 和提交 Bug。

pldroidmediastreaming's People

Contributors

boleliu avatar geeklok avatar herashowfeng avatar jhuster avatar jpxiong avatar kevinhuo avatar lawder avatar longbai avatar tanhx2008 avatar why404 avatar york1996 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pldroidmediastreaming's Issues

armeabi .so files

Currently Pili has only armeabi-v7a and arm64 support. Could you please also release armeabi files.

onPreviewFrame is not called

I followed the instruction and the Demo code to implement StreamingPreviewCallback (not SurfaceTextureCallback).

But I do not see the onPreviewFrame being called. What am I doing wrong?

Also what is the proper way to save the byte[] data to mp4 file?

[Feature Requests] Please consider the following feature requests

Firstly would like to thank for such a great library. I have been very happy to move to Pili from our own custom library. This library has shaped up great in the past 1 month or so. The separation of Preview from actual output in v1.3.5 is the best update so far. I am loving it.

But there are few features that is missing, we would like to have, which we had in our library but are missing from Pili. Could you consider adding them in upcoming versions and could you let us know if these are feasible and approximate timeline

  1. Pinch Zoom Camera during streaming (High priority)
  2. Filters API. Plug-n-Play modular architecture probably, so that we can add our own filters later. (High priority)
  3. Square aspect ratio (Low priority)

How to add Video Filters

in 1.4.1 in onDrawFrame() we could process the textureId to add filters. But onDrawFrame is only called when we use Software encoding and not the Hardware encoding.

Will the behaviour change in near future so that we can add filters even for Hardware encoding?

Camera Zoom and Click-To-Focus feature

Can you please add Pinch Zoom and Click-To-Focus feature as well. I used the below code to add that to camera

@OverRide
public boolean onTouchEvent(MotionEvent event) {
if(camera == null)
return false;
// Get the pointer ID
Camera.Parameters params = camera.getParameters();
int action = event.getAction();

    if (event.getPointerCount() > 1) {
        // handle multi-touch events
        if (action == MotionEvent.ACTION_POINTER_DOWN) {
            mDist = getFingerSpacing(event);
        } else if (action == MotionEvent.ACTION_MOVE && params.isZoomSupported()) {
            camera.cancelAutoFocus();
            handleZoom(event, params);
        }
    } else {
        // handle single touch events
        if (action == MotionEvent.ACTION_UP) {
            handleFocus(event, params);
        }
    }
    return true;
}

private void handleZoom(MotionEvent event, Camera.Parameters params) {
    int maxZoom = params.getMaxZoom();
    int zoom = params.getZoom();
    float newDist = getFingerSpacing(event);
    if (newDist > mDist) {
        //zoom in
        if (zoom < maxZoom)
            zoom++;
    } else if (newDist < mDist) {
        //zoom out
        if (zoom > 0)
            zoom--;
    }
    mDist = newDist;
    params.setZoom(zoom);
    camera.setParameters(params);
}

public void handleFocus(MotionEvent event, Camera.Parameters params) {
    if (params.getMaxNumFocusAreas() == 0)
    {
        return;
    }

    int pointerId = event.getPointerId(0);
    int pointerIndex = event.findPointerIndex(pointerId);
    // Get the pointer's current position
    float x = event.getX(pointerIndex);
    float y = event.getY(pointerIndex);

    List<String> supportedFocusModes = params.getSupportedFocusModes();
    if (supportedFocusModes != null && supportedFocusModes.contains(Camera.Parameters.FOCUS_MODE_AUTO)) {

        float touchMajor = event.getTouchMajor();
        float touchMinor = event.getTouchMinor();
        Rect touchRect = new Rect((int)(x - touchMajor / 2), (int)(y - touchMinor / 2), (int)(x + touchMajor / 2), (int)(y + touchMinor / 2));

        Rect focusArea = new Rect();

        focusArea.set(touchRect.left * 2000 / cameraPreviewFrame.getWidth() - 1000,
                touchRect.top * 2000 / cameraPreviewFrame.getHeight() - 1000,
                touchRect.right * 2000 / cameraPreviewFrame.getWidth() - 1000,
                touchRect.bottom * 2000 / cameraPreviewFrame.getHeight() - 1000);

        // Submit focus area to camera

        ArrayList<Camera.Area> focusAreas = new ArrayList<Camera.Area>();
        focusAreas.add(new Camera.Area(focusArea, 1000));

        params.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO);
        params.setFocusAreas(focusAreas);
        camera.setParameters(params);

        // Start the autofocus operation
        camera.autoFocus(new Camera.AutoFocusCallback() {
            @Override
            public void onAutoFocus(boolean b, Camera camera) {
                // currently set to auto-focus on single touch
            }
        });
    }
}

/** Determine the space between the first two fingers */
private float getFingerSpacing(MotionEvent event) {
    // ...
    float x = event.getX(0) - event.getX(1);
    float y = event.getY(0) - event.getY(1);
    return (float)Math.sqrt(x * x + y * y);
}

FFmpegMuxer.prepare():I/O error

Hello, I am trying to stream to Youtube Live Server now.

But stream with pldroid is not started with these error.

How can I solve this problem?

And Stream video resolution is 720x1280. How can I change this resolution to 1280x720?

Thank you

Error about stream not starting problem

I am trying to connect
rtmp.youtube.com/live2
so I id: "live2" , title: "live2", hub: "/"
make pldroid try to connect rtmp://rtmp.youtube.com///live2?key=secret
Please fix to able to insert blank in hub or id value.

09-08 23:42:12.235  12616-12616/com.pili.pldroid.streaming.camera.demo I/StreamingBaseActivity﹕ onStateChanged state:5
09-08 23:42:12.235  12616-12616/com.pili.pldroid.streaming.camera.demo I/Choreographer﹕ Skipped 33 frames!  The application may be doing too much work on its main thread.
09-08 23:42:12.235  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ onMeasure target=0.5625 width=[MeasureSpec: EXACTLY 720] height=[MeasureSpec: EXACTLY 1230],x:720,y:1280
09-08 23:42:12.235  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ new size=691x1230 + padding 0x0
09-08 23:42:12.235  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ onMeasure target=0.5625 width=[MeasureSpec: EXACTLY 691] height=[MeasureSpec: EXACTLY 1230],x:720,y:1280
09-08 23:42:12.235  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ aspect ratio is good (target=0.5625, view=691x1230)
09-08 23:42:12.245  12616-13049/com.pili.pldroid.streaming.camera.demo I/CameraStreamingManager﹕ startStreaming mRecordingEnabled=false,mIsPreviewReady=true,mIsOnlyAudioStreaming=false
09-08 23:42:12.245  12616-13049/com.pili.pldroid.streaming.camera.demo I/Muxer﹕ Created muxer for output: rtmp://rtmp.youtube.com///live2?key=secret
09-08 23:42:12.245  12616-13049/com.pili.pldroid.streaming.camera.demo I/CameraStreamingManager﹕ muxerStatusUpdate muxerState:PREPARING,TID:1571,isNeedUpdateProfile:false
09-08 23:42:12.245  12616-13049/com.pili.pldroid.streaming.camera.demo I/StreamingBaseActivity﹕ onStateChanged state:0
09-08 23:42:12.245  12616-13049/com.pili.pldroid.streaming.camera.demo I/FFmpegMuxer﹕ mBufferTimeLevelLow:200,mBufferTimeLevelHigh:800,mBufferTimeLevelFull:3000,mBufferTimeLevelLowTimeout:20000
09-08 23:42:12.245  12616-13049/com.pili.pldroid.streaming.camera.demo I/FFmpegMuxer﹕ mIsOnlyAudioStreaming=false
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ init
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo I/pldroid_ffmpegbridge﹕ is_pure_audio_streaming=0
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ initializing output_fmt_context ...
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo I/pldroid_ffmpegbridge﹕ _init_output_fmt_context format: flv path: rtmp://rtmp.youtube.com///live2?key=secret
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->name: flv
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->long_name: FLV (Flash Video)
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->mime_type: video/x-flv
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->extensions: flv
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->audio_codec: 86018
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->video_codec: 28
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->subtitle_codec: 0
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ fmt->flags: 132160
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ adding video stream ...
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->name: h264
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->long_name: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->type: 0
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->id: 28
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->capabilities: 12322
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo I/pldroid_ffmpegbridge﹕ _add_stream at index 0
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ _add_stream: using separate headers
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ _add_stream st: 0x5d946ac0
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ adding audio stream ...
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->name: aac
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->long_name: AAC (Advanced Audio Coding)
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->type: 1
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->id: 86018
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ codec->capabilities: 1026
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo I/pldroid_ffmpegbridge﹕ _add_stream at index 1
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ _add_stream: using separate headers
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ _add_stream st: 0x5fe4cc90
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ opening output url ...
09-08 23:42:12.250  12616-13049/com.pili.pldroid.streaming.camera.demo I/pldroid_ffmpegbridge﹕ Opening output file for writing at path rtmp://rtmp.youtube.com///live2?key=secret
09-08 23:42:12.315  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ onMeasure target=0.5625 width=[MeasureSpec: EXACTLY 720] height=[MeasureSpec: EXACTLY 1230],x:720,y:1280
09-08 23:42:12.315  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ new size=691x1230 + padding 0x0
09-08 23:42:12.315  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ onMeasure target=0.5625 width=[MeasureSpec: EXACTLY 691] height=[MeasureSpec: EXACTLY 1230],x:720,y:1280
09-08 23:42:12.315  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ aspect ratio is good (target=0.5625, view=691x1230)
09-08 23:42:12.320  12616-13049/com.pili.pldroid.streaming.camera.demo E/pili﹕ Handshaking...
09-08 23:42:12.405  12616-13049/com.pili.pldroid.streaming.camera.demo E/pili﹕ Type answer 3
09-08 23:42:12.405  12616-13049/com.pili.pldroid.streaming.camera.demo E/pili﹕ Server version 4.0.0.1
09-08 23:42:12.405  12616-13049/com.pili.pldroid.streaming.camera.demo E/pili﹕ Proto = rtmp, path = ///live2?key=secret, app = /, fname = live2?key=secret
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo E/pldroid_ffmpegbridge﹕ ERROR: ffmpegcore_prepare_stream error -- I/O error
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ logging (dumping) output_fmt_ctx log ...br_ctx=0x5d946490
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ Output #0, flv, to 'rtmp://rtmp.youtube.com///live2?key=secret':
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ Stream #0:0
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ , 0, 0/0
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ : Video: h264, yuv420p, 720x1280, q=2-31, 1228 kb/s
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ , 30 tbc
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ [ 09-08 23:42:12.555 12616:13049 D/pldroid_ffmpegbridge ]
    Stream #0:1
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ , 0, 1/44100
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ : Audio: aac, 44100 Hz, 1 channels, s16, 98 kb/s
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo D/pldroid_ffmpegbridge﹕ [ 09-08 23:42:12.555 12616:13049 E/pldroid_ffmpegbridge ]
    ERROR: init error -- I/O error
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo E/FFmpegMuxer﹕ FFmpegMuxer.prepare():I/O error
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo I/CameraStreamingManager﹕ muxerStatusUpdate muxerState:IOERROR,TID:1571,isNeedUpdateProfile:false
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo I/StreamingBaseActivity﹕ onStateChanged state:5
09-08 23:42:12.555  12616-13049/com.pili.pldroid.streaming.camera.demo I/StreamingBaseActivity﹕ res:false
09-08 23:42:12.560  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ onMeasure target=0.5625 width=[MeasureSpec: EXACTLY 720] height=[MeasureSpec: EXACTLY 1230],x:720,y:1280
09-08 23:42:12.560  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ new size=691x1230 + padding 0x0
09-08 23:42:12.560  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ onMeasure target=0.5625 width=[MeasureSpec: EXACTLY 691] height=[MeasureSpec: EXACTLY 1230],x:720,y:1280
09-08 23:42:12.560  12616-12616/com.pili.pldroid.streaming.camera.demo D/AspectFrameLayout﹕ aspect ratio is good (target=0.5625, view=691x1230)
09-08 23:53:58.890  12616-12616/com.pili.pldroid.streaming.camera.demo D/CameraStreamingManager﹕ onPause +
09-08 23:53:59.070  12616-12616/com.pili.pldroid.streaming.camera.demo I/CameraStreamingManager﹕ releaseCamera -- done
09-08 23:53:59.070  12616-12616/com.pili.pldroid.streaming.camera.demo D/CameraSurfaceRenderer﹕ renderer pausing -- releasing SurfaceTexture
09-08 23:53:59.100  12616-12616/com.pili.pldroid.streaming.camera.demo D/CameraStreamingManager﹕ onPause -

YouTube RMTP

Good afternoon. Sorry for my English, I use a translator. I'm trying to send a stream of RTMP servers on Youtube, but I can not understand exactly what I have in JasonObject transfer library. I try to set res value = res = "{'id': 'live2', 'hub': '/', 'title': 'live2', 'publishKey': 'key', 'publishSecurity': 'securitys', 'hosts': {'publish': { 'rtmp': 'rtmp://a.rtmp.youtube.com/live2/amiroshnikov164.is_youtube_key_value' } } }"; but i have case CameraStreamingManager.STATE.IOERROR: on start. Could you help me? Thank you.

Adaptive bitrate causing stream to stop and start

I am using adaptive bitrate to stream. But the stream is stopping and restarting after each bitrate change.

Can this be achieved without stopping and restarting the stream?

Is this related to Ffmpeg dependency ( like camera switch)

Dynamic camera switching, Custom resolutions

Since you are already using FFMpeg, we should allow using custom resolutions and not depend on Camera supported resolutions for final video output.

Previously we discussed that you would remove dependency on FFMpeg to allow dynamic camera switching, quality changing. But even with FFMpeg that should be possible

Kickflip SDK allows all that using FFMpeg. So technically it is possible.

https://github.com/Kickflip/kickflip-android-sdk

Native Crash when using demo app.

09-30 17:36:02.347 32672-348/? E/pldroid_core_rtmp﹕ WriteN, RTMP send error 88, error_msg(Socket operation on non-socket) (12 bytes)
09-30 17:36:02.347 32672-348/? E/pldroid_core_rtmp﹕ RTMP_Close
09-30 17:36:02.347 32672-348/? A/libc﹕ Fatal signal 11 (SIGSEGV), code 1, fault addr 0x14 in tid 348 (PLAVMuxer)
09-30 17:36:02.449 372-372/? A/DEBUG﹕ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-30 17:36:02.449 372-372/? A/DEBUG﹕ Build fingerprint: 'google/shamu/shamu:6.0/MPA44G/2170132:user/release-keys'
09-30 17:36:02.449 372-372/? A/DEBUG﹕ Revision: '0'
09-30 17:36:02.449 372-372/? A/DEBUG﹕ ABI: 'arm'
09-30 17:36:02.451 372-372/? A/DEBUG﹕ pid: 32672, tid: 348, name: PLAVMuxer >>> com.pili.pldroid.streaming.camera.demo <<<
09-30 17:36:02.451 372-372/? A/DEBUG﹕ signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x14
09-30 17:36:02.469 372-372/? A/DEBUG﹕ r0 0000001f r1 9d67e610 r2 196213a6 r3 196213a6
09-30 17:36:02.470 372-372/? A/DEBUG﹕ r4 9b79c000 r5 9b79c000 r6 9b7a0180 r7 b6d5aec0
09-30 17:36:02.470 372-372/? A/DEBUG﹕ r8 00000000 r9 a8816070 sl 00000000 fp ffffffc4
09-30 17:36:02.470 372-372/? A/DEBUG﹕ ip 9d67e638 sp 9d67eb20 lr a880c9cf pc a880c9d2 cpsr 600b0030
09-30 17:36:02.480 372-372/? A/DEBUG﹕ backtrace:
09-30 17:36:02.480 372-372/? A/DEBUG﹕ #00 pc 000069d2 /data/app/com.pili.pldroid.streaming.camera.demo-1/lib/arm/libpldroid_streaming_core.so (RTMP_Close+49)
09-30 17:36:02.480 372-372/? A/DEBUG﹕ #1 pc 00006cdf /data/app/com.pili.pldroid.streaming.camera.demo-1/lib/arm/libpldroid_streaming_core.so
09-30 17:36:02.480 372-372/? A/DEBUG﹕ #2 pc 00007025 /data/app/com.pili.pldroid.streaming.camera.demo-1/lib/arm/libpldroid_streaming_core.so (RTMP_SendPacket+608)

I can't run it

Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 2

Set Output size of Video to 360x640

I can see the bitrate can be set via Video quality, but how do we set the video output size. I am interested in options like 360X640 and 480X854.Currently the SMALL preview generates 432x768 which is not a fit for our requirement. MEDIUM generates 480x854, but there is no preview size for 360x640

Could you introduce resolution 360x640? Its a definitive requirement for us.

Also my suggestion is that preview sizes names can be more explanatory like 360P, 480P etc. instead of SMALL, MEDIUM, LARGE

Increasing latency over wifi

Hi there.
First at all, and once again, thanks for your work 😄

I'm testing with PLDroidCameraStreaming and PLDroidPlayer to make a simple videochat .
At first everything seems to work fine, but the latency starts to increase as time goes on.
It seems that applications are very sensitive to network errors, especially on the player side, and our wifi seems that hurts it a lot.
I wonder if this issue is happening to someone else or maybe this could be our equipment or server (Nginx) fault.
I would also like to know what parameters are passed to ffmpeg to create the stream, maybe there is a way to improve latency on the streamer side.

Thanks again, for all this great work!!!

[Question] How to record locally

I understand we have API setLocalFileAbsolutePath. But I am not sure how to use it to locally save video to file.

  1. mProfile.setVideoQuality(videoquality)
    .setAudioQuality(audioquality)
    .setEncodingSizeLevel(StreamingProfile.VIDEO_ENCODING_SIZE_QVGA)
    .setStream(stream)
    .setLocalFileAbsolutePath(Util.getVideoOutputPath() + "/recording.mp4")
    .setSendingBufferProfile(new StreamingProfile.SendingBufferProfile(0.2f, 0.8f, 3.0f, 10 * 1000));

If I use the above then streaming happens but recording to local file does not happen. if I comment ut setStream(stream), then we get IOError saying rtmp is null.

Please guide.

Demo不能正常使用,求问

下面是错误日志:
threadid=12: calling UncaughtExceptionHandler
FATAL EXCEPTION: TextureMovieEncoder
java.lang.NoSuchMethodError: android.media.MediaCodec.createInputSurface
at com.pili.pldroid.streaming.av.video.c.(VideoEncoderCore.java:63)
at com.pili.pldroid.streaming.av.video.b.a(TextureMovieEncoder.java:303)
at com.pili.pldroid.streaming.av.video.b.b(TextureMovieEncoder.java:222)
at com.pili.pldroid.streaming.av.video.b.a(TextureMovieEncoder.java:45)
at com.pili.pldroid.streaming.av.video.b$b.handleMessage(TextureMovieEncoder.java:386)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:194)
at com.pili.pldroid.streaming.av.video.b.run(TextureMovieEncoder.java:206)
at java.lang.Thread.run(Thread.java:838)

Unexpected delay in onRestartStreamingHandled()

I am testing the new API feature of StreamingSessionListener (onRestartStreamingHandled).

Basically I disconnect the internet and reconnect immediately. And in the code I call startStreaming after about 10 secs.

In the logs you can see the 10sec difference here

11-29 17:38:41.878 D/pldroid_core_packet: free_packet_data
11-29 17:38:52.147 D/pldroid_core_packet: initialize

But after the startStreaming() is called, it is taking around 30secs to again start the streaming.

11-29 17:38:52.997 E/pldroid_core_packet: rtmp_logcallback not ready.
11-29 17:39:23.007 E/pldroid_core_packet: rtmp_logcallback not ready. ===> 30s differerence
11-29 17:39:23.008 E/pldroid_core_packet: rtmp_logcallback not ready.
11-29 17:39:23.008 D/pldroid_core_packet: stream_state_callback state=3
11-29 17:39:23.008 D/pldroid_core_packet: stream_state_callback state=1

  1. Is this expected behaviour to take 30s to actually start the streaming. Normally startStreaming does not take that long?
  2. I also see that right before streaming restarts (which is about 30s after startStreaming is called), Pili sdk is closing the connection with the remote rtmp server and restarting the connection. But the expected behaviour is that Pili sdk should simply start streaming new audio/video data without resetting the connection.

In our test server we have nginx rtmp servers with the setting of drop_idle_publishers 120s. So RTMP server wait for 120s if the publisher is not sending any data. But in this case, calling startStreaming() again in OnRestartStreamingHandled() is actually sending a terminating signal to end the session. So basically there should be another function called CameraStreamingManager.restartStreaming() which should simply re-establish the broken connection and start streaming the data without resetting the connection.

This is important for lot of scenarios. In our case, once the session ends, we do lot of post processing. So if Pili terminates the connection on call to startStreaming, then we have incomplete data on the rtmp servers.

My Code:

@OverRide
public boolean onRestartStreamingHandled(int err) {
runOnUiThread(new Runnable() {
@OverRide
public void run() {
mLiveBanner.setText("RECONNECTING...");
new Handler().postDelayed(new Runnable() {
@OverRide
public void run() {
mCameraStreamingManager.startStreaming();
}
}, 10000);
}
});

    return true;
}

StreamingSessionListener_logs.txt

[Issue] Improper stream with Audio and Video stream positions exchanged

In 1.3.6 & 1.3.5 sometimes everything works fine (Stream 0:0 is video and Stream 0:1 is audio). But most often Stream 0:0 is audio and Stream 0:1 is video, with Video stream starts after about 30-120 secs of the audio. So basically the STATE.STREAMING is called after about 30-120 secs of STATE.CONNECTING, but other state like STATE.SENDING_BUFFER_HAS_FEW_ITEMS is called even before STATE.STREAMING is called. In our media server we can see Audio streams (0:0) is being pushed to the server from the phone immediately after STATE.CONNECTING is called.

In the logs I see the following

E/pldroid_core_rtmp: Property: <Name: level, STRING: status>
E/pldroid_core_rtmp: Property: <Name: code, STRING: NetStream.Publish.Start>
E/pldroid_core_rtmp: Property: <Name: description, STRING: Start publishing>
E/pldroid_core_rtmp: (object end)
E/pldroid_core_rtmp: (object end)
E/pldroid_core_rtmp: HandleInvoke, server invoking
E/pldroid_core_rtmp: HandleInvoke, onStatus: NetStream.Publish.Start
I/CameraStreamingManager: muxerStatusUpdate muxerState:READY,isNeedUpdateProfile:false
I/MediaCodec: name=audio/mp4a-latm isType=true encoder=true
I/MediaCodec: (0xb88f2e08) init name(audio/mp4a-latm) isType(1) encoder(1)
I/OMXClient: Using client-side OMX mux.
E/OMXMaster: A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one.
I/MediaCodec: (0xb88f2e08) Component Allocated (OMX.google.aac.encoder)
I/MediaCodec: (0xb88f2e08) configure nativeWindow(0x0) crypto(0x0) flags(1)
I/MediaCodec: (0xb88f2e08) start
I/MediaCodec: (0xb88f2e08) input buffers allocated
I/MediaCodec: (0xb88f2e08) numBuffers (4)
I/MediaCodec: (0xb88f2e08) output buffers allocated
I/MediaCodec: (0xb88f2e08) numBuffers (4)
I/MediaCodec: (0xb88f2e08) codec output format changed
I/CameraStreamingManager: toggleRecording enabled:true
I/PLAVMuxer: write config or eos frame
I/PLAVMuxer: AACMetaData
I/VideoEncoderCore: encodingSize.width:272, encodingSize.height:480
I/VideoEncoderCore: w:272, h:480
I/MediaCodec: name=video/avc isType=true encoder=true
I/MediaCodec: (0xb8996570) init name(video/avc) isType(1) encoder(1)
I/OMXClient: Using client-side OMX mux.
I/MediaCodec: (0xb8996570) Component Allocated (OMX.qcom.video.encoder.avc)
I/MediaCodec: (0xb8996570) configure nativeWindow(0x0) crypto(0x0) flags(1)
E/ACodec: [OMX.qcom.video.encoder.avc] storeMetaDataInBuffers (output) failed w/ err -2147483648
I/ACodec: [OMX.qcom.video.encoder.avc] setupVideoEncoder mime(video/avc) colorFormat(7f000789)
W/ACodec: do not know color format 0x7fa30c04 = 2141391876
W/ACodec: do not know color format 0x7f000789 = 2130708361
I/ACodec: width height(272x480) stride(272) sliceHeight(480)
I/ACodec: bitrate(524288) framerate(30.000000) compressionFormat(7)
I/ACodec: [OMX.qcom.video.encoder.avc] setupVideoEncoder succeeded
W/ACodec: do not know color format 0x7f000789 = 2130708361
I/MediaCodec: (0xb8996570) start
I/MediaCodec: (0xb8996570) input buffers allocated
I/MediaCodec: (0xb8996570) numBuffers (5)
I/MediaCodec: (0xb8996570) output buffers allocated
I/MediaCodec: (0xb8996570) numBuffers (4)
I/MediaCodec: (0xb8996570) codec output format changed
I/PLAVMuxer: write config or eos frame
I/PLAVMuxer: H264MetaData
I/PLAVMuxer: packet loop over
I/CameraStreamingManager: muxerStatusUpdate muxerState:CONNECTING,isNeedUpdateProfile:false
I/BroadcastActivity: onStateChanged state:2
I/PLAVMuxer: writeHeader :withoutStoppingStreaming=false
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=268
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=33
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=4
W/PLAVMuxer: Warming bufferInfo.presentationTimeUs:0
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=97
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=133
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=141
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=119
I/PLAVMuxer: packet loop over
I/PLAVMuxer: packet loop over
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=169
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=120
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=107
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=106
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=107
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=111
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=110
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=104
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=134
I/PLAVMuxer: packet loop over
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=107
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=113
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=107
I/PLAVMuxer: packet loop over
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=581
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=113
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=100
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=119
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=97
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=115
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=100
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=99
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=97
E/pldroid_core_rtmp: RTMP_SendPacket: fd=70, size=111

V1.3.3 JNI error after PREPARING stage

Pasting the logs (removed server name and app name)
Here is my setting

mProfile = new StreamingProfile();
mSupportVideoQualities = mProfile.getSupportVideoQualities();
mSupportAudioQualities = mProfile.getSupportAudioQualities();
int videoquality = mSupportVideoQualities.containsKey("0") ? mSupportVideoQualities.get("0") : StreamingProfile.VIDEO_QUALITY_LOW3;
int audioquality = mSupportAudioQualities.containsKey("0") ? mSupportAudioQualities.get("0") : StreamingProfile.AUDIO_QUALITY_MEDIUM1;
mProfile.setVideoQuality(videoquality)
.setAudioQuality(audioquality)
.setStream(stream)

                .setSendingBufferProfile(new StreamingProfile.SendingBufferProfile(0.2f, 0.8f, 3.0f, 20 * 1000));

        CameraStreamingSetting setting = new CameraStreamingSetting();
        setting.setCameraId(Camera.CameraInfo.CAMERA_FACING_BACK)
                .setContinuousFocusModeEnabled(false)
                .setCameraPrvSizeLevel(CameraStreamingSetting.PREVIEW_SIZE_LEVEL.SMALL)
                .setCameraPrvSizeRatio(CameraStreamingSetting.PREVIEW_SIZE_RATIO.RATIO_16_9);

        mCameraStreamingManager = new CameraStreamingManager(this, cameraholder, cameraPreview);
        mCameraStreamingManager.onPrepare(setting, mProfile);
        mCameraStreamingManager.setStreamingStateListener(this);

E/pldroid_core_rtmp? Parsing...
E/pldroid_core_rtmp? Parsed protocol: 0
E/pldroid_core_rtmp? Parsed host : XXXXXXXXXXX
E/pldroid_core_rtmp? Parsed app : XXXXXXXX
E/pldroid_core_rtmp? RTMP_Connect1, ... connected, handshaking
E/pldroid_core_rtmp? HandShake: Type Answer : 03
E/pldroid_core_rtmp? HandShake: Server Uptime : 12647209
E/pldroid_core_rtmp? HandShake: FMS Version : 0.0.0.0
E/pldroid_core_rtmp? RTMP_Connect1, handshaked
E/pldroid_core_rtmp? RTMP_SendPacket: fd=23, size=110
E/pldroid_core_rtmp? Invoking connect
E/pldroid_core_rtmp? RTMP_ReadPacket: fd=23
E/pldroid_core_rtmp? HandleServerBW: server BW = 5000000
E/pldroid_core_rtmp? RTMP_ReadPacket: fd=23
E/pldroid_core_rtmp? HandleClientBW: client BW = 5000000 2
E/pldroid_core_rtmp? RTMP_ReadPacket: fd=23
E/pldroid_core_rtmp? HandleChangeChunkSize, received: chunk size change to 4096
E/pldroid_core_rtmp? RTMP_ReadPacket: fd=23
E/pldroid_core_rtmp? RTMP_ClientPacket, received: invoke 190 bytes
E/pldroid_core_rtmp? (object begin)
E/pldroid_core_rtmp? Property: <Name: no-name., STRING: result>
E/pldroid_core_rtmp? Property: <Name: no-name., NUMBER: 1.00>
E/pldroid_core_rtmp? Property: <Name: no-name., OBJECT>
E/pldroid_core_rtmp? (object begin)
E/pldroid_core_rtmp? Property: <Name: fmsVer, STRING: FMS/3,0,1,123>
E/pldroid_core_rtmp? Property: <Name: capabilities, NUMBER: 31.00>
E/pldroid_core_rtmp? (object end)
E/pldroid_core_rtmp? Property: <Name: no-name., OBJECT>
E/pldroid_core_rtmp? (object begin)
E/pldroid_core_rtmp? Property: <Name: level, STRING: status>
E/pldroid_core_rtmp? Property: <Name: code, STRING: NetConnection.Connect.Success>
E/pldroid_core_rtmp? Property: <Name: description, STRING: Connection succeeded.>
E/pldroid_core_rtmp? Property: <Name: objectEncoding, NUMBER: 0.00>
E/pldroid_core_rtmp? (object end)
E/pldroid_core_rtmp? (object end)
E/pldroid_core_rtmp? HandleInvoke, server invoking <result>
E/pldroid_core_rtmp? HandleInvoke, received result for method call
E/pldroid_core_rtmp? RTMP_SendPacket: fd=23, size=118
E/pldroid_core_rtmp? Invoking releaseStream
E/pldroid_core_rtmp? RTMP_SendPacket: fd=23, size=114
E/pldroid_core_rtmp? Invoking FCPublish
E/pldroid_core_rtmp? RTMP_SendPacket: fd=23, size=25
E/pldroid_core_rtmp? Invoking createStream
E/pldroid_core_rtmp? RTMP_ReadPacket: fd=23
E/pldroid_core_rtmp? RTMP_ClientPacket, received: invoke 29 bytes
E/pldroid_core_rtmp? (object begin)
E/pldroid_core_rtmp? Property: <Name: no-name., STRING: result>
E/pldroid_core_rtmp? Property: <Name: no-name., NUMBER: 4.00>
E/pldroid_core_rtmp? Property: NULL
E/pldroid_core_rtmp? Property: <Name: no-name., NUMBER: 1.00>
E/pldroid_core_rtmp? (object end)
E/pldroid_core_rtmp? HandleInvoke, server invoking <result>
E/pldroid_core_rtmp? HandleInvoke, received result for method call
E/pldroid_core_rtmp? RTMP_SendPacket: fd=23, size=119
E/pldroid_core_rtmp? Invoking publish
E/pldroid_core_rtmp? RTMP_ReadPacket: fd=23
E/pldroid_core_rtmp? RTMP_ClientPacket, received: invoke 105 bytes
E/pldroid_core_rtmp? (object begin)
E/pldroid_core_rtmp? Property: <Name: no-name., STRING: onStatus>
E/pldroid_core_rtmp? Property: <Name: no-name., NUMBER: 0.00>
E/pldroid_core_rtmp? Property: NULL
E/pldroid_core_rtmp? Property: <Name: no-name., OBJECT>
E/pldroid_core_rtmp? (object begin)
E/pldroid_core_rtmp? Property: <Name: level, STRING: status>
E/pldroid_core_rtmp? Property: <Name: code, STRING: NetStream.Publish.Start>
E/pldroid_core_rtmp? Property: <Name: description, STRING: Start publishing>
E/pldroid_core_rtmp? (object end)
E/pldroid_core_rtmp? (object end)
E/pldroid_core_rtmp? HandleInvoke, server invoking
E/pldroid_core_rtmp? HandleInvoke, onStatus: NetStream.Publish.Start
A/art? art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: non-nullable argument was NULL
A/art? art/runtime/check_jni.cc:65] in call to ReleaseStringUTFChars
A/art? art/runtime/check_jni.cc:65] from void com.pili.pldroid.streaming.core.PLDroidStreamingCore.initialize(com.pili.pldroid.streaming.core.PLDroidStreamingCore$AVOptions, boolean)
A/art? art/runtime/check_jni.cc:65] "Thread-165546" prio=5 tid=50 Runnable
A/art? art/runtime/check_jni.cc:65] | group="main" sCount=0 dsCount=0 obj=0x12fd0040 self=0xb75ad0b0
A/art? art/runtime/check_jni.cc:65] | sysTid=25433 nice=0 cgrp=apps sched=0/0 handle=0xb7734988
A/art? art/runtime/check_jni.cc:65] | state=R schedstat=( 0 0 0 ) utm=1 stm=1 core=1 HZ=100
A/art? art/runtime/check_jni.cc:65] | stack=0xa171c000-0xa171e000 stackSize=1036KB
A/art? art/runtime/check_jni.cc:65] | held mutexes= "mutator lock"(shared held)
A/art? art/runtime/check_jni.cc:65] native: #00 pc 00004c58 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext
)+23)
A/art? art/runtime/check_jni.cc:65] native: #1 pc 000034c1 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext
)+8)
A/art? art/runtime/check_jni.cc:65] native: #2 pc 0025bebd /system/lib/libart.so (art::DumpNativeStack(std::1::basic_ostream<char, std::1::char_traits >&, int, char const, art::mirror::ArtMethod)+84)
A/art? art/runtime/check_jni.cc:65] native: #3 pc 0023fb5b /system/lib/libart.so (art::Thread::Dump(std::1::basic_ostream<char, std::1::char_traits >&) const+162)
A/art? art/runtime/check_jni.cc:65] native: #4 pc 000b102b /system/lib/libart.so (art::JniAbort(char const
, char const
)+610)
A/art? art/runtime/check_jni.cc:65] native: #5 pc 000b1751 /system/lib/libart.so (art::JniAbortF(char const
, char const
, ...)+68)
A/art? art/runtime/check_jni.cc:65] native: #6 pc 000b3b7b /system/lib/libart.so (art::ScopedCheck::Check(bool, char const
, ...) (.constprop.128)+550)
A/art? art/runtime/check_jni.cc:65] native: #7 pc 000bdba5 /system/lib/libart.so (art::CheckJNI::ReleaseStringUTFChars(JNIEnv, jstring, char const
)+68)
A/art? art/runtime/check_jni.cc:65] native: #8 pc 00004b09 /data/app/in.voola.android.staging-1/lib/arm/libpldroid_streaming_core.so (Java_com_pili_pldroid_streaming_core_PLDroidStreamingCore_initialize+616)
A/art? art/runtime/check_jni.cc:65] native: #9 pc 00675b63 /data/dalvik-cache/arm/data@[email protected]@[email protected] (Java_com_pili_pldroid_streaming_core_PLDroidStreamingCore_initialize__Lcom_pili_pldroid_streaming_core_PLDroidStreamingCore_00024AVOptions_2Z+106)
A/art? art/runtime/check_jni.cc:65] at com.pili.pldroid.streaming.core.PLDroidStreamingCore.initialize(Native method)
A/art? art/runtime/check_jni.cc:65] at com.pili.pldroid.streaming.av.e.a(PLAVMuxer.java:136)
A/art? art/runtime/check_jni.cc:65] at com.pili.pldroid.streaming.CameraStreamingManager.startStreaming(CameraStreamingManager.java:547)
A/art? art/runtime/check_jni.cc:65] at in.voola.android.activity.BroadcastActivity$8$3.run(BroadcastActivity.java:760)
A/art? art/runtime/check_jni.cc:65]
A/art? art/runtime/runtime.cc:284] Runtime aborting...
A/art? art/runtime/runtime.cc:284] Aborting thread:
A/art? art/runtime/runtime.cc:284] "Thread-165546" prio=5 tid=50 Native
A/art? art/runtime/runtime.cc:284] | group="" sCount=0 dsCount=0 obj=0x12fd0040 self=0xb75ad0b0
A/art? art/runtime/runtime.cc:284] | sysTid=25433 nice=0 cgrp=apps sched=0/0 handle=0xb7734988
A/art? art/runtime/runtime.cc:284] | state=R schedstat=( 0 0 0 ) utm=2 stm=14 core=1 HZ=100
A/art? art/runtime/runtime.cc:284] | stack=0xa171c000-0xa171e000 stackSize=1036KB
A/art? art/runtime/runtime.cc:284] | held mutexes= "abort lock" "mutator lock"(shared held)
A/art? art/runtime/runtime.cc:284] native: #00 pc 00004c58 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext)+23)
A/art? art/runtime/runtime.cc:284] native: #1 pc 000034c1 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext)+8)
A/art? art/runtime/runtime.cc:284] native: #2 pc 0025bebd /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::1::char_traits >&, int, char const, art::mirror::ArtMethod)+84)
A/art? art/runtime/runtime.cc:284] native: #3 pc 0023fb5b /system/lib/libart.so (art::Thread::Dump(std::1::basic_ostream<char, std::1::char_traits >&) const+162)
A/art? art/runtime/runtime.cc:284] native: #4 pc 0022ee29 /system/lib/libart.so (art::AbortState::DumpThread(std::1::basic_ostream<char, std::1::char_traits >&, art::Thread)+32)
A/art? art/runtime/runtime.cc:284] native: #5 pc 0022f0cb /system/lib/libart.so (art::AbortState::Dump(std::1::basic_ostream<char, std::1::char_traits >&)+410)
A/art? art/runtime/runtime.cc:284] native: #6 pc 0022f28b /system/lib/libart.so (art::Runtime::Abort()+82)
A/art? art/runtime/runtime.cc:284] native: #7 pc 000a7109 /system/lib/libart.so (art::LogMessage::~LogMessage()+1360)
A/art? art/runtime/runtime.cc:284] native: #8 pc 000b1217 /system/lib/libart.so (art::JniAbort(char const
, char const
)+1102)
A/art? art/runtime/runtime.cc:284] native: #9 pc 000b1751 /system/lib/libart.so (art::JniAbortF(char const
, char const
, ...)+68)
A/art? art/runtime/runtime.cc:284] native: #10 pc 000b3b7b /system/lib/libart.so (art::ScopedCheck::Check(bool, char const
, ...) (.constprop.128)+550)
A/art? art/runtime/runtime.cc:284] native: #11 pc 000bdba5 /system/lib/libart.so (art::CheckJNI::ReleaseStringUTFChars(JNIEnv, jstring, char const
)+68)
A/art? art/runtime/runtime.cc:284] native: #12 pc 00004b09 /data/app/in.voola.android.staging-1/lib/arm/libpldroid_streaming_core.so (Java_com_pili_pldroid_streaming_core_PLDroidStreamingCore_initialize+616)
A/art? art/runtime/runtime.cc:284] native: #13 pc 00675b63 /data/dalvik-cache/arm/data@[email protected]@[email protected] (Java_com_pili_pldroid_streaming_core_PLDroidStreamingCore_initialize__Lcom_pili_pldroid_streaming_core_PLDroidStreamingCore_00024AVOptions_2Z+106)
A/art? art/runtime/runtime.cc:284] at com.pili.pldroid.streaming.core.PLDroidStreamingCore.initialize(Native method)
A/art? art/runtime/runtime.cc:284] at com.pili.pldroid.streaming.av.e.a(PLAVMuxer.java:136)
A/art? art/runtime/runtime.cc:284] at com.pili.pldroid.streaming.CameraStreamingManager.startStreaming(CameraStreamingManager.java:547)
A/art? art/runtime/runtime.cc:284] at in.voola.android.activity.BroadcastActivity$8$3.run(BroadcastActivity.java:760)
A/art? art/runtime/runtime.cc:284] Dumping all threads without appropriate locks held: thread list lock mutator lock
A/art? art/runtime/runtime.cc:284] All threads:
A/art? art/runtime/runtime.cc:284] DALVIK THREADS (49):
A/art? art/runtime/runtime.cc:284] "main" prio=5 tid=1 Native
A/art? art/runtime/runtime.cc:284] | group="" sCount=0 dsCount=0 obj=0x732ef480 self=0xb6fdd4c0
A/art? art/runtime/runtime.cc:284] | sysTid=22132 nice=0 cgrp=apps sched=0/0 handle=0xb6f29ec8
A/art? art/runtime/runtime.cc:284] | state=S schedstat=( 0 0 0 ) utm=437 stm=330 core=0 HZ=100
A/art? art/runtime/runtime.cc:284] | stack=0xbe3ac000-0xbe3ae000 stackSize=8MB
A/art? art/runtime/runtime.cc:284] | held mutexes=
A/art? art/runtime/runtime.cc:284] kernel: sys_epoll_wait+0x2bc/0x398
A/art? art/runtime/runtime.cc:284] kernel: sys_epoll_pwait+0x124/0x130
A/art? art/runtime/runtime.cc:284] kernel: ret_fast_syscall+0x0/0x30
A/art? art/runtime/runtime.cc:284] native: #00 pc 0003ca44 /system/lib/libc.so (epoll_pwait+20)
A/art? art/runtime/runtime.cc:284] native: #1 pc 000140d5 /system/lib/libc.so (epoll_pwait+26)
A/art? art/runtime/runtime.cc:284] native: #2 pc 000140e3 /system/lib/libc.so (epoll_wait+6)
A/art? art/runtime/runtime.cc:284] native: #3 pc 000123e7 /system/lib/libutils.so (android::Looper::pollInner(int)+98)
A/art? art/runtime/runtime.cc:284] native: #4 pc 00012611 /system/lib/libutils.so (android::Looper::pollOnce(int, int
, int
, void
)+92)
A/art? art/runtime/runtime.cc:284] native: #5 pc 00080671 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(JNIEnv, int)+22)
A/art? art/runtime/runtime.cc:284] native: #6 pc 000b1cb7 /system/framework/arm/boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+102)
A/art? art/runtime/runtime.cc:284] at android.os.MessageQueue.nativePollOnce(Native method)
A/art? art/runtime/runtime.cc:284] at android.os.MessageQueue.next(MessageQueue.java:143)
A/art? art/runtime/runtime.cc:284] at android.os.Looper.loop(Looper.java:122)
A/art? art/runtime/runtime.cc:284] at android.app.ActivityThread.main(ActivityThread.java:5312)
A/art? art/runtime/runtime.cc:284] at java.lang.reflect.Method.invoke!(Native method)
A/art? art/runtime/runtime.cc:284] at java.lang.reflect.Method.invoke(Method.java:372)
A/art? art/runtime/runtime.cc:284] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
A/art? art/runtime/runtime.cc:284] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
A/art? art/runtime/runtime.cc:284]
A/art? art/runtime/runtime.cc:284] "Heap thread pool worker thread 1" prio=5 tid=2 Native (still starting up)
A/art? art/runtime/runtime.cc:284] | group="" sCount=0 dsCount=0 obj=0x0 self=0xb6fe3e60
A/art? art/runtime/runtime.cc:284] | sysTid=22139 nice=0 cgrp=apps sched=0/0 handle=0xb7123328
A/art? art/runtime/runtime.cc:284] | state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=2 HZ=100
A/art? art/runtime/runtime.cc:284] | stack=0xb4808000-0xb480a000 stackSize=1020KB
A/art? art/runtime/runtime.cc:284] | held mutexes=
A/art? art/runtime/runtime.cc:284] kernel: futex_wait_queue_me+0xe0/0x108
A/art? art/runtime/runtime.cc:284] kernel: futex_wait+0x170/0x238
A/art? art/runtime/runtime.cc:284] kernel: do_futex+0xfc/0x9fc
A/art? art/runtime/runtime.cc:284] kernel: sys_futex+0x80/0x160
A/art? art/runtime/runtime.cc:284] kernel: ret_fast_syscall+0x0/0x30
A/art? art/runtime/runtime.cc:284] native: #00 pc 000126b8 /system/lib/libc.so (syscall+28)
A/art? art/runtime/runtime.cc:284] native: #1 pc 000a9e43 /system/lib/libart.so (art::ConditionVariable::Wait(art::Thread)+98)
A/art? art/runtime/runtime.cc:284] native: #2 pc 00249d45 /system/lib/libart.so (art::ThreadPool::GetTask(art::Thread)+64)
A/art? art/runtime/runtime.cc:284] native: #3 pc 00249cdf /system/lib/libart.so (art::ThreadPoolWorker::Run()+62)
A/art? art/runtime/runtime.cc:284] native: #4 pc 0024a5cd /system/lib/libart.so (art::ThreadPoolWorker::Callback(void)+60)
A/art? art/runtime/runtime.cc:284] native: #5 pc 00015e63 /system/lib/libc.so (_pthread_start(void)+30)
A/art? art/runtime/runtime.cc:284] native: #6 pc 00013e37 /system/lib/libc.so (__start_thread+6)
A/art? art/runtime/runtime.cc:284] (no managed stack frames)
A/art? art/runtime/runtime.cc:284]

Please introduce the ability to record video to phone

This is a very critical feature. Currently we are using ffmpeg and the size of the apk has increased drastically.

Please provide the option to record to the sdcard along with live streaming. It is really very critical for us.

[Issue] Unexpected behavior with unstable connection

I distributed a version of our app using PILI to few of our customers. We observe the following

!) One of our customer has a very unstable connection.
2) We use Nginx RTMP and see that the upload speed goes to 0 and when internet restores it goes back again to 364kbps or higher.
3) But when it goes to 0, on the RTMP server, PUBLISH_DONE is called, which basically means the stream is over.
4) But on the client side, no state callback is invoked (like STATE.DISCONNECTED, STATE.SHUTDOWN etc..)and the streaming continues, though no data is sent to the server

If I do a test and I disconnect the internet, STATE.DISCONNECTED is called and the behaviour is expected. But in extremely low and unstable connection speed, it looks like PILI is trying to stop and restart the streaming without calling any of the STATE callbacks. And when the streaming restarts in the same session, the Upload speed is always 0 and no data is actually sent to the server.

in the NGINX RTMP and FFMPEG logs in our backend server, we can see that the streaming is getting started then getting over and then getting started and the cycle continues. But in the client side SHUTDOWN or any other error state is not called.

Unfortunately I would not be able to get the logs from customer's mobile.

Switch camera should not stop on going streaming.

The current behaviour of Switch camera is that the stopStreaming() is called. That should not be the case for most of the use cases. The switching should be dynamic without stopping the streaming.

V1.3.4 Camera switch still calls stopStreaming

Switching camera is still stopping the streaming. The code still shows the following. It still calls stopStreaming. In the rtmp side, I see that the incoming bytes become zero and no data comes in.

public boolean switchCamera() {
....
this.stopStreaming();
this.i();
this.b.onPause();
....
}

[Issue] pili 1.3.7 Crash on CameraStreamingManager.onPause

App crashing on v1.3.7 on CameraStreamingManage.onPause. But if we start streaming atleast once, then this does not crash on subsequent calls. For example. If the activity is opened and we press back button to close, it crashes. But if we start streaming once, then this call does not crash on subsequent activity open and close.

@OverRide
public void onPause() {
super.onPause();
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    if (mCameraStreamingManager != null) {
        mCameraStreamingManager.onPause();
    }
}

Logs

I/CameraStreamingManager: releaseCamera -- done
I/CameraSurfaceRenderer: notifyPausing +
E/AndroidRuntime: FATAL EXCEPTION: main
E/AndroidRuntime: Process: in.voola.android.staging, PID: 13258
E/AndroidRuntime: java.lang.RuntimeException: Unable to pause activity {in.voola.android.staging/in.voola.android.activity.BroadcastActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.pili.pldroid.streaming.av.video.c.c()' on a null object reference
E/AndroidRuntime: at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3312)
E/AndroidRuntime: at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3259)
E/AndroidRuntime: at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3234)
E/AndroidRuntime: at android.app.ActivityThread.access$1000(ActivityThread.java:148)
E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1310)
E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5312)
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
E/AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.pili.pldroid.streaming.av.video.c.c()' on a null object reference
E/AndroidRuntime: at com.pili.pldroid.streaming.av.video.b.a(TextureMovieEncoder.java:124)
E/AndroidRuntime: at com.pili.pldroid.streaming.av.video.a.a(CameraSurfaceRenderer.java:107)
E/AndroidRuntime: at com.pili.pldroid.streaming.CameraStreamingManager.onPause(CameraStreamingManager.java:196)
E/AndroidRuntime: at in.voola.android.activity.BroadcastActivity.onPause(BroadcastActivity.java:961)
E/AndroidRuntime: at android.app.Activity.performPause(Activity.java:6064)
E/AndroidRuntime: at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1317)
E/AndroidRuntime: at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3292)
E/AndroidRuntime: at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3259) 
E/AndroidRuntime: at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3234) 
E/AndroidRuntime: at android.app.ActivityThread.access$1000(ActivityThread.java:148) 
E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1310) 
E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 
E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135) 
E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5312) 
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372) 
E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901) 
E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696) 

Exception while resuming (intermittently)

Intermittently while resuming to the activity, I am getting the following exception

Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'void android.hardware.Camera.setPreviewTexture(android.graphics.SurfaceTexture)' on a null object reference

com.pili.pldroid.streaming.CameraStreamingManager.a (CameraStreamingManager.java:389)
com.pili.pldroid.streaming.CameraStreamingManager.a (CameraStreamingManager.java:31)
com.pili.pldroid.streaming.CameraStreamingManager$a.handleMessage (CameraStreamingManager.java:764)

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.