how to make full use of dual core CPU for camera recording?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

how to make full use of dual core CPU for camera recording?

Zhao, Halley

Hi Experts:

 

On a dual core platform, my gst command line only use half CPU. How could I improve recording performance by using more CPU?

Here is my command line:

gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=640,height=480,framerate=15/1 !ffmpegcolorspace ! tee name=t t. ! queue ! oggmux name=mux ! queue ! filesink location=test.ogv alsasrc device=“hw:0” ! queue ! audiorate ! audio/x-raw-int,rate=44100 ! audioconvert ! flacenc ! queue ! mux.

 

While latest cheese(use camerabin) can utilize more CPU to achieve better performance? What’s the difference?

Thanks.

 


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to make full use of dual core CPU for camera recording?

Stefan Sauer
On 12/14/2011 10:29 AM, Zhao, Halley wrote:

Hi Experts:

 

On a dual core platform, my gst command line only use half CPU. How could I improve recording performance by using more CPU?

Here is my command line:

gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=640,height=480,framerate=15/1 !ffmpegcolorspace ! tee name=t t. ! queue ! oggmux name=mux ! queue ! filesink location=test.ogv alsasrc device=“hw:0” ! queue ! audiorate ! audio/x-raw-int,rate=44100 ! audioconvert ! flacenc ! queue ! mux.


This already uses several threads to encode audio and video and write the muxed stream. Imho the "tee name=t t. ! queue" in front of oggmux is unused. Also I don't see any video encoder in your pipeline. Using a multithreaded encoder coudl help to better utilize the available copu cores (especially if the encoder is heavy).

Stefan

 

While latest cheese(use camerabin) can utilize more CPU to achieve better performance? What’s the difference?

Thanks.

 

_______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

RE: how to make full use of dual core CPU for camera recording?

Zhao, Halley

Thanks Stefan.

I made mistake to past the command line, here is the one I use.

gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=640,height=480,framerate=15/1 ! tee name=t ! ffmpegcolorspace ! queue ! ximagesink t. ! ffmpegcolorspace ! queue ! theoraenc ! oggmux name=mux ! filesink location=test.ogg alsasrc device="hw:0" ! queue ! audiorate ! audio/x-raw-int,rate=44100 ! audioconvert ! flacenc ! queue ! mux.

 

 

‘top’ shows one CPU is pretty busy in majority time (up to 97%); in the rest time, 2 CPU usage is balanced. (since my platform is 2 core 4 thread, I’m not sure the load is balanced on 2 core or 1core/2threads).

Maybe it is caused by theoraenc is not multi-threaded, I’ll dig more.

 

 

 

From: gstreamer-devel-bounces+halley.zhao=[hidden email] [mailto:gstreamer-devel-bounces+halley.zhao=[hidden email]] On Behalf Of Stefan Sauer
Sent: Wednesday, December 14, 2011 7:00 PM
To: [hidden email]
Subject: Re: how to make full use of dual core CPU for camera recording?

 

On 12/14/2011 10:29 AM, Zhao, Halley wrote:

Hi Experts:

 

On a dual core platform, my gst command line only use half CPU. How could I improve recording performance by using more CPU?

Here is my command line:

gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=640,height=480,framerate=15/1 !ffmpegcolorspace ! tee name=t t. ! queue ! oggmux name=mux ! queue ! filesink location=test.ogv alsasrc device=“hw:0” ! queue ! audiorate ! audio/x-raw-int,rate=44100 ! audioconvert ! flacenc ! queue ! mux.


This already uses several threads to encode audio and video and write the muxed stream. Imho the "tee name=t t. ! queue" in front of oggmux is unused. Also I don't see any video encoder in your pipeline. Using a multithreaded encoder coudl help to better utilize the available copu cores (especially if the encoder is heavy).

Stefan


 

While latest cheese(use camerabin) can utilize more CPU to achieve better performance? What’s the difference?

Thanks.

 

 
 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

 


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to make full use of dual core CPU for camera recording?

Florent THIERY-2

Maybe it is caused by theoraenc is not multi-threaded, I’ll dig more.


Exactly, you should either use a low complexity codec such as mjpeg or a multithreaded codec, like x264enc...

Florent

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel