48 lines
1.6 KiB
C#
48 lines
1.6 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using System;
|
|
//using VideoSurveillanceAdapter.ffmpeg;
|
|
using Yunda.ISAS.DataMonitoringServer.DataAnalysis;
|
|
using YunDa.ISAS.DataTransferObject;
|
|
|
|
namespace Yunda.ISAS.DataMonitoringServer.WebApi.Controllers
|
|
{
|
|
[Route("isas/api/dataMonitoringService/VideoTranscode/[action]")]
|
|
public class VideoTranscodeController
|
|
{
|
|
public string Index()
|
|
{
|
|
return "Hello VideoTranscodeController!";
|
|
}
|
|
[HttpGet]
|
|
public RequestEasyResult TranscodeVideoFile([FromQuery] string filePath, [FromQuery] string fileDstPath)
|
|
{
|
|
RequestEasyResult requestEasyResult = new RequestEasyResult();
|
|
try
|
|
{
|
|
//UseFFmpegExeTranscode.TrancodeHandle(filePath, fileDstPath);
|
|
requestEasyResult.Flag = true;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MonitoringEventBus.LogHandler($"转码失败{ex.Message}", "异常信息");
|
|
}
|
|
return requestEasyResult;
|
|
}
|
|
[HttpGet]
|
|
public RequestEasyResult PlayVideoFile([FromQuery] string filePath)
|
|
{
|
|
RequestEasyResult requestEasyResult = new RequestEasyResult();
|
|
try
|
|
{
|
|
//UseFFmpegExeTranscode.PlayVideo(filePath);
|
|
requestEasyResult.Flag = true;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MonitoringEventBus.LogHandler($"播放失败{ex.Message}", "异常信息");
|
|
}
|
|
return requestEasyResult;
|
|
}
|
|
}
|
|
}
|