record_done.sh 382 B

123456789101112
  1. #!/bin/bash
  2. FILE_NAME="$1" # stream
  3. FILE_PATH="$2" # /var/www/html/recordings/stream-1653927205-30052022-161325.flv
  4. FILE_BASENAME="$3" # stream-1653927205-30052022-161325
  5. # Convert FLV to MP4
  6. /usr/bin/ffmpeg -i ${FILE_PATH} -c copy /tmp/${FILE_BASENAME}.mp4 && \
  7. /bin/mv /tmp/${FILE_BASENAME}.mp4 /var/www/html/recordings && \
  8. /bin/rm ${FILE_PATH}
  9. # Do something here...