Hi there, I'm facing a low quality encoding and I don't know why... So... I have the original frames on BGR24... I want to compress them to send via RTP... I do the following: void video_encode(unsigned char* frame_rgb, int frame_rgb_size, unsigned char* enc_frame, int buf_size, int &enc_frame_size) { int hr; /* Feed uncompressed_frame with the raw RGB data */ AVPicture uncompressed_frame; uncompressed_frame.data[0] = frame_rgb; uncompressed_frame.data[1] = uncompressed_frame.data[2] = 0x00; uncompressed_frame.linesize[0] = 176*3; uncompressed_frame.linesize[1] = uncompressed_frame.linesize[2] = 0; /* Convert from RGB24 to YUV420P */ hr = img_convert((AVPicture*)yuv420_frame, PIX_FMT_YUV420P, &uncompressed_frame, PIX_FMT_BGR24, 176, 144); /* Encode the YUV420P frame to H.263 */ hr = avcodec_encode_video(enc_context, enc_frame, buf_size, yuv420_frame); if (hr>0) { enc_frame_size = hr; } else { enc_frame_size = -1; } } Any ideas on how can I improve the compression quality? Thanks