Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTMP to SRT #58

Closed
crack00r opened this issue Apr 17, 2022 · 8 comments
Closed

RTMP to SRT #58

crack00r opened this issue Apr 17, 2022 · 8 comments

Comments

@crack00r
Copy link

crack00r commented Apr 17, 2022

I try to send RTMP Signal forward as SRT

my config ist

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; This file documents all the ini parameters of MonaServer ;;;
;;;        and list them with their values by default,       ;;;
;;;    without this file their parameters values are these   ;;;
;;;                                                          ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; By default MonaServer.exe search a "MonaServer.ini"      ;;;
;;; in the same folder, but you can also start MonaServer    ;;;
;;; with path to one other ini file as first argument:       ;;;
;;; /> MonaServer /currentPath/Server.ini                    ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;; GENERAL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; application description (displaid with --help argument for example)
description=MonaServer
; number of cores to use, default value 0 give a cores auto detection
cores=0
; reuses buffer rather delete them
poolBuffers=true
; www folder of Mona, containing server applications
wwwDir="www"
; data folder of Mona, containing database
dataDir="data"



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;; CATEGORIZED ;;;;;;;;;;;;;;;;;;;;;;;;;;;

; configure logs of Mona, in addition if you set [logs=Publication]
; it makes logs accessible remotely by all protocols supported by mona
; (a 'logs' mona publication is created, see 'PUBLICATIONS' part above)
; For example you can see logs in real-time in a browser in opening http://locahost/logs.dat
[logs]
; directory where are stored logs
directory=MonaServer.log
; max size for a log file, if exceeds it starts a new log file, 0 value continues indefinitely to write the same file
maxSize=1000000
; number of log files to preserve, 1 value write all logs in the same file, 0 value will write a illimited number of files 
rotation=10

; configure path for TLS certificat and key
[TLS]
certificat=cert.pem
key=key.pem

; configure all sockets in mona
[net]
; bufferSize, base parameters for recvBufferSize and sendBufferSize
bufferSize=65536
; recvBufferSize, customize receiving socket buffer size
recvBufferSize=65536
; recvBufferSize, customize sending socket buffer size
sendBufferSize=65536



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;; SERVERS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Configure server and protocol of Mona, every protocol parameters can be
; generalized with general parameters (see above in GENERAL), for example
; you can set the same publicHost and bufferSize for all protocols and
; configure a specific bufferSize just for HTTP:
; publicHost=69.89.31.226
; bufferSize=65536
; [HTTP]
; bufferSize=131072

; [HTTP(=true|false)] HTTP server
[HTTP=false]
; socket bind
port=80
host=0.0.0.0
publicPort=80
publicHost=127.0.0.1
; socket parameters, if not set use [net] parameters (see above in CATEGORIZED)
bufferSize=65536
recvBufferSize=65536
sendBufferSize=65536
; timeout connection in seconds
timeout=10
; boolean or string, build a "index" files page on a folder GET request, if false returns a 401 unauthorized error
; value can be a file name to redirect a folder GET request to a file, for example index="index.html"
index=true
; rendezVous experimental service (HTTP 'RDV' command), allow to meet (with data exchange) two clients
; can be usefull to start a WebRTC session for example between two peers (with SDP exchange)
rendezVous=false

; [HTTPS(=true|false)] HTTP SSL server, disabled if TLS certificat and key are missing
[HTTPS=false]
; socket bind
port=443
host=0.0.0.0
publicPort=443
publicHost=127.0.0.1
; socket parameters, if not set use [net] parameters (see above in CATEGORIZED)
bufferSize=65536
recvBufferSize=65536
sendBufferSize=65536
; timeout connection in seconds
timeout=10
; boolean or string, build a "index" files page on a folder GET request, if false returns a 401 unauthorized error
; value can be a file name to redirect a folder GET request to a file, for example index="index.html"
index=true
; rendezVous experimental service (HTTP 'RDV' command), allow to meet (with data exchange) two clients
; can be usefull to start a WebRTC session for example between two peers (with SDP exchange)
rendezVous=false

