Remote RTMP Server

Ideas, technical topics, help and discussion for ATV enthusiasts
Forum rules
This forum is run by the BATC (British Amateur Television Club), it is service made freely available to all interested parties, please do not abuse this privilege.

Thank you
Post Reply
M0PIT
Posts: 18
Joined: Fri Jun 07, 2019 8:12 pm

Remote RTMP Server

Post by M0PIT » Sat Sep 28, 2019 9:24 pm

The article in CQ-TV256 on OBS inspired me to have a go at streaming from OBS to a remote RTMP server running NGINX on a Raspberry Pi then UTP into Portsdown. Using the code in the article but converted to run to as bash scripted for Linux, after several tweaks, I have been successful in doing so. But I have found that if I stop Streaming from OBS and then start Streaming again, ffmpeg objects with errors like this:

Non-monotonous DTS in out stream 0:1 previous: 2252563, current 290108; changing to 2252564. This may result in incorrect timestamps in the output file.

I believe the error is due to OBS starting a new RTMP stream, but ffmpeg is still expecting the next frame from the original RTMP stream. So the OBS stream now has to be stopped and the ffmpeg script has to be restarted, only then can the OBS stream can be restarted with no errors from ffmpeg.

As the ffmpeg script has to be restarted every time the OBS RTMP stream is restarted, has anyone got a possible workaround not having to restart ffmpeg with every new RTMP stream?

Phil M0PIT

G7JTT
Posts: 338
Joined: Fri Jun 10, 2016 5:05 pm

Re: Remote RTMP Server

Post by G7JTT » Sun Sep 29, 2019 7:28 am

Hi Phil I have the same issue if OBS stops streaming, then I have to restart the ffmpeg script haven't found a work around yet.

All best John

M0PIT
Posts: 18
Joined: Fri Jun 07, 2019 8:12 pm

Re: Remote RTMP Server

Post by M0PIT » Sun Sep 29, 2019 9:00 am

Hi John,

Good article hope there is more to come on the subject, please let know if you find a fix, or ideas on streaming RTMP into Portsdown.

73s,

Phil M0PIT

gi7ugv
Posts: 50
Joined: Tue Oct 31, 2017 2:47 pm

Re: Remote RTMP Server

Post by gi7ugv » Tue Oct 01, 2019 2:21 pm

This doesn't solve the issue but it might be of interest to save on button clicks.

If you install the obs-websocket plugin you can control OBS functions over a network connection.

I'm using the obswebsocket plugin in Python to do this in Linux, but I see there's a Windows executable here that could be called inside a script easily: https://obsproject.com/forum/resources/ ... ndows.615/. If this works okay then you could have it startrecord/stoprecord/startstream/stopstream. Not sure if it will work in a Windows batch script as something's going to need to go in to the background and it could do with being stoprecord being sent on the window closing.

The Python script I'm using in Linux, https://github.com/JayGe/dvbsdr/blob/ma ... calcalc.py, turns OBS recording on if requested in this way. I have another script to send to the Portsdown over UDP I can upload.

Code: Select all

	if (obson): # Uses OBS Websocket to turn Record on when we transmit
		client = obswebsocket.obsws("localhost", 4444, "whatever")
		client.connect()
		client.call(obswebsocket.requests.StartRecording())
		client.disconnect()
		time.sleep(1)

Post Reply

Return to “General ATV Discussion”