GstKinesisWebRTC/Getting Started/GStreamer Pipelines: Difference between revisions

From RidgeRun Developer Wiki
mNo edit summary
No edit summary
Line 4: Line 4:


Before running any of the following pipelines you need to set up the credentials using the environment variables or adding the element properties to the kinesiswebrtcbin element.
Before running any of the following pipelines you need to set up the credentials using the environment variables or adding the element properties to the kinesiswebrtcbin element.
== Setup ==
In order to test below pipelines, after completing the AWS registration process and Keys generation, you can use the following web page to run tests: [https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-js/examples/index.html https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-js/examples/index.html]. Make sure you complete the following:
* Use same '''region''' you used in the AWS account setup
* Add your '''Access Key ID''' and '''Secret Access Key'''
* Add channel name and make sure it matches with the element '''channel''' property.
* Depending on your use case, select Video only, Audio only, or both.
* Let '''STUN/TURN''' NAT Traversal option as default
* You MUST select '''Start Viewer'''
<pre style=background-color:yellow>
GstKinesisWebRTC supports Master mode only. Peers and Web applications must be configured as Viewers to work properly with the element.
</pre>
* You are ready to run the pipelines below, depending on the video, audio selection. For example, by running a pipeline with a video sender component, you will see something like this:


== X86 (PC) ==
== X86 (PC) ==

Revision as of 17:02, 21 October 2022



Previous: Getting Started/GstKinesisWebrtc Credentials Setup Index Next: Getting Started/C Example Application




Before running any of the following pipelines you need to set up the credentials using the environment variables or adding the element properties to the kinesiswebrtcbin element.

Setup

In order to test below pipelines, after completing the AWS registration process and Keys generation, you can use the following web page to run tests: https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-js/examples/index.html. Make sure you complete the following:

  • Use same region you used in the AWS account setup
  • Add your Access Key ID and Secret Access Key
  • Add channel name and make sure it matches with the element channel property.
  • Depending on your use case, select Video only, Audio only, or both.
  • Let STUN/TURN NAT Traversal option as default
  • You MUST select Start Viewer
GstKinesisWebRTC supports Master mode only. Peers and Web applications must be configured as Viewers to work properly with the element.
  • You are ready to run the pipelines below, depending on the video, audio selection. For example, by running a pipeline with a video sender component, you will see something like this:


X86 (PC)

The pipelines in this section use software based elements to capture and encode.

Send Audio Only

gst-launch-1.0  audiotestsrc is-live=TRUE ! queue leaky=2 max-size-buffers=400 ! audioconvert ! audioresample ! opusenc ! audio/x-opus,rate=48000,channels=2 ! queue ! kinesiswebrtcbin channel=test-ridgerun

Send Video Only

gst-launch-1.0 videotestsrc is-live=true ! queue ! video/x-raw,width=640,height=480,framerate=30/1 ! vp8enc error-resilient=partitions keyframe-max-dist=10 auto-alt-ref=true cpu-used=5 deadline=1  ! queue ! kinesiswebrtcbin channel=test-ridgerun

Send Audio and Video

gst-launch-1.0 videotestsrc is-live=true ! queue ! video/x-raw,width=640,height=480,framerate=30/1 ! vp8enc error-resilient=partitions keyframe-max-dist=10 auto-alt-ref=true cpu-used=5 deadline=1  ! queue ! kinesiswebrtcbin channel=test-ridgerun name=bin audiotestsrc is-live=TRUE ! queue leaky=2 max-size-buffers=400 ! audioconvert ! audioresample ! opusenc ! audio/x-opus,rate=48000,channels=2 ! queue ! bin.

Receive Video Only

gst-launch-1.0 kinesiswebrtcbin channel=test-ridgerun name=bin  bin.videosrc_0 !  queue ! vp8dec ! queue ! videoconvert ! ximagesink

Send-Receive Audio and Video

gst-launch-1.0 v4l2src ! videoconvert ! vp8enc error-resilient=partitions keyframe-max-dist=10 auto-alt-ref=true cpu-used=5 deadline=1  ! queue ! kinesiswebrtcbin channel=test-ridgerun name=bin alsasrc !  queue ! audioconvert ! audioresample ! opusenc ! audio/x-opus,rate=48000,channels=2 ! queue ! bin. bin.audiosrc_0 ! queue ! opusparse ! opusdec ! queue !  pulsesink sync=false bin.videosrc_0 ! queue ! vp8dec ! queue ! videoconvert ! ximagesink sync=false

NVIDIA Jetson Nano

The pipelines in this section use NVIDIA hardware accelerated elements to capture and encode.

Send Audio Only

gst-launch-1.0 alsasrc device=hw:2,0 ! audioconvert ! audioresample ! opusenc ! audio/x-opus,rate=48000,channels=2 ! queue !  kinesiswebrtcbin channel=test-ridgerun name=bin

Send Video Only

gst-launch-1.0 nvarguscamerasrc !  video/x-raw\(memory:NVMM\),width=1280,height=720,framerate=30/1 ! queue ! nvv4l2vp8enc ! queue ! kinesiswebrtcbin channel=test-ridgerun name=bin

Send Audio and Video

gst-launch-1.0 nvarguscamerasrc !  video/x-raw\(memory:NVMM\),width=1280,height=720,framerate=30/1 ! queue ! nvv4l2vp8enc ! queue ! kinesiswebrtcbin channel=test-ridgerun name=bin alsasrc device=hw:2,0 ! audioconvert ! audioresample ! opusenc ! audio/x-opus,rate=48000,channels=2 ! queue ! bin.

Send-Receive Audio and Video

gst-launch-1.0 nvarguscamerasrc !  video/x-raw\(memory:NVMM\),width=1280,height=720,framerate=30/1 ! queue ! nvv4l2vp8enc ! queue ! kinesiswebrtcbin channel=test-ridgerun name=bin alsasrc device=hw:2,0 ! audioconvert ! audioresample ! opusenc ! audio/x-opus,rate=48000,channels=2 ! queue ! bin.  bin.videosrc_0 !  queue ! vp8dec ! queue ! nvvidconv ! nvoverlaysink async=false bin.audiosrc_0 ! queue ! opusparse ! opusdec ! queue ! audioconvert ! audioresample !  "audio/x-raw, layout=(string)interleaved, rate=(int)44100, format=(string)S16LE, channels=(int)2" !  alsasink device=hw:2,0 async=false



Previous: Getting Started/GstKinesisWebrtc Credentials Setup Index Next: Getting Started/C Example Application