tarina

git clone https://git.tarina.org/tarina
Log | Files | Refs | README | LICENSE

commit 4e60715b24981359ce76c367483c19c15f3bc83c
parent 020dab5be80fc97f800391ee23890daf9a6e6b80
Author: rbckman <rob@tarina.org>
Date:   Thu, 18 Apr 2019 14:15:58 +0100

small fixes

Diffstat:
MREADME.md | 9++++++++-
Minstall.sh | 8++++----
Mtarina.py | 21+++++++++++----------
3 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/README.md b/README.md @@ -54,7 +54,14 @@ python tarina.py Why --- -Make your own tools to really get down to the nitty-gritty of your craft. +There are several reasons why, will write a longer story why but heres some fundamentals that has kept me going. + +- be able to repair if something breaks +- be able to expand / build on it / make modifications +- be able to connect to it / program it to do things +- do a film on the fly without the need of a another computer +- be able to watch your film directly on a screen ones you've filmed it +- learn about programming and your own crafts to really get down to the nitty-gritty. Connect ------- diff --git a/install.sh b/install.sh @@ -42,13 +42,13 @@ apt-get update apt-get upgrade -y apt-get -y install git python3-pip libav-tools mediainfo gpac omxplayer sox cpufrequtils usbmount apache2 libapache2-mod-wsgi libdbus-glib-1-dev dbus libdbus-1-dev echo "Getting the latest firmware for rpi..." -rpi-update +SKIP_WARNING=1 rpi-update echo "installing python-omxplayer-wrapper..." -pip3 install omxplayer-wrapper +sudo pip3 install omxplayer-wrapper echo "installing rwb27s openflexure microscope fork of picamera with lens shading correction..." -pip3 --no-cache-dir install https://github.com/rwb27/picamera/archive/lens-shading.zip --upgrade +sudo pip3 --no-cache-dir install https://github.com/rwb27/picamera/archive/lens-shading.zip --upgrade echo "installing web.py for the tarina webserver..." -pip3 install web.py==0.40-dev1 +sudo pip3 install web.py==0.40-dev1 if grep -q -F '#tarina-rpi-configuration-1.0' /boot/config.txt then diff --git a/tarina.py b/tarina.py @@ -471,7 +471,7 @@ def timelapse(beeps,camera,foldername,filename,tarinafolder): header = 'Adjust how many seconds between and filming' menu = 'BETWEEN:', 'DURATION:', 'START', 'BACK' while True: - settings = str(between), str(duration), '', '' + settings = str(round(between,2)), str(round(duration,2)), '', '' writemenu(menu,settings,selected,header) seconds = (3600 / between) * duration vumetermessage('1 h timelapse filming equals ' + str(int(seconds)) + ' second clip ') @@ -733,7 +733,7 @@ def render(filmfiles, filename): rendersize = countsize(filename + '.mp4') except: continue - writemessage('video rendering ' + str(rendersize) + ' of ' + str(videosize) + ' kb done') + writemessage('video rendering ' + str(int(rendersize)) + ' of ' + str(int(videosize)) + ' kb done') ##PASTE AUDIO TOGETHER writemessage('Hold on, rendering audio...') audiomerge = ['sox'] @@ -756,7 +756,7 @@ def render(filmfiles, filename): rendersize = countsize(filename + '.mp3') except: continue - writemessage('audio rendering ' + str(rendersize) + ' of ' + str(int(audiosize)) + ' kb done') + writemessage('audio rendering ' + str(int(rendersize)) + ' of ' + str(int(audiosize)) + ' kb done') ##MERGE AUDIO & VIDEO writemessage('Merging audio & video') call(['MP4Box', '-add', filename + '_tmp.mp4', '-add', filename + '.mp3', '-new', filename + '.mp4'], shell=False) @@ -781,13 +781,13 @@ def playthis(filename, camera): holdbutton = '' camera.stop_preview() writemessage('Starting omxplayer') - player = OMXPlayer(filename + '.mp4', args=['--fps', '25', '--layer', '3', '--win', '0,70,800,410', '--no-osd', '--no-keys', '-o', 'alsa:hw:0,0']) + player = OMXPlayer(filename + '.mp4', args=['--fps', '25', '--layer', '3', '--win', '0,70,800,410', '--no-osd', '--no-keys']) time.sleep(1) try: player.pause() player.set_position(0) player.play() - #os.system('aplay -D plughw:0 ' + filename + '.wav &') + os.system('aplay -D plughw:0 ' + filename + '.wav &') except: print('something wrong with omxplayer') return @@ -812,21 +812,22 @@ def playthis(filename, camera): try: player.stop() player.quit() + os.system('pkill aplay') except: - pass - #os.system('pkill aplay') - #os.system('pkill dbus-daemon') - #os.system('pkill omxplayer') + #kill it if it dont stop + os.system('pkill dbus-daemon') + os.system('pkill omxplayer') return elif selected == 1: try: + os.system('pkill aplay') player.pause() player.set_position(0) time.sleep(1) player.play() + os.system('aplay -D plughw:0 ' + filename + '.wav &') except: pass - #os.system('aplay -D plughw:0 ' + filename + '.wav &') starttime = time.time() time.sleep(0.02) t = time.time() - starttime