Video streams are not recording

vamsi

New Member
Hi,

I have added the config parameters to flashphoner.properties to store the video files. But after adding the parameters, I am unable to stream from the WCS. I have added below params
Code:
record_streams=true
record_flash_published_streams=true
record_rtsp_streams=true
stream_record_policy=streamName
stream_record_policy_template=stream-{mediaSessionId}-{login}
encode_record_name=true,HEX
encode_record_name=true,BASE64
exclude_record_name_characters=/
exclude_record_name_characters=:.,/
record_rotation=20
I also tried to hit the rest API /stream/startRecording by passing the session id. I got success response for the /stream/startRecording, but when I try to stop the recording it return below error

Code:
{
"exception": "com.flashphoner.rest.server.exception.NotFoundException",
"path": "/rest-api/stream/stopRecording",
"error": "Not Found",
"message": "NOT FOUND",
"timestamp": 1592982591196,
"status": 404
}
Please find the flashphoner logs
Screenshot from 2020-06-24 12-43-10.png



Please let me know if I miss anything to enable recording.

I am pushing the IP camera to flashphoner rtmp endpoint, I want the record the stream as a file for every hour.
 
Last edited:

Max

Administrator
Staff member
Good day.
Please collect a report including client debug logs as described here and send us using this link. Another option is to provide us SSH access to your server using this link, we will check stream recording in place.
 

Max

Administrator
Staff member
In logs provided we see no issues, RTMP published stream recording seems to be started correctly according to record_flash_published_streams=true{/ICODE] parameter. Then logs are interrupted, so we don't see /stopRecording query.
Please collect the report again by the following way:
1. Enable client debug logs
[CODE]client_log_level=debug[/CODE]
2. Restart WCS
3. Publish a stream
4. Start stream recording by /stream/startRecording REST API query (if stream does not recorded automatically according to your current WCS settings)
5. Get stream [ICODE]mediaSessionId
parameter using /stream/find query
6. Stop stream recording by /stream/stopRecording query passing mediaSessionId.
7. If /stream/stopRecording returns 404, collect the report using report.sh script
Send the report using this link.
 

vamsi

New Member
Hi Max,
I uploaded the report logs in the link shared. While hitting the stopRecord it returns 404.

But the requesting the /stream/find using the same session returns below response.

[{"appKey":"defaultApp","sessionId":"/27.57.39.128:56370/172.31.25.63:8080-dc4d319d-e70d-4f3e-821a-adaac492f751","mediaSessionId":"64c0e7e0-b6d3-11ea-9591-53982d806960","name":"internal","published":false,"hasVideo":true,"hasAudio":true,"status":"PLAYING","sdp":"v=0\r\no=- 8483855775148261727 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=msid-semantic: WMS\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 122 127 121 125 107 108 109 124 120 123\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:BaZK\r\na=ice-pwd:RD4iWyKbodDMZn7u34upUH/o\r\na=ice-options:trickle\r\na=fingerprint:sha-256 4B:62:8E:CA:65:4A:26:6B:AF:05:B7:FD:1E:B1:53:CF:FB:B8:27:63:E0:A2:83:33:11:D5:8A:C0:ED:89:8E:96\r\na=setup:actpass\r\na=mid:0\r\na=extmap:14 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:13 urn:3gpp:video-orientation\r\na=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:12 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:11 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\na=extmap:8 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07\r\na=extmap:9 http://www.webrtc.org/experiments/rtp-hdrext/color-space\r\na=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\na=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\r\na=recvonly\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=96\r\na=rtpmap:98 VP9/90000\r\na=rtcp-fb:98 goog-remb\r\na=rtcp-fb:98 transport-cc\r\na=rtcp-fb:98 ccm fir\r\na=rtcp-fb:98 nack\r\na=rtcp-fb:98 nack pli\r\na=fmtp:98 profile-id=0\r\na=rtpmap:99 rtx/90000\r\na=fmtp:99 apt=98\r\na=rtpmap:100 VP9/90000\r\na=rtcp-fb:100 goog-remb\r\na=rtcp-fb:100 transport-cc\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=fmtp:100 profile-id=2\r\na=rtpmap:101 rtx/90000\r\na=fmtp:101 apt=100\r\na=rtpmap:102 H264/90000\r\na=rtcp-fb:102 goog-remb\r\na=rtcp-fb:102 transport-cc\r\na=rtcp-fb:102 ccm fir\r\na=rtcp-fb:102 nack\r\na=rtcp-fb:102 nack pli\r\na=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f\r\na=rtpmap:122 rtx/90000\r\na=fmtp:122 apt=102\r\na=rtpmap:127 H264/90000\r\na=rtcp-fb:127 goog-remb\r\na=rtcp-fb:127 transport-cc\r\na=rtcp-fb:127 ccm fir\r\na=rtcp-fb:127 nack\r\na=rtcp-fb:127 nack pli\r\na=fmtp:127 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f\r\na=rtpmap:121 rtx/90000\r\na=fmtp:121 apt=127\r\na=rtpmap:125 H264/90000\r\na=rtcp-fb:125 goog-remb\r\na=rtcp-fb:125 transport-cc\r\na=rtcp-fb:125 ccm fir\r\na=rtcp-fb:125 nack\r\na=rtcp-fb:125 nack pli\r\na=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=rtpmap:107 rtx/90000\r\na=fmtp:107 apt=125\r\na=rtpmap:108 H264/90000\r\na=rtcp-fb:108 goog-remb\r\na=rtcp-fb:108 transport-cc\r\na=rtcp-fb:108 ccm fir\r\na=rtcp-fb:108 nack\r\na=rtcp-fb:108 nack pli\r\na=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f\r\na=rtpmap:109 rtx/90000\r\na=fmtp:109 apt=108\r\na=rtpmap:124 red/90000\r\na=rtpmap:120 rtx/90000\r\na=fmtp:120 apt=124\r\na=rtpmap:123 ulpfec/90000\r\n","videoCodec":"H264","record":true,"width":426,"height":240,"bitrate":0,"minBitrate":0,"maxBitrate":0,"quality":0,"parentMediaSessionId":"2a2e1df2-eac5-4bdd-90bd-09431d86322a","history":false,"gop":0,"fps":0,"audioBitrate":0,"codecImpl":"","transport":"UDP","cvoExtension":true,"createDate":1593082963539,"mediaType":"play","mediaProvider":"WebRTC","origin":"http://localhost:4200","constraints":{"audio":false,"video":{"width":"320","height":"240"}}}]
 

