Skip to content
Merged
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
33 changes: 22 additions & 11 deletions fauxstream
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,14 @@ GLOBAL="\
VIDEO_IN="\
-thread_queue_size 512 \
-show_region 1 \
${video_device} \
-f x11grab \
-video_size $resolution \
-framerate $framerate \
-i $DISPLAY$offset\
"

VIDEO_CONV="\
${video_device} \
${video_output_fps} \
-c:v $videocodec \
-profile:v high \
Expand All @@ -244,11 +244,13 @@ ${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 @@ -270,20 +272,29 @@ AUDIOMERGE="\

if [ $noaudio -lt 1 -a $mic -lt 1 ]; then
#only monitoring stream
RUN="ffmpeg $GLOBAL $MON_IN $VIDEO_IN $AUDIO_CONV -c:v copy -f nut pipe:1 | \
ffmpeg $GLOBAL -f nut -itsoffset $audiooffset -i pipe:0 \
$VIDEO_CONV -c:a copy -f "${container}" \"$filename\""
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\""
elif [ $noaudio -lt 1 ]; then
#mon + mic stream
RUN="ffmpeg $GLOBAL -thread_queue_size 512 $MIC_IN \
-thread_queue_size 512 $MON_IN $VIDEO_IN\
-filter_complex \"${AUDIOMERGE}\" -map '[a]' $AUDIO_CONV \
-map 2 -c:v copy -f nut pipe:1 | \
ffmpeg $GLOBAL -thread_queue_size 512 -f nut -itsoffset $audiooffset -i pipe:0 \
$VIDEO_CONV -c:a copy -f "${container}" \"$filename\""
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\""
else
#no audio
RUN="ffmpeg $GLOBAL $VIDEO_IN $VIDEO_CONV -f "${container}" \"$filename\""
RUN="ffmpeg $GLOBAL \
$VIDEO_IN $VIDEO_CONV \
-f "${container}" \"$filename\""
fi

echo "$RUN\n"
Expand Down