Skip to content

Commit 2024200

Browse files
committed
Set up instructions for raspberry pi
1 parent a1aacf6 commit 2024200

File tree

2 files changed

+333
-79
lines changed

2 files changed

+333
-79
lines changed

docs/linux.md

Lines changed: 8 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,13 @@ You can find the RTSP URL from your IP camera manual or manufacturers product pa
6161
```
6262
$ gst-launch-1.0 -v v4l2src device=/dev/video0 ! videoconvert ! video/x-raw,format=I420,width=640,height=480,framerate=30/1 ! x264enc bframes=0 key-int-max=45 bitrate=500 tune=zerolatency ! video/x-h264,stream-format=avc,alignment=au ! kvssink stream-name=YourStreamName storage-size=128 access-key="YourAccessKey" secret-key="YourSecretKey"
6363
```
64-
###### Running the `gst-launch-1.0` command to start streaming from USB camera source which has h264 encoded stream already in **Ubuntu** and **Raspberry-PI**.
64+
###### Running the `gst-launch-1.0` command to start streaming from USB camera source which has h264 encoded stream already:
6565
```
6666
$ gst-launch-1.0 -v v4l2src device=/dev/video0 ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink stream-name=YourStreamName storage-size=128 access-key="YourAccessKey" secret-key="YourSecretKey"
6767
```
6868

69-
###### Running the `gst-launch-1.0` command to start streaming from camera source in **Raspberry-PI**.
70-
71-
```
72-
$ gst-launch-1.0 -v v4l2src do-timestamp=TRUE device=/dev/video0 ! videoconvert ! video/x-raw,format=I420,width=640,height=480,framerate=30/1 ! omxh264enc periodicty-idr=45 inline-header=FALSE ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink stream-name=YourStreamName access-key="YourAccessKey" secret-key="YourSecretKey"
73-
```
74-
or use a different encoder
75-
```
76-
$ gst-launch-1.0 -v v4l2src device=/dev/video0 ! videoconvert ! video/x-raw,format=I420,width=640,height=480,framerate=30/1 ! x264enc bframes=0 key-int-max=45 bitrate=500 tune=zerolatency ! video/x-h264,stream-format=avc,alignment=au ! kvssink stream-name=YourStreamName storage-size=128 access-key="YourAccessKey" secret-key="YourSecretKey"
77-
```
7869

79-
80-
###### Running the `gst-launch-1.0` command to start streaming both audio and video in **Raspberry-PI** and **Ubuntu**.
70+
###### Running the `gst-launch-1.0` command to start streaming both audio and video:
8171

8272
Please ensure that audio drivers are installed first by running
8373

@@ -99,20 +89,14 @@ card 3: Camera [H264 USB Camera], device 0: USB Audio [USB Audio]
9989
Subdevice #0: subdevice #0
10090
```
10191

102-
The audio recording device is represented by `hw:card_number,device_numer`. So to use the second device in the example, use `hw:3,0` as the device in `gst-launch-1.0` command.
103-
104-
Raspberry Pi:
105-
106-
```
107-
gst-launch-1.0 -v v4l2src device=/dev/video0 ! videoconvert ! video/x-raw,width=640,height=480,framerate=30/1,format=I420 ! omxh264enc periodicty-idr=45 inline-header=FALSE ! h264parse ! video/x-h264,stream-format=avc,alignment=au,profile=baseline ! kvssink name=sink stream-name="my-stream-name" access-key="YourAccessKey" secret-key="YourSecretKey" alsasrc device=hw:1,0 ! audioconvert ! avenc_aac ! queue ! sink.
108-
```
92+
The audio recording device is represented by `hw:card_number,device_number`. So to use the second device in the example, use `hw:3,0` as the device in `gst-launch-1.0` command.
10993

110-
Ubuntu:
11194
```
11295
gst-launch-1.0 -v v4l2src device=/dev/video0 ! videoconvert ! video/x-raw,width=640,height=480,framerate=30/1,format=I420 ! x264enc bframes=0 key-int-max=45 bitrate=500 tune=zerolatency ! h264parse ! video/x-h264,stream-format=avc,alignment=au,profile=baseline ! kvssink name=sink stream-name="my-stream-name" access-key="YourAccessKey" secret-key="YourSecretKey" alsasrc device=hw:1,0 ! audioconvert ! avenc_aac ! queue ! sink.
11396
```
11497

115-
if your camera supports outputting h264 encoded stream directly, then you can use this command in both Raspberry Pi and Ubuntu:
98+
if your camera supports outputting h264 encoded stream directly, then you can use this command:
99+
116100
```
117101
gst-launch-1.0 -v v4l2src device=/dev/video0 ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink name=sink stream-name="my-stream-name" access-key="YourAccessKey" secret-key="YourSecretKey" alsasrc device=hw:1,0 ! audioconvert ! avenc_aac ! queue ! sink.
118102
```
@@ -143,24 +127,6 @@ Change your current working directory to `build`. Launch the sample application
143127
AWS_ACCESS_KEY_ID=YourAccessKeyId AWS_SECRET_ACCESS_KEY=YourSecretAccessKey ./kinesis_video_gstreamer_sample_app <my-stream> </path/to/file>
144128
```
145129

