Hi I was surprised with size of Theora files and thought of feedback. Following 1minute duration Theora and Xvid files were made from a y4m file. The resolution is 1280x720: 1. Xvid 17MB 2. Ogg/Theora Q7 31MB 3. Ogg/Theora Q8 38MB 4. Ogg/Theora Q9 49MB 5. Ogg/Theora Q10 61MB The Xvid file was made using mencoder by 2 passes with following options: bitrate=2500:autoaspect:chroma_opt:vhq=4:bvhq=1:quant_type=mpeg:pass=1 The encoder_example was used to create Ogg/Theora files. It was noted y4m to Theora encoding was the fastest that I have ever seen. The Q9 Ogg/Theora took only 2 minutes 35 seconds. But the files created were way too large compared to Xvid. The Xvid quality was very good, it may be equivalent to Ogg/Theora Q9 or Q10, but its file size is just 17MB. But where as Q10 Ogg/Theora is nearly 4 times bigger than similar Xvid! Q7 Ogg/Theora quality was quite acceptable but its still twice bigger than Xvid. In fact, it doesn't matter if it takes more time to encode if the resulting file size is smaller. Can we achieve smaller file sizes with Theora without compromising quality? Best Regards Unga __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
>>>>> "Unga" == Unga <unga888@yahoo.com> writes:> Hi I was surprised with size of Theora files and thought of feedback.> Following 1minute duration Theora and Xvid files were made from a y4m > file. The resolution is 1280x720:> 1. Xvid 17MB 2. Ogg/Theora Q7 31MB 3. Ogg/Theora Q8 38MB 4. Ogg/Theora > Q9 49MB 5. Ogg/Theora Q10 61MB> The Xvid file was made using mencoder by 2 passes with following > options: > bitrate=2500:autoaspect:chroma_opt:vhq=4:bvhq=1:quant_type=mpeg:pass=1> The encoder_example was used to create Ogg/Theora files.Hi, two things come to my mind: * AFAIK macro-blocks are smaller in Theora than they are in MPEG4. Theora is thus not as well-suited for HDTV content as MPEG4. * What is Y4M, and how did you feed your Y4M-File into encoder_example? Are you sure that the Theora file and the MPEG4-File you created have the same chroma sampling? Else it wouldn't be a fair comparison. Actually I doubt that Theora and MPEG4 currently work with anything else than YUV12, but who knows... BTW there is a hidden option in encoder_example that allows trading file size for sharpness. Might be a good idea to sacrifice some sharpness for HDTV content. Also you can increase the keyframe distance. I attach the patch of my local copy of encoder_example.c, that was "tuned" that way. regards, David -- GnuPG public key: http://user.cs.tu-berlin.de/~dvdkhlng/dk.gpg Fingerprint: B17A DC95 D293 657B 4205 D016 7DEF 5323 C174 7D40 -------------- next part -------------- A non-text attachment was scrubbed... Name: encoder_example.c.patch Type: text/x-patch Size: 606 bytes Desc: not available Url : http://lists.xiph.org/pipermail/theora-dev/attachments/20061006/30846d28/encoder_example.c.bin
You can try increasing decreasing the keyframe interval. The default is suitable for streaming (which is what Theora seems to be most successful in and where it's important to have a usable picture after a few seconds), so the it's placing a keyframe every 64 pictures. XviD places far fewer keyframes, thus making streaming less viable but saving on file size. in encoder_example.c you can toy around with following values ti.quick_p=1; Setting this to 0 makes encoding much slower, but is supposed to predict motion better. ti.keyframe_frequency=64; You can increase this to 500 or so ; (keyframe usally after 20 seconds on with a 25fps video) ti.keyframe_frequency_force=64; You can increase this to 1000 (force keyframe after 40 seconds (when input is 25fps) so you can still seek) ti.noise_sensitivity=1; You can toy around with this, too (I think valid values or 0, 1 or 2) I think you can shave off a fare bit from Theora filessize. XviD, however, is simply a very very good MPEG4 encoder which has received plenty of tuning. It has a very good performance and would be perfect if it wasn't using patented methods. Theora reference encoder in it's current form performs more like a MPEG4 encoder from around 2000. The Theora spec defines some advanced features that could inrease coding efficiency a lot - but there's no encoder yet using those features. To put it into a nutshell: Theora is stable and usable Theora is perfect if you don't want to pay licensing fees Theora is not as efficient as XviD or other highly tuned encoders (especially when using 2 pass encoding - which Theora doesn't have), although there is room for improvement Unga schrieb:> Hi > > I was surprised with size of Theora files and thought > of feedback. > > Following 1minute duration Theora and Xvid files were > made from a y4m file. The resolution is 1280x720: > > 1. Xvid 17MB > 2. Ogg/Theora Q7 31MB > 3. Ogg/Theora Q8 38MB > 4. Ogg/Theora Q9 49MB > 5. Ogg/Theora Q10 61MB > > The Xvid file was made using mencoder by 2 passes with > following options: > bitrate=2500:autoaspect:chroma_opt:vhq=4:bvhq=1:quant_type=mpeg:pass=1 > > The encoder_example was used to create Ogg/Theora > files. > > It was noted y4m to Theora encoding was the fastest > that I have ever seen. The Q9 Ogg/Theora took only 2 > minutes 35 seconds. But the files created were way too > large compared to Xvid. The Xvid quality was very > good, it may be equivalent to Ogg/Theora Q9 or Q10, > but its file size is just 17MB. But where as Q10 > Ogg/Theora is nearly 4 times bigger than similar Xvid! > Q7 Ogg/Theora quality was quite acceptable but its > still twice bigger than Xvid. > > In fact, it doesn't matter if it takes more time to > encode if the resulting file size is smaller. Can we > achieve smaller file sizes with Theora without > compromising quality? > > Best Regards > Unga > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > _______________________________________________ > theora-dev mailing list > theora-dev@xiph.org > http://lists.xiph.org/mailman/listinfo/theora-dev > >
>>>>> "Unga" == Unga <unga888@yahoo.com> writes:> Hi I was surprised with size of Theora files and thought of feedback.> Following 1minute duration Theora and Xvid files were made from a y4m > file. The resolution is 1280x720:> 1. Xvid 17MB 2. Ogg/Theora Q7 31MB 3. Ogg/Theora Q8 38MB 4. Ogg/Theora > Q9 49MB 5. Ogg/Theora Q10 61MBI just ran my own test on a 1 minute video of 1280x720 using theora SVN. /usr/local/src/xiph-cvs/theora/examples/encoder_example \ -o movie.ogg -v 7 stream.yuv Result: 37344631 bytes Then I set: ti.keyframe_frequency=3*64; ti.keyframe_frequency_force=4*64; ti.sharpness=2; Result: 31377957 bytes Viewing the resulting video, there's still some noticable noise (which might be typical for HDTV content?). So I also tried to tune the noise sensitivity: ti.keyframe_frequency=3*64; ti.keyframe_frequency_force=4*64; ti.sharpness=2; ti.noise_sensitivity=6; Result: 28579140 bytes I also perceive the resulting quality as better now. Maybe a result of noise suppression? If I now encode with these settings at quality 5 (which I usually use for all the stuff I encode), I get: Result: 18219860 bytes I can't see any "bad" artefacts like blockiness etc., so for me this quality would be ok. But actually I don't have XviD installed to compare to. regards, David -- GnuPG public key: http://user.cs.tu-berlin.de/~dvdkhlng/dk.gpg Fingerprint: B17A DC95 D293 657B 4205 D016 7DEF 5323 C174 7D40
Reasonably Related Threads
- Live Streams
- Open Source Video Codec and Container (alternative to Xvid)
- Theora blurriness in Windows players
- [LLVMdev] How to compile a simple C program with clang on Windows 8.1?
- [LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)