; [WS(=true|false)] WebSocket server, disabled if HTTP is disabled
[WS=false]
; socket parameters only for clients, if not set use [net] parameters (see above in CATEGORIZED)
bufferSize=65536
recvBufferSize=65536
sendBufferSize=65536
; timeout connection in seconds
timeout=80

; [WSS(=true|false)] WebSocket SSL server, disabled if HTTPS is disabled
[WSS=false]
; socket parameters only for clients, if not set use [net] parameters (see above in CATEGORIZED)
bufferSize=65536
recvBufferSize=65536
sendBufferSize=65536
; timeout connection in seconds
timeout=80

; [STUN(=true|false)] STUN server
[STUN=false]
; socket bind
port=3478
host=0.0.0.0
publicPort=3478
publicHost=127.0.0.1
; socket parameters, if not set use [net] parameters (see above in CATEGORIZED)
bufferSize=65536
recvBufferSize=65536
sendBufferSize=65536

; [SRT(=true|false)] SRT server, disabled if Mona is not built with ENABLE_SRT
; Parameters also any SRT socket in mona even if server is disabled with [SRT=false]
[SRT=true]
; soc=trueket bind
port=1936
host=0.0.0.0
publicPort=1937
publicHost=127.0.0.1
; socket parameters, if not set use [net] parameters (see above in CATEGORIZED)
bufferSize=65536
recvBufferSize=65536
sendBufferSize=65536
; SRTO_TLPKTDROP, see https://github.com/Haivision/srt/blob/master/docs/API.md#options
pktdrop=true
; SRTO_PBKEYLEN, see https://github.com/Haivision/srt/blob/master/docs/API.md#options
encryption=0
; SRTO_PASSPHRASE, see https://github.com/Haivision/srt/blob/master/docs/API.md#options
passphrase=
; SRTO_RCVLATENCY, see https://github.com/Haivision/srt/blob/master/docs/API.md#options
latency=120
; SRTO_PEERLATENCY, see https://github.com/Haivision/srt/blob/master/docs/API.md#options
peerlatency=0
; SRTO_MSS, see https://github.com/Haivision/srt/blob/master/docs/API.md#options
mss=1500
; SRTO_OHEADBW, see https://github.com/Haivision/srt/blob/master/docs/API.md#options
overheadbw=25
; SRTO_MAXBW, see https://github.com/Haivision/srt/blob/master/docs/API.md#options
maxbw=-1

; [RTMP(=true|false)] RTMP (and RTMPE) server
[RTMP=true]
; socket bind
port=1935
host=0.0.0.0
publicPort=1935
publicHost=127.0.0.1
; socket parameters, if not set use [net] parameters (see above in CATEGORIZED)
bufferSize=65536
recvBufferSize=65536
sendBufferSize=65536
; timeout connection in seconds
timeout=60

; [RTMPS(=true|false)] RTMPS server, disabled if TLS certificat and key are missing
[RTMPS=false]
; socket bind
port=8443
host=0.0.0.0
publicPort=8443
publicHost=127.0.0.1
; socket parameters, if not set use [net] parameters (see above in CATEGORIZED)
bufferSize=65536
recvBufferSize=65536
sendBufferSize=65536
; timeout connection in seconds
timeout=60

; [RTMFP(=true|false)] RTMFP server
[RTMFP=false]
; socket bind
port=1935
host=0.0.0.0
publicPort=1935
publicHost=127.0.0.1
; socket parameters, if not set use [net] parameters (see above in CATEGORIZED)
bufferSize=65536
recvBufferSize=65536
sendBufferSize=65536
; keepalive frequency between peers in seconds
keepalivePeer=10
; keepalive frequency between peers in seconds
keepalivePeer=10
; addresses separated by semicolon of other RTMFP server to make scalable the rendezvous service of RTMFP
addresses=


