Cool_Zer0 wrote:
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.
What I asked for was whether my guess at what you call low-quality, is right.
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...
avcodec_alloc_context sets it to AV_CODEC_DEFAULT_BITRATE 200*1000. -- Michel Bardiaux R&D Director T +32 [0] 2 790 29 41 F +32 [0] 2 790 29 02 E mailto:mbardiaux at mediaxim.be Mediaxim NV/SA Vorstlaan 191 Boulevard du Souverain Brussel 1160 Bruxelles http://www.mediaxim.com/