Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using FFMPEG on Google Cloud Platform

I'm storing audio files on Google Cloud Storage (through Firebase storage).

I need to use FFMPEG to convert the audio file from stereo (two channels) to mono (one channel).

How can I perform the above conversion on Google Cloud Platform?

Update: I suspect one possibility is to use Google Compute Engine to create a virtual machine, install ffmpeg, and somehow gain access to the audio files.

I'm not sure if this is the best way or even possible. So I'm still investigating.

like image 424
itsSLO Avatar asked Feb 09 '17 21:02

itsSLO


1 Answers

If you have code that exists already which can talk to Google Cloud Storage, you can deploy that code as an App Engine application which runs on a Custom Runtime. To ensure the ffmpeg binary is available to your application, you'd add this to your app's Dockerfile:

RUN apt-get install ffmpeg

Then, it is just a matter of having your code save the audio file from GCS somewhere in /tmp, then shelling out to /usr/bin/ffmpeg to do your conversion, then having your code do something else with the resulting output file (like serving it back to the client or saving it back to Cloud Storage).

like image 107
Adam Avatar answered Sep 21 '22 08:09

Adam