Advertisement
rajhlinux

Untitled

Aug 8th, 2022 (edited)
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. FFmpeg Script File:
  2.  
  3. #!/bin/sh
  4.  
  5. ffmpeg \
  6. -init_hw_device vaapi=decdev:/dev/intel_gpu \
  7. -init_hw_device vaapi=encdev:/dev/dri/renderD129 \
  8. -hwaccel vaapi \
  9. -hwaccel_device decdev \
  10. -hwaccel_output_format vaapi \
  11. -f v4l2 -input_format mjpeg -framerate 30 -video_size 1920x1080 \
  12. -i /dev/video0 \
  13. -filter_hw_device encdev \
  14. -filter_complex \
  15. "[0:v]hwdownload, settb=AVTB, setpts='trunc(PTS/1K)*1K+st(1,trunc(RTCTIME/1K))-1K*trunc(ld(1)/1K)',
  16. drawtext=fontfile=/usr/share/fonts/TTF/Verdana.TTF:text='(%{localtime\:%A, %B-%-d-%Y}\) \ \
  17. [%{localtime\:%-I}\:%{localtime\:%M}\:%{localtime\:%S}\:%{eif\:1M*t-1K*trunc(t*1K)\:d} \ %{localtime\:%p}\]':x=0:y=0:borderw=3:bordercolor=#000000:fontsize=50:fontcolor=orange:box=1:boxcolor=black@0.3, split=2[v_1][v_2];\
  18. [v_1]format=nv12, hwupload[out_1];\
  19. [v_2]select='gt(scene,0.04)'[out_2]" \
  20. -map '[out_1]' -c:v hevc_vaapi -b:v 2M -rc_mode 2 -level 4.1 -f segment -segment_time 600 -reset_timestamps 1 -strftime 1 /home/user/Living_Room/"(%b-%-d-%Y-%a)_%-I::%M::%S::%p.mp4" \
  21. -map '[out_2]' -f image2 -r 1/6 -strftime 1 /home/user/Living_Room_Snap/"(%b-%-d-%Y-%a)_%-I::%M::%S::%p.jpg"
  22.  
  23.  
  24.  
  25. ------------------
  26.  
  27. Service File located at: /etc/systemd/system/shell_script_dvr.service
  28.  
  29. [Unit]
  30. Description=DVR FFMPEG COMMANDs
  31.  
  32. [Service]
  33. ExecStart=/home/user/shell_script_dvr.sh
  34.  
  35. [Install]
  36. WantedBy=multi-user.target
  37.  
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement