Michel Bardiaux wrote:
Cool_Zer0 wrote:
Michel Bardiaux wrote:
Cool_Zer0 wrote:
Hi there,
I'm facing a low quality [snip]
Quality depends on what you put in enc_context. If you keep the defaults, that will be 200kbits, which by my seat-of-the-pants-o-meter should be roughly equivalent to a 400kbits MPEG1, ie a little worse than long-play VCR.
Please tell if you have indeed this.
void video_encode_init() { yuv420_frame = avcodec_alloc_frame(); if(yuv420_frame==NULL) { printf("avcodec_alloc_frame() error!\n"); exit(1); } numBytes=avpicture_get_size(PIX_FMT_YUV420P, 176, 144); buffer=new uint8_t[numBytes]; avpicture_fill((AVPicture *)yuv420_frame, buffer, PIX_FMT_YUV420P, 176, 144); enc_codec = avcodec_find_encoder(CODEC_ID_H263); if (!enc_codec) { fprintf(stderr, "encoder not found\n"); exit(1); } enc_context = avcodec_alloc_context(); enc_context->width = 176; enc_context->height = 144; enc_context->pix_fmt = PIX_FMT_YUV420P; enc_context->time_base.num = 1; enc_context->time_base.den = 90000; if (avcodec_open(enc_context, enc_codec) < 0) { fprintf(stderr, "could not open codec\n"); exit(1); } } This is my function that initializes the enc_context... I don't specify the bitrate any where...