aws-samples/amazon-kinesis-video-streams-demos

gst-launch-1.0: command not found

Mr-MeerMoazzam opened this issue · 4 comments

Hi,
I followed the instructions to run the RTSP example application using Docker from the https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/examples-rtsp.html official documentation. When executing AWS_ACCESS_KEY_ID=$1 AWS_SECRET_ACCESS_KEY=$2 AWS_DEFAULT_REGION="us-east-1" gst-launch-1.0 rtspsrc location=rtsp://$3 ! rtph264depay ! h264parse ! kvssink stream-name=$4 storage-size=512 within the docker container then getting the error.

bash: gst-launch-1.0: command not found

Hi @Mr-MeerMoazzam, can you please check if your container has gstreamer installed with gst-launch-1.0 --gst-version. If not, please install gstreamer before you try again

Hi @niyatim23
This is the docker file:

FROM ubuntu:18.04 AS builder

RUN apt-get upgrade && \
    apt-get update && \
    apt-get install -y  \
    byacc \
    cmake \
    curl \
    g++ \
    git \
    gstreamer1.0-plugins-base-apps \
    libgstreamer1.0-dev \
    libgstreamer-plugins-base1.0-dev \
    m4 \
    maven \
    openjdk-8-jdk \
    pkg-config \
    xz-utils && \
    rm -rf /var/lib/apt/lists/* && \
    cd /opt/

# ===== Setup Kinesis Video Streams Producer SDK (CPP) =======================================
WORKDIR /opt/
RUN git clone https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp.git
WORKDIR /opt/amazon-kinesis-video-streams-producer-sdk-cpp/build/
RUN cmake .. -DBUILD_GSTREAMER_PLUGIN=ON && \
    make


FROM ubuntu:18.04

RUN apt update && \
    apt install -y \
    gstreamer1.0-plugins-bad \
    gstreamer1.0-plugins-good \
    gstreamer1.0-plugins-ugly \
    openjdk-8-jre && \
    rm -rf /var/lib/apt/lists/*

COPY --from=builder /opt/amazon-kinesis-video-streams-producer-sdk-cpp /opt/amazon-kinesis-video-streams-producer-sdk-cpp

WORKDIR /opt/amazon-kinesis-video-streams-producer-sdk-cpp/build/

ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/
ENV LD_LIBRARY_PATH=/opt/amazon-kinesis-video-streams-producer-sdk-cpp/open-source/local/lib:$LD_LIBRARY_PATH
ENV GST_PLUGIN_PATH=/opt/amazon-kinesis-video-streams-producer-sdk-cpp/build

I build the container using this

Hi @niyatim23 @mariobaldini @hyandell @yuma-m
I updated the dockerfile little bit and now it's working fine

RUN apt install -y \
    gstreamer1.0-plugins-bad \
    gstreamer1.0-plugins-good \
    gstreamer1.0-plugins-ugly \
    gstreamer1.0-tools \   # Add this line to install GStreamer tools
    openjdk-8-jre && \
    rm -rf /var/lib/apt/lists/*

But now when I am running this command

AWS_ACCESS_KEY_ID=$1  AWS_SECRET_ACCESS_KEY=$2 AWS_DEFAULT_REGION="us-east-1" gst-launch-1.0 rtspsrc location=$3 short-header=TRUE ! rtph264depay ! h264parse ! kvssink stream-name=camera_148 storage-size=512

getting

Additional debug info:
gstrtspsrc.c(5427): gst_rtspsrc_reconnect (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Could not receive any UDP packets for 5.0000 seconds, maybe your firewall is blocking it. Retrying using a tcp connection.

and this is stuck here.
I also tried the command:

AWS_ACCESS_KEY_ID=$1 AWS_SECRET_ACCESS_KEY=$2 AWS_DEFAULT_REGION="us-east-1" ./kvs_gstreamer_sample camera_148 rtsp://admin:password@url

but getting

New pad found: recv_rtp_src_0_321070664_96
[INFO ] [30-08-2023 05:38:12:185.572 GMT] Pad link failed
Error received from element source: Internal data stream error.
Debugging information: gstrtspsrc.c(5653): gst_rtspsrc_loop (): /GstPipeline:rtsp-kinesis-pipeline/GstRTSPSrc:source:
streaming stopped, reason not-linked (-1)

Closing this issue as it has been resolved