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

feasibility question #99

Closed
philipptrenz opened this issue Jun 14, 2019 · 6 comments
Closed

feasibility question #99

philipptrenz opened this issue Jun 14, 2019 · 6 comments

Comments

@philipptrenz
Copy link
Contributor

philipptrenz commented Jun 14, 2019

Hey there,

thanks for your great project! I read the documentation, but I'm still not sure if Restreamer can archive what I'm looking for. That's why I want to ask for some advice.

So here's my use case:

  • Goal: Provide a publicly available 24/7 live stream embedded in a website (https)
  • Having a RTSP stream url from a security camera available from within the local network
  • The ISP does not provide a static IP, so DynDNS is not an option
  • I have server resources within the local network (NAS with Docker) as well as publicly available (cloud instance with static IP)

Can you outline a way for me to achieve my goal? Setting up servers, writing Dockerfiles, configuring nginx and ffmpeg is not a problem for me and I just need a tip in the right direction ;)

Thanks in advance!

@ioppermann
Copy link
Member

ioppermann commented Jun 15, 2019 via email

@philipptrenz
Copy link
Contributor Author

philipptrenz commented Jun 15, 2019

Hi @ioppermann,

thanks for the quick reply and the explanations.

I understood the documentation up to this point, but, as you may have overlooked, my problem is, that the local network is behind a NAT and does not get any public IP assigned by the ISP. Therefore, a port forwarding from the local network to the internet is not possible.

Is there a preferable way to go?

@ioppermann
Copy link
Member

ioppermann commented Jun 15, 2019 via email

@philipptrenz
Copy link
Contributor Author

Perfect, that is what I was looking for!

Could I, instead of the local Restreamer, just use ffmpeg to redirect the provided RTSP over TCP url to the cloud instance as I do not need the other Restreamer features from within my network?

Thanks!

@ioppermann
Copy link
Member

ioppermann commented Jun 15, 2019 via email

@philipptrenz
Copy link
Contributor Author

philipptrenz commented Jun 15, 2019

Perfect! I summarized the procedure. Even though I have not tested it yet, I share my findings here for anyone who has similar things in mind:

Step 1: Install Restreamer Docker image on a cloud instance

Inside the Restreamer Docker container is a RTMP-Server running (nginx-rtmp) that you can use to push streams to. To have access to the RTMP-Server, you have to expose the port 1935 of the Docker container.

You should secure your stream with an token, so that only you can stream to the Restreamer instance. Also change credentials by setting it via enviroment variables.

Start the container with:

docker run -d --restart always \
	--name restreamer \
	-e "RS_USERNAME=[your_username]" -e "RS_PASSWORD=[your_password]" -e "RS_TOKEN=[stream_token]" \
	-p 8080:8080 -p 1935:1935 -v [path_to_restreamer_directory_on_the_docker_host]:/restreamer/db \
	datarhei/restreamer:latest

Step 2: Push local stream to Restreamer cloud instance

Use a local instance of Restreamer and configure the External RTMP-Streaming-Server to rtmp://[url_of_restreamer_cloud_instance]/live/external.stream?token=[stream_token]

OR

just use ffmpeg:

ffmpeg -i 'rtsp://[rtsp_or_rtmp_url_from_local_device]' -codec copy -f flv rtmp://[url_of_restreamer_cloud_instance]/live/external.stream?token=[stream_token]

Step 3: Configure Restreamer and start streaming

Navigate to the Restreamer web interface athttp://[url_of_restreamer_cloud_instance]:8080/.

For the video source enter the same address you are pushing to, and replace the public address and port with localhost:

rtmp://localhost/live/external.stream?token=[stream_token]

Now you can forward it to an other RTMP-Server or embed the player in a website.

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