Skip to content

Instantly share code, notes, and snippets.

@kefir-
kefir- / capture.sh
Created February 26, 2019 22:47
Screen capture with webcam overlay using ffmpeg
ffmpeg -f x11grab -thread_queue_size 64 -video_size 1920x1080 -framerate 30 -i :1 \
-f v4l2 -thread_queue_size 64 -video_size 320x180 -framerate 30 -i /dev/video0 \
-filter_complex 'overlay=main_w-overlay_w:main_h-overlay_h:format=yuv444' \
-vcodec libx264 -preset ultrafast -qp 0 -pix_fmt yuv444p \
video.mkv
@kefir-
kefir- / cv2showimage.py
Last active July 26, 2023 05:00
Python cv2 show image in window with correct size
#!/usr/bin/env python
import cv2
c = cv2.imread('ketil.jpg')
height, width = c.shape[:2]
cv2.namedWindow('jpg', cv2.WINDOW_NORMAL)
cv2.resizeWindow('jpg', width, height)
cv2.imshow('jpg', c)
r = cv2.waitKey(0)
print "DEBUG: waitKey returned:", chr(r)
cv2.destroyAllWindows()
@kefir-
kefir- / perimeter layer heights
Created July 10, 2013 20:32
Various layer heights, extrusion width varies with layer height, but "perimeters extrusion width" is always the same as my nozzle diameter, 0.35mm.
; generated by Slic3r 0.9.11-dev on 2013-07-10 at 20:50:53
; layer_height = 0.35
; perimeters = 2
; top_solid_layers = 2
; bottom_solid_layers = 2
; fill_density = 0.3
; perimeter_speed = 80
; infill_speed = 100
; travel_speed = 300