How to correctly set rest-hook?

linelin

New Member
Last edited:

Max

Administrator
Staff member
Hello.
now, i try post `http://ip:8081/apps/EchoApp/connect`, no parameter
alway response status 200
On 8081 TCP port, the build-in backend listens for REST hooks. This backend always responds 200 OK on every request.
You should do the following:
1. Install web server
2. Install PHP
3. Implement your own backend script as described here.
4. Update WCS server application defaultApp as described here (step 4).
 

Max

Administrator
Staff member
Hello.
Please run this command as
Code:
update app -l "http://localhost/rest-hooks" defaultApp
App key should be last field in command line.
 

linelin

New Member
üse`rest-api/rest-api/pull/rtmp/pull`pull rtmp streaming,
1. can i custom stream name?
2. why Pull rtmp stream is always interrupted after one minute?
see the attach file, log.jpg, flashphoner.txt
thanks
 

Attachments

Last edited:

Max

Administrator
Staff member
It seems your pulled stream has empty audio track.
If so try to add setting:
Code:
rtp_activity_detecting=false
to prevent stopping by timeout
 

Max

Administrator
Staff member
can i custom stream name?
You can't set custom stream name for pulled streams
rest-api/rest-api/pull/rtmp/pull
However you can re-publish pulled stream with a new name
https://docs.flashphoner.com/display/WCS52EN/To+another+RTMP+server
1. Add in flashphoner.properties
Code:
rtmp_transponder_full_url=true
2. Do /pull/push
Code:
{
"streamName": "rtmp://localhost:1935/live/stream1",
"rtmpUrl": "rtmp://localhost:1935/live/stream2",
"options": {}
}
Here stream1 is your pulled stream.
steram2 is your re-published stream.
 

linelin

New Member
It seems your pulled stream has empty audio track.
If so try to add setting:
Code:
rtp_activity_detecting=false
to prevent stopping by timeout
setting sucess can be play streaming
but too much log
1. how can i do prevent this?
2. what is mean `Codec not found; pt - 119; current pt - 95`? and how to fix it?
Code:
09:47:14,623 INFO        RtpVideoConfig - pool-36-thread-2 Codec not found; pt - 119; current pt - 95
09:47:14,654 INFO        RtpVideoConfig - pool-36-thread-2 Codec not found; pt - 119; current pt - 95
09:47:14,654 INFO        RtpVideoConfig - pool-36-thread-2 Codec not found; pt - 119; current pt - 95
09:47:14,903 INFO        RtpVideoConfig - pool-36-thread-2 Codec not found; pt - 119; current pt - 95
09:47:14,955 INFO        RtpVideoConfig - pool-36-thread-2 Codec not found; pt - 119; current pt - 95
09:47:15,007 INFO        RtpVideoConfig - pool-36-thread-2 Codec not found; pt - 119; current pt - 95
09:47:15,117 INFO        RtpVideoConfig - pool-36-thread-2 Codec not found; pt - 119; current pt - 95
09:47:15,117 INFO        RtpVideoConfig - pool-36-thread-2 Codec not found; pt - 119; current pt - 95
09:47:15,117 INFO        RtpVideoConfig - pool-36-thread-2 Codec not found; pt - 119; current pt - 95
09:47:15,117 INFO        RtpVideoConfig - pool-36-thread-2 Codec not found; pt - 119; current pt - 95
09:47:15,148 INFO        RtpVideoConfig - pool-36-thread-2 Codec not found; pt - 119; current pt - 95
 

Max

Administrator
Staff member
Hello
what is mean `Codec not found; pt - 119; current pt - 95`? and how to fix it?
This means your H264 stream goes with payload type (pt) 119, but RTMP pull agent payload type for H264 is 95 by default.
To fix it create file rtmp_agent.sdp with the following content
Code:
v=0
o=- 1988962254 1988962254 IN IP4 0.0.0.0
c=IN IP4 0.0.0.0
t=0 0
a=sdplang:en
m=video 0 RTP/AVP 119 95
a=rtpmap:95 H264/90000
a=fmtp:95 profile-level-id=42e01f;packetization-mode=1
a=rtpmap:119 H264/90000
a=fmtp:119 profile-level-id=42e01f;packetization-mode=1
a=recvonly
m=audio 0 RTP/AVP 103 96 97 98 99 100 102 108 104
a=rtpmap:108 mpeg4-generic/48000/1
a=rtpmap:96 mpeg4-generic/8000/1
a=rtpmap:97 mpeg4-generic/11025/1
a=rtpmap:98 mpeg4-generic/12000/1
a=rtpmap:99 mpeg4-generic/16000/1
a=rtpmap:100 mpeg4-generic/22050/1
a=rtpmap:104 mpeg4-generic/24000/1
a=rtpmap:102 mpeg4-generic/32000/1
a=rtpmap:103 mpeg4-generic/44100/1
a=recvonly
and place this file to WCS_HOME/conf, then restart server.
 

linelin

New Member
i often recive following message, and video quality may be change to lower video resolution
Code:
Not enough bandwidth, consider using lower video resolution or bitrate. Bandwidth 0 bitrate 51
- It is mean Bandwidth vary lower, video bitrate too big ?
- How to fix this problem?
 

Max

Administrator
Staff member
Hello.
Please check the channel bandwidth between publisher and server, between server and player as described here. The channel test result will show you the maximum bitrate value, so you should limit the publisher video bitrate with this value. For example if iperf shows 1,15 mbit/s bandwidth, you should limit the maximum publisher bitrate with 1 mbit/s. Bitrate management in WCS is described here in details.
 

linelin

New Member
how to setting publish video timeout, when nobody play this streaming?

flashphoner.property
cdn_outbound_connection_timeout right?
 
Last edited:

Max

Administrator
Staff member
Hello.
The option
Code:
cdn_outbound_connection_timeout
is intended to use with CDN only.
If you want to stop publishing a stream that have no subscribers in certain time, there's no explicit config option for this. You can do it using REST API:
1. Send the query periodically
Code:
/rest-api/stream/find
{
    "name": "your_stream_name",
    "published": "false"
}
It returns a list of subscribers sessions or 404 Not found
2. If 404 Not found is received in certain time, stop publishing the stream
 

linelin

New Member
hi Max,
my step
- client play `rtmp://aa.bb/live/stream`
- wcs start pull `rtmp://aa.bb/live/stream` video
- run `/rest-api/stream/find_all`, return one stream publish
- client close video
- After one minute, run `/rest-api/stream/find_all`, return NOT FOUND video
how to setting publish timeout, let timeout extend to 30 minutes ?
 

Max

Administrator
Staff member
Hello.
You can set the following parameter to desired timeout in milliseconds
Code:
rtmp_activity_timer_timeout=1800000
In this case, RTMP pulled stream with no subscribers will be terminated in 30 minutes.
By default, this interval is set to 60000 ms, or 1 minute.
 
Top