Then make a script file which uses piping of ossrecord output. For twitch livestreaming I am using this script:
Code: Select all
ossrecord -s48000 -b16 -c2 -d/dev/oss/oss_cmi878x0/loop0 - | ffmpeg -loglevel error -f s16le -ac 2 -i pipe: -s 1920x1080 -r 25 -f x11grab -draw_mouse 0 -i :0.0 -c:v libx264 -b:v 16000k -minrate 8000k -maxrate 16000k -bufsize 16000k -preset ultrafast -pix_fmt yuv420p -s 1280x720 -strict -2 -c:a aac -b:a 192k -threads 0 -f flv "rtmp://xxxxxxxx.twitch.tv/app/live_xxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Info about ffmpeg arguments can be found here:
ffmpeg -h
man ffmpeg
https://trac.ffmpeg.org/wiki/StreamingGuide
https://trac.ffmpeg.org/wiki/Encode/H.264
Known problem:
Loop device working nice just once after OSS started. So if you stopped your recording, then you should "soundoff && soundon" to make loop device working again.