##
##  go2rtc.yml -- MediaMTX Server Configuration
##

#   Sender:
#   RTSP:       rtsp://<ip>:8554/<name>
#   MPEG-TS:    http://<ip>:1984/api/stream.ts?dst=<name>
#   WHIP:       http://<ip>:1984/api/webrtc?dst=<name>
#
#   Player:
#   RTSP:       rtsp://<ip>:8554/<name>?mp4
#   MP4:        http://<ip>:1984/api/stream.mp4?src=<name>      (H264, H265, AAC)
#   HLS/fMP4:   http://<ip>:1984/api/stream.m3u8?src=<name>&mp4 (H264, H265, AAC)
#   HLS/TS:     http://<ip>:1984/api/stream.m3u8?src=<name>     (H264)
#   Any:        http://<ip>:1984/

log:
    level:      "info"

#   Control
api:
    listen:     "127.0.0.1:1984"
    username:   "admin"
    password:   "admin"
    base_path:  ""
    static_dir: ""
    origin:     "*"

#   Transcoding
ffmpeg:
    bin:        "@l_prefix@/bin/ffmpeg"
    global:     "-hide_banner"
    file:       "-re -stream_loop -1 -i {input}"
    http:       "-fflags nobuffer -flags low_delay -i {input}"
    rtsp:       "-fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i {input}"
    rtsp/udp:   "-fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -i {input}"
    h264:       "-c:v libx264 -g 50 -profile:v high -level:v 4.1 -preset:v superfast -tune:v zerolatency -pix_fmt:v yuvj420p"
    h265:       "-c:v libx265 -g 50 -profile:v main -level:v 5.1 -preset:v superfast -tune:v zerolatency"
    opus:       "-c:a libopus -ar:a 48000 -ac:a 2 -application:a voip -compression_level:a 0"
    output:     "-user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output}"

#   Streaming Server
rtsp:
    listen:     "127.0.0.1:8554"
    username:   ""
    password:   ""
srtp:
    listen:     "127.0.0.1:8443"
webrtc:
    listen:     "127.0.0.1:8555"
    candidates: [ "stun:8555" ]
    ice_servers:
        -   urls: [ "stun:stun.l.google.com:19302" ]
            username:   ""
            credential: ""

#   Streaming Client
streams: {}

