#!/bin/bash inres="1366x768" fps="25" bitrate="3000k" read -p 'type in filename >' filename if [ -z "$filename" ]; then filename="test" fi ffmpeg -threads:0 3 -threads:1 1 \ -f x11grab -probesize 42M -video_size $inres -framerate $fps -thread_queue_size 1024 -i :0.0 \ -f alsa -probesize 10M -channels 2 -sample_rate 48000 -thread_queue_size 1024 -i default \ -c:v libopenh264 -allow_skip_frames true -b:v $bitrate \ -c:a aac -af asetpts=N/SR/TB /tmp/$filename.mp4