[FFmpeg-user] How to properly test FFmpeg CPU usage.
Wodzu
brucedickinson at wp.pl
Wed Mar 13 13:14:33 EET 2024
Hi, I would like to test FFmpeg CPU usage in the following conditions: 1. FFmpeg grabs RTSP stream (h264) 2.Decodes each frame and converts it to BGR24. I am interested only in these two points, I don't want to output anything. Am I doing it correctly? $ ffmpeg -i 'rtsp://xavier:8554/1600x1200_15_CU001' -vf format=bgr24 -f null - ffmpeg version n6.0.1-5-g511b844423 Copyright (c) 2000-2023 the FFmpeg developers built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04) configuration: --pkg-config-flags=--static --enable-gpl --enable-libx264 --enable-libx265 --enable-pic --enable-nonfree libavutil 58. 2.100 / 58. 2.100 libavcodec 60. 3.100 / 60. 3.100 libavformat 60. 3.100 / 60. 3.100 libavdevice 60. 1.100 / 60. 1.100 libavfilter 9. 3.100 / 9. 3.100 libswscale 7. 1.100 / 7. 1.100 libswresample 4. 10.100 / 4. 10.100 libpostproc 57. 1.100 / 57. 1.100 [h264 @ 0x5556464bdd40] co located POCs unavailable Input #0, rtsp, from 'rtsp://xavier:8554/1600x1200_15_CU001': Metadata: title : No Name Duration: N/A, start: 0.235533, bitrate: N/A Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1600x1200, 15 fps, 15 tbr, 90k tbn Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native)) Press [q] to stop, [?] for help [h264 @ 0x555646572500] co located POCs unavailable [swscaler @ 0x555646d29f00] [swscaler @ 0x555646d36ea0] No accelerated colorspace conversion found from yuv420p to bgr24. [swscaler @ 0x555646d29f00] [swscaler @ 0x555646d43e40] No accelerated colorspace conversion found from yuv420p to bgr24. [swscaler @ 0x555646d29f00] [swscaler @ 0x555646d52790] No accelerated colorspace conversion found from yuv420p to bgr24. [swscaler @ 0x555646d29f00] [swscaler @ 0x555646d618f0] No accelerated colorspace conversion found from yuv420p to bgr24. [swscaler @ 0x555646d29f00] [swscaler @ 0x555646d70a50] No accelerated colorspace conversion found from yuv420p to bgr24. Output #0, null, to 'pipe:': Metadata: title : No Name encoder : Lavf60.3.100 Stream #0:0: Video: wrapped_avframe, bgr24(pc, gbr/unknown/unknown, progressive), 1600x1200, q=2-31, 200 kb/s, 15 fps, 15 tbn Metadata: encoder : Lavc60.3.100 wrapped_avframe frame= 7635 fps= 15 q=-0.0 Lsize=N/A time=00:08:28.93 bitrate=N/A speed= 1x x video:3579kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Exiting normally, received signal 2. The thing is that when I am using libav in my C++ application, the exact task is taking around 4% CPU and ffmpeg application takes 7%. The results are consistent, there are no fluctuations here. Average: UID PID %usr %system %guest %wait %CPU CPU Command Average: 1002 1938685 26.10 1.00 0.00 1.00 6.82 - ffmpeg Average: UID PID minflt/s majflt/s VSZ RSS %MEM Command Average: 1002 1938685 0.20 0.00 654528 69056 0.84 ffmpeg Average: UID PID %usr %system %guest %wait %CPU CPU Command Average: 0 1938996 15.70 0.10 0.00 0.00 3.95 - my_app Average: UID PID minflt/s majflt/s VSZ RSS %MEM Command Average: 0 1938996 8.50 0.00 234880 44470 0.54 my_app Thanks for any ideas.
More information about the ffmpeg-user
mailing list