[gst-devel] Tell me about y4menc and other encoders.

wally_bkg wb666greene at gmail.com
Fri Dec 3 22:53:55 CET 2010


I'm working on a real time image processing system and I'd like to "Tee" off
the input video and save it to a file for a variety of reasons -- archiving
epochs of particular interest,  re-analysis with algorithms that can't yet
run in real time, system verification, etc.  Previous work has shown that
good quality compression (like with a commercial DVD Recorder) is acceptable
(we've been using SVHS recorders for ~20 years :) )


I first tried: jpegenc, mpeg2enc, and theoraenc.  I could eliminate mpeg2enc
from a combination of too high CPU load and too low video quality (using
only the defaults).  If I'm wrong about mpeg2enc please set me straight
about how to get good results from it.


Here some sample pipelines

gst-launch v4l2src ! video/x-raw-yuv, framerate=\(fraction\)30000/1001 ! tee
name=t ! queue ! wally ! xvimagesink t. ! queue ! ffmpegcolorspace ! jpegenc
! avimux ! filesink location=mjpeg.avi

gst-launch v4l2src ! video/x-raw-yuv, framerate=\(fraction\)30000/1001 ! tee
name=t ! queue ! wally ! xvimagesink t. ! queue ! ffmpegcolorspace !
theoraenc ! oggmux ! filesink location=theora.ogv

The wally plug-in is a simple filter plug-in I wrote that does a simple
transformation of the video data as a proxy for my image processing.  Both
pipelines seem to work OK but CPU usage seems high with theoraenc being
about 40% more CPU but with about half the file size of jpegenc.   My
problem here is while the files play back fine in Totem, there is something
wrong with them if I try to play them on a Windows system (that is set up
for MJPEG and OGG/Theora).  Not a show stopper, but I'd love clues as to
what might be making these files not usable on Windows.


Then I discovered y4menc:

gst-launch v4l2src ! video/x-raw-yuv, framerate=\(fraction\)30000/1001 !
y4menc ! filesink location=y4menc.yuv

while it gives about 30X the file size of theoraenc it uses very little CPU,
less than half of the jpegenc pipeline. 


The doc at:

http://www.gstreamer.net/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-y4menc.html

doesn't really tell me anything helpful.  


What are some of the pros and cons (other than gigantic files) of y4menc,
and what is its intended purpose?  I don't seem to be able to pipe it into
one of the container formats like avimux, oggmux, or matroskamux.   If I do
"Open With Media Player" the file appears to play fine, although it seems
playback in Totem doesn't seek.  

I can play it back with:
 gst-launch filesrc location=y4menc_big.yuv ! decodebin ! ffmpegcolorspace !
xvimagesink

Having captured & played back an ~10 minute clip into a 9.7 GB file
(apparently glitch free!) while composing this message I'm most impressed
with this aspect of gstreamer performance!


Are there better encoders in gstreamer that perhaps I don't have or know
about?  (I've installed about everything gst related that is available in
the Ubuntu repos).




-- 
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Tell-me-about-y4menc-and-other-encoders-tp3071830p3071830.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list