Well that depends on your Operating System,
i for myself use Linux, and to record Openxcom, i use ffmpeg and the following script (for the bash):
#!/bin/bash
filename=$1
ffmpeg -f alsa -ac 2 -i hw:0 -f x11grab -r 24 -s 1280x720 -i :0.0 -acodec libmp3lame -vcodec mpeg4 -aspect 16:9 -q:a 1 -q:v 1 $filename.avi & pid1=$!
opencxom
kill $pid1
exit
Creates me an *avi Container file with encoded video and audio, i then use Avidemux to cut it like i want and convert into a *.mp4 with h264 encoding, with the following script:
#!/bin/bash
find . -name "*.avi" | while read filename;
do
new_filename=$(echo "$filename" | sed "s/^\(.*\)avi$/\1mp4/g");
if [ ! -f "$new_filename" ]
then
ffmpeg -i "$filename" -vcodec libx264 -preset slow -crf 22 -acodec libmp3lame "$new_filename" &
wait $!;
fi
done
Hope someone may find this helpfull.