From f5095d1f23dc839f7e9d7c4b9b25fe6181ca8d24 Mon Sep 17 00:00:00 2001 From: "ladislav.dusa" Date: Wed, 25 Sep 2024 16:06:24 +0200 Subject: [PATCH 01/14] rebase --- handle_imported_video.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handle_imported_video.py b/handle_imported_video.py index 98b8ccd..7591648 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -209,8 +209,8 @@ if _ACTION == "join": pbar.update(1) pbar.close() - print("\r\n",end='',flush=True) - print(f"\rProcess finished with rc: {proc.returncode}",end='',flush=True) + print("\r\n",end='\n',flush=True) + print(f"\rProcess finished with rc: {proc.returncode}",end='\n',flush=True) # get the output status = 0 From ebc38ea27dc4afd2e2ee8060aadf43fe219b352f Mon Sep 17 00:00:00 2001 From: "ladislav.dusa" Date: Wed, 25 Sep 2024 16:28:36 +0200 Subject: [PATCH 02/14] rebase --- handle_imported_video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handle_imported_video.py b/handle_imported_video.py index 7591648..3e998f0 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -274,7 +274,7 @@ if _ACTION == "encode": myCmd = [ "/opt/ffmpeg/ffmpeg", "-i", p, "-c:v", "hevc_amf", "-rc", "cqp", "-qp_i", _QUALITY[0], "-qp_p", _QUALITY[1], "-quality", "quality", "-crf", _QUALITY[2], "-y", export_name , "-f", "null", "/dev/null", ] - print(myCmd) + #print(myCmd) print(f"Encoding {p} to {export_name} in {_DAY_DIR}...") ff = FfmpegProgress(myCmd) with tqdm(total=100, position=1, desc="Encode") as pbar: From cbe2214d06d9083e276a2225b7a456efdfc4cae3 Mon Sep 17 00:00:00 2001 From: "ladislav.dusa" Date: Wed, 25 Sep 2024 16:47:18 +0200 Subject: [PATCH 03/14] rebase --- handle_imported_video.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/handle_imported_video.py b/handle_imported_video.py index 3e998f0..ca02a80 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -209,6 +209,9 @@ if _ACTION == "join": pbar.update(1) pbar.close() + if _TEST: + print(proc.stdout) + print(proc.communicate()[0]) print("\r\n",end='\n',flush=True) print(f"\rProcess finished with rc: {proc.returncode}",end='\n',flush=True) # get the output From 0af4ddea5a25555a83714d79449ccdfcb92ef1bb Mon Sep 17 00:00:00 2001 From: "ladislav.dusa" Date: Wed, 25 Sep 2024 16:51:47 +0200 Subject: [PATCH 04/14] rebase --- handle_imported_video.py | 1 + 1 file changed, 1 insertion(+) diff --git a/handle_imported_video.py b/handle_imported_video.py index ca02a80..f574bcc 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -212,6 +212,7 @@ if _ACTION == "join": if _TEST: print(proc.stdout) print(proc.communicate()[0]) + print(proc) print("\r\n",end='\n',flush=True) print(f"\rProcess finished with rc: {proc.returncode}",end='\n',flush=True) # get the output From 2573bf2debe9eb15acaa27da0e1e247d42fce618 Mon Sep 17 00:00:00 2001 From: "ladislav.dusa" Date: Wed, 25 Sep 2024 16:56:54 +0200 Subject: [PATCH 05/14] rebase --- handle_imported_video.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/handle_imported_video.py b/handle_imported_video.py index f574bcc..dc3b0f0 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -1,3 +1,4 @@ +from lib2to3.pygram import python_grammar_no_print_and_exec_statement import os from posixpath import ismount import sys @@ -210,9 +211,10 @@ if _ACTION == "join": pbar.update(1) pbar.close() if _TEST: + print("Outputs") print(proc.stdout) print(proc.communicate()[0]) - print(proc) + print(python_grammar_no_print_and_exec_statement``) print("\r\n",end='\n',flush=True) print(f"\rProcess finished with rc: {proc.returncode}",end='\n',flush=True) # get the output From 4d4f709e508fcf51d20db09e170baa630f359e86 Mon Sep 17 00:00:00 2001 From: "ladislav.dusa" Date: Wed, 25 Sep 2024 16:57:56 +0200 Subject: [PATCH 06/14] rebase --- handle_imported_video.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/handle_imported_video.py b/handle_imported_video.py index dc3b0f0..3e28619 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -1,4 +1,3 @@ -from lib2to3.pygram import python_grammar_no_print_and_exec_statement import os from posixpath import ismount import sys @@ -214,7 +213,7 @@ if _ACTION == "join": print("Outputs") print(proc.stdout) print(proc.communicate()[0]) - print(python_grammar_no_print_and_exec_statement``) + print(proc) print("\r\n",end='\n',flush=True) print(f"\rProcess finished with rc: {proc.returncode}",end='\n',flush=True) # get the output From 1cf0707af6f706fa318ec9e88e5d1e46a9f34dd6 Mon Sep 17 00:00:00 2001 From: "ladislav.dusa" Date: Wed, 25 Sep 2024 16:59:01 +0200 Subject: [PATCH 07/14] rebase --- handle_imported_video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handle_imported_video.py b/handle_imported_video.py index 3e28619..1dd8d80 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -219,7 +219,7 @@ if _ACTION == "join": # get the output status = 0 - if status == 0: + if status == 0 and not _TEST: print("Moving...") for p in parts: try: From 6217a7c4179ec42bbb1fe461b1e28a2c0b6e448b Mon Sep 17 00:00:00 2001 From: "ladislav.dusa" Date: Wed, 25 Sep 2024 17:00:38 +0200 Subject: [PATCH 08/14] rebase --- handle_imported_video.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/handle_imported_video.py b/handle_imported_video.py index 1dd8d80..4b91e5b 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -209,7 +209,9 @@ if _ACTION == "join": pbar.update(1) pbar.close() + pbar.clear() if _TEST: + print("\r\n") print("Outputs") print(proc.stdout) print(proc.communicate()[0]) From fe59bd687dcdc85bbfc45ac62fdf1af60e116dc1 Mon Sep 17 00:00:00 2001 From: "ladislav.dusa" Date: Wed, 25 Sep 2024 17:01:59 +0200 Subject: [PATCH 09/14] rebase --- handle_imported_video.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/handle_imported_video.py b/handle_imported_video.py index 4b91e5b..bbe1d5a 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -207,9 +207,9 @@ if _ACTION == "join": time.sleep(3) - pbar.update(1) - pbar.close() - pbar.clear() + # pbar.update(1) + # pbar.close() + # pbar.clear() if _TEST: print("\r\n") print("Outputs") From e56a4b52429543c340c9898284bcd01b4dd64d5a Mon Sep 17 00:00:00 2001 From: "ladislav.dusa" Date: Wed, 25 Sep 2024 17:06:10 +0200 Subject: [PATCH 10/14] rebase --- handle_imported_video.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/handle_imported_video.py b/handle_imported_video.py index bbe1d5a..cb4d510 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -184,7 +184,7 @@ if _ACTION == "join": #print(myCmd) print(f"Joining {len(parts)} files to {export_name} in {_DAY_DIR}...") - proc = subprocess.Popen(myCmd,stdout=subprocess.DEVNULL,stderr=subprocess.STDOUT) + proc = subprocess.Popen(myCmd,stderr=subprocess.STDOUT) # with tqdm(total=100, position=1, desc="Convert") as pbar: # for progress in ff.run_command_with_progress(): # pbar.update(progress - pbar.n) @@ -210,9 +210,13 @@ if _ACTION == "join": # pbar.update(1) # pbar.close() # pbar.clear() + if _TEST: + status,output = proc.communicate() print("\r\n") print("Outputs") + print(status) + print(output) print(proc.stdout) print(proc.communicate()[0]) print(proc) From 7ef38c4bfd1208b78701e7fc009649441ef69145 Mon Sep 17 00:00:00 2001 From: "ladislav.dusa" Date: Wed, 25 Sep 2024 17:07:35 +0200 Subject: [PATCH 11/14] rebase --- handle_imported_video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handle_imported_video.py b/handle_imported_video.py index cb4d510..1317bc0 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -184,7 +184,7 @@ if _ACTION == "join": #print(myCmd) print(f"Joining {len(parts)} files to {export_name} in {_DAY_DIR}...") - proc = subprocess.Popen(myCmd,stderr=subprocess.STDOUT) + proc = subprocess.Popen(myCmd,stdout=subprocess.PIPE,stderr=subprocess.STDOUT) # with tqdm(total=100, position=1, desc="Convert") as pbar: # for progress in ff.run_command_with_progress(): # pbar.update(progress - pbar.n) From c9849ecc6ed63e191bb746d17f3661e07edad2b6 Mon Sep 17 00:00:00 2001 From: "ladislav.dusa" Date: Wed, 25 Sep 2024 18:01:45 +0200 Subject: [PATCH 12/14] rebase --- handle_imported_video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handle_imported_video.py b/handle_imported_video.py index 1317bc0..2becf98 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -184,7 +184,7 @@ if _ACTION == "join": #print(myCmd) print(f"Joining {len(parts)} files to {export_name} in {_DAY_DIR}...") - proc = subprocess.Popen(myCmd,stdout=subprocess.PIPE,stderr=subprocess.STDOUT) + proc = subprocess.Popen(myCmd,stdout=subprocess.DEVNULL,stderr=subprocess.STDOUT) # with tqdm(total=100, position=1, desc="Convert") as pbar: # for progress in ff.run_command_with_progress(): # pbar.update(progress - pbar.n) From 32b364b6f5133ed85d7ac282fdb83c3c75eb7a62 Mon Sep 17 00:00:00 2001 From: "ladislav.dusa" Date: Wed, 25 Sep 2024 18:07:30 +0200 Subject: [PATCH 13/14] rebase --- handle_imported_video.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/handle_imported_video.py b/handle_imported_video.py index 2becf98..6d9add3 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -184,6 +184,10 @@ if _ACTION == "join": #print(myCmd) print(f"Joining {len(parts)} files to {export_name} in {_DAY_DIR}...") + try: + os.remove(export_name) + except: + pass proc = subprocess.Popen(myCmd,stdout=subprocess.DEVNULL,stderr=subprocess.STDOUT) # with tqdm(total=100, position=1, desc="Convert") as pbar: # for progress in ff.run_command_with_progress(): From ce0d242f284396a85ce0ffff2a57b3b67fe2cf46 Mon Sep 17 00:00:00 2001 From: "ladislav.dusa" Date: Wed, 25 Sep 2024 18:57:48 +0200 Subject: [PATCH 14/14] rebase --- handle_imported_video.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handle_imported_video.py b/handle_imported_video.py index 6d9add3..0898612 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -181,8 +181,8 @@ if _ACTION == "join": myCmd = [ "/opt/ffmpeg/ffmpeg", "-f", "concat", "-i", "video.txt ","-vcodec", "copy", "-acodec", "copy", "-y", export_name ] - - #print(myCmd) + if _TEST: + print(" ".join(myCmd)) print(f"Joining {len(parts)} files to {export_name} in {_DAY_DIR}...") try: os.remove(export_name)