If you're working with the rpi3's gpio, the pigpio
library can be very handy.
sudo apt-get update
sudo apt-get install pigpio
If you also want to access pigpio from python, install:
sudo apt-get install python-pigpio python3-pigpio
sudo vi /etc/hosts
# replace raspberrypi with your desired hostname, and save
sudo vi /etc/hostname
# replace raspberrypi with your desired hostname, and save
# you will get a warning about "sudo: unable to resolve host raspberrypi" after save
sudo reboot
# wmctrl one-liners | |
# DISPLAY is needed if you're running from eg an ssh shell | |
# list all windows | |
DISPLAY=:0 wmctrl -lG | |
# Resize the "active" window | |
# dimensions are: X,Y,width,height | |
DISPLAY=:0 wmctrl -r :ACTIVE: -e 0,40,40,1000,500 |
markdown
renders markdown as html, and the lynx
browser) using homebrew:brew install markdown lynx
markdown
and pipe the output to lynx
:markdown README.md | lynx -stdin
Setup your Raspberry Pi 0 w to develop with the Rust language.
If you're working with the rpi0's GPIO, the pigpio
library can be very handy.
# x11grab from the default device at offset x=70, y=65 | |
ffmpeg -video_size 1280x720 -framerate 30 -f x11grab -i :0.0+70,65 -c:v libx264rgb -crf 0 -preset ultrafast -color_range 2 out6.mkv | |
# use x265 output encoding instead | |
ffmpeg -video_size 1280x720 -framerate 30 -f x11grab -i :0.0+70,65 -c:v libx265 out7.mp4 |
# first, install imagemagick, eg on debian: | |
# sudo apt install libpng-dev libjpeg-dev libtiff-dev imagemagick | |
convert input_image.png -depth 1 gray:output.raw |
# Input a video ID (this is used to build an input filename) and frame to dump | |
video_id=$1 | |
guess_frame=$2 | |
# modern video formats prefer timestamps over framerates, so YMMV | |
frame=$(( ${guess_frame} )) | |
printf "video_id: %s frame: %d \r\n" ${video_id} ${frame} | |
# this is a heuristic guess as to how frequently (every 250 frames) we see a keyframe | |
keyframe=$(( ${frame} / 250 )) |