I am currently using firebase function to do video compression, the file is first downloaded from the firebase storage, then through fluent ffmpeg, compress the file. Then, the video is re-uploaded to the firebase storage. However, the firebase function console shows that there is a error in ffmpeg:
An error occurred: ffmpeg exited with code 1: compressed-Scooter- One (Always Hardcore).mp3: Read-only file system
But the firebase storage rules is set to read and write:
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
My code: https://github.com/MobileProjectTPC/VideoCompressor/blob/master/functions/index.js
The upper part is my own code, while the lower part is the testing code from Can you call out to FFMPEG in a Firebase Cloud Function with some changes.
So, I don't understand why the ffmpeg function wasn't able to convert the file. Do any one know why this keeps happening and how to fix it?
Also, the output of the functions for my code is as follows:
While their code is as follows:
As you can see for my code, the error shows up after the output of function finished. While for their code, there isn't any error at all but no compressed file in firebase. Does this means the fluent-ffmpeg function wasn't even ran at all for their code?
Thank You.