Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload any video and convert to .mp4 online in .net

Tags:

c#

.net

video

mp4

I have a strange requirement. User can upload their video of any format (or a limited format). We have to store them and convert them to .mp4 format so we can play that in our site.

Same requirement also for audio files.

I have googled but I can't get any proper idea. Any help or suggestions....??

Thanks in advance

like image 940
Sachin Avatar asked May 22 '13 14:05

Sachin


1 Answers

You can convert almost any video/audio user files to mp4/mp3 with FFMpeg command line utility. From .NET it can be called using wrapper library like Video Converter for .NET (this one is nice because everything is packed into one DLL):

(new NReco.VideoConverter.FFMpegConverter()).ConvertMedia(pathToVideoFile, pathToOutputMp4File, Formats.mp4)

Note that video conversion requires significant CPU resources; it's good idea to run it in background.

like image 192
Vitaliy Fedorchenko Avatar answered Nov 16 '22 00:11

Vitaliy Fedorchenko