Upload video in live server firstly convert video in .mts format to .mp4 using FFMpeg Converter but convert video successfully .mp4 but i have face a problem it's video play in local but not upload in live server what is issue.
it' s my code
- var wwwrootPath = webHost.ContentRootPath + "\\wwwroot\\UploadVideo\\";
- if (CategoryVideo.FileName == null || CategoryVideo.FileName.Length == 0)
- return Content("file not selected");
- var path = Path.Combine(
- wwwrootPath,
- CategoryVideo.FileName);
- using (var stream = new FileStream(path, FileMode.Create))
- await CategoryVideo.CopyToAsync(stream);
- string fileExt = Path.GetExtension(CategoryVideo.FileName);
- string thisFileName = CategoryVideo.FileName;
- if (fileExt != ".mp4")
- {
- string input = path;
- string filenameWoExt = Path.GetFileNameWithoutExtension(CategoryVideo.FileName);
- var ffmpeg = new NReco.VideoConverter.FFMpegConverter();
- Convertvideo(input, Path.Combine(
- wwwrootPath,
- filenameWoExt + ".mp4"), NReco.VideoConverter.Format.mp4);
- thisFileName = filenameWoExt + ".mp4";
- System.IO.File.Delete(path);
- }