[Libav-user] Convert video from avi to mp4

Nicolas Braini nicoz.b at gmail.com
Fri Apr 13 15:52:01 CEST 2012


Hi,
What you want to do is video transcoding right ?

So, what I suggest is simply do that :

Configure the decoder with the input format.
Configure the encoder with the output format.

For specifying the format, have a look at av_guess_format(...) and
avformat_alloc_context().

AVOutputFormat *outForm= av_guess_format(...) ;
AVFormatContext *formCtxt = avformat_alloc_context();

And after :

AVI file ----> decode video ( avcodec_decode_video2(...) ) -----> frame
finish ----> store frame ---> encode video with frame
(avcodec_encode_video(...) ) ----> MP4 file.

Hope it helps !

Br,
Nicolas Braini.


2012/4/13 Vinoth raj <vinoth.amu at gmail.com>

>
> Dear All,
>
> How to use the libavcodec C library to convert video format from avi to
> mp4?
> I do not want to use ffmpeg from command line but rather want to create a
> C/C++ application with the ability to convert AVI to MP4 video format.
>
> I could not find any samples on video format conversion. Can anyone
> suggest what sequence of steps should I follow to handle conversion of
> videos?
> Or Which methods in the source code should I use for video conversion?
>
> Kindly help!
>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120413/a7f44f5d/attachment.html>


More information about the Libav-user mailing list