Try to compile libx264 to create a static library.. and link it to the
ffmpeg during compilation.

-----Original Message-----
From: [email protected]
[mailto:[email protected]]on Behalf Of Stefano Sabatini
Sent: Thursday, December 25, 2008 6:11 AM
To: [email protected]
Subject: Re: [libav-user] H264 encoding using libav


On date Wednesday 2008-12-24 23:21:42 +0400, Artem encoded:
> Thank you for your answer! I'm using latest svn source code. I call
> avcodec_register_all() at the start, here is my code(it works fine with
> codecs other than H264):

Don't top post.

>     av_register_all();
>
>     filename = "test.mp4";
>
>     fmt = guess_format(NULL, filename, NULL);
>     if (!fmt) {
>         printf("Could not deduce output format from file extension: using
> MPEG.\n");
>         fmt = guess_format("mpeg", NULL, NULL);
>     }
>     if (!fmt) {
>         fprintf(stderr, "Could not find suitable output format\n");
>         exit(1);
>     }
>
>     fmt->video_codec = CODEC_ID_H264;
>
>     oc = av_alloc_format_context();
>     if (!oc) {
>         fprintf(stderr, "Memory error\n");
>         exit(1);
>     }
>     oc->oformat = fmt;
>
>     snprintf(oc->filename, sizeof(oc->filename), "%s", filename);
>
>     video_st = NULL;
>     if (fmt->video_codec != CODEC_ID_NONE) {
>         video_st = add_video_stream(oc, fmt->video_codec);
>
>     }
>
>     if (av_set_parameters(oc, NULL) < 0) {
>         fprintf(stderr, "Invalid output format parameters\n");
>         exit(1);
>     }
>
>     ...
>
>
> What did I miss?

Are you sure you're compiling/linking against your compiled
FFmpeg version?

What's the result of:
avcodec_find_encoder(CODEC_ID_H264); ?

If that's the problem then you should double check your
compilation/linking commands, and make them points to the right path
where you installed your version of FFmpeg.

[...]

Regards.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user


The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments contained in it.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to