Publish GStreamer streams to Kinesis Video, implemented in Java.
This code is more or less analogous to the kinesis-video-gst-demo provided in amazon-kinesis-video-streams-producer-cpp, except it's written in pure Java (well, it depends on GStreamer and the native Kinesis bindings, but the code is all Java).
This code depends on the amazon-kinesis-video-streams-producer-sdk-java, and simply
implements a MediaSource
which can read from GStreamer.
- I've only implemented H264 RTSP streaming (because my use case was publishing streams from a security camera which uses H264 and emits a RTSP stream).
- Coming soon I intend to genericify the GStreamer code so you can plug any GST
Pipeline
in. Or feel free to do that yourself.
- Coming soon I intend to genericify the GStreamer code so you can plug any GST
- There's a demo (
GStreamerRtspPublisherDemo
) which should work.
- This currently depends on some code which isn't actually available. Specifically:
- I forked amazon-kinesis-video-streams-producer-sdk-java because it didn't
really support making custom implementations of
MediaSource
(hopefully this will be merged in soon). - That library isn't actually published to Maven yet so to get this project to build you'll need to jump through some hoops described below.
- I forked amazon-kinesis-video-streams-producer-sdk-java because it didn't
really support making custom implementations of
I actually wrote this in Kotlin first. I'll provide some Kotlin code soon. I wanted a Java-based demo so AWS could refer to it though. Hey, I used Java 10 and var
at least?
- Gradle (
brew install gradle
) - Maven (
brew install maven
) - GStreamer (
brew install gstreamer gst-plugins-base gst-libav gst-plugins-bad gst-plugins-good gst-plugins-ugly
)
-
Clone a local copy of my forked version of amazon-kinesis-video-streams-producer-sdk-java
-
Install it into your local Maven repository (
mvn install
from its directory) -
Clone this repository
-
Run the demo!
gradle -Paws.accessKeyId=<accessKeyId>> -Paws.secretKey=<secretKey> -PstreamName=<KinesisStreamName> -PrtspUri=<rtsp://whateverYourRtspUriHappensToBe> runRtspDemo