Search code examples
c#google-cloud-platformffmpeggoogle-cloud-functions

C# Cloud Function (System Packages Included in Cloud Functions not loading)


I am new to cloud functions, and I'm trying to load the FFMPEG system package included in ubuntu (System Packages Included in Cloud Functions | Cloud Functions Documentation | Google Cloud)

Currently i am trying to load the FFMPEG system package like this: Process.Start("ffmpeg",$"-i {temp_input_file} -vn -acodec wav {temp_output_file}"); but i am getting this error

An error occurred trying to start process 'ffmpeg' with working directory '/layers/google.dotnet.publish/publish/bin'. No such file or directory

I did this with python and it worked fine but i have a requirement to work with C#.

Thanks.

I tried Process.Start("ffmpeg",$"-i {temp_input_file} -vn -acodec wav {temp_output_file}");

I need it to convert from MP4 to WAV in c# using google cloud function.


Solution

  • So after a weekend of debugging I solved this issue, which relates to the version of OS the google cloud functions use, Since FFMpeg is not included in Ubuntu 22.04 and .Net 6 (which I was using) runs on Ubuntu 22.04 and .Net 3.1 runs on Ubuntu 18.04 which has FFMpeg, so this how I was able to fix this issue,

    Thanks.

    Issue Solved