This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Adaptive Motion-activated Light | |
description: Yet Another Motion Automation | |
domain: automation | |
source_url: https://gist.github.com/cylonbrain/3299596e288d215ea4a65606f6029b97 | |
input: | |
motion_entity: | |
name: Motion Sensor | |
selector: | |
entity: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/bash | |
for i in *.MP4; do | |
frame_rate=25 | |
#$(ffprobe -i -show_streams 2>&1|grep fps|sed "s/.*, \([0-9]*\) fps,.*/\1/") | |
#clipname=${(basename "$i")/\.*/} | |
#ffmpeg -i "$i" "${i/.MP4/_tc.mov}" | |
timecode="${i:7:2}\\:${i:10:2}\\:00\\:00" | |
echo $timecode | |
ffmpeg -i "${i}" -copyts -vcodec libx264 -b:v 20000k -an -vf drawtext="fontfile=/usr/local/share/munin/DejaVuSansMono.ttf:rate=${frame_rate}:timecode=\\'${timecode}\\':textfile=textfile:fontsize=18:fontcolor=\\'white\\':boxcolor=0x000000AA:x=w-(tw+10):y=h-(th+10)" "${i/.MP4/_tc.mp4}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Compat linux | |
kldload linux | |
pkg install linux_base-f10 | |
echo linux_enable=\"YES\" >> /etc/rc.conf | |
#Base | |
pkg install bash curl wget git netatalk3 avahi | |
#linproc to fstab | |
echo "linproc /compat/linux/proc linprocfs rw 0 0" >> /etc/fstab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Timecode burn with ffmpeg | |
# ffmpeg must be configured with --enable-libfreetype | |
# box=1 - tells ffmpeg to draw a box around the text | |
# boxcolor - format is 0xRRGGBB[AA] | |
ffmpeg -i video.mov -vcodec libx264 -cmp 22 -vf "drawtext=fontfile=DroidSansMono.ttf: timecode='09\:57\:00\:00': r=23.976: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000099" -y output.mov |