Step 3: Run and verify the code - Amazon Kinesis Video Streams
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Step 3: Run and verify the code

To run and verify the code for the Producer Library procedure, do the following:

  1. Run the following commands to create a build directory in your downloaded C SDK, and launch cmake from it:

    mkdir -p amazon-kinesis-video-streams-producer-c/build; cd amazon-kinesis-video-streams-producer-c/build; cmake ..

    You can pass the following options to cmake ..

    • -DBUILD_DEPENDENCIES - whether to build depending libraries from source.

    • -DBUILD_TEST=TRUE - build unit and integration tests. Might be useful to confirm support for your device.


    • -DCODE_COVERAGE - enable coverage reporting.

    • -DCOMPILER_WARNINGS - enable all compiler warnings.

    • -DADDRESS_SANITIZER - build with AddressSanitizer.

    • -DMEMORY_SANITIZER - build with MemorySanitizer.

    • -DTHREAD_SANITIZER - build with ThreadSanitizer.

    • -DUNDEFINED_BEHAVIOR_SANITIZER - build with UndefinedBehaviorSanitizer.

    • -DALIGNED_MEMORY_MODEL - build for aligned memory model only devices. Default is OFF.

  2. Navigate to the build directory that you just created with the previous step, and run make to build the WebRTC C SDK and its provided samples.

  3. The sample application kinesis_video_cproducer_video_only_sample sends h.264-encoded video frames inside the folder samples/h264SampleFrames to Kinesis Video Streams. The following command sends the video frames in a loop for ten seconds to Kinesis Video Streams:

    ./kinesis_video_cproducer_video_only_sample YourStreamName 10

    If you want to send H.264-encoded frames from another folder (for example, MyH264FramesFolder), run the sample with the following arguments:

    ./kinesis_video_cproducer_video_only_sample YourStreamName 10 MyH264FramesFolder
  4. To enable verbose logs, define the HEAP_DEBUG and LOG_STREAMING C-defines by uncommenting the appropriate lines in CMakeList.txt.

You can monitor the progress of the test suite in the debug output in your IDE. You can also monitor the traffic on your stream by watching the metrics that are associated with your stream in the Amazon CloudWatch console, such as PutMedia.IncomingBytes.


The console doesn't display the data as a video stream because the test harness only sends frames of empty bytes.