146-
###### Running the `gst-launch-1.0` command to upload [MKV](https://www.matroska.org/) file that contains both *audio and video* in **Raspberry-PI**. Note that video should be H264 encoded and audio should be AAC encoded.
147-
148-
```
149-
gst-launch-1.0 -v filesrc location="YourAudioVideo.mkv" ! matroskademux name=demux ! queue ! h264parse ! kvssink name=sink stream-name="my_stream_name" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.
150-
```
151-
152-
###### Running the `gst-launch-1.0` command to upload MP4 file that contains both *audio and video* in **Raspberry-PI**.
153-
154-
```
155-
gst-launch-1.0 -v filesrc location="YourAudioVideo.mp4" ! qtdemux name=demux ! queue ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink name=sink stream-name="audio-video-file" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.
156-
```
157-
158-
###### Running the `gst-launch-1.0` command to upload MPEG2TS file that contains both *audio and video* in **Raspberry-PI**.
159-
160-
```
161-
gst-launch-1.0 -v filesrc location="YourAudioVideo.ts" ! tsdemux name=demux ! queue ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink name=sink stream-name="audio-video-file" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.
162-
```
163-
164130
##### Running the GStreamer sample application to upload a *audio and video* file
165131

166132
`kinesis_video_gstreamer_audio_video_sample_app` supports uploading a video that is either MKV, MPEGTS, or MP4. The sample application expects the video is encoded in H264 and audio is encoded in AAC format. Note: If your media uses a different format, then you can revise the pipeline elements in the sample application to suit your media format.
@@ -208,7 +174,6 @@ For additional examples on using Kinesis Video Streams Java SDK and Kinesis Vid
208174
##### Running C++ unit tests
209175

210176
**Note:** Please set the credentials before running the unit tests:
211-
212177
```
213178
$ export AWS_ACCESS_KEY_ID=YourAccessKeyId
214179
$ export AWS_SECRET_ACCESS_KEY=YourSecretAccessKey
@@ -232,7 +197,7 @@ The executable for **GStreamer unit tests** will be built as `./tst/gstkvsplugin
232197
----
233198
##### How to configure logging for producer SDK sample applications.
234199

235-
For the sample demo applications included in the producer SDK (CPP), the log configuration is referred from the file `kvs_log_configuration` (within the `build` folder).
200+
For the sample demo applications included in the producer SDK (CPP), the log configuration is referred from the file `kvs_log_configuration` (within the `samples` folder).
236201

237202
Refer sample configuration in the folder `build` for details on how to set the log level (DEBUG or INFO) and output options (whether to send log output to either console or file (or both)).
238203
* Log output messages to console:
@@ -244,9 +209,9 @@ Refer sample configuration in the folder `build` for details on how to set the l
244209

245210
By default C producer prints all logging information to stdout.
246211

247-
To send log information to a file (named kvsProducerLog.index), you need to use the addFileLoggerPlatformCallbacksProvider API after ClientCallbacks has been initialized.
212+
To send log information to a file (named kvsProducerLog.index), you need to use the `addFileLoggerPlatformCallbacksProvider` API after ClientCallbacks has been initialized.
248213

249-
The addFileLoggerPlatformCallbacksProvider API takes five parameters.
214+
The `addFileLoggerPlatformCallbacksProvider` API takes five parameters.
250215

251216
* First parameter is the PClientCallbacks that is created during the createCallback provider API (e.g.createDefaultCallbacksProviderWithAuthCallbacks.
252217
* Second parameter is the size of string buffer that file logger will use. Logs are buffered in the string buffer and flushed into files when the buffer is full.
@@ -277,39 +242,3 @@ The projects depend on the following open source components. Running `CMake` wil
277242
* [x264]( https://www.videolan.org/developers/x264.html)
278243

279244
----
280-
281-
### Troubleshooting:
282-
283-
##### Raspberry PI failure to load the camera device.
284-
To check this is the case run `ls /dev/video*` - it should be file not found. The remedy is to run the following:
285-
```
286-
$ls /dev/video*
287-
{not found}
288-
```
289-
```
290-
$vcgencmd get_camera
291-
```
292-
Example output:
293-
```
294-
supported=1 detected=1
295-
```
296-
if the driver does not detect the camera then
297-
298-
* Check for the camera setup and whether it's connected properly
299-
* Run firmware update `$ sudo rpi-update` and restart
300-
```
301-
$sudo modprobe bcm2835-v4l2
302-
```
303-
```
304-
$ls /dev/video*
305-
{lists the device}
306-
```
307-
308-
##### Raspberry PI timestamp/range assertion at runtime.
309-
Update the Raspberry PI firmware.
310-
```
311-
$ sudo rpi-update
312-
$ sudo reboot
313-
```
314-
315-
* Raspberry PI GStreamer assertion on gst_value_set_fraction_range_full: assertion 'gst_util_fraction_compare (numerator_start, denominator_start, numerator_end, denominator_end) < 0' failed. The uv4l service running in the background. Kill the service and restart the sample app.

0 commit comments

Comments
 (0)