Stream video not saving

Dosan

New Member
How we can debug function video save? In one folder we have 90 000 videos.
 
Last edited:

Max

Administrator
Staff member
Good day.
The script on_record_hook.sh is called when recording file is saved. You can modify the script to check if recording file exists. Please read details here.
If recording files are no saved, please chek if you watching the folder set in the following parameter
Code:
record_dir=/usr/local/FlashphonerWebCallServer/records
The default setting is shown here.
Also please check if recording is stopped by stream publishing stop or by REST API query /stream/stopRecording, but not by stopping server itself. When server is stopping, current recordings will not be saved.
If the problem still persists, please collect a report as described here, and send using this form, or provide SSH access to the server using this form
 
Last edited:

Dosan

New Member
В on_record_hook.sh тут как то можно передать переменную текущей даты.
Чтобы сохранять в таком формате
SRC_DIR="/usr/local/FlashphonerWebCallServer/records/2020-09-28/$fileName"
 

Max

Administrator
Staff member
Please use date shell command to get current date in the script
Code:
CUR_DATE=$(date '+%Y-%m-%d')
 

Dosan

New Member
not saved video exists here
/usr/local/FlashphonerWebCallServer/records
how to stop streaming? and move to our directory?
 

Max

Administrator
Staff member
Stream can be stopped using WebSDK function Stream.stop()
Code:
function onPlaying(stream) {
    $("#playBtn").text("Stop").off('click').click(function () {
        $(this).prop('disabled', true);
        stream.stop();
    }).prop('disabled', false);
    $("#playInfo").text("");
}
or by REST API query /stream/terminate
Code:
POST /rest-api/stream/terminate HTTP/1.1
Host: 192.168.1.101:8081
Content-Type: application/json
 
{
    "mediaSessionId":"4f112b20-13d0-11e7-b521-59a9cb7eddeb"
}
If stream is publishing and is recording, the stream recording will be stopped and saved to file.
To stop stream recording without stopping the stream, use REST API query /stream/stopRecording
Code:
POST /rest-api/stream/stopRecording HTTP/1.1
Host: 192.168.1.101:8081
Content-Type: application/json
 
{
    "mediaSessionId":"b8ffd290-bcfa-11e9-9482-17706e285ec5"
}
In this case, recording will be stopped and saved to file.
To move stream recordings to custom location, use on_record_hook.sh script, for example
Code:
STREAM_NAME=$1
SRC_FILE=$2
SRC_DIR="/usr/local/FlashphonerWebCallServer/records/"
REPLACE_STR="/var/www/html/stream_records/$STREAM_NAME-"
DST_FILE="${SRC_FILE/$SRC_DIR/$REPLACE_STR}"
cp $SRC_FILE $DST_FILE
The script should be placed to /usr/local/FlashphonerWebCallServer/bin folder.
 
Top