simultaneous streaming and storing
This commit is contained in:
@@ -27,6 +27,7 @@ VIDEO_FRAMERATE="10"
|
||||
VIDEO_FILE="camera_$(date +%Y-%m-%d_%H-%M-%S).mp4"
|
||||
VIDEO_DURATION="1000000000"
|
||||
SOUND_SOURCE="none"
|
||||
PEERTUBE_LIVE="rtmp://peertube.virtonline.eu:1935/live/LIVE-STREAM-KEY"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
@@ -77,12 +78,12 @@ if [ "${SOUND_SOURCE}" = "none" ]; then
|
||||
# ffmpeg params without audio
|
||||
ffmpeg -hide_banner \
|
||||
-thread_queue_size 1024 \
|
||||
-use_wallclock_as_timestamps 1 \
|
||||
-t ${VIDEO_DURATION} \
|
||||
-i pipe:0 \
|
||||
-c:v copy \
|
||||
-f mp4 \
|
||||
-t ${VIDEO_DURATION} \
|
||||
${VIDEO_FILE} &
|
||||
-f tee -map 0:0 -flags +global_header -flvflags no_duration_filesize \
|
||||
"[f=mp4:movflags=+faststart:onfail=ignore]${VIDEO_FILE}|[f=fifo:fifo_format=flv:drop_pkts_on_overflow=1:attempt_recovery=1:recovery_wait_time=1:use_wallclock_as_timestamps=1]${PEERTUBE_LIVE}" \
|
||||
&
|
||||
elif [ "${SOUND_SOURCE}" = "anullsrc" ]; then
|
||||
# ffmpeg params with silent audio
|
||||
ffmpeg -hide_banner \
|
||||
|
||||
Reference in New Issue
Block a user