BASH   18

start ffmpeg sh

Guest on 25th August 2022 04:37:49 AM

  1. #!/bin/bash
  2.  
  3. SERVICE="ffmpeg"
  4. RTSP_URL="rtsp://192.168.0.119:554/video.pro1"
  5. YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"
  6. YOUTUBE_KEY="dn7v-5g6p-1d3w-c3da"
  7.  
  8. COMMAND="sudo ffmpeg -f lavfi -i anullsrc -rtsp_transport tcp -i ${RTSP_URL} -tune zerolatency -vcodec libx264 -t 12:00:00 -pix_fmt + -c:v copy -c:a aac -strict experimental -f flv ${YOUTUBE_URL}/${YOUTUBE_KEY}"
  9.  
  10. if sudo /usr/bin/pgrep $SERVICE > /dev/null
  11. then
  12.         echo "${SERVICE} is already running."
  13. else
  14.         echo "${SERVICE} is NOT running! Starting now..."
  15.         $COMMAND
  16. fi

Raw Paste


Login or Register to edit or fork this paste. It's free.