Browse Source

cleanup: dir/Xdesk to arc/

micha 1 year ago
parent
commit
60af354a72

+ 0 - 0
aura-ipx-20.py → arc/aura-ipx-20.py


+ 0 - 0
aura-ipx-36.py → arc/aura-ipx-36.py


+ 0 - 0
aura-ipx-36nofine.py → arc/aura-ipx-36nofine.py


+ 0 - 0
console_test.py → arc/console_test.py


+ 0 - 0
dev/pull_dev.sh → arc/dev/pull_dev.sh


+ 0 - 0
issue.txt → arc/issue.txt


+ 0 - 0
old/apcmini.py → arc/old/apcmini.py


+ 0 - 0
old/fx.py → arc/old/fx.py


+ 0 - 0
old/generate_dim.py → arc/old/generate_dim.py


+ 0 - 0
old/preset.py → arc/old/preset.py


+ 0 - 0
old/send_loop.py → arc/old/send_loop.py


+ 0 - 0
patch.sav → arc/patch.sav


+ 0 - 0
testing/video_import.py → arc/testing/video_import.py


+ 0 - 0
unittest_run.py → arc/unittest_run.py


+ 10 - 0
home/LibreLight/video/converter/convert.desktop

@@ -0,0 +1,10 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=convert mp4
+Comment=verkleinert die Videodateien in der Auflösung
+Exec=xterm -e 'python3 /opt/LibreLight/Xdesk/vpu/convert.py'
+Icon=view-restore
+Path=~/LibreLight/video/converter/
+Terminal=true
+StartupNotify=false

+ 0 - 20
home/LibreLight/video/converter/convert.py

@@ -1,20 +0,0 @@
-#!/usr/bin/python3
-import os
-
-print("go")
-for i in os.listdir("groß/"):
-    i2 = i.split(".",-1)[0]
-    #if not i.endswith("mov"):
-    #    continue
-    if os.path.isfile("groß/"+i):
-        print(i)
-         	  
-        cmd="ffmpeg -n -i 'groß/"+i+"' -s 640x480 -c:a copy 'klein/"+i2+".mp4'"
-        print(cmd)
-        os.system(cmd)
-        print(" ")
-        print(" ")
-
-print("")
-input("ende")
-time.sleep( 10)

+ 0 - 0
fix_gen.py → tool/fix_gen.py


+ 62 - 0
vpu/convert.py

@@ -0,0 +1,62 @@
+#!/usr/bin/python3
+import os
+
+print("... checking home dir")
+HOME = os.getenv('HOME')
+try:
+    os.chdir(HOME+"/LibreLight/video/converter")
+except FileNotFoundError:  
+    cmd =  "mkdir -p {}/LibreLight/video/converter".format(HOME)
+    os.system(cmd)
+    os.chdir(HOME+"/LibreLight/video/converter")
+
+print("ok")
+
+cmd =  "mkdir -p {}/LibreLight/video/converter/klein".format(HOME)
+os.system(cmd)
+cmd =  "mkdir -p {}/LibreLight/video/converter/groß".format(HOME)
+os.system(cmd)
+
+cmd =  "mkdir -p groß/"
+os.system(cmd)
+
+def convert_img(s,t):# to 1 sec video
+    cmd="ffmpeg -y -framerate 1 -i 'groß/{}' -r 1000 'groß/{}.mp4'".format(s,t)
+    cmd="ffmpeg -y -framerate 1 -i 'groß/{}' -s 640x480 -c:a copy -r 1000 'klein/{}.mp4'".format(s,t)
+    print(cmd)
+    os.system(cmd)
+    print("*"*40)
+    print("*"*40)
+    print()
+
+def convert_video(s,t):
+    cmd="ffmpeg  -y -i 'groß/{}' -s 640x480 -c:a copy 'klein/{}.mp4'".format(s,t)
+    print(cmd)
+    os.system(cmd)
+    print("*"*40)
+    print("*"*40)
+    print()
+
+files = os.listdir("groß/")
+if not files:
+    print("- no files in groß")
+
+for s in files:
+    if "." not in s:
+        continue
+
+    t = s.rsplit(".",1)[0] # cut ending .mp4
+
+    if os.path.isfile("groß/"+s):
+        print(s)
+        ending = s.lower().split(".")[-1] 
+        if ending in  ["png","jpg","jpeg","bmp","gif"] :
+            convert_img(s,t)
+            #s = t+".mp4"
+        else:
+            convert_video(s,t)
+        print(" ")
+        print(" ")
+
+print("")
+input("ende")