Click here to Skip to main content
15,886,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I need to to convert my .mp4 file to .avi in my VMS application.

How it can be done?


Also how to find no.of frames in .mp4 file?


Kindly help...


Regards

Dinesh
Posted
Comments
Kenneth Haugland 10-Nov-15 1:39am    
yes it can be done, but its not so simple. Your best bet is to get a dll file or a program to do it for you.

Seriously, this is a very non-trivial process. Even commercial packages have real problems doing this right every time. Part of the problem is that both AVI and MP4 are not Video formats, they are Container file formats which hold both audio and video streams - and these can be in a range of different video types - AVI does not support all the stream types that MP4 does, and so you sometimes have to transcode the streams as well as change the container format. And that depends on having the right codecs installed on your PC (another true PITA sometimes).

There is at least one open source video converter which may be able to help you: Handbrake[^] (allthough I don't like it that much as an application and tend to use Freemake instead, which is free, but not open source)

Looking at how Handbrake does it may help you at least understand the complexity of what you are getting into! :laugh:
 
Share this answer
 
 
Share this answer
 
v2
There is no such thing as "mp4" file. This kind of file name pattern can cover many sorts of media containers and compression algorithm for each channel. You are not asking about anything certain. The answer depends on what exactly you want to achieve, and you probably don't know it yet.

Not to worry. Learn it. For starters, please see my past answers and the links I provided:
video (mp4) to Mp3 convert[^],
HTML5 and Mime, Streaming a video?[^],
how to convert image to video in C#[^],
How to trim the video using Directshow!?[^].

As you can see, I always recommend one tool which I consider the best: FFMpeg and libav; and I also recommend the ways to use those libraries (or just utilities, through spawning the application process for conversion) in .NET. The documentation, among many other things, describe supported codecs, media containers, protocols, and so on. You can try all the codes and a number of containers, to figure out what you would prefer.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900