Skip to content

Commit

Permalink
CPU/resources usage statistics for ffmpeg with options we used before,
Browse files Browse the repository at this point in the history
  • Loading branch information
vmdocua committed Sep 17, 2024
1 parent 3deba7f commit 44589ca
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
12 changes: 8 additions & 4 deletions Capture/research/ffmpeg_enc/ffmpeg_enc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@
#/usr/bin/time -v ffmpeg -f alsa -t 600 -ac 2 -thread_queue_size 4096 -i hw:1,1 -f v4l2 -t 600 -framerate 60 -video_size 1920x1080 -i /dev/video0 -c:v libx264 -flush_packets 1 -preset ultrafast -crf 18 -r 60 -tune zerolatency -b:v 2M -maxrate 2M -bufsize 4M -acodec aac -vf setpts=PTS-STARTPTS -af asetpts=PTS-STARTPTS output007.mp4

# video capture with x264 optimizations: ultrafast, crf=18 zerolatency
echo "Test 008"
rm output008.mp4
/usr/bin/time -v ffmpeg -f alsa -t 15 -ac 2 -thread_queue_size 4096 -i hw:1,1 -f v4l2 -t 15 -framerate 60 -video_size 1920x1080 -i /dev/video0 -c:v libx264 -flush_packets 1 -preset ultrafast -crf 18 -r 60 -tune zerolatency -b:v 2M -maxrate 2M -bufsize 4M -acodec aac -vf setpts=PTS-STARTPTS -af asetpts=PTS-STARTPTS output008.mp4

#echo "Test 008"
#rm output008.mp4
#/usr/bin/time -v ffmpeg -f alsa -t 15 -ac 2 -thread_queue_size 4096 -i hw:1,1 -f v4l2 -t 15 -framerate 60 -video_size 1920x1080 -i /dev/video0 -c:v libx264 -flush_packets 1 -preset ultrafast -crf 18 -r 60 -tune zerolatency -b:v 2M -maxrate 2M -bufsize 4M -acodec aac -vf setpts=PTS-STARTPTS -af asetpts=PTS-STARTPTS output008.mp4

# video capture similar to initial one we have before changes
echo "Test 009"
rm output009.mp4
/usr/bin/time -v ffmpeg -f alsa -t 15 -ac 2 -thread_queue_size 4096 -i hw:1,1 -f v4l2 -t 15 -input_format yuyv422 -framerate 60 -video_size 1920x1080 -thread_queue_size 4096 -i /dev/video0 -c:v libx264 -flush_packets 1 output009.mkv
27 changes: 26 additions & 1 deletion Capture/research/ffmpeg_enc/results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,29 @@ Command being timed: "ffmpeg -f alsa -t 15 -ac 2 -thread_queue_size 4096 -i hw:1
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
Exit status: 0

#009
Command being timed: "ffmpeg -f alsa -t 15 -ac 2 -thread_queue_size 4096 -i hw:1,1 -f v4l2 -t 15 -input_format yuyv422 -framerate 60 -video_size 1920x1080 -thread_queue_size 4096 -i /dev/video0 -c:v libx264 -flush_packets 1 output009.mkv"
User time (seconds): 49.37
System time (seconds): 6.06
Percent of CPU this job got: 252%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:21.99
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 4146316
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 58
Minor (reclaiming a frame) page faults: 1174653
Voluntary context switches: 32669
Involuntary context switches: 88676
Swaps: 0
File system inputs: 15048
File system outputs: 960
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

0 comments on commit 44589ca

Please sign in to comment.