mirror of
https://github.com/aler9/rtsp-simple-server
synced 2026-04-22 23:17:11 +08:00
34 lines
827 B
Markdown
34 lines
827 B
Markdown
# Basic usage
|
|
|
|
1. [Publish](../2-features/03-publish.md) a stream. For instance, you can publish a stream from a MP4 file with _FFmpeg_:
|
|
|
|
```sh
|
|
ffmpeg -re -stream_loop -1 -i file.mp4 -c copy \
|
|
-f rtsp rtsp://localhost:8554/mystream
|
|
```
|
|
|
|
or _GStreamer_:
|
|
|
|
```sh
|
|
gst-launch-1.0 rtspclientsink name=s location=rtsp://localhost:8554/mystream filesrc location=file.mp4 \
|
|
! qtdemux name=d d.video_0 ! queue ! s.sink_0 d.audio_0 ! queue ! s.sink_1
|
|
```
|
|
|
|
2. [Read](../2-features/04-read.md) the stream. For instance, you can read the stream with _VLC_:
|
|
|
|
```sh
|
|
vlc --network-caching=50 rtsp://localhost:8554/mystream
|
|
```
|
|
|
|
or _GStreamer_:
|
|
|
|
```sh
|
|
gst-play-1.0 rtsp://localhost:8554/mystream
|
|
```
|
|
|
|
or _FFmpeg_:
|
|
|
|
```sh
|
|
ffmpeg -i rtsp://localhost:8554/mystream -c copy output.mp4
|
|
```
|