问题
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);
These are the Property screenshots of both the mp4 files.
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