/// <summary> /// それぞれの有音区間の動画を作成し、出力データのリストを返す /// </summary> /// <param name="mInfo"></param> /// <returns></returns> private List <string> CreatePartMovies(MovieInfomation mInfo) { var context = mInfo.Context; var partsData = mInfo.PartsData; // 出力先のフォルダ var outPutPath = context.OutputDirectoryPath; // 出力先のフォルダを作成 Directory.CreateDirectory(outPutPath); // List <string> outPutFileList = new List <string>(); foreach (var part in partsData) { if (!part.IsCreate) { continue; } var oFileName = $@"output{part.Number}.mp4"; var fullFileName = outPutPath + @"\" + oFileName; outPutFileList.Add(fullFileName); var arguments = $@"-ss {part.From + context.StartDelayDuration} -i {context.InputMoviePath} -t {part.Duration + context.StartDelayDuration + context.EndDelayDuration} {fullFileName}"; FfmpegExecute(arguments); } return(outPutFileList); }
public List <MovieInfomation> GetAllMoviePartsList(List <GetMovieContext> movieContexts) { List <MovieInfomation> movieInfomations = new List <MovieInfomation>(); foreach (var context in movieContexts) { var parts = CreatePartList(context); var movie = new MovieInfomation(context, parts); movieInfomations.Add(movie); } return(movieInfomations); }