...
3. Click the "Stop" button. Broadcasting stops, and a link to play and download the recorded fragment appears.
![](/download/attachments/3048980/stream_recording-download.jpg?version=1&modificationDate=1529888724000&api=v2)
Configuration
Server side
Turning stream recording on and off
By default, stream recording is turned off on the WCS server.
To turn recording off add the following line to the config /usr/local/FlashphonerWebCallServer/conf/flashphoner.properties:
Code Block |
---|
|
record_streams=false |
Parameter
Code Block |
---|
|
record_flash_published_streams=true |
turns on recording for the streams published with Flash, RTMP encoder or republished from another RTMP server.
Parameter
Code Block |
---|
|
record_rtsp_streams=true |
turns on recording for the streams captured from RTSP IP cameras.
Forming the name of the stream record file
Parameter stream_record_policy sets the way to from the name of the stream record file. For example,
Code Block |
---|
|
stream_record_policy=streamName |
means that the file name will match the stream name. So, the stream published with ffmpeg
Code Block |
---|
|
ffmpeg -re -i BigBuckBunny.mp4 -preset ultrafast -acodec aac -vcodec h264 -strict -2 -f flv rtmp://test1.flashphoner.com:1935/live/stream_ffmpeg |
will be written to file stream_ffmpeg.mp4.
By default, the file name is formed by template
Code Block |
---|
|
stream_record_policy=template |
In its turn, the template is specified with stream_record_policy_template parameter. By default
Code Block |
---|
|
stream_record_policy_template=stream-{sessionId}-{mediaSessionId} |
When the file name matches the stream name, it may contain characters that are not allowed in file names, slash '/' for example. In that case, the file name should be encoded using the parameter
Code Block |
---|
|
encode_record_name=true,HEX |
Then, the file name will be encoded with a hexadecimal number. The parameter
Code Block |
---|
|
encode_record_name=true,BASE64 |
will encode the file name with BASE64 encoding.
Another way to escape invalid characters is to remove them using exclude_record_name_characters parameter. By default
Code Block |
---|
|
exclude_record_name_characters=/ |
For example, to remove colons, commas, periods and slashes set
Code Block |
---|
|
exclude_record_name_characters=:.,/ |
Record files rotation
Stream records can be splitted to parts of a given duration using record_rotation parameter. For example, the setting
Code Block |
---|
|
record_rotation=20 |
specifies a fragment duration as 10 seconds.
Record files handling script
The on_record_hook_script setting points to the shell-script in the /usr/local/FlashphonerWebCallServer/bin directory that is invoked when stream recording finishes.
...