Function-as-a-Service (FaaS)
Remote Procedure Call (RPC) 调用远程函数
- apt install ffmpeg; ffmpeg -i a.mp4 -f ffmetadata -
def get_media_data(object_key):
client = fc2.Client(
endpoint="https://<id>.cn-hangzhou.fc.aliyuncs.com",
accessKeyID="xxxxxxxx", accessKeySecret="yyyyyy"
)
return client.invoke_function(
"FcOssFFmpeg",
"GetMediaMeta",
payload=json.dumps({
"bucket_name": "test-bucket",
"object_key": object_key
})).data
get_media_data('/object/key/to/a.mp4')