Hi Emyr
In your code the call av_register_all() s missing, because without it, no
other function of libav can be called.
Second at av_open_input_file() the third parameter must be null, otherwise
you force the input format, instead of libav detect it.
For a example the code of output_example in the src directory is also
helpful.
Steffen
> Hi,
> I couldn't find any basic tutorials or documentation about using this
> library. If anyone has any links feel free to share.
> I had a look at the api_example.c in the avcodec src dir and I also ran
> doxygen against the headers in the include directories created with a
> make install. Using this information I came up with the following...
>
> #include <iostream>
>
> extern "C" {
> #include <libavformat/avformat.h>
> }
>
> using namespace std;
>
> int main(int argc, char **argv)
> {
>
>
> if (argc <= 1) {
> cout << "usage audio_convert <fielname>\n" << endl;
> }
>
> // data structures
> AVFormatContext *pFormatContext=new AVFormatContext;
> AVInputFormat *pInputFormat=new AVInputFormat;
>
> // open input file
> av_open_input_file(&pFormatContext, argv[1], pInputFormat,0,0);
>
> // dump the format
> dump_format(pFormatContext,0,0,0);
>
> return 0;
> }
>
> and compile it with
>
> g++ -o audio_convert audio_convert.c -lavcodec -lavdevice -lavformat
> -lavutil -lz
>
> Here's what happens when I run it...
>
> $ ./audio_convert music.mp3
> Segmentation fault
>
> What I need is a program that loads a media file (just audio file at
> mo), detects it's format and codec, then saves the output as a low
> quality ogg format. I will then want to be able to load in video files
> and strip out any audio they contain and save that out as low quality too.
>
> Can anyone give suggestions on getting started here ?
>
> Cheers,
> Emyr
> _______________________________________________
> libav-user mailing list
> [email protected]
> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user