I’m trying to use rtmpgw to set up a stream on a local port, to be accessed using a videoview or some other video player. I have the native executable set up and it’s working, however when I test it with the command
rtmpgw --sport 8080
it returns the following error:
HTTP-RTMP Stream Gateway v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu; license: GPL
ERROR: startStreaming, TCP bind failed for port number: 8080
ERROR: Failed to start HTTP server, exiting!
This happens on any port I’ve tried. Without the --sport argument it tries port 80 and fails. From my understanding, non-privileged/non-root users can’t bind ports lower than 1024 in unix. Since this is a virtual machine is it different? Wouldn’t the native executable / static binary be executed outside the virtual machine?
Code:
File rtmp = new File(getFilesDir() + "/rtmpgw");
ProcessBuilder pb = new ProcessBuilder("./" + rtmp.getName(), "--sport", "8080");
pb.directory(getFilesDir());
Process stream = pb.start();
Thanks for the responses. It turns out being above port 1024 isn’t the only requirement. It needs to fall in the ephemeral port range. To get the ephemeral port range, I executed the command
I’m not certain how consistent that range is across all android devices, but my native executable successfully starts when given a port within the ephemeral range.