Published using Google Docs
Cheese perf issue
Updated automatically every 5 minutes

TODO list for Cheese:

Vidoe Noise.

This biggest problem is performance. Mostly it depend on used video and audio codec, framerate and resolution. We cant do best choice for all situations.

https://bugzilla.gnome.org/show_bug.cgi?id=627971

https://bugzilla.gnome.org/show_bug.cgi?id=627459

Pixel format: YUYV (YUV 4:2:2 (YUYV); MIME type: video/x-raw-yuv)

  Frame size: 160x120

        Frame rates: 30, 25, 20, 15, 10, 5

  Frame size: 176x144

        Frame rates: 30, 25, 20, 15, 10, 5

  Frame size: 320x240

        Frame rates: 30, 25, 20, 15, 10, 5

  Frame size: 352x288

        Frame rates: 30, 25, 20, 15, 10, 5

  Frame size: 640x480

        Frame rates: 30, 25, 20, 15, 10, 5

  Frame size: 800x600

        Frame rates: 25, 20, 15, 10, 5

  Frame size: 960x720

        Frame rates: 10, 5

  Frame size: 1600x1200

        Frame rates: 5

As you can see, biggest resolution is 1600x1200 with worst frame rate 5fps - this is the best resolution for photo. Best resolution for video will be 640x480, because this is last resolution with  30fps.

160x120     1.333   or   4:3

176x144     1.222   or 11:9

320x240     1.333   or   4:3

352x288     1.222   or 11:9

640x480     1.333   or   4:3

800x600     1.333   or   4:3

960x720     1.333   or   4:3

1600x1200 1.333   or   4:3

I’d say 176x144 and 352x288 is duplicate of 160x120 and 320x240 in other aspect ratio. IMHO if we haw this kind of duplicates, we should filter it out.

Comment: fargiolas do not like this idea. If you have max resolution 352x288 you’d like to get maximum of our cam.

gst-launch -v v4l2src ! video/x-raw-yuv, width=800, height=600, framerate=15/1 ! ffmpegcolorspace ! aspectratiocrop aspect-ratio=16/9 ! autovideosink

Capture on netbook Asus eeepc 1005 (Atom N280 @1.66GHz):

$(sleep 30; pkill gst-launch)& time gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! theoraenc ! oggmux ! filesink location=test.ogg

real    0m30.062s

user    0m4.732s

sys    0m0.068s

real    0m30.085s

user    0m19.149s

sys    0m0.024s

Other monoton fps test:

res\fps

5 fps

10

15

20

25

30

160x120

7%

10%

13%

24%

320x240

17%/276K

27%

37%/376K

47%

57%

67%/480K

640x480

57%

100%

1280x1024

100%

real    0m20.281s

user    0m12.201s

sys    0m0.152s

Here is not filtered video with enabled telemetry http://videobin.org/+1o2/1xf.html

real    0m18.272s

user    0m11.061s

sys    0m0.128s

Here is filtered video with enabled telemetry http://videobin.org/+1o2/1xe.html

Take a look here to learn more about telemetry visualisation.  And here is the my bugreport and patch adding telemetry debuging to gstreamers theora:

https://bugzilla.gnome.org/show_bug.cgi?id=628488

gst-launch -v v4l2src ! ffmpegcolorspace ! fpsdisplaysink

uvcdynctrl -f

http://tools.arantius.com/stopwatch

record it and play frame by frame:

this is real frame:

and this is real frame:

this is frame was probably produced by codec as sum of two frames from webcam:

After you can capture real time between frames we can measure real frame rate.

mplayer -nosound -vo jpeg some_file.avi

Audio part of performance porblem

real    0m30.045s

user    0m2.636s

sys    0m0.640s

CPU 10%

this created one channel  vorbis audio with 44100 sample rate.

audio/x-raw-float,channles=1 

Correction: there was a mistake in the test, so i got wrong results.

16000

32000

44100

7% CPU

10%

13%

With default settings, speex use 20%.

gst-launch-0.10 pulsesrc ! audioconvert ! audio/x-raw-float,channles=1,rate=16000 ! fakesink

than list all pulse clients:

pacmd ls

at the end of list we should get some thing like this. If not search for “gst-launch” in it:

....

        index: 0

    driver: <protocol-native.c>

    flags: START_CORKED

    state: RUNNING

    source: 1 <alsa_input.pci-0000_00_1b.0.analog-stereo>

    current latency: 0,00 ms

    requested latency: 5,00 ms

    sample spec: float32le 2ch 16000Hz

    channel map: front-left,front-right

                     Stereo

    resample method: speex-float-1

    owner module: 8

    client: 12 <gst-launch-0.10>

    properties:

            media.name = "Record Stream"

            application.name = "gst-launch-0.10"

            native-protocol.peer = "UNIX socket client"

            native-protocol.version = "16"

            application.process.id = "7189"

Most cpuload is coused by resampler. Here is the cat from man page:

           resample-method= The resampling algorithm to use. Use onhje of  src-sinc-

           best-quality,   src-sinc-medium-quality,   src-sinc-fastest,  src-zero-

           order-hold, src-linear, trivial, speex-float-N, speex-fixed-N,  ffmpeg.

           See  the documentation of libsamplerate for an explanation for the dif‐

           ferent src- methods. The method trivial is  the  most  basic  algorithm

           implemented.  If  you're tight on CPU consider using this. On the other

           hand it has the worst quality of them all. The Speex resamplers take an

           integer  quality  setting in the range 0..9 (bad...good). They exist in

           two flavours: fixed and float. The former uses fixed point numbers, the

           latter relies on floating point numbers. On most desktop CPUs the float

           point resmampler is a lot faster, and it also  offers  slightly  better

           quality. See the output of dump-resample-methods for a complete list of

           all available resamplers. Defaults to  speex-float-3.  The  --resample-

           method  command  line  option  takes precedence. Note that some modules

           overwrite or allow overwriting of the resampler to use.

To adjust resample method change /etc/pulse/daemon.conf:

resample-method = speex-float-1

Bugs:

https://bugzilla.gnome.org/show_bug.cgi?id=627263

real    0m30.042s

user    0m1.468s

sys    0m1.904s

Athom with ht (18% CPU)

real    0m30.040s

user    0m2.380s

sys    0m3.100s

Core 2 Duo 2 cores (6%)

real    0m30.010s

user    0m0.680s

sys    0m1.110s

Core 2 Duo 1 core (2%)

real    0m30.015s

user    0m0.260s

sys    0m0.360s