Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions fauxstream
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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"\
"
Expand All @@ -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]\
"

Expand All @@ -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\""
Expand Down