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

Kinesis video stream, Video not showing in Kinesis console #242

Closed
Balaji-V19 opened this issue Sep 14, 2020 · 5 comments
Closed

Kinesis video stream, Video not showing in Kinesis console #242

Balaji-V19 opened this issue Sep 14, 2020 · 5 comments

Comments

@Balaji-V19
Copy link

Balaji-V19 commented Sep 14, 2020

I'm using the below code to create a video stream. However, the video is not getting streamed at the Kinesis console

class CameraPage extends StatefulWidget {
  @override
  _CameraPageState createState() => _CameraPageState();
}

class _CameraPageState extends State<CameraPage> {

  CameraController controller;
  var index=0;
  final service = KinesisVideo(region: 'ap-south-1',credentials: AwsClientCredentials
    (accessKey: "XXXXXXXXXXXXXXXXXX",
    secretKey: "XXXXXXXXXXXXXXXX",),);

  @override
  void initState() {
    controller = CameraController(cameras[index], ResolutionPreset.medium);
    controller.initialize().then((_) {
      if (!mounted) {
        return;
      }
      setState(() {});
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    final mediaQuery=MediaQuery.of(context).size;
    if (!controller.value.isInitialized) {
      return Container();
    }
    return Scaffold(
      body: Container(
        width: mediaQuery.width,
        height: mediaQuery.height*0.9,
        child: Stack(
          children: [
            CameraPreview(controller),
            Positioned(bottom: 20,
            child: Container(
              width: mediaQuery.width,
              child: Row(
                children: [
                  Spacer(),
                  Container(width: 40.0,),
                  Spacer(),
                  InkWell(
                    onTap: (){
                      service.createStream(streamName: "demo7_stream",dataRetentionInHours: 24,
                          mediaType: "video/h264",kmsKeyId: "b2e58180-ed42-471a-a1e3-02a4527c5919",
                        deviceName: "Redmi"
                          );
                    },
                    child: Container(
                      width: 100.0,
                      height: 100.0,
                      decoration: BoxDecoration(
                        color: Colors.red,
                        shape: BoxShape.circle,
                      ),
                      child: Center(
                        child: Text('Emergency',style: TextStyle(color: Colors.white),),
                      ),
                    ),
                  ),
                  Spacer(),
                  IconButton(icon: Icon(Icons.switch_camera,size: 40.0,color: Colors.white,),onPressed: (){
                    setState(() {
                      if(index==0){
                        index=1;
                      }else{
                        index=0;
                      }
                      controller = CameraController(cameras[index], ResolutionPreset.high);
                      controller.initialize().then((_) {
                        if (!mounted) {
                          return;
                        }
                        setState(() {});
                      });
                    });
                  },),
                  Spacer(),
                ],
              ),
            ),),


          ],
        ),
      ),
    );
  }
}

The Logcat for this application

2020-09-14 23:29:44.512 19450-19450/com.bjofficial.testing_kinesis W/testing_kinesis: type=1400 audit(0.0:529442): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=12941 scontext=u:r:untrusted_app:s0:c60,c259,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
2020-09-14 23:29:44.527 19450-19450/com.bjofficial.testing_kinesis E/libc: Access denied finding property "vendor.camera.aux.packagelist"
2020-09-14 23:29:52.292 19450-19450/com.bjofficial.testing_kinesis W/Binder:19450_5: type=1400 audit(0.0:529446): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=12941 scontext=u:r:untrusted_app:s0:c60,c259,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
2020-09-14 23:29:52.310 19450-19903/com.bjofficial.testing_kinesis E/libc: Access denied finding property "vendor.camera.aux.packagelist"
2020-09-14 23:29:52.391 19450-19903/com.bjofficial.testing_kinesis E/libc: Access denied finding property "vendor.camera.aux.packagelist"
2020-09-14 23:29:52.372 19450-19450/com.bjofficial.testing_kinesis W/Binder:19450_5: type=1400 audit(0.0:529448): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=12941 scontext=u:r:untrusted_app:s0:c60,c259,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
2020-09-14 23:29:52.422 19450-19482/com.bjofficial.testing_kinesis W/testing_kinesi: Long monitor contention with owner main (19450) at void android.hardware.camera2.impl.CameraDeviceImpl.close()(CameraDeviceImpl.java:1174) waiters=0 in void android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onResultReceived(android.hardware.camera2.impl.CameraMetadataNative, android.hardware.camera2.impl.CaptureResultExtras, android.hardware.camera2.impl.PhysicalCaptureResultInfo[]) for 569ms
2020-09-14 23:29:52.472 19450-19450/com.bjofficial.testing_kinesis W/testing_kinesis: type=1400 audit(0.0:529449): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=12941 scontext=u:r:untrusted_app:s0:c60,c259,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
2020-09-14 23:29:52.489 19450-19450/com.bjofficial.testing_kinesis E/libc: Access denied finding property "persist.vendor.camera.privapp.list"
2020-09-14 23:29:52.552 19450-19450/com.bjofficial.testing_kinesis W/Binder:19450_5: type=1400 audit(0.0:529451): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=12941 scontext=u:r:untrusted_app:s0:c60,c259,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
2020-09-14 23:29:52.570 19450-19903/com.bjofficial.testing_kinesis E/libc: Access denied finding property "vendor.camera.aux.packagelist"
2020-09-14 23:29:52.592 19450-19903/com.bjofficial.testing_kinesis E/libc: Access denied finding property "vendor.camera.aux.packagelist"
2020-09-14 23:30:52.839 19450-19450/com.bjofficial.testing_kinesis W/Looper: Slow Looper main: doFrame is 336ms late because of 2 msg, msg 1 took 217ms (h=android.app.ActivityThread$H w=159), msg 2 took 108ms (late=230ms h=android.app.ActivityThread$H w=137)
2020-09-14 23:30:53.755 19450-19450/com.bjofficial.testing_kinesis W/Looper: Slow Looper main: Activity com.bjofficial.testing_kinesis/.MainActivity is 388ms late (wall=50ms running=0ms ClientTransaction{ lifecycleRequest=android.app.servertransaction.PauseActivityItem }) because of 7 msg, msg 1 took 110ms (late=55ms h=android.app.ActivityThread$H w=159), msg 2 took 275ms (late=42ms h=android.view.Choreographer$FrameHandler w=0)
2020-09-14 23:30:54.166 19450-19450/com.bjofficial.testing_kinesis W/Looper: Slow Looper main: Activity com.bjofficial.testing_kinesis/.MainActivity is 381ms late (wall=9ms running=0ms ClientTransaction{ lifecycleRequest=android.app.servertransaction.StopActivityItem }) because of 23 msg, msg 20 took 269ms (late=127ms h=android.view.Choreographer$FrameHandler c=android.view.Choreographer$FrameDisplayEventReceiver)
2020-09-14 23:30:58.938 19450-19700/com.bjofficial.testing_kinesis E/libc: Access denied finding property "vendor.camera.aux.packagelist"
2020-09-14 23:30:58.922 19450-19450/com.bjofficial.testing_kinesis W/Binder:19450_4: type=1400 audit(0.0:529520): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=12941 scontext=u:r:untrusted_app:s0:c60,c259,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
2020-09-14 23:30:58.988 19450-19700/com.bjofficial.testing_kinesis E/libc: Access denied finding property "vendor.camera.aux.packagelist"
2020-09-14 23:30:58.999 19450-19506/com.bjofficial.testing_kinesis W/testing_kinesi: Long monitor contention with owner main (19450) at boolean android.os.BinderProxy.transactNative(int, android.os.Parcel, android.os.Parcel, int)(Binder.java:-2) waiters=0 in void android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onCaptureStarted(android.hardware.camera2.impl.CaptureResultExtras, long) for 523ms
2020-09-14 23:30:59.113 19450-19506/com.bjofficial.testing_kinesis E/libc: Access denied finding property "vendor.camera.aux.packagelist"
2020-09-14 23:31:05.375 19450-19506/com.bjofficial.testing_kinesis E/libc: Access denied finding property "vendor.camera.aux.packagelist"

The terminal output when trying to create the stream

Performing hot restart...
Syncing files to device Redmi Note 7S...
Restarted application in 21,878ms.
W/testing_kinesis(19450): type=1400 audit(0.0:529442): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=12941 scontext=u:r:untrusted_app:s0:c60,c259,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
E/libc    (19450): Access denied finding property "vendor.camera.aux.packagelist"
W/Binder:19450_5(19450): type=1400 audit(0.0:529446): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=12941 scontext=u:r:untrusted_app:s0:c60,c259,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
E/libc    (19450): Access denied finding property "vendor.camera.aux.packagelist"
E/libc    (19450): Access denied finding property "vendor.camera.aux.packagelist"
W/Binder:19450_5(19450): type=1400 audit(0.0:529448): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=12941 scontext=u:r:untrusted_app:s0:c60,c259,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
W/testing_kinesi(19450): Long monitor contention with owner main (19450) at void android.hardware.camera2.impl.CameraDeviceImpl.close()(CameraDeviceImpl.java:1174) waiters=0 in void android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onResultReceived(android.hardware.camera2.impl.CameraMetadataNative, android.hardware.camera2.impl.CaptureResultExtras, android.hardware.camera2.impl.PhysicalCaptureResultInfo[]) for 569ms
W/testing_kinesis(19450): type=1400 audit(0.0:529449): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=12941 scontext=u:r:untrusted_app:s0:c60,c259,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
E/libc    (19450): Access denied finding property "persist.vendor.camera.privapp.list"
W/Binder:19450_5(19450): type=1400 audit(0.0:529451): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=12941 scontext=u:r:untrusted_app:s0:c60,c259,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
E/libc    (19450): Access denied finding property "vendor.camera.aux.packagelist"
E/libc    (19450): Access denied finding property "vendor.camera.aux.packagelist"
W/Looper  (19450): Slow Looper main: doFrame is 336ms late because of 2 msg, msg 1 took 217ms (h=android.app.ActivityThread$H w=159), msg 2 took 108ms (late=230ms h=android.app.ActivityThread$H w=137)
W/Looper  (19450): Slow Looper main: Activity com.bjofficial.testing_kinesis/.MainActivity is 388ms late (wall=50ms running=0ms ClientTransaction{ lifecycleRequest=android.app.servertransaction.PauseActivityItem }) because of 7 msg, msg 1 took 110ms (late=55ms h=android.app.ActivityThread$H w=159), msg 2 took 275ms (late=42ms h=android.view.Choreographer$FrameHandler w=0)
W/Looper  (19450): Slow Looper main: Activity com.bjofficial.testing_kinesis/.MainActivity is 381ms late (wall=9ms running=0ms ClientTransaction{ lifecycleRequest=android.app.servertransaction.StopActivityItem }) because of 23 msg, msg 20 took 269ms (late=127ms h=android.view.Choreographer$FrameHandler c=android.view.Choreographer$FrameDisplayEventReceiver)
E/libc    (19450): Access denied finding property "vendor.camera.aux.packagelist"
W/Binder:19450_4(19450): type=1400 audit(0.0:529520): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=12941 scontext=u:r:untrusted_app:s0:c60,c259,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
E/libc    (19450): Access denied finding property "vendor.camera.aux.packagelist"
W/testing_kinesi(19450): Long monitor contention with owner main (19450) at boolean android.os.BinderProxy.transactNative(int, android.os.Parcel, android.os.Parcel, int)(Binder.java:-2) waiters=0 in void android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks.onCaptureStarted(android.hardware.camera2.impl.CaptureResultExtras, long) for 523ms
E/libc    (19450): Access denied finding property "vendor.camera.aux.packagelist"
E/libc    (19450): Access denied finding property "vendor.camera.aux.packagelist"

Here is the image file from the kinesis console

Screen Shot 2020-09-14 at 11 34 35 PM

@Schwusch
Copy link
Collaborator

I am not an expert on Kinesis (I just read the introduction), but it seems you need the producer SDK/Client to actually send the video stream according to their documentation:
.
Fortunately it seems to be available for Android, which I figure you're using.

@Balaji-V19
Copy link
Author

The code is actually written in a flutter, I tested the Native sample Android code, it was running perfectly. The migration from Android to Flutter is where I'm facing the challenge and looking for an example so that I can get past this.

https://pub.dev/documentation/aws_kinesisvideo_api/latest/kinesisvideo-2017-09-30/CreateStreamOutput-class.html

I'm using the above method/package to create a stream, it would be really helpful if there was a sample available

@Schwusch
Copy link
Collaborator

it would be really helpful if there was a sample available

This SDK is basically a clone of the Javascript SDK. I would look at the JS examples, since the names are the same.
Here is someone trying to do the same as I believe you are: https://stackoverflow.com/questions/55873939/how-do-i-send-video-data-into-kinesis-video-stream

@Schwusch Schwusch closed this as completed Oct 5, 2020
@satyajitghana
Copy link

The JS Library has no Producer Code. So it implies flutter video produce for kinesis is not existent ?

@Schwusch
Copy link
Collaborator

@satyajitghana It does not exist in this SDK atleast.

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

3 participants