API call erros

API call erros

admin Staff asked 9 years ago
The company I work for would like to be able to record RTSP streams on command and watch these recordings on demand. To achieve this, we chose the Evostream Media Server. We are currently running the EMS on an AWS instance. Starting the EMS with “service evostream start_console” results in the following table: +—————————————————————————–+ | Services| +—+—————+—–+————————-+————————-+ | c | ip | port| protocol stack name | application name | +—+—————+—–+————————-+————————-+ |tcp| 127.0.0.1|44908| inboundBinVariant| webserver| +—+—————+—–+————————-+————————-+ A lot of examples on the internet show these tables filled with a lot of services like “inboundRtsp” and “inboundRtmp”. At first these missing services did not bother me that much, but now I would like to make API calls to add streams and start recordings. I do not seem to be able to make API calls through port 7777, does this have to do with missing services since I seems to be able to make these calls through port 8888 on which the webserver listens? Could you also tell me the correct way of making these API calls(both remote and localhost)? I tried making the calls with curl like this: curl -X POST ‘http://evostream:@localhost:8888/apiproxy/pullStream?params=Base64(uri=rtsp://public-ip:554/ localStreamName=RTSPTest)’ in which “” is the AWS instance-id and “Base64(uri=rtsp://public-ip:554/ localStreamName=RTSPTest)” are the Base64 encoded parameters. This results in the following message: {“data”:null,”description”:”Syntax error. No parameters provided”,”status”:”FAIL”}



3 Answers
admin Staff answered 9 years ago

Thank you for your response. In the meantime i got a bit closer to what I wanted to achieve and my original problem is solved. I am able to make calls using port 7777 like this: curl -X POST ‘http://localhost:7777/apiproxy/version’. This also seems to work with the pullStream Command after I changed some of the parameters: { “data”: { “audioCodecBytes”: “”, “configId”: 3, “emulateUserAgent”: “EvoStream Media Server (www.evostream.com) player”, “forceTcp”: false, “httpProxy”: “”, “isAudio”: true, “keepAlive”: false, “localStreamName”: “oem-livetest”, “operationType”: 1, “pageUrl”: “”, “ppsBytes”: “”, “rangeEnd”: -1, “rangeStart”: -2, “rtcpDetectionInterval”: 10, “sendRenewStream”: false, “spsBytes”: “”, “ssmIp”: “”, “swfUrl”: “”, “tcUrl”: “”, “tos”: 256, “ttl”: 256, “uri”: { “document”: “ch0”, “documentPath”: “\/live\/”, “documentWithFullParameters”: “ch0”, “fullDocumentPath”: “\/live\/ch0”, “fullDocumentPathWithParameters”: “\/live\/ch0”, “fullParameters”: “”, “fullUri”: “rtsp:\/\/ip-address\/live\/ch0”, “fullUriWithAuth”: “rtsp:\/\/username:password@ip-address\/live\/ch0”, “host”: “”, “ip”: “2”, “originalUri”: “rtsp:\/\/username:password@ip-address\/live\/ch0”, “parameters”: {}, “password”: “correct-password”, “port”: 554, “portSpecified”: false, “scheme”: “rtsp”, “userName”: “correct-username” } }, “description”: “Stream rtsp:\/\/username:password@ip-address\/live\/ch0 enqueued for pulling”, “status”: “SUCCESS” } When I then request a list of all streams, this stream is listed, but after about 15 seconds it disappears and I get: {“data”:null,”description”:”Available streams”,”status”:”SUCCESS”} Could you tell me why this is(lost connection to the camera?) and how to resolve this? 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). So what is the correct syntax with authentication?

admin Staff answered 9 years ago

