You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The resulting stream will be available in path `/mystream`.
306
+
The resulting stream is available in path `/mystream`.
305
307
306
308
GStreamer can also publish a stream by using the [WebRTC / WHIP protocol](#webrtc). Make sure that GStreamer version is at least 1.22, and that if the codec is H264, the profile is baseline. Use the `whipclientsink` element:
307
309
@@ -350,7 +352,7 @@ Latest versions of OBS Studio can publish to the server with the [WebRTC / WHIP
350
352
351
353
Save the configuration and click `Start streaming`.
352
354
353
-
The resulting stream will be available in path `/mystream`.
355
+
The resulting stream is available in path `/mystream`.
354
356
355
357
#### OpenCV
356
358
@@ -425,7 +427,7 @@ while True:
425
427
start = now
426
428
```
427
429
428
-
The resulting stream will be available in path `/mystream`.
430
+
The resulting stream is available in path `/mystream`.
429
431
430
432
#### Unity
431
433
@@ -536,7 +538,7 @@ public class WebRTCPublisher : MonoBehaviour
536
538
537
539
In the _Hierarchy_ window, find or create a scene and a camera, then add the `WebRTCPublisher.cs` script as component of the camera, by dragging it inside the _Inspector_ window. then Press the _Play_ button at the top of the page.
538
540
539
-
The resulting stream will be available in path `/unity`.
541
+
The resulting stream is available in path `/unity`.
540
542
541
543
#### Web browsers
542
544
@@ -546,7 +548,7 @@ Web browsers can publish a stream to the server by using the [WebRTC protocol](#
546
548
http://localhost:8889/mystream/publish
547
549
```
548
550
549
-
The resulting stream will be available in path `/mystream`.
551
+
The resulting stream is available in path `/mystream`.
550
552
551
553
This web page can be embedded into another web page by using an iframe:
552
554
@@ -584,7 +586,7 @@ Where `USB2.0 HD UVC WebCam` is the name of a webcam, that can be obtained with:
584
586
ffmpeg -list_devices true -f dshow -i dummy
585
587
```
586
588
587
-
The resulting stream will be available in path `/cam`.
589
+
The resulting stream is available in path `/cam`.
588
590
589
591
#### Raspberry Pi Cameras
590
592
@@ -611,7 +613,7 @@ If you want to run the standard (non-Docker) version of the server:
611
613
source: rpiCamera
612
614
```
613
615
614
-
The resulting stream will be available in path `/cam`.
616
+
The resulting stream is available in path `/cam`.
615
617
616
618
If you want to run the server inside Docker, you need to use the `latest-rpi` image and launch the container with some additional flags:
617
619
@@ -639,6 +641,8 @@ paths:
639
641
640
642
All available parameters are listed in the [sample configuration file](/mediamtx.yml).
641
643
644
+
##### Adding audio
645
+
642
646
In order to add audio from a USB microfone, install GStreamer and alsa-utils:
643
647
644
648
```sh
@@ -678,7 +682,42 @@ paths:
678
682
runOnInitRestart: yes
679
683
```
680
684
681
-
The resulting stream will be available in path `/cam_with_audio`.
685
+
The resulting stream is available in path `/cam_with_audio`.
686
+
687
+
##### Secondary stream
688
+
689
+
It is possible to enable a secondary stream from the same camera, with a different resolution, FPS and codec. Configuration is the same of a primary stream, with `rpiCameraSecondary` set to `true` and parameters adjusted accordingly:
690
+
691
+
```yml
692
+
paths:
693
+
# primary stream
694
+
rpi:
695
+
source: rpiCamera
696
+
# Width of frames.
697
+
rpiCameraWidth: 1920
698
+
# Height of frames.
699
+
rpiCameraHeight: 1080
700
+
# FPS.
701
+
rpiCameraFPS: 30
702
+
703
+
# secondary stream
704
+
secondary:
705
+
source: rpiCamera
706
+
# This is a secondary stream.
707
+
rpiCameraSecondary: true
708
+
# Width of frames.
709
+
rpiCameraWidth: 640
710
+
# Height of frames.
711
+
rpiCameraHeight: 480
712
+
# FPS.
713
+
rpiCameraFPS: 10
714
+
# Codec. in case of secondary streams, it defaults to M-JPEG.
715
+
rpiCameraCodec: auto
716
+
# JPEG quality.
717
+
rpiCameraJPEGQuality: 60
718
+
```
719
+
720
+
The secondary stream is available in path `/secondary`.
682
721
683
722
### By protocol
684
723
@@ -690,7 +729,7 @@ SRT is a protocol that allows to publish and read live data stream, providing en
Replace `mystream` with any name you want. The resulting stream will be available in path `/mystream`.
732
+
Replace `mystream` with any name you want. The resulting stream is available in path `/mystream`.
694
733
695
734
If credentials are enabled, append username and password to `streamid`:
696
735
@@ -723,7 +762,7 @@ WebRTC is an API that makes use of a set of protocols and methods to connect two
723
762
http://localhost:8889/mystream/publish
724
763
```
725
764
726
-
The resulting stream will be available in path `/mystream`.
765
+
The resulting stream is available in path `/mystream`.
727
766
728
767
WHIP is a WebRTC extensions that allows to publish streams by using a URL, without passing through a web page. This allows to use WebRTC as a general purpose streaming protocol. If you are using a software that supports WHIP (for instance, latest versions of OBS Studio), you can publish a stream to the server by using this URL:
729
768
@@ -756,7 +795,7 @@ RTSP is a protocol that allows to publish and read streams. It supports differen
756
795
rtsp://localhost:8554/mystream
757
796
```
758
797
759
-
The resulting stream will be available in path `/mystream`.
798
+
The resulting stream is available in path `/mystream`.
760
799
761
800
Known clients that can publish with RTSP are [FFmpeg](#ffmpeg), [GStreamer](#gstreamer), [OBS Studio](#obs-studio).
762
801
@@ -771,7 +810,7 @@ paths:
771
810
source: rtsp://original-url
772
811
```
773
812
774
-
The resulting stream will be available in path `/proxied`.
813
+
The resulting stream is available in path `/proxied`.
775
814
776
815
The server supports any number of source streams (count is just limited by available hardware resources) it's enough to add additional entries to the paths section:
777
816
@@ -792,7 +831,7 @@ RTMP is a protocol that allows to read and publish streams, but is less versatil
792
831
rtmp://localhost/mystream
793
832
```
794
833
795
-
The resulting stream will be available in path `/mystream`.
834
+
The resulting stream is available in path `/mystream`.
796
835
797
836
In case authentication is enabled, credentials can be passed to the server by using the `user` and `pass` query parameters:
798
837
@@ -813,7 +852,7 @@ paths:
813
852
source: rtmp://original-url
814
853
```
815
854
816
-
The resulting stream will be available in path `/proxied`.
855
+
The resulting stream is available in path `/proxied`.
817
856
818
857
#### HLS cameras and servers
819
858
@@ -826,7 +865,7 @@ paths:
826
865
source: http://original-url/stream/index.m3u8
827
866
```
828
867
829
-
The resulting stream will be available in path `/proxied`.
868
+
The resulting stream is available in path `/proxied`.
830
869
831
870
#### UDP/MPEG-TS
832
871
@@ -854,7 +893,7 @@ paths:
854
893
source: udp://238.0.0.1:1234
855
894
```
856
895
857
-
The resulting stream will be available in path `/mypath`.
896
+
The resulting stream is available in path `/mypath`.
858
897
859
898
Known clients that can publish with WebRTC and WHIP are [FFmpeg](#ffmpeg) and [GStreamer](#gstreamer).
0 commit comments