This repository has been archived on 2020-06-28. You can view files and clone it, but cannot push or open issues or pull requests.
systemd-client/user/ffsnap.service

11 lines
538 B
SYSTEMD

[Unit]
Description=Keep recording segments to /tmp and encode them on ffmpeg kill like shadowplay
Requires=xorg@0.service
[Service]
ExecStart=/bin/ffmpeg -loglevel error -video_size 1920x1080 -framerate 30 -f x11grab -i :0 -c:v libx264rgb -crf 0 -preset ultrafast -movflags +faststart -tune zerolatency -f segment -segment_time 6 -segment_wrap 5 -segment_list /tmp/list.m3u8 -segment_list_size 5 "/tmp/seg%%d.ts"
ExecStopPost=/bin/ffmpeg -loglevel error -y -i /tmp/list.m3u8 -c:v copy /tmp/snap.mp4
Restart=always
RestartSec=1
Type=exec