commit 680893f1f79881666387ffeb7a515f6357378255
parent ee88a5ef32ac63f8118249d80f9df387c01c44dc
Author: rbckman <rob@tarina.org>
Date: Fri, 21 Jul 2023 07:30:54 +0100
splitter port 2 network stream
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tarina.py b/tarina.py
@@ -3390,17 +3390,17 @@ def startstream(camera, stream, plughw, channels):
#stream_cmd = 'ffmpeg -f h264 -r 25 -i - -itsoffset 5.5 -fflags nobuffer -f alsa -ac '+str(channels)+' -i hw:'+str(plughw)+' -ar 44100 -vcodec copy -acodec libmp3lame -b:a 128k -ar 44100 -map 0:0 -map 1:0 -strict experimental -f flv ' + youtube + key[0]
#
#stream_cmd = 'ffmpeg -f h264 -r 25 -i - -itsoffset 5.5 -fflags nobuffer -f alsa -ac '+str(channels)+' -i hw:'+str(plughw)+' -ar 44100 -vcodec copy -acodec libmp3lame -b:a 128k -ar 44100 -map 0:0 -map 1:0 -strict experimental -f mpegts tcp://0.0.0.0:3333\?listen'
- stream_cmd = 'ffmpeg -f h264 -r 25 -i - -itsoffset 5.5 -fflags nobuffer -f alsa -ac '+str(channels)+' -i hw:'+str(plughw)+' -ar '+soundrate+' -acodec mp2 -b:a 128k -ar '+soundrate+' -vcodec copy -map 0:0 -map 1:0 -g 0 -f mpegts udp://192.168.0.100:5000'
+ stream_cmd = 'ffmpeg -f h264 -r 25 -i - -itsoffset 5.5 -fflags nobuffer -f alsa -ac '+str(channels)+' -i hw:'+str(plughw)+' -ar '+soundrate+' -acodec mp2 -b:a 128k -ar '+soundrate+' -vcodec copy -map 0:0 -map 1:0 -g 0 -f mpegts udp://10.42.0.169:5000'
try:
stream = subprocess.Popen(stream_cmd, shell=True, stdin=subprocess.PIPE)
- camera.start_recording(stream.stdin, format='h264', bitrate = 2000000)
+ camera.start_recording(stream.stdin, splitter_port=2, format='h264', bitrate = 55555)
except:
stream = ''
#now = time.strftime("%Y-%m-%d-%H:%M:%S")
return stream
def stopstream(camera, stream):
- camera.stop_recording()
+ camera.stop_recording(splitter_port=2)
os.system('pkill -9 ffmpeg')
print("Camera safely shut down")
print("Good bye")