Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

3. Click the "Stop" button. Broadcasting stops, and a link to play and download the recorded fragment appears.

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
languagebash
themeRDark
record_streams=false

Parameter

Code Block
languagebash
themeRDark
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
languagebash
themeRDark
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
languagebash
themeRDark
stream_record_policy=streamName

means that the file name will match the stream name. So, the stream published with ffmpeg

Code Block
languagebash
themeRDark
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
languagebash
themeRDark
stream_record_policy=template

In its turn, the template is specified with stream_record_policy_template parameter. By default

Code Block
languagebash
themeRDark
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
languagebash
themeRDark
encode_record_name=true,HEX

Then, the file name will be encoded with a hexadecimal number. The parameter

Code Block
languagebash
themeRDark
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
languagebash
themeRDark
exclude_record_name_characters=/

For example, to remove colons, commas, periods and slashes set

Code Block
languagebash
themeRDark
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
languagebash
themeRDark
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.

...