David 10 lat temu
rodzic
commit
d66cc2da63
4 zmienionych plików z 15 dodań i 7 usunięć
  1. 5 1
      completo-2cam.ini
  2. 7 3
      stream.sh
  3. 2 2
      working-udp-audio.sh
  4. 1 1
      working-udp-video.sh

+ 5 - 1
completo-2cam.ini

@@ -63,7 +63,7 @@ audio feed rate 1 48000
 audio feed format 1 16 signed
 audio feed mute off 1
 #audio feed volume 1 1
-audio feed delay 1 150
+#audio feed delay 1 150
 
 audio feed add 2 Audio feed #2
 audio feed channels 2 2
@@ -85,6 +85,10 @@ audio mixer source feed 1 2
 audio mixer source mute off 1 1
 audio mixer source mute off 1 2
 
+
+audio mixer source mindelay 1 1 170
+audio mixer source maxdelay 1 1 250
+
 # Dummy sink
 audio sink add 0 Dummy Audio
 audio sink channels 0 2

+ 7 - 3
stream.sh

@@ -33,15 +33,15 @@ h264_bframes=0
 keyint=$(echo "2 * $framerate" |bc)
 
 
-VIDEOCONVERT=videoconvert
-VIDEO='video/x-raw, format=(string)BGRA, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive'
-AUDIO=audio/x-raw
+VIDEOCONVERT="videoconvert"
+#VIDEOCONVERT="video/x-raw, width=800, height=600 ! videoconvert"
 # VIDEO=video/x-raw-yuv
 afid="format=(string)S16LE, "
 
 ENCAUDIOFORMAT='aacparse ! audio/mpeg,mpegversion=4,stream-format=raw'
 videoencoder="x264enc bitrate=$vbitrate key-int-max=$keyint bframes=$h264_bframes byte-stream=false aud=true" #speed-preset=1"
 videoencoder="x264enc bitrate=$vbitrate key-int-max=$keyint bframes=$h264_bframes byte-stream=false aud=true speed-preset=4"
+videoencoder="x264enc bitrate=$vbitrate key-int-max=$keyint bframes=$h264_bframes byte-stream=false aud=true speed-preset=4"
 #default=6=medium, 5=fast, 4=faster...0=none
 
 audioencoder="faac bitrate=$abitrate"
@@ -57,7 +57,11 @@ framerate="$framerate/1" #Fraction
 ENCVIDEOFORMAT='h264parse ! video/x-h264,level=(string)'$h264_level',profile='$h264_profile
 ENCVIDEOFORMAT="h264parse ! video/x-h264,level=(string)$h264_level,profile=$h264_profile"
 
+
+VIDEO='video/x-raw, format=(string)BGRA, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive'
 VIDEOFORMAT=$VIDEO', framerate='$framerate', width='$width', height='$height
+
+AUDIO=audio/x-raw
 AUDIOFORMAT=$AUDIO', '$afid' endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)'$audiorate', channels=(int)'$channels
 
 # ctrsocket must match system socket in running Snowmix

+ 2 - 2
working-udp-audio.sh

@@ -1,8 +1,8 @@
 #!/bin/bash
 
 SOURCE="audiotestsrc is-live=true"
-SOURCE='udpsrc port=5001 caps="application/x-rtp" ! queue ! rtppcmadepay ! alawdec'
-SOURCE='udpsrc port=5001 caps="application/x-rtp" ! queue ! rtppcmudepay ! mulawdec'
+SOURCE='udpsrc port=5001 do-timestamp=true caps="application/x-rtp" ! queue ! rtppcmadepay ! alawdec'
+SOURCE='udpsrc port=5001 do-timestamp=true caps="application/x-rtp" ! queue ! rtppcmudepay ! mulawdec'
 
 BANDPASS="audiochebband mode=band-pass lower-frequency=50 upper-frequency=4000"
 

+ 1 - 1
working-udp-video.sh

@@ -59,7 +59,7 @@ SHMOPTION="wait-for-connection=1 sync=true"
 SHMSINK1="shmsink socket-path=$feed_control_pipe $SHMSIZE $SHMOPTION"
 #AUDIOFORMAT="$AUDIOS16LE"', rate='$feed_rate', channels='$feed_channels
 VIDEOFORMAT=$VIDEOBGRA', width='$feed_width', height='$feed_height', framerate=24/1'
-SRC="udpsrc port=5000 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 "
+SRC="udpsrc port=5000 do-timestamp=true ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 "
 while true ; do
     # Remove the named pipe if it exist
     rm -f $feed_control_pipe