'Use gstreamer to stream video to AWS Kinesis video stream from H264 USB camera on Windows
Finally I managed to compile the AWS kinesis producer SDK and kvssink plugin on Win 10. I thought that is the difficult part. But now I am having issue streaming video from my H264 USB camera which previously worked in Ubuntu environment.
So I have a USB camera that natively supports H264 format:
Device found:
name : j5create 360 Meeting Webcam
class : Video/Source
caps : image/jpeg, width=1920, height=1080, framerate=[ 5/1, 30/1 ], pixel-aspect-ratio=1/1
image/jpeg, width=1280, height=720, framerate=[ 5/1, 30/1 ], pixel-aspect-ratio=1/1
image/jpeg, width=640, height=480, framerate=[ 5/1, 30/1 ], pixel-aspect-ratio=1/1
image/jpeg, width=640, height=360, framerate=[ 5/1, 30/1 ], pixel-aspect-ratio=1/1
video/x-raw, format=H264, width=1920, height=1080, framerate=[ 5/1, 30/1 ], pixel-aspect-ratio=1/1
video/x-raw, format=H264, width=1280, height=720, framerate=[ 5/1, 30/1 ], pixel-aspect-ratio=1/1
video/x-raw, format=H264, width=640, height=480, framerate=[ 5/1, 30/1 ], pixel-aspect-ratio=1/1
video/x-raw, format=H264, width=640, height=360, framerate=[ 5/1, 30/1 ], pixel-aspect-ratio=1/1
video/x-raw, format=YUY2, width=640, height=480, framerate=30/1, pixel-aspect-ratio=1/1
gst-launch-1.0 ksvideosrc device-path="\\\\\?\\usb\#vid_0711\&pid_0360\&mi_00\#6\&ce9609c\&0\&0000\#\{6994ad05-93ef-11d0-a3cc-00a0c9223196\}\\global" ! ...
and I use this command which previously works in Ubuntu system with a TCP source.
gst-launch-1.0 -v ksvideosrc do-timestamp=true device-name="j5create 360 Meeting Webcam" ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink name=sink stream-name="SomeVideoStream" access-key="<>" secret-key="<>" aws-region="ap-southeast-1"
The error is
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstKsVideoSrc:ksvideosrc0: streaming stopped, reason not-negotiated (-4)
If I use the following command
gst-launch-1.0 ksvideosrc do-timestamp=TRUE device-name="j5create 360 Meeting Webcam" ! video/x-raw,width=640,height=480,framerate=30/1 ! videoconvert ! x264enc bframes=0 key-int-max=45 bitrate=512 ! video/x-h264,profile=baseline,stream-format=avc,alignment=au ! kvssink stream-name="SomeVideoStream" access-key="<>" secret-key="<>" aws-region="ap-southeast-1"
It works when I use the Kinesis media viewer to check. However, the image quality is bad.
If I increase the width and height to 1920 x 1080, I get the reason not-negotiated (-4) error again.
I thought a USB camera with native H264 support is preferred by AWS Kinesis Video Streams. But it turns out to be quite difficult to streams in Windows. Any help is greatly appreciated!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
