commit 32821c82f29efeba7559267d144ba37d659ebec0
parent 590470210b49afb38792df5bfb26345bbc362e16
Author: rbckman <rob@tarina.org>
Date: Sat, 4 Oct 2025 09:20:32 +0100
tweaking edit mode-
Diffstat:
3 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/gonzopi.py b/gonzopi.py
@@ -832,11 +832,6 @@ def main():
print(term.clear)
filmname = newfilmname
newfilmname = ''
- vumetermessage('film already exist!')
- logger.info('film already exist!')
- updatethumb = True
- loadfilmsettings = True
- rendermenu = True
#EDIT FILM NAME
elif pressed == 'middle' and menu[selected] == 'TITLE' or filmname == '':
newfilmname = nameyourfilm(filmfolder, filmname, abc, False)
@@ -1321,10 +1316,11 @@ def main():
take = counttakes(filmname, filmfolder, scene, shot)
elif 'SHOTSCENES:' in pressed:
sceneshot=pressed.split(':')[1]
- scene=sceneshot.split('|')[0]
+ scene=sceneshot.split('|')[0].split('#')[0]
scene=int(scene)
- shot=sceneshot.split('|')[1]
+ shot=sceneshot.split('|')[1].split('#')[0]
shot=int(shot)
+ filmname = sceneshot.split('|')[1].split('#')[1]
take = counttakes(filmname, filmfolder, scene, shot)
elif 'REMOVE:' in pressed:
scene=pressed.split(':')[1]
@@ -6536,7 +6532,7 @@ def split_list_save(foldername, splitlist):
#---------------Video Trim--------------------
def videotrim(filmfolder, foldername ,filename, where, s, t, make_new_take_or_shot):
- global film_reso
+ global film_reso, db
#theres two different ways of non-rerendering mp4 cut techniques that i know MP4Box and ffmpeg
if make_new_take_or_shot == 'take':
trim_filename = foldername+filename[:-3] + str(counttakes2(foldername)+1).zfill(3)
@@ -6605,6 +6601,8 @@ def videotrim(filmfolder, foldername ,filename, where, s, t, make_new_take_or_sh
# writemessage('trimming original sound')
# audiotrim(trim_filename, 'end', foldername+'dub/original.wav')
#take last frame
+ videolength = get_video_length(video_origins+'.mp4')
+ db.insert('videos', tid=datetime.datetime.now(), filename=video_origins+'.mp4', foldername=foldername, audiolength=videolength/1000, videolength=videolength/1000)
if film_reso == '1920x1080':
run_command('ffmpeg -y -sseof -1 -i ' + trim_filename + '.mp4 -update 1 -q:v 1 -vf scale=800:450 ' + trim_filename + '.jpeg')
run_command('ffmpeg -y -sseof -1 -i ' + trim_filename + '.mp4 -update 1 -q:v 1 -vf scale=80:45 ' + trim_filename + '_thumb.jpeg')
@@ -6645,7 +6643,7 @@ def fastaudiotrim(filename, beginning, end):
#--------------Audio Trim--------------------
# make audio file same length as video file
def audiotrim(filename, where, dub):
- global channels, fps
+ global channels, fps, db
videofile=filename
audiosync=0
print("chaaaaaaaaaaaaaaaanel8: " +str(channels))
@@ -6673,6 +6671,7 @@ def audiotrim(filename, where, dub):
#audioms = int(audiolength) % 1000
#videos = int(videolength) / 1000
#audios = int(audiolength) / 1000
+ video_origins = (os.path.realpath(filename+'.mp4'))
audio_origins = (os.path.realpath(filename+'.wav'))
if int(audiolength) > int(videolength):
#calculate difference
diff --git a/srv/gonzopiserver.py b/srv/gonzopiserver.py
@@ -667,7 +667,9 @@ class api:
elif i.func == 'paste':
sendtocamera(ip,port,'paste')
elif i.scene!=None and i.shot!=None and i.film != None:
- sendtocamera(ip,port,'SHOTSCENES:'+str(i.scene)+'|'+str(i.shot))
+ #sendtocamera(ip,port,'NEWFILM:'+i.film)
+ #time.sleep(0.05)
+ sendtocamera(ip,port,'SHOTSCENES:'+str(i.scene)+'|'+str(i.shot)+'#'+i.film)
time.sleep(0.2)
sendtocamera(ip,port,'SELECTED:3')
interface=open('/dev/shm/interface','r')
diff --git a/srv/templates/edit.html b/srv/templates/edit.html
@@ -72,6 +72,7 @@ button {
}
.responsive-div {
display: none; /* Hide by default */
+ text-align: center;
}
@media (max-width: 700px) {
.responsive-div {
@@ -107,6 +108,7 @@ $if film != '' and scene != '' and shot != '':
$ i = film
$ scenes=countscenes(filmfolder, i)
$for s in range(scenes):
+ <pre style="margin-top:0px; margin-left:5px; width: 100%; " ></pre>
<pre style="margin-top:0px; margin-left:5px; width: 100%; " >scene $str(s+1)</pre>
$ t = counttakes(i, filmfolder, s+1, 1)
$ shots = countshots(i, filmfolder, s+1)
@@ -368,6 +370,7 @@ $$('#PASTE').on('click', function () {
// Assuming JSON response like: { "scene": "1", "shot": "2" }
const currentScene = response.scene;
const currentShot = response.shot;
+ const currentFilm = response.film;
const fileList = response.selected;
// Reset all divs to transparent border
@@ -377,7 +380,7 @@ $$('#PASTE').on('click', function () {
// Find and update matching div
$$shotDivs.each(function() {
const $$div = $$(this);
- if ($$div.data('scene') == currentScene && $$div.data('shot') == currentShot) {
+ if ($$div.data('scene') == currentScene && $$div.data('shot') == currentShot && $$div.data('film') == currentFilm ) {
$$div.css('border', '1px solid white'); // Draw border on matching div
}
if (fileList.includes($$div.data('file'))) {