Using FFMPEG on Google Cloud Platform

£可爱£侵袭症+ 提交于 2020-05-27 06:59:05

问题


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.


回答1:


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).



来源:https://stackoverflow.com/questions/42147585/using-ffmpeg-on-google-cloud-platform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!