Here are some logs of what happens when I use the pullStream call, like I described in the previous post. THIS HAPPENS ON “PULLSTREAM”: 1463998706:4:/thelib/src/netio/epoll/iohandlermanager.cpp:119:RegisterIOHandler:Handlers count changed: 20->21 IOHT_TCP_CARRIER 1463998706:3:/thelib/src/netio/epoll/tcpacceptor.cpp:187:Accept:Inbound connection accepted: (Far: 127.0.0.1:48027; Near: 127.0.0.1:7777) CTCP(3) TCP(707) IHTT(708) H4C(709) [IJSONCLI(710)] 1463998706:3:/applications/evorouter/src/protocols/cli/cliappprotocolhandler.cpp:1205:ProcessMessage:command: pullstream 1463998706:4:/thelib/src/netio/epoll/iohandlermanager.cpp:119:RegisterIOHandler:Handlers count changed: 21->22 IOHT_TCP_CONNECTOR 1463998706:4:/thelib/src/netio/epoll/iohandlermanager.cpp:129:UnRegisterIOHandler:Handlers count changed: 22->21 IOHT_TCP_CARRIER 1463998706:6:/thelib/src/application/baseclientapplication.cpp:385:UnRegisterProtocol:Protocol [IJSONCLI(710)] unregistered from application: evostreamms 1463998706:4:/thelib/src/netio/epoll/iohandlermanager.cpp:119:RegisterIOHandler:Handlers count changed: 21->22 IOHT_TCP_CARRIER 1463998706:3:/thelib/include/netio/epoll/tcpconnector.h:111:OnEvent:Outbound connection established: (Far: ; Near: 10.0.14.143:42620) CTCP(27) TCP(711) [RTSP(712)] 1463998706:4:/thelib/src/netio/epoll/iohandlermanager.cpp:129:UnRegisterIOHandler:Handlers count changed: 22->21 IOHT_TCP_CONNECTOR 1463998706:2:/thelib/src/protocols/rtp/sdp.cpp:514:ParseSDPLineA:Attribute `range` with value `npt=0-` not parsed 1463998706:2:/thelib/src/protocols/rtp/sdp.cpp:486:ParseSDPLineA:Invalid codec: X-KATA 1463998706:4:/thelib/src/netio/epoll/iohandlermanager.cpp:119:RegisterIOHandler:Handlers count changed: 21->22 IOHT_UDP_CARRIER 1463998706:4:/thelib/src/netio/epoll/iohandlermanager.cpp:119:RegisterIOHandler:Handlers count changed: 22->23 IOHT_UDP_CARRIER 1463998706:4:/thelib/src/netio/epoll/iohandlermanager.cpp:119:RegisterIOHandler:Handlers count changed: 23->24 IOHT_UDP_CARRIER 1463998706:4:/thelib/src/netio/epoll/iohandlermanager.cpp:119:RegisterIOHandler:Handlers count changed: 24->25 IOHT_UDP_CARRIER 1463998706:3:/thelib/src/application/baseclientapplication.cpp:391:SignalStreamRegistered:Stream INP(12) with name `oem-livetest` from protocol RTSP(712) registered to origin application `evostreamms` 1463998706:4:/thelib/src/netio/epoll/iohandlermanager.cpp:119:RegisterIOHandler:Handlers count changed: 25->26 IOHT_TCP_CONNECTOR 1463998706:4:/thelib/src/netio/epoll/iohandlermanager.cpp:119:RegisterIOHandler:Handlers count changed: 26->27 IOHT_TIMER 1463998706:4:/thelib/src/netio/epoll/iohandlermanager.cpp:119:RegisterIOHandler:Handlers count changed: 27->28 IOHT_TCP_CARRIER 1463998706:3:/thelib/include/netio/epoll/tcpconnector.h:111:OnEvent:Outbound connection established: (Far: 127.0.0.1:8888; Near: 127.0.0.1:53473) CTCP(31) TCP(722) OHTT2(723) [ORPC(724)] 1463998706:4:/thelib/src/netio/epoll/iohandlermanager.cpp:129:UnRegisterIOHandler:Handlers count changed: 28->27 IOHT_TCP_CONNECTOR 1463998706:6:/thelib/src/application/baseclientapplication.cpp:385:UnRegisterProtocol:Protocol [ORPC(724)] unregistered from application: evostreamms 1463998706:4:/thelib/src/netio/epoll/iohandlermanager.cpp:129:UnRegisterIOHandler:Handlers count changed: 27->26 IOHT_TCP_CARRIER THIS HAPPENS AFTER 10 TO 20 SECONDS: 1463998760:4:/thelib/src/netio/epoll/iohandlermanager.cpp:119:RegisterIOHandler:Handlers count changed: 26->27 IOHT_TCP_CARRIER 1463998760:3:/thelib/src/netio/epoll/tcpacceptor.cpp:187:Accept:Inbound connection accepted: (Far: 127.0.0.1:48035; Near: 127.0.0.1:7777) CTCP(31) TCP(750) IHTT(751) H4C(752) [IJSONCLI(753)] 1463998760:3:/applications/evorouter/src/protocols/cli/cliappprotocolhandler.cpp:1205:ProcessMessage:command: version 1463998760:4:/thelib/src/netio/epoll/iohandlermanager.cpp:129:UnRegisterIOHandler:Handlers count changed: 27->26 IOHT_TCP_CARRIER 1463998760:6:/thelib/src/application/baseclientapplication.cpp:385:UnRegisterProtocol:Protocol [IJSONCLI(753)] unregistered from application: evostreamms 1463998767:2:/applications/evorouter/src/protocols/timer/keepalivetimerprotocol.cpp:110:TimePeriodElapsed:No traffic on stream INP(13) with name `oem-livetest` from protocol RTSP(737). Destroy it 1463998767:4:/thelib/src/netio/epoll/iohandlermanager.cpp:129:UnRegisterIOHandler:Handlers count changed: 26->25 IOHT_TCP_CARRIER 1463998767:3:/thelib/src/application/baseclientapplication.cpp:397:SignalStreamUnRegistered:Stream INP(13) with name `oem-livetest` from protocol RTSP(737) unregistered from origin application `evostreamms` 1463998767:6:/thelib/src/application/baseclientapplication.cpp:385:UnRegisterProtocol:Protocol [RTSP(737)] unregistered from application: evostreamms 1463998767:4:/thelib/src/netio/epoll/iohandlermanager.cpp:119:RegisterIOHandler:Handlers count changed: 25->26 IOHT_TCP_CONNECTOR 1463998767:6:/thelib/src/application/baseclientapplication.cpp:385:UnRegisterProtocol:Protocol (Bound on: 0.0.0.0:41892) CUDP(3) UDP(738) [IRTP(739)] unregistered from application: evostreamms 1463998767:6:/thelib/src/application/baseclientapplication.cpp:385:UnRegisterProtocol:Protocol (Bound on: 0.0.0.0:41893) CUDP(28) UDP(740) [RTCP(741)] unregistered from application: evostreamms 1463998767:6:/thelib/src/application/baseclientapplication.cpp:385:UnRegisterProtocol:Protocol (Bound on: 0.0.0.0:54988) CUDP(30) UDP(742) [IRTP(743)] unregistered from application: evostreamms 1463998767:6:/thelib/src/application/baseclientapplication.cpp:385:UnRegisterProtocol:Protocol (Bound on: 0.0.0.0:54989) CUDP(29) UDP(744) [RTCP(745)] unregistered from application: evostreamms 1463998767:4:/thelib/src/netio/epoll/iohandlermanager.cpp:129:UnRegisterIOHandler:Handlers count changed: 26->25 IOHT_UDP_CARRIER 1463998767:4:/thelib/src/netio/epoll/iohandlermanager.cpp:129:UnRegisterIOHandler:Handlers count changed: 25->24 IOHT_UDP_CARRIER 1463998767:4:/thelib/src/netio/epoll/iohandlermanager.cpp:129:UnRegisterIOHandler:Handlers count changed: 24->23 IOHT_UDP_CARRIER 1463998767:4:/thelib/src/netio/epoll/iohandlermanager.cpp:129:UnRegisterIOHandler:Handlers count changed: 23->22 IOHT_UDP_CARRIER 1463998767:4:/thelib/src/netio/epoll/iohandlermanager.cpp:129:UnRegisterIOHandler:Handlers count changed: 22->21 IOHT_TIMER 1463998767:4:/thelib/src/netio/epoll/iohandlermanager.cpp:119:RegisterIOHandler:Handlers count changed: 21->22 IOHT_TCP_CARRIER 1463998767:3:/thelib/include/netio/epoll/tcpconnector.h:111:OnEvent:Outbound connection established: (Far: 127.0.0.1:8888; Near: 127.0.0.1:53480) CTCP(27) TCP(754) OHTT2(755) [ORPC(756)] 1463998767:4:/thelib/src/netio/epoll/iohandlermanager.cpp:129:UnRegisterIOHandler:Handlers count changed: 22->21 IOHT_TCP_CONNECTOR 1463998767:6:/thelib/src/application/baseclientapplication.cpp:385:UnRegisterProtocol:Protocol [ORPC(756)] unregistered from application: evostreamms 1463998767:4:/thelib/src/netio/epoll/iohandlermanager.cpp:129:UnRegisterIOHandler:Handlers count changed: 21->20 IOHT_TCP_CARRIER

xai Staff answered 9 years ago
Set keepalive=true when you do a pullstream so EMS will continuously try to reconnect to the stream.
Also, EMS only supports the H264 codec, I see that your stream’s codec is X-KATA.

Offcanvas

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