datarhei / restreamer

The Restreamer is a complete streaming server solution for self-hosting. It has a visually appealing user interface and no ongoing license costs. Upload your live stream to YouTube, Twitch, Facebook, Vimeo, or other streaming solutions like Wowza. Receive video data from OBS and publish it with the RTMP and SRT server.
https://docs.datarhei.com/restreamer/
Apache License 2.0
3.83k stars 440 forks source link

How to create a new channel via API? #409

Open noho501 opened 2 years ago

noho501 commented 2 years ago

Hi,

I would like to create a new channel, video input ( RTMP Server ) then will import some PUBLICATION to the new channel through API without UI. Any ideas?

Thanks and best regards

create-channel video-setup add-platforms
jstabenow commented 2 years ago

Hey @noho501 Should the processes be displayed in the user interface?

noho501 commented 2 years ago

Hi @jstabenow

It should be displayed in the UI, so the admin can manage them. Could you please help me with how to do that?

jstabenow commented 2 years ago

Yes, no problem. But it takes some time. So I will answer you in the coming days.

noho501 commented 2 years ago

Thanks a lot

noho501 commented 2 years ago

Hi @jstabenow Any updates?

jstabenow commented 2 years ago

Hi @jstabenow Any updates?

I am working on a CLI with which you can read out, edit or create all processes, for example.

That should help you with your project. And if you want to develop custom management.

There are API clients for Go and Python. And for Javascript, here is the file from the Restreamer UI we use for API communication.

As soon as the CLI is ready, I will let you know.

noho501 commented 2 years ago

Hi, @jstabenow Thank you very much for your help.

privatesam commented 1 year ago

I'd be interested in the CLI when its ready too. Thanks.

seccentral commented 1 year ago

Nice that this is already raised.

I'm also interested in this, especially in creating a new channel from the cli or api for RTMP. Previously using nginx with rtmp module, all I had to do was define a location path ie /live and then publish my stream from cli like ffmpeg [...] rtmp://<host>/<path>/{my_tag}" -> would be automatically ingested by nginx at /path/my_tag and an entry would be added to it's stat page. Would love to do that here also, but at the moment restreamer needs manual gui setup for every new channel after which restreamer issues a rtmp://<host>/<path>/<random-generated-string>.stream?token={my_token}

Funny thing is, ffmpeg can stream to restreamer using rtmp://<host>/<path>/teststream?token={my_token} but this stream is nowhere visible in the admin page, nor the publication page

ioppermann commented 1 year ago

@seccentral

Funny thing is, ffmpeg can stream to restreamer using rtmp://.../teststream?token={my_token} but this stream is nowhere visible in the admin page, nor the publication page

This is true. You can choose any name for the stream and the RTMP server will accept it (as long as the token is correct). If you want to use it, you can enter the internal address for this stream as a network source. The internal address is the same address you use for pushing the stream, but replace the host with 127.0.0.1:1935 (or whatever RTMP port you configured).

The process in the GUI with suggesting a RTMP address with a random generated string and probing is for convenience, so you don't have to bother with the internal address of the RTMP server.

We'll take it as a suggestion to list available RTMP streams, regardless if the name has been suggested or you chose the name.

seccentral commented 1 year ago

We'll take it as a suggestion to list available RTMP streams, regardless if the name has been suggested or you chose the name.

Would be super useful to see incoming streams in the admin and especially playersite with their names taken from the ffmpeg cli command, helps a lot with debugging and overviewing multiple streams in dev environments like computer vision and ai tinkering: push a stream from a devkit board and see it pop in the playersite automatically

kyjus25 commented 1 year ago

Agreed. I am looking to reproduce the functionality of Bambuser with Restreamer. I have a Node script that converts a webcam WEBM stream from my website into an RTMP feed that Restreamer can ingest. I was surprised at how much configuration is involved in creating a new channel on demand through Restreamer's API, and would very much appreciate an easy-to use createChannel endpoint that abstracts out all the JSON config bits associated with it. I got it to work by inspecting the UI's POST requests and mimicing the numerous endpoint calls, but a simple endpoint that takes in an aspect ratio and a stream URL would be much nicer.

RLutsch commented 1 year ago

sitting with exacly the same problem, be great if I could hit the api and say something like POST /api/channels then {data: channelID } etc etc? a cli or sdk could also do the trick