Click here to Skip to main content
13,864,785 members
Rate this:
Please Sign up or sign in to vote.
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...


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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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:
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Rate this: bad
Please Sign up or sign in to vote.

Solution 3

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.


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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.190214.1 | Last Updated 10 Nov 2015
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100