private static void AddVideoSourceFromOption(string[] option, VideoEditCore core) { VideoSource src; if (option.Length == 2) { src = new VideoSource( option[0], new[] { new FileSegment(null, null) }); } else { src = new VideoSource( option[0], new[] { new FileSegment(TimeSpan.FromMilliseconds(Convert.ToInt32(option[2])), TimeSpan.FromMilliseconds(Convert.ToInt32(option[3]))) }); } if (option.Length == 2) { core.Input_AddVideoFile(src); } else { core.Input_AddVideoFile(src, TimeSpan.FromMilliseconds(Convert.ToInt32(option[4]))); } }
private static void AddVideoSourceFromOption(string[] option, VideoEditCore core) { VFVEVideoSource src; if (option.Length == 2) { src = new VFVEVideoSource( option[0], new[] { new VFVEFileSegment(-1, -1) }); } else { src = new VFVEVideoSource( option[0], new[] { new VFVEFileSegment(Convert.ToInt32(option[2]), Convert.ToInt32(option[3])) }); } if (option.Length == 2) { core.Input_AddVideoFile(src); } else { core.Input_AddVideoFile(src, Convert.ToInt32(option[4])); } }
public ActionResult StartConvertClick() { var sourceFile = Session["UploadedFile"].ToString(); var sourceFileFull = Path.Combine(Server.MapPath("~/Data/"), sourceFile); ViewBag.Message = $"Converting... ({sourceFile})"; _core = new VideoEditCore(); _core.OnError += _core_OnError; _core.OnProgress += _core_OnProgress; _core.Input_AddVideoFile(sourceFileFull); _core.Input_AddAudioFile(sourceFileFull, sourceFileFull); _core.Mode = VFVideoEditMode.Convert; _core.Output_Format = new VFMP4v8v10Output(); _core.Output_Filename = Server.MapPath("~/Data/output.mp4"); _core.ConsoleUsage = true; _core.Start(); _core.Dispose(); return(RedirectToAction("Download", new { filename = "output.mp4" })); }