【发布时间】:2019-09-16 05:45:42
【问题描述】:
我正在 Visual Studio 中构建一个 Azure 函数来将视频帧转换为图像。我正在使用 Accord.Video.FFMPEG 类中的 VideoFileReader 类。该代码在我的机器上运行,但在尝试将其构建为 Azure 函数项目时,使用指令 Accord.Video.FFMPEG 错误。 随后找不到 VideoFileReader 类型。
我已尝试重新安装 Accord、Accord.Video 和 Accord.Video.FFMPEG NuGet 包。
using System.IO;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using Accord;
using Accord.Video;
using Accord.Video.FFMPEG;
namespace ConvertVideo
{
public static class Function1
{
[FunctionName("Function1")]
public static void Run([BlobTrigger("videos/{name}", Connection = "AzureWebJobsStorage")]Stream myBlob, string name, ILogger log)
{
log.LogInformation($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
//start a new videoFileReader
using (var vFReader = new VideoFileReader())
{
//open the video
vFReader.Open(name);
//get the framerate
double frameRate = vFReader.FrameRate.ToDouble();
//more code which converts a frame to jpg
}
}
}
}
【问题讨论】:
标签: c# azure video ffmpeg azure-functions