mirror of https://github.com/OpenVidu/openvidu.git
echo End of recording after thumbnail finished to inform openvidu-server that recording is ended
parent
8c2060ab35
commit
2e214cbcd5
|
@ -157,14 +157,14 @@ elif [[ "${COMPOSED_QUICK_START_ACTION}" == "--stop-recording" ]]; then
|
||||||
### Change permissions to metadata file ###
|
### Change permissions to metadata file ###
|
||||||
sudo chmod 777 /recordings/$VIDEO_ID/.recording.$VIDEO_ID
|
sudo chmod 777 /recordings/$VIDEO_ID/.recording.$VIDEO_ID
|
||||||
|
|
||||||
echo "Recording finished /recordings/$VIDEO_ID/$VIDEO_NAME.$VIDEO_FORMAT"
|
|
||||||
|
|
||||||
### Generate video thumbnail ###
|
### Generate video thumbnail ###
|
||||||
|
|
||||||
MIDDLE_TIME=$(ffmpeg -i /recordings/$VIDEO_ID/$VIDEO_NAME.$VIDEO_FORMAT 2>&1 | grep Duration | awk '{print $2}' | tr -d , | awk -F ':' '{print ($3+$2*60+$1*3600)/2}')
|
MIDDLE_TIME=$(ffmpeg -i /recordings/$VIDEO_ID/$VIDEO_NAME.$VIDEO_FORMAT 2>&1 | grep Duration | awk '{print $2}' | tr -d , | awk -F ':' '{print ($3+$2*60+$1*3600)/2}')
|
||||||
THUMBNAIL_HEIGHT=$((480*$HEIGHT/$WIDTH))
|
THUMBNAIL_HEIGHT=$((480*$HEIGHT/$WIDTH))
|
||||||
ffmpeg -ss $MIDDLE_TIME -i /recordings/$VIDEO_ID/$VIDEO_NAME.$VIDEO_FORMAT -vframes 1 -s 480x$THUMBNAIL_HEIGHT /recordings/$VIDEO_ID/$VIDEO_ID.jpg &> /tmp/ffmpeg-thumbnail.log
|
ffmpeg -ss $MIDDLE_TIME -i /recordings/$VIDEO_ID/$VIDEO_NAME.$VIDEO_FORMAT -vframes 1 -s 480x$THUMBNAIL_HEIGHT /recordings/$VIDEO_ID/$VIDEO_ID.jpg &> /tmp/ffmpeg-thumbnail.log
|
||||||
|
|
||||||
|
echo "Recording finished /recordings/$VIDEO_ID/$VIDEO_NAME.$VIDEO_FORMAT"
|
||||||
|
|
||||||
} 2>&1 | tee -a /tmp/container-stop-recording.log
|
} 2>&1 | tee -a /tmp/container-stop-recording.log
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue