From 48fab00d25a43e1f9c2235e6be03c27ba256bace Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 12 Aug 2021 12:17:40 +0200 Subject: [PATCH] 25 frames / second --- zen/stream/process-stream.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/zen/stream/process-stream.sh b/zen/stream/process-stream.sh index b208d5b..ab0687e 100755 --- a/zen/stream/process-stream.sh +++ b/zen/stream/process-stream.sh @@ -4,6 +4,8 @@ HLS_TIME=40 M3U8_SIZE=3 IPFS_GATEWAY="http://127.0.0.1:8181" +echo "Astroport stream is playing on star_1 : https://tube.copylaradio.com/ipns/$(ipfs key list -l | grep star_1 | cut -d ' ' -f 1)" + # Load settings # Prepare Pi Camera @@ -14,18 +16,18 @@ function startFFmpeg() { while true; do mv /tmp/ffmpeg.log /tmp/ffmpeg.1 echo 1 > /tmp/stream-reset - - # Stream WebCamera - ffmpeg -f pulse -i 1 -f video4linux2 -video_size 1280x720 -framerate 30 -i /dev/video0 -hls_time "${HLS_TIME}" "${what}.m3u8" > /tmp/ffmpeg.log 2>&1 - ## MORE SOURCES - # http://4youngpadawans.com/stream-camera-video-and-audio-with-ffmpeg/ - ## STILL BAD :: ffmpeg -f v4l2 -i /dev/video0 -f alsa -i hw:0 -profile:v high -pix_fmt yuvj420p -level:v 4.1 -preset ultrafast -tune zerolatency -vcodec libx264 -r 10 -b:v 512k -s 640x360 -acodec aac -strict -2 -ac 2 -ab 32k -ar 44100 -f mpegts -flush_packets 0 -hls_time "${HLS_TIME}" "${what}.m3u8" > /tmp/ffmpeg.log 2>&1 - ################ GOOD ? + # Stream WebCamera + ffmpeg -f pulse -i 1 -f video4linux2 -video_size 1280x720 -framerate 25 -i /dev/video0 -hls_time "${HLS_TIME}" "${what}.m3u8" > /tmp/ffmpeg.log 2>&1 + + ## MORE SOURCES + # http://4youngpadawans.com/stream-camera-video-and-audio-with-ffmpeg/ + ## STILL BAD :: ffmpeg -f v4l2 -i /dev/video0 -f alsa -i hw:0 -profile:v high -pix_fmt yuvj420p -level:v 4.1 -preset ultrafast -tune zerolatency -vcodec libx264 -r 10 -b:v 512k -s 640x360 -acodec aac -strict -2 -ac 2 -ab 32k -ar 44100 -f mpegts -flush_packets 0 -hls_time "${HLS_TIME}" "${what}.m3u8" > /tmp/ffmpeg.log 2>&1 + ################ GOOD ? # Stream FM Station from a SDR module (see contrib/pi-stream to install drivers) # Frequency ends in M IE 99.9M # rtl_fm -f 99.9M -M fm -s 170k -A std -l0 -E deemp -r 44.1k | ffmpeg -r 15 -loop 1 -i ../audio.jpg -f s16le -ac 1 -i pipe:0 -c:v libx264 -tune stillimage -preset ultrafast -hls_time "${HLS_TIME}" "${what}.m3u8" > /tmp/ffmpeg 2>&1 - + sleep 0.5 done }