-
Notifications
You must be signed in to change notification settings - Fork 0
/
capture
executable file
·35 lines (26 loc) · 1.09 KB
/
capture
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# This captures video from some capture device and writes it to ~30 second parts
for ((;;)); do
# TODO: change directory to machine specific
DIR=/home/stream/capture/cap_gen1_$(date +%Y%m%d_%H%M)/
mkdir -p $DIR
cd $DIR
# Unisheen UC3200HS - USB HDMI/SDI capture device
# ffmpeg -copyts -f alsa -i hw:3 -ts abs -f v4l2 -video_size 1920x1080 -i /dev/video2 -c:v copy -c:a copy -f nut -
# NDI Receive
# ffmpeg -y -f libndi_newtek -i "$1" -pix_fmt rgb0 -force_key_frames 'expr:gte(t,n_forced*30)' ...
# Blackmagic PCIe capture cards
/home/stream/capture/bmdcapture -C 0 -m 7 -A 2 -V 4 -F nut \
-o strict=experimental:syncpoints=none -f pipe:1 | \
ffmpeg -vsync passthrough -y -probesize 200M -i - -force_key_frames 'expr:gte(t,n_forced*30)' \
-vcodec hevc_nvenc -preset medium \
-profile:v main -level 4.1 -rc vbr -b:v 10M -rc-lookahead 60 \
-acodec aac \
-f segment -segment_time 30 -segment_list cap.ffcat \
cap%04d.nut
# (re)stream to NDI
# -f libndi_newtek -y stream
# for h264 add -pix_fmt yuv420p
echo "Restarting in 5"
sleep 5
done