Max

Administrator
Staff member
Hello,

Reproduced issues with these settings
Code:
encode_record_name=true,HEX
exclude_record_name_characters=:.,/
Created tickets WCS-2773 (for hexadecimal encoding) and WCS-2774 (for exclude_record_name_characters) for the issues - will inform when there is an update.

Each setting should be added to config only once:
Code:
encode_record_name=true,HEX
or
Code:
encode_record_name=true,BASE64
If both are present, then anyway only the last is applied.
stream_record_policy is obsolete and can be remove from the config.

Please try using these settings
Code:
stream_record_policy_template=stream-{mediaSessionId}-{login}
encode_record_name=true,BASE64
record_rotation=20
 

vamsi

New Member
Hi Max,

I have used the configuration which you mentioned the 404 on stopRecords and records folder is empty.

record_streams=true
stream_record_policy_template=stream-{mediaSessionId}-{login}
encode_record_name=true,BASE64
record_rotation=20
For startRecording and stopRecording, I am passing sessionId which we get from session.createStream().

I have uploaded the report logs in this link.
 

Max

Administrator
Staff member
Hello,

WCS can record published streams - mediaSessionId of a published stream should be passed to startRecording. In the log, mediaSessionId of a playing subscriber stream is passed.
Starting from WCS v. 5.2.654, startRecording returns 404 if mediaSessionId of a subscriber stream is passed as parameter.

Published Flash stream can be auto recorded (setting record_flash_published_streams=true in flashphoner.properties).
 

vamsi

New Member
Hi Max,
After adding the record_flash_published_streams=true, the video are auto-recording which worked.
1. But how to fix the startRecording and StopRecording issue?
2. What is the maximum record rotation time we can configure?
3. I have configured the stream_record_policy_template={streamName}-{startTime}-{endTime}-{duration}, but still the records are stored as
WlhoMFpYSnVZV3d0ZTNOMFlYSjBWR2x0WlgwdGUyVnVaRlJwYldWOUxYdGtkWEpoZEdsdmJuMD0=_2.mp4
 

Max

Administrator
Staff member
Hello,

1. Use mediaSessionId of a published (not played) session as parameter for startRecording and stopRecording.
2. If rotation is set in seconds, the value will be parsed as Long.
3. Remove setting encode_record_name=true,BASE64 from the config.
 

Max

Administrator
Staff member
WCS build 5.2.692 has fixes for stream record name processing (excluding characters and encoding): WCS-2773, WCS-2774, WCS-2793.
 
Last edited:
Top