Recording RTSP stream

edmundherbert

New Member
Hi could you help me i want to record rtsp stream as i view, it I believe if i set record_rtsp_streams=true on server then when i view rtsp stream it will be recorded and saved on server as mp4 file my question when viewing rtsp stream how do i get file name and location of saved file i need to save file name and reference in my db so i can view at later stage
 

Max

Administrator
Staff member
Hello,

By default, records are saved to /usr/local/FlashphonerWebCallServer/records. Record file name template is specified by stream_record_policy_template. The template can be changed to include stream name (':' and '/' will be replaced with '_').
The parameters can be configured in flashphoner.properties
Code:
record_dir=records
record_rtsp_streams=true
stream_record_policy_template={streamName}-{mediaSessionId}
on_record_hook.sh gets the recording file name right after recording is done.
 

edmundherbert

New Member
Thank you for your reply a question you have a recording sample that uses local camera do you have sample that does recording but uses RTSP stream instead of local camera
 

edmundherbert

New Member
If you do not have example as discussed above can you show me in Player example how I could get recording file name after playing or during playing RTSP stream
 

Max

Administrator
Staff member
do you have sample that does recording but uses RTSP stream instead of local camera
No, there is no such example because it is a little more complex task.
If you do not have example as discussed above can you show me in Player example how I could get recording file name after playing or during playing RTSP stream
If you've set the server option
Code:
record_rtsp_streams=true
and play an RTSP stream in Player example, you should use REST API /recorder/find_all
Code:
POST /rest-api/recorder/find_all HTTP/1.1
HOST: wcs:8081
content-type: application/json
content-length: 0
which returns actual recordings list
Code:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Length: 125
 
[
    {
        "fileName": "9c3e-test-1563776083752-{endTime}.mp4",
        "mediaSessionId": "5a072377-73c1-4caf-abd3"
    }
]
So you can get the file name for every RTSP stream while it is recording.
We also recommend you to set a recording file name template as described in the post above.
 
Top