• This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #74
    Donald BiltonDonald Bilton
    Keymaster

    How to create an rtmp server with android. There are several ways to approach this issue. I will focus on a terminal based solution using termux terminal emulator located in the android app store. We will then fetch the tools and configurations required to become an rtmp server.

    1. Download termux (terminal emulator) in the android app store and launch the application.No rooting is required.

    https://play.google.com/store/apps/details?id=com.termux

    termux home screen

    2. Auto scripts are in development through github

    Please visit https://github.com/isodecryptor/tollstream-RTMP-server for more information.

    3. Copy and paste the commands into termux. Include the () in the code snippet

    (
    pkg install proot-distro screen -y
    proot-distro install alpine 
    proot-distro login alpine)

    4. The terminal should go through the process
    of updating termux, fetch a copy of alpine
    and download the RTMP server’s dependencies.
    Now we need to update Alpine Linux and install the rtmp
    server dependencies. Include the parenthesis in
    copy paste.

    (cd /home; apk update; apk upgrade
    apk add git bash screen openssl
    git clone --depth=1 -b Alpine \
    --single-branch \
    https://github.com/isodecryptor/tollstream-RTMP-server.git
    cd tollstream-RTMP-server
    chmod +x Alpine_rtmp_tollstream.sh
    ./Alpine_rtmp_tollstream.sh)

    tollstream script

    Ngrok.com provides free(free works well for small scale servers) and paid accounts through Ngrok.com. Tollstream is not affiliated with Ngrok. We use Ngrok’s reverse proxy to assist people in port forwarding issues. (Behind firewalls they can’t configure,routers or other, non administrative restrictions. )
    https://www.ngrok.com

    5. Please visit https://ngrok.com if your are behind nat firewalls that you either don’t have the administration rights to configure, the know how, or the patience. You will want to register for free with ngrok.com. Ngrok also let’s you monitor your connections and blacklist ips etc and add other ips to your whitelist such as friends. The free version works for 4 connections from the outside world, and there are paid versions that have no restrictions.

    6. After registration, you will enter the authkey into the terminal to register it with the servers automated script. From that point on, ngrok will be the one giving you urls that are accessible from the internet. You will be accessible from the web from that url. The automated install script will list that url that is accessible from the internet. The automated script then takes your url and username of tollstream, encrypts it, and sends it to tollstream.com for e-commerce assistance.
    ngrok authkey

    ngrok home screen

    Your authkey will be saved in your server and will only need to be entered once.

    7. Your server should be set up and the automated script should list several urls. You should make note of these urls, depending on your desired configuration. I will attempt to explain what these urls mean and how they will be used.

    tollstream rtmp urls

    A) You will receive a url that is accessible from the web if port forwarding was successful. If you port forwarded ,yourself ,and are having connection problems from the outside web, please check to see if you have configured your firewalls properly to port forward tcp 1935.

    B) You will receive a url that was issued from ngrok.com that points to your public ip address and rtmp server. This would be the same as if someone typed in your public ip and attempted to access your server, except it allows for port forwarding behind networks that are not configured for port forwarding.

    C) You will receive a url that assumes that you are running broadcasting software on the same machine as the server is located. This is the url that is considered localhost looking like rtmp://localhost:1935/(app)/(stream key)
    Or rtmp://127.0.0.1:1935/(app)/(stream key)

    D) you will receive a url that includes your private ip address of your server so that other devices such as cameras, sell phones, or other networked devices can send their information to the server from within you own network. This means devices that are connected to the same router but have been issued separate private ip. (Every device connected to the same router has a separate private ip and, typically, share the same public ip that is issued by your internet service provider.

    Example. I have tollstream rtmp server set up on my laptop but I want to use my cell phone that is on the same wifi to send live video to my server.

    8. To test if your rtmp server is working, you can download larix broadcaster in the app store at :
    https://play.google.com/store/apps/details?id=com.wmspanel.larix_broadcaster.

    You may use any other streaming application such as obs studio but it will be your job to learn the format and settings.

    9. In order to test your nginx, rtmp, server to see if your video streaming is working, properly, please go into the settings in larix broadcaster. Then select connections. Create a new connection.

    larix settings

    The format that will be expected is rtmp://127.0.0.1/larix/(stream key) where (stream key) is replaced with a stream key of your choice. Example: rtmp://127.0.0.1/larix/mystreamkey
    Save the setting.

    streaming url larix

    You will also want to go into advanced setting in larix in the main settings screen. Please check the box next to background streaming. This will allow larix to continue broadcasting your chosen camera, regardless if the app is in the foreground or not. Larix will need to be restarted to apply the settings.

    10. In order to see if your broadcaster and nginx,rtmp,server is working, you should download vlc media player from:
    https://play.google.com/store/apps/details?id=org.videolan.vlc

    11. Return back to the main screen of larix broadcaster until you see video of your camera and a red button to start streaming. Push the red button. You should see a bit rate being uploaded equal to the bitrate that larix has in it’s settings for your connections video. That can be altered by going into your connections video settings. If it remains at zero bits, there is a problem communicating with the nginx,rtmp, server installed through termux.

    After install, launch vlc and Click the three horizontal lines icon known as settings in vlc. You will select stream and paste your larix connection settings that was in the format of rtmp://127.0.0.1/larix/yourstreamkey is the stream key string of your choosing.

    You should see your stream being played in vlc if all is going well.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.