I'm evaluating some video codecs for a online conference system. I'm encoding images (640x480) from a webcam. I've been playing around with theora and xvid. First of all, using theora, the decoded image looks strange: http://integrasoft.ro/~mgliga/theora/comparison.png <http://integrasoft.ro/%7Emgliga/theora/comparison.png>. On the left side the image from the webcam, on the right side the image from the webcam encoded, and then decoded using theora. As you can see there are some strange colors overs there ( looks like edge detection :-D ). Then I measured how long does it take for Theora to encode an image (/th_encode_ycbcr_in/ and / th_encode_packetout/ calls). int TIMER_t0 = GetTickCount(); int ret = th_encode_ycbcr_in( (th_enc_ctx*)m_encoderHandler, ycbcr); ogg_packet op; th_encode_packetout((th_enc_ctx*)m_encoderHandler,0,&op)>0 int TIMER_t1 = GetTickCount(); printf( "Timer : %d \n",TIMER_t1 - TIMER_t0 ); On average: *80 ms*. Using XVID I've obtained between *20-25 ms* for an image. That's 60ms longer using Theora. I don't know if I am doing something wrong while initializing the encoder, or that's the way it supposed to be. The encoder initialization used by me can be found here: http://integrasoft.ro/~mgliga/theora/theora_init.cpp <http://integrasoft.ro/%7Emgliga/theora/comparison.png> Used hardware/software: Processor Pentium(R) Dual-Core CPU E5200 @ 2.50GHz, 2400 Mhz, 2 Core(s), 2 Logical Processor(s) Installed Physical Memory (RAM) 2.00 GB OS Name Microsoft? Windows Vista^(TM) Any ideas or suggestions are welcomed. -- Mircea Gliga -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/theora/attachments/20091207/b1aebd92/attachment.htm
> webcam encoded, and then decoded using theora. As you can see there are > some strange > colors overs there ( looks like edge detection :-D ).I'd guess that the YUV to RGB color conversion code is not clamping where it should. See the color space docs in the Theora tarball (color.html).
Mircea Gliga wrote:> Then I measured how long does it take for Theora to encode an image...> On average: *80 ms*. > Using XVID I've obtained between *20-25 ms* for an image. That's > 60ms longer using Theora.That is surprising. A big difference like this is definitely not expected. Are you encoding at approximately the same bitrate? Video encoding speed depends heavily the target bitrate or quality. What version of libtheora are you linking against? Apart from switching out XVID and Theora, is the code otherwise identical? --Ben -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature Url : http://lists.xiph.org/pipermail/theora/attachments/20091207/becef382/attachment.pgp
With all the measurements I've done with the images from my webcam ( the API calls: /th_encode_ycbcr_in/ and /th_encode_packetout/ take *80 ms *when there is a lot of motion from the webcam ), I've come to the conclusion that I can only encode around 10-12 frames/sec without any other image processing ( YUV conversion, etc). Mircea Gliga wrote:> I'm evaluating some video codecs for a online conference system. I'm > encoding images (640x480) > from a webcam. I've been playing around with theora and xvid. > First of all, using theora, the decoded image looks strange: > http://integrasoft.ro/~mgliga/theora/comparison.png > <http://integrasoft.ro/%7Emgliga/theora/comparison.png>. > On the left side the image from the webcam, on the right side the > image from the > webcam encoded, and then decoded using theora. As you can see there > are some strange > colors overs there ( looks like edge detection :-D ). > Then I measured how long does it take for Theora to encode an > image (/th_encode_ycbcr_in/ and / > th_encode_packetout/ calls). > > int TIMER_t0 = GetTickCount(); > int ret = th_encode_ycbcr_in( (th_enc_ctx*)m_encoderHandler, ycbcr); > ogg_packet op; > th_encode_packetout((th_enc_ctx*)m_encoderHandler,0,&op)>0 > int TIMER_t1 = GetTickCount(); > printf( "Timer : %d \n",TIMER_t1 - TIMER_t0 ); > > On average: *80 ms*. > > Using XVID I've obtained between *20-25 ms* for an image. That's > 60ms longer using Theora. > I don't know if I am doing something wrong while initializing the > encoder, or that's the way it > supposed to be. The encoder initialization used by me can be found > here: http://integrasoft.ro/~mgliga/theora/theora_init.cpp > <http://integrasoft.ro/%7Emgliga/theora/comparison.png> > > Used hardware/software: > Processor Pentium(R) Dual-Core CPU E5200 @ 2.50GHz, 2400 > Mhz, 2 Core(s), 2 Logical Processor(s) > Installed Physical Memory (RAM) 2.00 GB > OS Name Microsoft? Windows Vista^(TM) > > > Any ideas or suggestions are welcomed. > > -- > Mircea Gliga >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/theora/attachments/20091209/b77ffd2d/attachment.htm