Hi :)
Why a encoder has been found but I can't open it.But when I change to
other CODEC_ID_ there is no problem.

h264CodecContext->codec_type = AVMEDIA_TYPE_VIDEO;
        h264CodecContext->width = width;
        h264CodecContext->height = height;
//      h264CodecContext->bit_rate = 400000;
        h264CodecContext->time_base = (AVRational) {1,25};
//      h264CodecContext->gop_size = 12;
//      h264CodecContext->max_b_frames=1;
        h264CodecContext->pix_fmt = PIX_FMT_YUV420P;

        h264Codec = avcodec_find_encoder(CODEC_ID_MPEG1VIDEO);

        if (!h264Codec) {
                __android_log_write(ANDROID_LOG_INFO, "NDK", "codec not 
found\n");
                exit(1);
        };

        if (avcodec_open(h264CodecContext, h264Codec) < 0) {
                __android_log_write(ANDROID_LOG_INFO, "NDK", "OPEN\n");
                exit(1);
        }

CODEC_ID_MPEG1VIDEO: the avcodec_open worked.
When I changed to MJPEG the avcodec_open failed.

Could you tell me why?
Or where I can find the information to the answer ?

Thanks very much!!

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

Reply via email to