shmsrc framerate performance

mattes effemm at mykmk.com
Wed Nov 23 10:29:07 PST 2011


I have a custom app creating customized video frames and connects to gstreamer via the shm interface.
Gstreamer is used in this case to encode the video stream (shm) and capture/encode audio, saving both
AV streams into a file. I have difficulty getting the desired 30 fps framerate!

Here is what I found out so far:

1) encoding audio 'alsasrc' and video 'videotestsrc'    ==> 30fps
2) encoding audio 'alsasrc' and video 'v4l2src'         ==> 30fps

3) encoding video only via 'shmsrc'                     ==> 30fps
4) encoding audio 'audiotest' and video 'shmsrc'        ==> 30fps
5) encoding audio 'alsasrc' and video 'shmsrc'          ==> 20fps
6) encoding audio 'alsasrc buffer-time=1000000'
        and video 'shmsrc'                              ==> 6fps
7) encoding audio 'alsasrc'
        and video 'shmsrc ! videorate'                  ==> 30fps

in cases 5) and 6) cpu usage is less than 1-4) and 7).

To take my custom app out of the equation, I substituted it with gstreamer shmsink instead.
Result are very similiar.

Running tests on different computers actually yields different results
for 5) and 6).

All tests have been done running Fedora 15 with 2.6.40 (with current updates installed)
and gstreamer-0.10.34.

Here my gstreamer commandline I used for testing.

Producer:
gst-launch -v videotestsrc ! 'video/x-raw-yuv, width=1280, height=720, framerate=30/1,
format=(fourcc)I420' ! shmsink socket-path=/tmp/test shm-size=10000000 blocksize=40960
wait-for-connection=0

Consumer/encoder:
gst-launch -e shmsrc blocksize=40960 socket-path=/tmp/test is-live=1 do-timestamp=1 !
video/x-raw-yuv,framerate=30/1,width=1280,height=720 ! queue ! ffenc_h263p bitrate=2000000 name=venc 
alsasrc  ! audio/x-raw-int,rate=48000,channels=1 ! queue ! audioconvert ! lame name=aenc   qtmux
name=mux ! filesink location=test.mp4 aenc. ! mux. venc. ! mux.

Why does adding  'buffer-time=1000000' to alsasrc makes  video frame rate go down?
Why does replacing  'alsasrc' with 'audiotestsrc' makes  video frame rate speed up?

How could any change on the audio branch pipe affect the video encoding?

mattes










More information about the gstreamer-devel mailing list