commit 6c5d3efa5f3432cf42f4803d6927f404ac07cc48
parent 827f95986ee4cbe3b0efb938b77cf58e61b5fb1b
Author: Robin Bäckman <robinbackman@gmail.com>
Date: Tue, 25 Oct 2016 12:19:42 +0300
proto3
Diffstat:
8 files changed, 93 insertions(+), 54 deletions(-)
diff --git a/INSTALL b/INSTALL
@@ -20,27 +20,32 @@ enable camera, extend filesystem and reboot
2. sudo apt-get update
3. sudo apt-get upgrade
-4. sudo apt-get install git python-picamera python-imaging python-pexpect libav-tools gpac omxplayer sox cpufrequtils usbmount
+4. sudo apt-get install git python-picamera python-imaging python-pexpect libav-tools gpac omxplayer sox cpufrequtils usbmount python-dbus
-5. git clone https://rbckman@bitbucket.org/rbckman/tarina.git
+5. git clone https://github.com/willprice/python-omxplayer-wrapper.git
-6. put this line in the end of /etc/fstab
-tmpfs /mnt/tmp tmpfs defaults 0 0
+6. cd python-omxplayer-wrapper
-7. change cpu to performance. open /etc/default/cpufrequtils and paste in this:
+7. python setup.py
+
+8. git clone https://rbckman@bitbucket.org/rbckman/tarina.git
+
+9. cd tarina
+
+10. sudo python tarina.py
+
+11. change cpu to performance. open /etc/default/cpufrequtils and paste in this:
GOVERNOR="performance"
if USB soundcard
-1. place this in /etc/asound.conf
+add this to /etc/modprobe.d/alsa-base.conf
+
+#set index value
+options snd_usb_audio index=0
+options snd_bcm2835 index=1
-pcm.!default {
- type hw
- card 1
-}
+#reorder
+options snd slots=snd_usb_audio, snd_bcm2835
-ctl.!default {
- type hw
- card 1
-}
diff --git a/README.md b/README.md
@@ -1,13 +1,9 @@
-# Tarina #
+# Tarina PROTO 3#
### DIY filmmaking device for Raspberry pi ###
You film, Tarina puts the pieces together and, voilá!, you have a movie! Shoot your films as takes, shots and scenes, and see how they fit together on the go. If you're not happy, retake it. Once you get it there’s no need for editing later.
Tarina has been tested and is working with Raspberry pi 1, 2 and 3, Pi camera module 1.3 and v. 2.1 Sony IMX219 8-megapixel sensor, CS lenses or M12 lenses, USB via vt1620a Sound card, Electrec in-built front mic with preamp, 7700mAh li-ion Battery (6 hours filming), U-geek 3.5" screen (800x480 pixels), Adafruit 3.5" screen (480x 320 pixels), in-built speakers, Bluetooth keyboard, 3d printed body
-![20160811_011.jpg](https://bitbucket.org/repo/rBz7ep/images/1585674534-20160811_011.jpg)
-![20160811_004.jpg](https://bitbucket.org/repo/rBz7ep/images/3780887106-20160811_004.jpg)
-![20160811_014.jpg](https://bitbucket.org/repo/rBz7ep/images/2499796340-20160811_014.jpg)
-
more info at http://tarina.org
### 3d printable files ###
@@ -17,12 +13,16 @@ Blender file and printable stls in 3d folder
## Installing Tarina ##
Install dependencies
```
-sudo apt-get install git python-picamera python-imaging python-pexpect libav-tools gpac omxplayer sox cpufrequtils usbmount
-```
-git clone tarina
+sudo apt-get install git python-picamera python-imaging python-pexpect libav-tools gpac omxplayer sox cpufrequtils usbmount python-dbus
```
git clone https://rbckman@bitbucket.org/rbckman/tarina.git
```
+git clone https://github.com/willprice/python-omxplayer-wrapper.git
+```
+cd python-omxplayer-wrapper
+```
+python setup.py install
+```
put this line in the end of /etc/fstab
```
tmpfs /mnt/tmp tmpfs defaults 0 0
@@ -136,4 +136,4 @@ Texy
https://www.raspberrypi.org/forums/viewtopic.php?t=48967
The Dispmanx library
-https://github.com/raspberrypi/userland/tree/master/host_applications/linux/apps/hello_pi-
\ No newline at end of file
+https://github.com/raspberrypi/userland/tree/master/host_applications/linux/apps/hello_pi
diff --git a/delay0414m.wav b/delay0414m.wav
Binary files differ.
diff --git a/install.sh b/install.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+# My first script
+
+echo "Installing all dependencies..."
+sudo apt-get update
+sudo apt-get upgrade
+sudo apt-get install -y git python-picamera python-imaging python-pexpect libav-tools gpac omxplayer sox cpufrequtils usbmount python-dbus
+git clone https://github.com/willprice/python-omxplayer-wrapper.git
+echo "setting up python-omxplayer-wrapper..."
+cd python-omxplayer-wrapper
+python setup.py install
+cd ..
+echo "changing cpu governor to performance..."
+cat >> /etc/default/cpufrequtils << EOF
+GOVERNOR="performance"
+EOF
+echo "Installing rpi hd tft screen..."
+cp rpihdtft/dt-blob.bin /boot
+cat >> /boot/config.txt << EOF
+framebuffer_width=800
+framebuffer_height=480
+dtparam=spi=off
+dtparam=i2c_arm=off
+enable_dpi_lcd=1
+display_default_lcd=1
+dpi_output_format=0x6f015
+dpi_group=2
+dpi_mode=87
+hdmi_timings=480 0 16 16 24 800 0 4 2 2 0 0 0 60 0 32000000 6
+display_rotate=3
+EOF
+echo "Congratz everything done! run sudo tarina.py"
diff --git a/rpihdtft/dt-blob.bin b/rpihdtft/dt-blob.bin
Binary files differ.
diff --git a/tarina.py b/tarina.py
@@ -37,6 +37,7 @@ from PIL import Image
#GPIO.setup(13, GPIO.IN, pull_up_down=GPIO.PUD_UP)
#GPIO.setup(16, GPIO.IN, pull_up_down=GPIO.PUD_UP)
#GPIO.setup(26, GPIO.IN, pull_up_down=GPIO.PUD_UP)
+#GPIO.setup(22, GPIO.IN, pull_up_down=GPIO.PUD_UP)
os.system('clear')
@@ -518,7 +519,7 @@ def photobooth(beeps, camera, filmfolder, filmname, scene, shot, take, filename)
holdbutton = ''
seconds = 0.5
selected = 0
- header = 'Press enter to start!! :)'
+ header = 'Janica 30 kamera. Paina nappia!! :)'
menu = ''
while True:
settings = 'START'
@@ -551,7 +552,7 @@ def photobooth(beeps, camera, filmfolder, filmname, scene, shot, take, filename)
writemessage('Taking picture ' + str(p))
i = i + 0.1
time.sleep(0.1)
- middlebutton = GPIO.input(5)
+ middlebutton = GPIO.input(22)
if middlebutton == False or p > 9:
break
if middlebutton == False or p > 9:
@@ -748,7 +749,7 @@ def render(scene, shot, filmfolder, filmname, renderedshots, renderfullscene, fi
#if render > 2:
# audiomerge.append(filename + '.wav')
for f in filmfiles:
- audiomerge.append(tarinafolder + '/delay0138m.wav')
+ audiomerge.append(tarinafolder + '/delay0414m.wav')
audiomerge.append(f + '.wav')
audiomerge.append(filename + '.wav')
call(audiomerge, shell=False)
@@ -909,23 +910,25 @@ def empty(filename):
def getbutton(lastbutton, buttonpressed, buttontime, holdbutton):
event = screen.getch()
pressed = ''
- #middlebutton = GPIO.input(5)
+ #middlebutton = GPIO.input(22)
#upbutton = GPIO.input(12)
#downbutton = GPIO.input(13)
#leftbutton = GPIO.input(16)
#rightbutton = GPIO.input(26)
if event == 27:
pressed = 'quit'
- if event == curses.KEY_ENTER or event == 10 or event == 13:
+ elif event == curses.KEY_ENTER or event == 10 or event == 13:
pressed = 'middle'
- if event == ord('w') or event == curses.KEY_UP:
+ elif event == ord('w') or event == curses.KEY_UP:
pressed = 'up'
- if event == ord('s') or event == curses.KEY_DOWN:
+ elif event == ord('s') or event == curses.KEY_DOWN:
pressed = 'down'
- if event == ord('a') or event == curses.KEY_LEFT:
+ elif event == ord('a') or event == curses.KEY_LEFT:
pressed = 'left'
- if event == ord('d') or event == curses.KEY_RIGHT:
+ elif event == ord('d') or event == curses.KEY_RIGHT:
pressed = 'right'
+ #elif middlebutton == False:
+ # pressed = 'middle'
buttontime = time.time()
holdbutton = pressed
if float(time.time() - buttontime) > 1.0 and buttonpressed == True:
@@ -956,7 +959,7 @@ def main():
with picamera.PiCamera() as camera:
#START PREVIEW
- camera.resolution = (1920, 816) #tested modes 1920x816, 1296x552
+ camera.resolution = (1640, 698) #tested modes 1920x816, 1296x552, v2 1640x698
camera.crop = (0, 0, 1.0, 1.0)
camera.led = False
time.sleep(1)
@@ -964,12 +967,12 @@ def main():
camera.start_preview()
#START fbcp AND dispmax hello interface hack
- call ([tarinafolder + '/fbcp &'], shell = True)
+ #call ([tarinafolder + '/fbcp &'], shell = True)
call (['./startinterface.sh &'], shell = True)
#MENUS
menu = 'MIDDLEBUTTON: ','SHUTTER:', 'ISO:', 'RED:', 'BLUE:', 'BRIGHT:', 'CONT:', 'SAT:', 'FLIP:', 'BEEP:', 'LENGTH:', 'MIC:', 'PHONES:', 'DSK:', '', 'SCENE:', 'SHOT:', 'TAKE', '', ''
- actionmenu = 'Record', 'Play', 'Copy to USB', 'Upload', 'Update', 'New Film', 'Load Film', 'Remove'
+ actionmenu = 'Record', 'Play', 'Copy to USB', 'Upload', 'Update', 'New Film', 'Load Film', 'Remove', 'Photobooth'
#STANDARD VALUES
selectedaction = 0
@@ -1032,7 +1035,6 @@ def main():
foldername = filmfolder + filmname + '/' + 'scene' + str(scene).zfill(3) + '/shot' + str(shot).zfill(3) + '/'
filename = 'scene' + str(scene).zfill(3) + '_shot' + str(shot).zfill(3) + '_take' + str(take).zfill(3)
- filmname='spede'
#NEW FILM (IF NOTHING TO LOAD)
if filmname == '':
filmname = nameyourfilm()
@@ -1094,8 +1096,9 @@ def main():
time.sleep(0.1)
recording = True
camera.led = True
- os.system(tarinafolder + '/alsa-utils-1.0.25/aplay/arecord -f S16_LE -c1 -r44100 -vv /mnt/tmp/' + filename + '.wav &')
- camera.start_recording('/mnt/tmp/' + filename + '.h264', format='h264', quality=21)
+ #os.system(tarinafolder + '/alsa-utils-1.0.25/aplay/arecord -f S16_LE -c1 -r44100 -vv /mnt/tmp/' + filename + '.wav &')
+ os.system('arecord -f S16_LE -c 1 -r 44100 -vv' + foldername + filename + '.wav &')
+ camera.start_recording(foldername + filename + '.h264', format='h264', quality=10)
starttime = time.time()
#camera.wait_recording(10)
elif recording == True:
@@ -1103,22 +1106,22 @@ def main():
diskleft = str(disk.f_bavail * disk.f_frsize / 1024 / 1024 / 1024) + 'Gb'
recording = False
camera.led = False
- os.system('pkill -9 arecord')
+ os.system('pkill arecord')
camera.stop_recording()
t = 0
rectime = ''
showrec = ''
vumetermessage('Tarina ' + tarinaversion[:-1] + ' ' + tarinavername[:-1])
thefile = foldername + filename
- writemessage('Copying video file...')
- os.system('mv /mnt/tmp/' + filename + '.h264 ' + foldername)
- try:
- writemessage('Copying audio file...')
- os.system('mv /mnt/tmp/' + filename + '.wav ' + foldername + ' &')
- except:
- writemessage('no audio file')
- time.sleep(0.5)
- os.system('cp err.log lasterr.log')
+ #writemessage('Copying video file...')
+ #os.system('mv /mnt/tmp/' + filename + '.h264 ' + foldername)
+ #try:
+ # writemessage('Copying audio file...')
+ # os.system('mv /mnt/tmp/' + filename + '.wav ' + foldername + ' &')
+ #except:
+ # writemessage('no audio file')
+ # time.sleep(0.5)
+ #os.system('cp err.log lasterr.log')
#render thumbnail
os.system('avconv -i ' + foldername + filename + '.h264 -frames 1 -vf scale=800:340 ' + filmfolder + filmname + '/.thumbnails/' + filename + '.png &')
savesetting(camera.brightness, camera.contrast, camera.saturation, camera.shutter_speed, camera.iso, camera.awb_mode, camera.awb_gains, awb_lock, miclevel, headphoneslevel, filmfolder, filmname, scene, shot, take, thefile, beeps, flip, renderedshots)
@@ -1135,7 +1138,7 @@ def main():
savesetting(camera.brightness, camera.contrast, camera.saturation, camera.shutter_speed, camera.iso, camera.awb_mode, camera.awb_gains, awb_lock, miclevel, headphoneslevel, filmfolder, filmname, scene, shot, take, thefile, beeps, flip, renderedshots)
#PHOTOBOOTH
- elif pressed == 'middle' and selectedaction == 81:
+ elif pressed == 'middle' and selectedaction == 8:
thefile = filmfolder + filmname + '/' + 'scene' + str(scene).zfill(3) + '/' + filename
timelapsefolder = filmfolder + filmname + '/' + 'scene' + str(scene).zfill(3) + '/' + 'timelapse' + str(shot).zfill(2) + str(take).zfill(2)
thefile = photobooth(beeps, camera, filmfolder, filmname, scene, shot, take, filename)
diff --git a/vc/src/hello_pi/hello_interface/camerainterface.bin b/vc/src/hello_pi/hello_interface/camerainterface.bin
Binary files differ.
diff --git a/vc/src/hello_pi/hello_interface/main.c b/vc/src/hello_pi/hello_interface/main.c
@@ -138,10 +138,10 @@ int main(void)
//const char *text = "Never give up on your dreams";
uint32_t y_offset = 460;
uint32_t y_offset2 = 0;
- uint32_t y_offset3 = 25;
- uint32_t y_offset4 = 50;
- uint32_t y_offset5 = 410;
- uint32_t y_offset6 = 435;
+ uint32_t y_offset3 = 20;
+ uint32_t y_offset4 = 40;
+ uint32_t y_offset5 = 420;
+ uint32_t y_offset6 = 440;
// graphics_resource_fill(img, 0, 0, width, height, GRAPHICS_RGBA32(0,0,0,0x00));
// blue, at the top (y=40)