Closed j0928888843 closed 1 year ago
I faced this exact problem recently.
To get around it, I followed the clues in the OSX build instructions and installed all of the needed dependencies via HomeBrew, the used a CMake flag to prevent the build from trying to assemble the dependencies itself.
Here's some history from my shell:
git clone https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp.git\
cd amazon-kinesis-video-streams-producer-sdk-cpp
mkdir build
cd build
KVS_GST_PLUGIN_PATH=$(pwd)
brew install pkg-config openssl cmake gstreamer \
gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly \
log4cplus gst-libav openjdk
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_JNI=FALSE -DBUILD_DEPENDENCIES=OFF
make
export GST_PLUGIN_PATH=/opt/homebrew/lib/gstreamer-1.0:${KVS_GST_PLUGIN_PATH}
After that, the build and these commands started working for me:
gst-device-monitor
gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink
gst-launch-1.0 avfvideosrc device-index=0 ! video/x-raw, framerate=30/1, width=1280, height=720 ! queue ! autovideosink
Perhaps it will help others... here are a few more commands that I am frequently using:
brew install awscli jq
# create a stream using FaceTime camera, etc.
# locate the device-index and device nuber for the cam and mic using the Device Monitor command
gst-device-monitor
cameraDeviceIndex=0
audioDeviceNum=51
export AWS_ACCESS_KEY_ID="<foo>"
export AWS_SECRET_ACCESS_KEY="<baz>"
export AWS_DEFAULT_REGION="us-east-1"
streamName="My-Test-Stream-nnn"
gst-launch-1.0 -v avfvideosrc device-index=${cameraDeviceIndex} \
! videoconvert \
! vtenc_h264_hw \
allow-frame-reordering=FALSE \
realtime=TRUE \
max-keyframe-interval=45 \
! kvssink name=sink \
stream-name="${streamName}" \
osxaudiosrc device=${audioDeviceNum} \
! audioconvert \
! avenc_aac \
! queue \
! sink.
# Get the HLS URL for the camera that is now streaming (in another terminal window)
streamName="My-Test-Stream-nnn"
kvsDataEndpoint=$(aws kinesisvideo get-data-endpoint \
--stream-name "${streamName}" \
--api-name GET_HLS_STREAMING_SESSION_URL \
| jq -r '.DataEndpoint')
hlsStreamingSessionUrl=$(aws kinesis-video-archived-media get-hls-streaming-session-url \
--endpoint-url "${kvsDataEndpoint}" \
--stream-name "${streamName}" \
--playback-mode LIVE \
| jq -r '.HLSStreamingSessionURL')
open -b com.apple.safari "${hlsStreamingSessionUrl}"
Some notes I have found: you also need to install GTest on a clean system: brew install googletest
, and you need to specify OpenSSL location in the PKG_CONFIG_PATH via something like export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@3/lib/pkgconfig"
. Thank you for the help @ThePhen!
Logging
platform: M1 pro macbook pro The C compiler identification is AppleClang 13.1.6.13160021 The CXX compiler identification is AppleClang 13.1.6.13160021