You are not logged in.

#1 2013-03-23 11:29:01

Vatri91
Member
Registered: 2011-11-04
Posts: 15

ffmpeg - low fps when i record my desktop;

Hello. When i am running ffmpeg on 1280x768 resolution, program record with ~100fps, When i change resolution to my native(1366x768), program record with ~29 fps and system running slow.

Record with 1280x768

frame=   66 fps=0.0 q=17.0 size=     417kB time=00:00:00.30 bitrate=11374.4kbitsframe=  132 fps=131 q=17.0 size=     449kB time=00:00:00.63 bitrate=5832.5kbits/frame=  199 fps=132 q=17.0 size=     449kB time=00:00:00.96 bitrate=3807.7kbits/frame=  256 fps=127 q=24.0 size=     481kB time=00:00:01.25 bitrate=3149.3kbits/frame=  321 fps=128 q=17.0 size=     769kB time=00:00:01.57 bitrate=4000.0kbits/

Record with 1366x768

frame=   18 fps=0.0 q=18.0 size=     390kB time=00:00:00.06 bitrate=53303.6kbitsframe=   33 fps= 32 q=17.0 size=     443kB time=00:00:00.13 bitrate=26879.3kbitsframe=   48 fps= 31 q=17.0 size=     465kB time=00:00:00.21 bitrate=18156.8kbitsframe=   63 fps= 31 q=17.0 size=     482kB time=00:00:00.28 bitrate=13841.4kbitsframe=   78 fps= 30 q=18.0 size=     502kB time=00:00:00.36 bitrate=11420.9kbitsframe=   93 fps= 30 q=18.0 size=     516kB time=00:00:00.43 bitrate=9708.7kbits/

ffmpeg commend
ffmpeg -f x11grab -r 100 -s 1366x768 -i :0.0 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -threads 5 arch.mkv

sysinfo
Linux adrian 3.8.3-2-ARCH #1 SMP PREEMPT Sun Mar 17 13:04:22 CET 2013 x86_64 GNU/Linux
hardware info:
i5 8gb ram 630m

Do u know how to get better fps on my native resolution?

THX

Dziękuje i Pozdrawiam:}

Last edited by Vatri91 (2013-03-23 11:30:29)

Offline

#2 2013-03-24 19:05:20

DrZaius
Member
Registered: 2008-01-02
Posts: 193

Re: ffmpeg - low fps when i record my desktop;

Do u know how to get better fps on my native resolution?

Remove "-threads 5": the appropriate number of threads are automatically calculated by default. Add "-qp 0" to record a lossless output. It should record faster, but it results in a huge output. You can then re-encode this lossless intermediate file to something more manageable:

ffmpeg -i arch.mkv -c:v libx264 -crf 23 -preset medium -c:v libmp3lame -q:a 2 output.mkv

See the FFmpeg and x264 Encoding Guide for more info and examples.

Offline

#3 2013-03-24 20:17:14

teckk
Member
Registered: 2013-02-21
Posts: 518

Re: ffmpeg - low fps when i record my desktop;

Couple of thoughts.

30 fps is DVD quality. I would drop (-r 100) to (-r 24) I don't know what you are gaining capturing at 100fps.

You can also dump to raw video then encode the file later.

You can lower the video bitrate that you encode to (c:v libx264 -b:v 500k). Depends on how active your screen is. If you are just doing a tutorial of something then you may be able to drop down to (300k). Anything under (1000k) will be noticeable if you have a lot of movement on the screen.

This example gives a smooth full screen capture (without sound) (On an AMDx2)

ffmpeg -f x11grab -r 24 -s 1920x1080 -i :0.0 -an -c:v libx264 -b:v 500k output.mpg

This is easier on the CPU

ffmpeg -f x11grab -r 24 -s 1920x1080 -i :0.0 -an -c:v libx264 -crf 0 -preset ultrafast output.mpg

Another example using -qscale

ffmpeg -f x11grab -r 24 -s 1920x1080 -i :0.0 -an -c:v libx264 -qscale 10 output.mpg

For a raw video

ffmpeg -f x11grab -r 24 -s 1920x1080 -i :0.0 -an -f rawvideo output.raw

You have a raw video now so to play it, or take it and encode it.

mplayer -demuxer rawvideo -rawvideo w=1920:h=1080:y8 output.mpg

If framerate is dropping below specified while capturing with ffmpeg then, you'll have to lower the bitrate that you are encoding at, dump the stream as a raw video then encode it later, capture a smaller area of screen, or I hear that recordmydesktop does well.

EDIT: reason for edit, syntax correction.

Last edited by teckk (2013-03-27 14:57:33)

Offline

#4 2013-03-27 02:36:20

Vatri91
Member
Registered: 2011-11-04
Posts: 15

Re: ffmpeg - low fps when i record my desktop;

DrZaius still i got 25-30 fps;/

teck
[x11grab @ 0x21bc940] Could not open X display.
0:0: Input/output error

Offline

#5 2013-03-27 14:58:52

teckk
Member
Registered: 2013-02-21
Posts: 518

Re: ffmpeg - low fps when i record my desktop;

Yes my syntax was wrong

ffmpeg -i :0.0

not

ffmpeg -i 0:0

I've corrected it.

Offline

#6 2013-03-28 13:51:23

Vatri91
Member
Registered: 2011-11-04
Posts: 15

Re: ffmpeg - low fps when i record my desktop;

Try all comend, but no effect. If i record in 1280x768 everything is ok. My resolution is 1366x768. If i use resolution set on 1281x768, system lagging and video work 2x faster, than normal wideo.

Offline

Board footer

Powered by FluxBB