tarina

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

commit c03a85289fe6dd20e4d7331d208c1e3799f7e32d
parent e37e992091b3c74597034e99ec6da126c6eb3c28
Author: rob <rob@tarina.org>
Date:   Fri, 19 Apr 2019 02:02:10 +0100

bug fix when removing a take, should now work. show films in order last modified on browser. basic implementation of dubbing feature

Diffstat:
MREADME.md | 4++++
Minstall.sh | 2+-
Msrv/tarinaserver.py | 16++++++----------
Mtarina.py | 15++++++++++++++-
4 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md @@ -34,6 +34,10 @@ The interface focuses on presenting the essentials for film making in one menu t - need a fast sd card although you can turn down the quality on h264 with low speed cards - the h264 needs to be converted to a mp4 container for viewing, right now I'm doing this right after filming a clip, however there will possible be a feature to film directly to mp4 in future releases of picamera +### Features / ideas / to do +- dubbing feature (basic concept alpha stage) +- trimming takes + Installing ---------- Download latest [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) and follow [install instructions](https://www.raspberrypi.org/documentation/installation/installing-images/README.md). diff --git a/install.sh b/install.sh @@ -40,7 +40,7 @@ sleep 3 echo "Installing all dependencies..." 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 +apt-get -y install git python3-pip libav-tools mediainfo gpac omxplayer sox cpufrequtils usbmount apache2 libapache2-mod-wsgi-py3 libdbus-glib-1-dev dbus libdbus-1-dev echo "Getting the latest firmware for rpi..." SKIP_WARNING=1 rpi-update echo "installing python-omxplayer-wrapper..." diff --git a/srv/tarinaserver.py b/srv/tarinaserver.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import web import os @@ -21,6 +21,7 @@ urls = ( '/f/(.*)', 'films' ) +app = web.application(urls, globals()) render = web.template.render('templates/', base="base") def getfilms(filmfolder): @@ -28,7 +29,7 @@ def getfilms(filmfolder): films_sorted = [] films = next(os.walk(filmfolder))[1] for i in films: - if os.path.isfile(filmfolder + i + '/' + 'settings.p') == True: + if os.path.isfile(filmfolder + i + '/settings.p') == True: lastupdate = os.path.getmtime(filmfolder + i + '/' + 'settings.p') films_sorted.append((i,lastupdate)) else: @@ -43,20 +44,15 @@ class index: renderedfilms = [] unrenderedfilms = [] for i in films: - if os.path.isfile('static/Videos/' + i + '/' + i + '.mp4') == True: - renderedfilms.append(i) + if os.path.isfile('static/Videos/' + i[0] + '/' + i[0] + '.mp4') == True: + renderedfilms.append(i[0]) else: - unrenderedfilms.append(i) + unrenderedfilms.append(i[0]) return render.index(renderedfilms, unrenderedfilms) class films: def GET(self, film): return render.filmpage(film) -app = web.application(urls, globals(), autoreload=False) application = app.wsgifunc() -#if __name__== "__main__": - #app = web.application(urls, globals()) - #app.run() - diff --git a/tarina.py b/tarina.py @@ -611,6 +611,7 @@ def remove(filmfolder, filmname, scene, shot, take, sceneshotortake): if sceneshotortake == 'take': #os.system('rm ' + foldername + filename + '.h264') os.system('rm ' + foldername + filename + '.mp4') + os.system('rm ' + foldername + filename + '.wav') os.system('rm ' + foldername + filename + '.png') take = take - 1 if take == 0: @@ -657,7 +658,10 @@ def organize(filmfolder, filmname): print('correct') if organized_nr != unorganized_nr: print('false, correcting from ' + str(unorganized_nr) + ' to ' + str(organized_nr)) - os.system('mv ' + filmfolder + filmname + '/' + i + '/' + p + '/take' + str(unorganized_nr).zfill(3) + '.mp4 ' + filmfolder + filmname + '/' + i + '/' + p + '/take' + str(organized_nr).zfill(3) + '.mp4') + mv = 'mv ' + filmfolder + filmname + '/' + i + '/' + p + '/take' + str(unorganized_nr).zfill(3) + os.system(mv + '.mp4 ' + filmfolder + filmname + '/' + i + '/' + p + '/take' + str(organized_nr).zfill(3) + '.mp4') + os.system(mv + '.wav ' + filmfolder + filmname + '/' + i + '/' + p + '/take' + str(organized_nr).zfill(3) + '.wav') + os.system(mv + '.png ' + filmfolder + filmname + '/' + i + '/' + p + '/take' + str(organized_nr).zfill(3) + '.png') organized_nr = organized_nr + 1 # Shots for i in sorted(scenes): @@ -746,6 +750,15 @@ def render(filmfiles, filename): #count estimated audio filesize with a bitrate of 320 kb/s audiosize = countsize(filename + '.wav') * 0.453 rendersize = 0 + #overdubbing + if os.path.isfile(filename + '_dub.wav'): + writemessage('Dub audio found lets mix...') + #sox -G -m -v 0.5 test.wav -v 1 guide.wav newtest.wav trim 0 audiolenght + pipe = subprocess.check_output('soxi -D ' + filename + '.wav', shell=True) + audiolenght = pipe.decode() + os.system('cp ' + filename + '.wav ' + filename + '_tmp.wav') + os.system('sox -G -m -v 1 ' + filename + '_dub.wav -v 0.5 ' + filename + '_tmp.wav ' + filename + '.wav trim 0 ' + audiolenght) + os.remove(filename + '_tmp.wav') ##CONVERT AUDIO IF WAV FILES FOUND if os.path.isfile(filename + '.wav'): os.system('mv ' + filename + '.mp4 ' + filename + '_tmp.mp4')