使用FFMpegConverter的C#视频串联 [英] C# Video concatenation using FFMpegConverter

查看:167
本文介绍了使用FFMpegConverter的C#视频串联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在ASP.NET Web API中实现视频串联.我可以使用'FFMpegConverter'Nuget Package成功连接从互联网下载的一些示例视频.但是,当我尝试合并从移动设备捕获的文件并尝试打开它时,出现以下错误.

I need to implement video concatenation in my ASP.NET Web API. I could successfully concatenate some sample videos downloaded from internet using 'FFMpegConverter' Nuget Package . But when I tried concatenating files captured from my mobile and tried opening it, I got the following error.

以下是我正在使用的代码段:

Below is the code snippet I'm using:

var ffMpeg = new NReco.VideoConverter.FFMpegConverter();
ffMpeg.ConcatMedia(_fileNames, videoRootPath.mp4, 
                   NReco.VideoConverter.Format.mp4, set);

这些是两个mp4文件的属性"屏幕截图.

These are the Property screenshots of both the mp4 files.

预先感谢

推荐答案

通过对代码进行以下更改,我得到了正确的输出

I got correct output by making the following changes to the code

  var ffMpeg = new NReco.VideoConverter.FFMpegConverter();
                NReco.VideoConverter.ConcatSettings set = new NReco.VideoConverter.ConcatSettings();
                ffMpeg.ConcatMedia(_fileNames, videoRootPath + tobename + ".mp4", NReco.VideoConverter.Format.mp4, set);

NReco.VideoConverter.ConcatSettings必须使用默认值初始化.这应该是"ffMpeg.Concatmedia"方法的第四个参数.

NReco.VideoConverter.ConcatSettings had to be initialised with default values. This should have been the fourth parameter to "ffMpeg.Concatmedia" method.

这篇关于使用FFMpegConverter的C#视频串联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