Motion - Feature Request 2005x 11x 20x 101205

Feature Request: Add Ogg Theora video support (perhaps replacing ffmpeg)

Description

I've been doing some video processing and setup of video streaming using icecast these last couple of weeks. What I've found is that Ogg Theora (with a default quality setting of 7) produces significantly better video than ffmpeg MPEG4 at 6000K bit rate and the resulting file size is 1/2 to 1/3 ffmpeg MPEG4 files recorded at 3000K bit rate.

Streaming a video feed of size 160x120 (qsif) at 5 fps with Ogg Theora results in network usage of around 1.8K-2.5K (actually about every other second). Currently the webcam view with 3.2.1 of motion consumes 13.8K-18.4K per second with only 2 fps (quality setting of 50).

Using Ogg Theora should also permit the reactivation of the time lapse video option. Additional functionality could include the addtion of audio into the stream (using either Vorbis or Speex) so the observer could hear as well as see whats going on (the Logictech QuickCam 4000s have a microphone).

The additional benefit is that Theora can be used by anybody and doesn't require licensing as MPEG does. The main site for Ogg Theora is http://www.theora.org/ and codecs for Windows Media Player can be found here: http://www.illiminable.com/ogg (note WMP9 had trouble closing the stream, WMP10 works fine).

Most of the free players (MPlayer, xine, VLC) already support Ogg Theora. I'd put this on my project plate except I probably wouldn't get to it until 2007 frown, sad smile

-- WilliamVolkman - 20 Nov 2005

Follow up

Comments

what is the CPU overhead of "Ogg Theora" with respect to ffmpeg ?

-- EvilPete - 20 Nov 2005

William your request has been discussed in the past , i was playing with theora but the API wasn't clear enought , so your request is nice , but we need a good API.

-- AngelCarpintero - 21 Nov 2005

System is a 2.4 GHz P4 with 1GB of memory. Theora has not yet been tuned.

time ffmpeg -i jim6.yuv -b 3000 -f mp4 wkv.mpg
ffmpeg version CVS, build 3211264, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cpu=x86 --extra-cflags=-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables --enable-mp3lame --enable-libogg --enable-vorbis --enable-theora --enable-faad --enable-faadbin --enable-faac --enable-libgsm --enable-xvid --enable-a52 --enable-a52bin --enable-pp --enable-shared-pp --enable-shared --enable-gpl --disable-debug --disable-opts --disable-strip
  built on Aug 18 2005 16:08:39, gcc: 4.0.1 20050727 (Red Hat 4.0.1-5)
Input #0, yuv4mpegpipe, from 'jim6.yuv':
  Duration: N/A, bitrate: N/A
  Stream #0.0: Video: rawvideo, yuv420p, 720x480, 30.00 fps
Output #0, mp4, to 'wkv.mpg':
  Stream #0.0: Video: mpeg4, yuv420p, 720x480, 30.00 fps, q=2-31, 3000 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 2128 q=0.0 Lsize=    2904kB time=70.9 bitrate= 335.4kbits/s
video:2886kB audio:0kB global headers:0kB muxing overhead 0.624206%

real    1m0.951s
user    0m13.457s
sys     0m3.864s

time theora_encode -o wkv.ogg -v 7 jim6.yuv
File jim6.yuv is 720x480 30.00 fps YUV12 video.
Compressing....
      0:01:10.90 audio: 0kbps video: 50kbps
done.

real    1m8.355s
user    0m23.537s
sys     0m1.812s

ls -l wkv.ogg wkv.mpg jim6.yuv
-rw-rw-r--  1 wkv wkv 1103168011 Nov 14 03:22 jim6.yuv
-rw-rw-r--  1 wkv wkv    2973558 Nov 20 18:41 wkv.mpg
-rw-rw-r--  1 wkv wkv     443889 Nov 20 18:52 wkv.ogg

-- WilliamVolkman - 21 Nov 2005

There is the encoder_example.c file in the source, last I looked at it the API seemed pretty straight forward; you build a OGG output stream, you fill-in and encode a theora_info structure (ensuring that video size is a multiple of 16), encode the theora header, send to ogg stream, force the ogg page out so it's aligned. Theora works frame by frame, I.E. a single frame in creates a single frame out (keep one frame buffered so that you know when you are at end and can mark the frame appropriately). Send the frames into the ogg stream, writing the ogg pages out.

-- WilliamVolkman - 21 Nov 2005

Is this API thing still an issue? Theora support would be great, because the upcoming Debian version "Lenny" won't have a ffmpeg version that supports mpeg4 due to license/non-free issues.

The default now is flv, which is quite a deterioration in quality.

I'm quite an experienced C/C++-Developer, but i will need some pointers to start with.

-- PeterSchaefer - 23 Jul 2008


Instead of add more encoders in motion core , probably is better until we switch to motion 4.x use an extenal pipe :

http://www.lavrsen.dk/twiki/bin/view/Motion/DarkwindHackeronMotionPatching

-- AngelCarpintero - 25 Jul 2008

With the new html 5 video tag (and at least firefox's support for ogg) it would be nice to have this looked at again please.

-- BenHardill - 27 Jan 2010

since ffmpeg already handles ogg it's easy to enable it in the code. http://www.lavrsen.dk/foswiki/bin/view/Motion/OggTimelapse

-- MichaelLuich - 18 Jan 2012

FeatureRequestForm edit

TopicTitle Add Ogg Theora video support (perhaps replacing ffmpeg)
FeatureRequestStatus Discussion
SubmittedBy WilliamVolkman
Topic revision: r10 - 18 Jan 2012, MichaelLuich
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.