Theora

From OLPC
Revision as of 07:50, 5 February 2008 by 70.113.207.43 (talk) (→‎Testing)
Jump to navigation Jump to search

Theora is the preferred video codec for the OLPC.

Useful Encoding software

You can encode Theora files using the command line application ffmpeg2theora.

Recommended settings

[This file] plays back well on a B4 laptop, running build 623. Ogg multiplexed audio/video file, Theora/Vorbis, length 1m14s, 320×240 pixels, 148kbps overall.

These settings created a file which played back from the local disk successfully:

ffmpeg2theora -x 320 -y 256 -V 148 -A 32 "inputfilename.ogg"

Testing

I have done a few simple libtheora tests needed for the theora encoder ticket (http://dev.laptop.org/attachment/ticket/5988/) using theora-svn.

I have used 2 simple raw yuv file (ftp://ftp.ldv.e-technik.tu-muenchen.de/dist/test_sequences/601) as input, encoded with ffmpeg and converted the video to yuv4mjpeg format (mplayer input.avi -vo yuv4mpeg) needed by thetheoraencoder. I have used the encoder from theora-tools-svn (should be the same encoder as the one in the thero svn examples/ folder)

theoraenc stream.yuv -o output.ogg

I compared 3 theora configurations with the unpatched encoder and with the patched encoder which enables super fast encoding (patch: http://dev.laptop.org/attachment/ticket/5988/speed_example.diff)

The theora builds/configurations I used are the following:

default: standard theora library on my G1G1 OLPC (/usr/lib/libtheora.so.0.2.0)

gcc4.3-geode: CFLAGS= -O3--force-addr -fomit-frame-pointer -finline-functions -funroll-loops -march=geode -mtune=geode

gcc4.3-geode-nommx: configure theora with --disable-asm (most of the mmx specific code is hand assembly, and the mno-{mmx.3dnow} do not make a difference here) and CFLAGS = -O3--force-addr -fomit-frame-pointer -finline-functions -funroll-loops -mno-mmx -mno-3dnow

Numbers below are in seconds

<verbatim>

video input 1 (576i25_mobcal_ter.yuv)

| *library* | *patched* | *unpatched* | | default | 79.5 | 119.5 | gcc4.3 geode | 84.3 | 118.5 | gcc4.3 geode nommx | 137 | 347

video input 2 (576i25_parkrun_ter.yuv)

| *library* | *patched* | *unpatched* | | default | 89 | 197 | gcc4.3 geode | 92.4 | 190 | gcc4.3 geode nommx | 147 | 892

</verbatim>

video input 1 (576i25_mobcal_ter.yuv)

| library || *patched* || *unpatched* | | default || 79.5 | 119.5 | | gcc4.3 geode || 84.3 || 118.5 | | gcc4.3 geode nommx || 137 || 347 |

video input 2 (576i25_parkrun_ter.yuv)

| *library* || *patched* || *unpatched* | | default || 89 || 197 | gcc4.3 geode || 92.4 | 190 | gcc4.3 geode nommx || 147 | 892

- the patch for fastmode (http://dev.laptop.org/attachment/ticket/5988/speed_example.diff) reduces encoding time to half for the inputs. I have not verified this for the gstreamer plugin patch. - the gcc4.3 geode-aware configuration/compilation do not seem to provide performance gains against the default libtheora. In fact the default libtheora seems to be slightly faster for the superfast encoder mode - do we know the configuration/compiler flags used? Many performance critical routines seem to be hand-coded assembly. Do we know which important routine the compiler affects? Any other compiler flag suggestions are welcome. - disabling mmx has a big performance drop as expected.

- Do we have specific encoding timing restraints for videoconferencing applications? - Can anyone suggest suitable inputs that combine both video and audio?

I have not used the gnashdev gcc4.3 build (http://wiki.gnashdev.org/wiki/index.php/Building_OLPC_Tools), but my own build. Let me know if something seems to be missing from the configuration

configured with: /home/vliaskov/compilers/gcc-geode/gcc/configure --prefix=/opt/gcc4-3-gode --enable-shared --enable-threads-posix --with-systen-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++ --disable-dssi --with-cpu=geode Thread model: posix gcc version 4.3.0 20080116 (experimental) (GCC)

[Vasilis Liaskovitis]

See also

External Links

  • [VLC], the free media player software can also encode Theora files.
  • Colingo's wiki contains an entry on how to encode your video in Theora and in Theora/Speex. Translation and walkthrough for this space to come.
  • [[1]] Manual page for ffmpeg2theora.