Guest User

Untitled

a guest
Oct 6th, 2022
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.49 KB | None | 0 0
  1. #!/bin/bash
  2. LOG_FILE=/home/hass/.homeassistant/scripts/espcam_video.log
  3. exec 1>>${LOG_FILE} 2>>${LOG_FILE}
  4.  
  5. date
  6.  
  7. folder=/home/hass/.homeassistant/media/cam-vid
  8. id=$(date +"%Y-%m-%d_%H:%M:%S")_vid
  9. http_url=https://192.168.1.110:8123/api/camera_proxy_stream/camera.espcam_door_camera?token=$1
  10.  
  11. echo "Save to: $folder/$id"
  12. echo "Video URL: $http_url"
  13.  
  14. ffmpeg -r 5 -i $http_url -t 4 -c:v libx264 -profile:v main -vf format=yuv420p -preset slow -movflags +faststart -c:a copy $folder/$id.mp4
  15.  
Add Comment
Please, Sign In to add comment