I want to record all HLS streams/previews to S3 bucket. How can I do that?
I want to record all HLS streams/previews to S3 bucket. How can I do that?
There are a couple of ways to upload the HLS files to S3. First solution is writing files to S3(mounting the S3 Bucket) while broadcasting and second solution is writing the files after broadcasting is finished.
If you would like to have full recording of HLS files, you need to do following settings
settings.hlsPlayListType) to event and settings.deleteHLSFilesOnEnded to false . Edit your /usr/local/antmedia/webapps/{YOUR_APP}/WEB-INF/red5-web.properties for the application and set the following settings
settings.hlsPlayListType=event
settings.deleteHLSFilesOnEnded=false
sudo service antmedia restart
sudo apt install s3fs
echo {WRITE_YOUR_ACCESS_KEY_ID}:{WRITE_YOUR_SECRET_ACCESS_KEY} | sudo tee /etc/passwd-s3fs > /dev/null
sudo chmod 600 /etc/passwd-s3fs
sudo mkdir /mnt/myS3Bucket
sudo s3fs -o dbglevel=info -o curldbg -o allow_other -o use_cache=/tmp/s3-cache myS3Bucket /mnt/myS3Bucket
Please check the disk if mount is successful. You should see a line similar to below in the output when you run df
s3fs 274877906944 0 274877906944 0% /mnt/myS3Bucket
streams directory to your mount directory
sudo ln -s /mnt/myS3Bucket /usr/local/antmedia/webapps/{YOUR_APP}/streams
After that all your streams are directly written to S3 bucket.
You can do that with Ant Media Server S3 integration. Check this out