Guest User

Guest User

  • Tech Writer
  • 611
  • 117k

Error in Live Server.

Oct 7 2020 1:18 AM
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
  1. var wwwrootPath = webHost.ContentRootPath + "\\wwwroot\\UploadVideo\\";  
  2. if (CategoryVideo.FileName == null || CategoryVideo.FileName.Length == 0)  
  3. return Content("file not selected");  
  4. var path = Path.Combine(  
  5. wwwrootPath,  
  6. CategoryVideo.FileName);  
  7. using (var stream = new FileStream(path, FileMode.Create))  
  8. await CategoryVideo.CopyToAsync(stream);  
  9. string fileExt = Path.GetExtension(CategoryVideo.FileName);  
  10. string thisFileName = CategoryVideo.FileName;  
  11. if (fileExt != ".mp4")  
  12. {  
  13. string input = path;  
  14. string filenameWoExt = Path.GetFileNameWithoutExtension(CategoryVideo.FileName);  
  15. var ffmpeg = new NReco.VideoConverter.FFMpegConverter();  
  16. Convertvideo(input, Path.Combine(  
  17. wwwrootPath,  
  18. filenameWoExt + ".mp4"), NReco.VideoConverter.Format.mp4);  
  19. thisFileName = filenameWoExt + ".mp4";  
  20. System.IO.File.Delete(path);  
  21. }  

Answers (1)