# -rw-r--r-- 1.1 KiB View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env sh
#requires v4l-utils imagemagick ffmpeg sxiv                                         
#2020 slvr and amom based on work from                                                  
#https://git.sr.ht/~martijnbraam/python-pinecamera     

# create a launcher somewhere like
# /usr/share/applications/camera.desktop 
# to access from a GUI

cd ~                                                                                                            
media-ctl -d /dev/media1 --set-v4l2 '"ov5640 3-004c":0[fmt:UYVY8_2X8/1920x1080@1/20]'                        
v4l2-ctl --device /dev/video1 --set-fmt-video="width=1920,height=1080,pixelformat=UYVY" ;                    
ffplay -f v4l2 -framerate 20 -video_size 1920x1080 -i /dev/video1 -exitonmousedown -vf "transpose=1" -x 640 -y 360 ;
newfilename=IMG_$(date +%Y%m%d_%H%M%S).jpg ;                                                             
ffmpeg -f v4l2 -framerate 20 -video_size 1920x1080 -ss 00:00:00.5 -i /dev/video1 -frames:v 1 -vf "transpose=1" $newfilename ;
sxiv $newfilename &                                                 
rm -rf /tmp/frame.raw ;