;;;;;;;;;;;;;;;; MUTLIPLE SERVER INSTANCES  ;;;;;;;;;;;;;;;;;;;;
; Start multiple server instances with [name=protocol], parameters inherit from those of the base protocol.
; Uncomment the two lines below for example to start a 2nd server HTTP on port 88
; [=HTTP]
; port=88



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;; PUBLICATIONS ;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Mona publication are media stream shared between all the protocol supported by Mona
; Any protocol can publish a new publication, or subscribe to a publication
; Use sub category with [name=Publication] to configure some publication properties,
; as soon as a publication with this name is created these properties will be assigned to it
; [test=Publication]
; description= publication of test
; name=value
;
; Also allow of mapping a publication with input and output stream (TODO document it!)
; A publication with input streams will be created when a stream input start
; A publication with output streams will serve them one time the publication started by any protocol publisher
; Examples:
;
; create a publication 'test' reading Sintel.ts with its Sintel.vtt subtitle
; [test=Publication]
; IN Sintel.ts
; IN Sintel.vtt
;
; will record publication 'test' in flv and its subtitle in srt
; [test=Publication]
; OUT record.flv
; OUT record.srt

; UDP/TS input on port 1234 will be recorded in a mp4 file
; [test=Publication]
; IN 0.0.0.0:1234 UDP/TS
; OUT record.mp4

; SRT/TS input on port 1234 will be pushed to https://localhost/test.mp4
; [stream=Publication]
; OUT srt://127.0.0.1:1234
; IN rtmp://0.0.0.0:1234 
; OUT srt://@0.0.0.0:1234

; resource 127.0.0.1:88/path/video.mp4 will be served to SRT on port 1234
; [test=Publication]
; IN 127.0.0.1:88/path/video.mp4
; OUT @0.0.0.0:1234 SRT/TS

[stream=Publication]
OUT srt://127.0.0.1:1939

but it always crash

17/04 23:01:09.5  INFO   8368 Application.cpp[134]          MonaServer v2.565
17/04 23:01:09.5  INFO   8368 Application.cpp[136]          Load configuration file MonaServer.ini
17/04 23:01:09.5  NOTE   11344 Protocols.h[82]              RTMP server started on 0.0.0.0:1935
17/04 23:01:09.5  NOTE   11344 Protocols.h[82]              SRT server started on 0.0.0.0:1936
17/04 23:01:09.5  FATAL  11344 Server.cpp[133]              Server, bad allocation
17/04 23:01:09.5  INFO   11344 Server.cpp[188]              Server memory release...
17/04 23:01:09.5  NOTE   11344 Server.cpp[192]              Server stopped

@crack00r
Copy link
Author

when i remove the

[stream=Publication]
OUT srt://127.0.0.1:1939

the server works as normal

@crack00r
Copy link
Author

ok, after many google, it seams its cause of old version...
i just found an old version vom 2020 wirth SRT
#57

can you pls upload one with SRT on currentmonaserver version?

@crack00r
Copy link
Author

got it to work now
RTMP can connect to monaserver
but, i get 2 errors - purple, and OBS can not connect to SRT output

@crack00r
Copy link
Author

image

@thomasjammet
Copy link
Contributor

Hi!

Sorry about the crash you've got, can you try with MonaTiny? MonaServer is quite unstable now because of the lua wrapper which is not ready (sadly). This would resolve your crash I think.

For your RTMP INPUT you should change the target URL from rtmp://<host>/stream to rtmp://<host>/something/stream because in some RTMP client implementation the "app" (something here in this example) is necessary. For this reason you have a blank for your publication name in your logs.

On the OUTPUT side you'll have to set the following parameters :

  • Input : srt://<host>:1234
  • Input Format : mpegts
    Like this :
    image

@crack00r
Copy link
Author

i got everything to work now
just i´m on: MonaServer v2.723
now, its for me impossible to get the SRT Version compiled.

Would be cool if you could upload always incl. the SRT

@thomasjammet
Copy link
Contributor

@crack00r
Copy link
Author

works, thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants