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

Reply via email to