C# Video concatenation using FFMpegConverter

只愿长相守 提交于 2021-02-07 10:57:18

问题


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. enter image description here

Below is the code snippet I'm using:

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

These are the Property screenshots of both the mp4 files.

enter image description here

Thanks in advance


回答1:


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 had to be initialised with default values. This should have been the fourth parameter to "ffMpeg.Concatmedia" method.



来源:https://stackoverflow.com/questions/22953287/c-sharp-video-concatenation-using-ffmpegconverter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!