我正在开发一个媒体门户。我已经每天插入和查看视频和图像。想要使用带有 C# 的 Amazon Elastic 转码器将视频格式转码为 .mp4。以下是我上传视频的代码:
public string UploadVideoToLocation(Stream fs, String folder, String subFolder, String filename)
{
string accessKey = this.accessKey;
string secretKey = this.secretKey;
filename = filename.Replace("+", "");
String filePath = folder.Replace("+", "") + "/" + subFolder.Replace("+", "") + "/" + Guid.NewGuid() + filename;
if (Path.GetExtension(filePath).IsNullOrEmpty())
{
filePath += ".mp4";
}
using (var client = new Amazon.S3.AmazonS3Client(accessKey, secretKey, S3Config))
{
PutObjectRequest request = new PutObjectRequest { BucketName = "VideoToConvert", CannedACL = S3CannedACL.PublicRead, Key = filePath, InputStream = fs };
client.PutObject(request);
}
String finalOriginalPath = AMAZON_ROOT + filePath;
finalOriginalPath = finalOriginalPath.Replace("+", "%2B");
//TODO: transcode to needed format
return finalOriginalPath;
}
我应该如何继续使用代码将视频转码为 .mp4 ?