tarina

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

commit a19e433e5129438fa6a01a33b137a409b1704a47
parent 3c77f26754db5f2da2e9f9c87355827f357fe709
Author: rob <rob@tarina.org>
Date:   Sat, 11 Nov 2023 03:48:39 +0200

Merge branch 'master' of https://git.tarina.org/tarina

Diffstat:
M3d/tarina-picamera-clipgrip.stl | 0
Mdocs/wiring.svg | 8++++----
Mtarina.py | 55+++++++++++++++++++++++++++++++++++++------------------
3 files changed, 41 insertions(+), 22 deletions(-)

diff --git a/3d/tarina-picamera-clipgrip.stl b/3d/tarina-picamera-clipgrip.stl Binary files differ. diff --git a/docs/wiring.svg b/docs/wiring.svg @@ -901,25 +901,25 @@ transform="scale(-1)" /> <path style="fill:none;fill-rule:evenodd;stroke:#c40000;stroke-width:0.978723;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 17.709959,257.56988 0,19.20596 H 83.13183 v -14.93707 h 17.18567" + d="m 26.671785,257.56988 v 19.20596 l 56.460045,0 v -14.93707 h 17.18567" id="path5069" inkscape:connector-curvature="0" sodipodi:nodetypes="ccccc" /> <path style="fill:none;fill-rule:evenodd;stroke:#0000ff;stroke-width:0.978723;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 20.908522,257.37415 0,22.53366 H 85.1395 v -14.85677 h 14.696161" + d="m 23.646892,257.37415 v 22.53366 l 61.492608,0 v -14.85677 h 14.696161" id="path5071" inkscape:connector-curvature="0" sodipodi:nodetypes="ccccc" /> <path style="fill:none;fill-rule:evenodd;stroke:#00bb00;stroke-width:0.978723;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 23.278565,257.45035 0,25.42883 H 87.4684 v -15.178 h 12.367261" + d="m 20.908522,257.37415 v 24.89966 l 66.559878,0.60537 v -15.178 h 12.367261" id="path5073" inkscape:connector-curvature="0" sodipodi:nodetypes="ccccc" /> <path style="fill:none;fill-rule:evenodd;stroke:#bb00ff;stroke-width:0.978723;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 26.486587,257.4504 0.115041,28.36288 63.356292,-0.0431 v -15.57955 h 10.038351" + d="m 17.787728,257.4504 0.115041,28.36288 72.055151,-0.0431 v -15.57955 h 10.038351" id="path5075" inkscape:connector-curvature="0" sodipodi:nodetypes="ccccc" /> diff --git a/tarina.py b/tarina.py @@ -160,6 +160,8 @@ def main(): moving = False stream = '' live = 'no' + peakshot = '' + peaktake = '' plughw = 0 #default audio device channels = 1 #default mono #SAVE SETTINGS FREQUENCY IN SECS @@ -930,17 +932,19 @@ def main(): if a == camselected: if camera_recording == a: if a==0: - pressed="retake_now" - retake = True - camera_recording=None + if recording == True: + pressed="retake_now" + retake = True + camera_recording=None else: sendtocamera(i,port,'STOPRETAKE') camera_recording=None else: if a==0: - pressed="retake_now" - retake = True - camera_recording=0 + if recording == False: + pressed="retake_now" + retake = True + camera_recording=0 else: sendtocamera(i,port,'RETAKE:'+str(shot)) camera_recording=camselected @@ -967,7 +971,8 @@ def main(): a=a+1 elif pressed == "record" and camera_recording != None: if camera_recording == 0: - pressed='record_now' + if recording == True: + pressed='record_now' else: sendtocamera(cameras[camera_recording],port,'STOP') camera_recording=None @@ -1082,7 +1087,8 @@ def main(): delayedstop=c elif a == newselected: if a == 0: - pressed='record_now' + if recording == False: + pressed='record_now' else: sendtocamera(c,port,'REC') camera_recording=newselected @@ -1096,7 +1102,8 @@ def main(): if delayedstop: time.sleep(0.05) if delayedstop==cameras[0]: - pressed='record_now' + if recording == True: + pressed='record_now' pressagain='insert_shot' else: sendtocamera(delayedstop,port,'STOP') @@ -2078,6 +2085,7 @@ def countshots(filmname, filmfolder, scene): def counttakes(filmname, filmfolder, scene, shot): takes = 0 + doubles = '' try: allfiles = os.listdir(filmfolder + filmname + '/scene' + str(scene).zfill(3) + '/shot' + str(shot).zfill(3)) except: @@ -2085,7 +2093,9 @@ def counttakes(filmname, filmfolder, scene, shot): return takes for a in allfiles: if '.mp4' in a or '.h264' in a: - takes = takes + 1 + if not doubles.replace('.h264', '.mp4') == a: + takes = takes + 1 + doubles = a return takes #-----------Count videos on floor----- @@ -2913,6 +2923,8 @@ def organize(filmfolder, filmname): print('appending: '+origin) origin_files.append(origin) origin_scene_files.append(origin) + if os.path.isfile(takename+'.h264'): + print('oh no boubles found!') if '.h264' in s: origin=os.path.realpath(takename+'.h264') if origin != os.path.abspath(takename+'.h264'): @@ -2938,7 +2950,7 @@ def organize(filmfolder, filmname): logger.info(s) #time.sleep(5) compileshot(takename,filmfolder,filmname) - #organized_nr -= 1 + organized_nr -= 1 organized_nr += 1 origin_files.extend(origin_scene_files) with open(filmfolder+filmname+'/'+i+'/.origin_videos', 'w') as outfile: @@ -3195,7 +3207,7 @@ def renderaudio(audiofiles, filename, dubfiles, dubmix): audiomerge = ['sox'] #if render > 2: # audiomerge.append(filename + '.wav') - if len(audiofiles) > 1: + if isinstance(audiofiles, list): for f in audiofiles: audiomerge.append(f + '.wav') audiomerge.append(filename + '.wav') @@ -3274,12 +3286,14 @@ def rendershot(filmfolder, filmname, renderfilename, scene, shot): #take = counttakes(filmname, filmfolder, scene, shot) #renderfilename = filmfolder + filmname + '/scene' + str(scene).zfill(3) + '/shot' + str(shot).zfill(3) + '/take' + str(take).zfill(3) # Video Hash - compileshot(renderfilename,filmfolder,filmname) - videohash = videohash + str(int(countsize(renderfilename + '.mp4'))) - print('Videohash of shot is: ' + videohash) #if something shutdown in middle of process if os.path.isfile(renderfilename + '_tmp.mp4') == True: os.system('cp ' + renderfilename + '_tmp.mp4 ' + renderfilename + '.mp4') + compileshot(renderfilename,filmfolder,filmname) + videohash = videohash + str(int(countsize(renderfilename + '.mp4'))) + print('Videohash of shot is: ' + videohash) + #if os.path.isfile(renderfilename + '.h264') and os.path.isfile(renderfilename + '.mp4'): + # os.system('rm ' + renderfilename + '.h264 ') scenedir = filmfolder + filmname + '/scene' + str(scene).zfill(3) + '/shot' + str(shot).zfill(3) + '/' # Check if video corrupt renderfix = False @@ -3389,11 +3403,11 @@ def renderscene(filmfolder, filmname, scene): renderfixscene = True print('Scene lenght ' + videolenght) if videolenght == '': - print('Okey, scene file not found or is corrupted') + print('Okey, hold your horses, rendering!') # For backwards compatibility remove old rendered scene files #run_command('rm ' + renderfilename + '.mp4') #run_command('rm ' + renderfilename + '.wav') - vumetermessage('corrupted scene file! removing, please render again') + #vumetermessage('corrupted scene file! removing, please render again') renderfixscene = True #return '', '' # Video Hash @@ -3404,8 +3418,13 @@ def renderscene(filmfolder, filmname, scene): scene = int(p.rsplit('scene',1)[1][:3]) shot = int(p.rsplit('shot',1)[1][:3]) rendershotname, renderfix = rendershot(filmfolder, filmname, p, scene, shot) + if renderfix == True: + renderfixscene = True if rendershotname: - videohash = videohash + str(int(countsize(p + '.mp4'))) + try: + videohash = videohash + str(int(countsize(p + '.mp4'))) + except: + print('no file? ') print('Videohash of scene is: ' + videohash) try: with open(scenedir + '.videohash', 'r') as f: