0

Question : Why I am getting ~7 FPS even I have specified 30 ?

I am using raspberry pi 3 and compiled latest soruce code from the GIT and still getting low fps(~7) while using below ffmpeg command using x11grab.

ffmpeg -f lavfi -i anullsrc -f x11grab -r 30 -s 1280,720 -i :0.0+0,0 -c:v libx264 -pix_fmt yuv420p -preset ultrafast -g 30 -b:v 2000k -c:a aac -ar 44100 -threads 0 -bufsize 5048k -f flv file.flv

I have tried working with -threads , -bufsize , replaced -r 30 with -framerate option still no luck and my CPU usage is ~40%

below is my output :

  ffmpeg version N-92829-g1a6cca1989 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
  configuration: --enable-libx264 --enable-gpl --enable-nonfree --enable-libxcb
  libavutil      56. 25.100 / 56. 25.100
  libavcodec     58. 42.104 / 58. 42.104
  libavformat    58. 25.100 / 58. 25.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 46.101 /  7. 46.101
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, lavfi, from 'anullsrc':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s
[x11grab @ 0x1ffe270] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #1, x11grab, from ':0.0+0,0':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1280x720, 30 fps, 1000k tbr, 1000k tbn, 1000k tbc
Stream mapping:
  Stream #1:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (pcm_u8 (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x20076d0] VBV maxrate unspecified, assuming CBR
[libx264 @ 0x20076d0] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x20076d0] profile Constrained Baseline, level 3.1, 4:2:0, 8-bit
[libx264 @ 0x20076d0] 264 - core 157 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=30 keyint_min=3 scenecut=0 intra_refresh=0 rc_lookahead=0 rc=cbr mbtree=0 bitrate=2000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=2000 vbv_bufsize=5048 nal_hrd=none filler=0 ip_ratio=1.40 aq=0
Output #0, flv, to 'a.flv':
  Metadata:
    encoder         : Lavf58.25.100
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p(progressive), 1280x720, q=-1--1, 2000 kb/s, 30 fps, 1k tbn, 30 tbc
    Metadata:
      encoder         : Lavc58.42.104 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 5048000 vbv_delay: -1
    Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.42.104 aac
[x11grab @ 0x1ffe270] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
frame=    5 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
frame=    8 fps=7.2 q=19.0 size=       0kB time=00:00:00.00 bitrate=3520.0kbits/s speed=0.000899x    
frame=   12 fps=7.4 q=27.0 size=      92kB time=00:00:00.16 bitrate=4647.7kbits/s speed=0.0993x    
frame=   16 fps=7.4 q=22.0 size=     122kB time=00:00:00.30 bitrate=3318.1kbits/s speed=0.14x    
frame=   20 fps=7.5 q=20.0 size=     130kB time=00:00:00.41 bitrate=2556.7kbits/s speed=0.156x    
frame=   24 fps=7.5 q=20.0 size=     164kB time=00:00:00.55 bitrate=2419.0kbits/s speed=0.175x    
frame=   28 fps=7.5 q=19.0 size=     181kB time=00:00:00.69 bitrate=2132.1kbits/s speed=0.188x    
frame=   32 fps=7.6 q=18.0 size=     184kB time=00:00:00.83 bitrate=1800.3kbits/s speed=0.198x    
frame=   36 fps=7.5 q=-1.0 Lsize=     351kB time=00:00:01.16 bitrate=2464.6kbits/s speed=0.244x    

UPDATE: Today I have tried latest code and compiled it but still no luck

  • And what's the question? – Ingo Dec 29 '18 at 11:21
  • Why I am getting ~7 FPS even I have specified 30 ? even I have compiled latest source code from the repository. – SagarVirpara Dec 29 '18 at 11:29

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.