Hi all. I would really like to use Theora for the commercial product I work on... It's a Linux based DVR. Actually we use ffmpeg to produce MPeg4 short clips from 4 BNC channels in CIF resolution. I made a small module for our project that uses Theora... but I see that it gets a lot of CPU :( So I'm here to ask for any kind tips to reduce the CPU usage. - Hardware... do you think there are better CPUs for Theora? AMD64? - CPU optimisations... they are enabled by default, right? - Encoding parameters... now I use: ... theora_info tTheoraInfo; tTheoraInfo.colorspace = OC_CS_ITU_REC_470BG; /* OC_CS_UNSPECIFIED ? */ tTheoraInfo.pixelformat = OC_PF_420; tTheoraInfo.target_bitrate = 0; tTheoraInfo.quality = 15; tTheoraInfo.dropframes_p = 0; tTheoraInfo.quick_p = 1; tTheoraInfo.keyframe_auto_p = 1; tTheoraInfo.keyframe_frequency = 64; tTheoraInfo.keyframe_frequency_force = 64; tTheoraInfo.keyframe_data_target_bitrate = tTheoraInfo.target_bitrate * 1.5; tTheoraInfo.keyframe_auto_threshold = 80; tTheoraInfo.keyframe_mindistance = 8; tTheoraInfo.noise_sensitivity = 1; ... - Other parameters...? Other ideas...? - Perhaps some options I could disable that consume CPU to get also less quality if it needs... I'm studying the Theora's examples and ffmpeg2theora to see if I can optimize my code... but I don't know libogg / libtheora so I can't understand well some functions. Is there an API reference also for libogg... ? Thank you in advance, -Mat-
On Wed, Oct 04, 2006 at 12:55:58PM +0200, Mat wrote:> So I'm here to ask for any kind tips to reduce the CPU usage. > - Hardware... do you think there are better CPUs for Theora? AMD64?What optimization we have should work with both x86 and x86_64 cpus. You do need a fast machine for SD res, but CIF shouldn't be a problem. By "4 BNC" do you mean capturing 4 separate CIF feeds (4x2.5 Mpixel/second) simultanteously?> - CPU optimisations... they are enabled by default, right?Should be, if you're using the latest release. alpha6 had a bug where they were not. If you 'make debug' from svn it should tell you what it's using.> - Encoding parameters... now I use:These looks like they're appropriate. Reducing the framerate will help a lot, but that may not be acceptable for a DVR.> I'm studying the Theora's examples and ffmpeg2theora to see if I can > optimize my code... but I don't know libogg / libtheora so I can't > understand well some functions. Is there an API reference also for > libogg... ?http://xiph.org/ogg/doc/libogg/ It is unlikely to be a bottleneck, however. HTH, -r
On Wed, 4 Oct 2006, Ralph Giles wrote:> It is unlikely to be a bottleneck, however.The main bottleneck for theora (live) broadcasts is currently the bitrate instability with fast motion. I wonder if this *can* be fixed. Stefan de Konink
Now i write application to capture and encode video stream from V4L2 device to Theora/Ogg file (384x288 25fps). And i have low performance problems on my athlon processor (2Ghz). Maybe i must change theora to some faster codec (mpeg in ffmpeg?) But maybe there is something which i can do to make better performance? Example, i have code to convert RGB buffer to YUV buffer, but this is can take lot CPU ticks. (function ogg_encode_frame in http://linpvr.googlecode.com/svn/trunk/src/ogg_enc.c ) Any suggestions ??? PS. Maybe someone know about applications like Analog VCR for v4l ?