diff --git a/fauxstream b/fauxstream old mode 100755 new mode 100644 index e4fad15..9966f72 --- a/fauxstream +++ b/fauxstream @@ -213,12 +213,11 @@ echo "): ${resolution}${offset}\n" GLOBAL="\ -hide_banner \ -loglevel error \ --thread_queue_size 512 \ -threads $threads\ " VIDEO_IN="\ --thread_queue_size 512 \ +-thread_queue_size 64 \ -show_region 1 \ ${video_device} \ -f x11grab \ @@ -244,13 +243,11 @@ ${video_format} \ " MON_IN="\ --thread_queue_size 512 \ -f sndio \ -i snd/mon\ " MIC_IN="\ --thread_queue_size 512 \ -f sndio \ -i "$mic_device"\ " @@ -262,8 +259,8 @@ AUDIO_CONV="\ " AUDIOMERGE="\ -[0]volume=$volume_mic,aformat=channel_layouts=stereo$hilopass[l];\ -[1]volume=$volume_mon,aformat=channel_layouts=stereo[m];\ +[0]aresample=async=1,volume=$volume_mic,aformat=channel_layouts=stereo$hilopass[l];\ +[1]aresample=async=1,volume=$volume_mon,aformat=channel_layouts=stereo[m];\ [l][m]amix=inputs=2[a]\ " @@ -272,15 +269,17 @@ AUDIOMERGE="\ if [ $noaudio -lt 1 -a $mic -lt 1 ]; then #only monitoring stream - RUN="ffmpeg $GLOBAL $MON_IN $AUDIO_CONV -f nut pipe:1 | \ - ffmpeg $GLOBAL -thread_queue_size 512 -f nut -itsoffset $audiooffset -i pipe:0 \ - $VIDEO_IN $VIDEO_CONV -c:a copy -f "${container}" \"$filename\"" + RUN="ffmpeg $GLOBAL $MON_IN -f nut pipe:1 | \ + ffmpeg $GLOBAL -thread_queue_size 64 -f nut -itsoffset $audiooffset -i pipe:0 \ + -filter_complex aresample=async=1 $VIDEO_IN $VIDEO_CONV $AUDIO_CONV \ + -f "${container}" \"$filename\"" elif [ $noaudio -lt 1 ]; then #mon + mic stream - RUN="ffmpeg $GLOBAL $MIC_IN $MON_IN -filter_complex \"${AUDIOMERGE}\" \ - -map '[a]' $AUDIO_CONV -f nut pipe:1 | \ - ffmpeg $GLOBAL -thread_queue_size 512 -f nut -itsoffset $audiooffset -i pipe:0 \ - $VIDEO_IN $VIDEO_CONV -c:a copy -f "${container}" \"$filename\"" + RUN="ffmpeg $GLOBAL $MIC_IN $MON_IN -filter_complex \"${AUDIOMERGE}\" -map '[a]' \ + -f nut pipe:1 | \ + ffmpeg $GLOBAL -thread_queue_size 64 -f nut -itsoffset $audiooffset -i pipe:0 \ + -filter_complex aresample=async=1 $VIDEO_IN $VIDEO_CONV $AUDIO_CONV \ + -f "${container}" \"$filename\"" else #no audio RUN="ffmpeg $GLOBAL $VIDEO_IN $VIDEO_CONV -f "${container}" \"$filename\""