EMS pullstream issues

EMS pullstream issues

admin Staff asked 9 years ago
The company I work for wants to be able to record video streams on command and watch these recordings on demand. For this we would like to use the Evostream Media Server. I have an Amazon AWS instance with EMS running and I opened all ports that need to be opened. I am able to add a stream with the pullStream command: curl -X POST ‘http://localhost:7777/apiproxy/pullStream?params=Base64(uri=rtsp://username:password@IP-address/live/ch0 keepAlive=0 localStreamname=oem-livetest)’ When I then request a list of all streams, this stream is listed, but after 10 to 20 seconds it disappears and I get: {“data”:null,”description”:”Available streams”,”status”:”SUCCESS”} I attached parts of the log to this email. Could you tell me how to keep the stream listed and if this is even possible when the stream disappears for a while? Could you also tell me how to make API calls from a remote host? HTTP POST requests do not seem to work from remote hosts (connection refused). What is the correct syntax with authentication? Also, we have some camera’s that don’t use AAC for audio encoding(they use things like mlaw). Is it still possible to record these streams by using the transcoder?



1 Answers
Don answered 9 years ago
Hi,
HTTP API w/ Authentication
Could you also tell me how to make API calls from a remote host? HTTP POST requests do not seem to work from remote hosts (connection refused). What is the correct syntax with authentication?
Before this can be done, the web server configuration file should be edited to enable the API Proxy feature. Uncomment the apiProxy block in webconfig.lua by removing the markers “–[[” and “]]–” at the beginning and end of the block. Replace the values for pseudoDomain, userName, and password then restart the EMS. A typical apiProxy block is shown below. (Note: The port in the apiProxy block, 7777, refers to the inboundHttpJsonCli port as defined in config.lua. The port used in the HTTP API command, 8888, is the EWS port as defined in webconfig.lua under applications > rootDirectory > port.)

            apiProxy=
            {
                authentication=”basic”,
                pseudoDomain=”apiproxy”,
                address=”127.0.0.1″,
                port=7777,
                userName=”user1″,
                password=”pass1″,
            }

After restarting the EMS, you can send authenticated HTTP API commands using the following syntax:
http://<username>:<password>@<ews_ip_address>:<ews_port>/<pseudo_domain>/<api_command>?params=<base64_encoded_string>
Here’s an example with parameters:
http://user1:pass1@localhost:8888/apiproxy/pullstream?params=dXJpPXJ0bXA6Ly9zdHJlYW1pbmcuY2l0eW9mYm9zdG9uLmdvdi9saXZlL2NhYmxlIGxvY2Fsc3RyZWFtbmFtZT1zdHJlYW0x
Here’s an example without parameters:
http://user1:pass1@localhost:8888/apiproxy/version
Please refer to http://docs.evostream.com/ems_user_guide/webconfigfile#apiproxy for more details.
You can manually convert parameter strings to Base64 using this site: https://www.base64encode.org/  
Transcoding
Also, we have some camera’s that don’t use AAC for audio encoding(they use things like mlaw). Is it still possible to record these streams by using the transcoder?
Yes, you can transcode streams with non-AAC audio (such as mlaw) to AAC using the transcode API comand of the EMS. Please refer to http://docs.evostream.com/ems_api_definition/transcode for the proper syntax and some practical examples.   Cheers,
Don

Offcanvas

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.