Open burak-58 opened 1 year ago
You can make this up as a workaround on the operating system side by mounting the bucket to the operating system.
First install the Google SDK as follows.
sudo apt-get install apt-transport-https ca-certificates gnupg
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update && sudo apt-get install google-cloud-cli
gcloud auth application-default login
Now install the Google Cloud Storage FUSE tool.
echo "deb http://packages.cloud.google.com/apt gcsfuse-`lsb_release -c -s` main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install gcsfuse
Mount your bucket to /usr/local/antmedia/webapps/WebRTCAppEE/streams.
gcsfuse --file-mode 777 --dir-mode 777 -o allow_other antmedia-test /usr/local/antmedia/webapps/WebRTCAppEE/streams
You can also follow the document below for HLS recording.
https://antmedia.io/docs/guides/playing-live-stream/hls-playing/#save-hls-records
And that's it.
I tested the GCS fuse solution, which works as expected by mounting the streams directory to the GCS bucket.
However, when accessing the .m3u8 file from GCS bucket the content of the .m3u8 file is not updated in the bucket as the cache settings get rewritten on the bucket whereas it is updated on the OS side.
To upload the recording to the cloud storage, AMS waits for stream end. Instead it should upload recordings every 15 secs. In case the recording process fails due to some reason we want a fallback option such that the damage is minimal.