vlc CPU usage?

About encoding, codec settings, muxers and filter usage
xezoyu
Blank Cone
Blank Cone
Posts: 10
Joined: 22 Nov 2010 17:11

vlc CPU usage?

Postby xezoyu » 06 Jan 2011 14:02

Hello everybody,
I have a question about cpu usage. Namely, when I transcode stream from tv card using h264(x264) encoding cpu is almost all the time on 100% usage. Machine is DualCore on 3GHz with 2GB memory, OS is winXP. I tried to change "threads" parameter but it doesn't change anything.
One of transcode attempts is like this: "venc=x264{keyint=128,idrint=2,cabac=0,bframes=0},vcodec=h264,vb=1000,fps=30,width=640,height=480,threads=2,acodec=mp4a,ab=32,channels= 1,samplerate=44100}"

Is there a way to reduce that cpu usage?
What level of cpu usage is "normal" for h264 encoding using vlc?
Is there a difference using vlc and h264 encoding on windows vs. linux?

Thanks in advance.

Rémi Denis-Courmont
Developer
Developer
Posts: 15212
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: vlc CPU usage?

Postby Rémi Denis-Courmont » 06 Jan 2011 14:07

Transcoding should always take 100% CPU since VLC tries to convert as fast as possible.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

xezoyu
Blank Cone
Blank Cone
Posts: 10
Joined: 22 Nov 2010 17:11

Re: vlc CPU usage?

Postby xezoyu » 06 Jan 2011 14:22

Is there any parameter which can define encoding performance? Something like 'convert slow/medium/fast'?
I mean, it's not possible to have machine running 24x7 with 100% cpu usage ...

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: vlc CPU usage?

Postby Sébastien Escudier » 06 Jan 2011 14:43

when transoding from a file, it should be 100% of CPU
But when transcoding from your tv card, you can reduce your cpu usage by reducing the fps.

xezoyu
Blank Cone
Blank Cone
Posts: 10
Joined: 22 Nov 2010 17:11

Re: vlc CPU usage?

Postby xezoyu » 06 Jan 2011 16:37

As I said, I'm transcoding from tv card and I tried with some standard fps values(30, 25, 24) but cpu usage is always 100%. Right now, I tried with fps=15 but still cpu is lock on 100%.

Is there anything else I can try?

ammoun
New Cone
New Cone
Posts: 8
Joined: 24 Mar 2008 00:58

Re: vlc CPU usage?

Postby ammoun » 06 Jan 2011 16:52

Could you plz report CPU usage with MP4 codec?

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: vlc CPU usage?

Postby Sébastien Escudier » 07 Jan 2011 08:16

ammoun, you meant MPEG4 I think...

ammoun
New Cone
New Cone
Posts: 8
Joined: 24 Mar 2008 00:58

Re: vlc CPU usage?

Postby ammoun » 08 Jan 2011 00:22

ammoun, you meant MPEG4 I think...
Right! Thanks Sébastien Escudier.

xezoyu
Blank Cone
Blank Cone
Posts: 10
Joined: 22 Nov 2010 17:11

Re: vlc CPU usage?

Postby xezoyu » 10 Jan 2011 12:47

With these transcode settings "transcode{vcodec=mpeg4,vb=800,scale=1,acodec=mp4a,ab=128,channels=2,samplerate=44100}" CPU usage is between 75% and 95%. Rarely it goes below 75%, also rarely it goes up(above 95%).

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: vlc CPU usage?

Postby Sébastien Escudier » 10 Jan 2011 14:14

That's very high...
Maybe your input access reads frame from the tv card too fast, and don't limit the fps ?

xezoyu
Blank Cone
Blank Cone
Posts: 10
Joined: 22 Nov 2010 17:11

Re: vlc CPU usage?

Postby xezoyu » 10 Jan 2011 14:46


Sébastien Escudier said:
Maybe your input access reads frame from the tv card too fast
I'm not sure what that means and how I can check or change that?
Also, I tried to define fps using values 24, 25, 30 but that doesn't change anything.

Do you have any idea?

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: vlc CPU usage?

Postby Sébastien Escudier » 10 Jan 2011 15:00

I just tested on linux and it takes 65% of my 2.4Ghz CPU, with mpeg4
But I don't know how the capture of the tv card works on windows...

xezoyu
Blank Cone
Blank Cone
Posts: 10
Joined: 22 Nov 2010 17:11

Re: vlc CPU usage?

Postby xezoyu » 10 Jan 2011 15:21

Thanks, these days I'll try on linux and see if there is any difference.

viulian
New Cone
New Cone
Posts: 7
Joined: 30 Jan 2010 18:45

Re: vlc CPU usage?

Postby viulian » 22 Jan 2011 01:24

I am streaming from a TV Card on Ubuntu 10.04 running on Intel Core 2 Duo E8500 3.16Ghz / 6Mb L2 Cache / 2Gb of RAM.
My CPU usage was 165% on average (and load at 2.00). It was so strange, that I had to look up online why the CPU would ever be shown more than 100% load. Seems standard on Linux, if you have more than one CPU or more cores.

I was transcoding with:

Code: Select all

setup vlc42 output #transcode{venc=x264,vcodec=h264,vb=512,scale=1,fps=25,threads=2,acodec=mpga,ab=96,channels=1,samplerate=22050}:std{access=http,mux=ts,dst=0.0.0.0:1234}
It seems that switching from threads=2 to threads=1 lowered the CPU usage in half to ~80%. It still encodes properly and I have no loss of quality.


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 2 guests