From dfceeb7aff98d4f7426e5f1e5e41d71e399bae2f Mon Sep 17 00:00:00 2001 From: Shreya Shrivastava <126598622+shrivastavanolo@users.noreply.github.com> Date: Tue, 10 Oct 2023 00:55:36 +0530 Subject: [PATCH 1/8] Create connvert_vid_to_mp4 --- connvert_vid_to_mp4 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 connvert_vid_to_mp4 diff --git a/connvert_vid_to_mp4 b/connvert_vid_to_mp4 new file mode 100644 index 000000000..750c8f688 --- /dev/null +++ b/connvert_vid_to_mp4 @@ -0,0 +1,23 @@ +import subprocess +import os + +src = './src' +dst = './mp4' + +for root, dirs, filenames in os.walk(src, topdown=False): + #print(filenames) + for filename in filenames: + print('[INFO] 1',filename) + try: + #These are valid video formats that can be converted to .mp4 file + valid_formats=[".flv",".mp4",".avi",".mov"] + _format = '' + dot=filename.index('.') + _format=filename[dot:] + if _format in valid_formats: + inputfile = os.path.join(root, filename) + print('[INFO] 1',inputfile) + outputfile = os.path.join(dst, filename.lower().replace(_format, ".mp4")) + subprocess.call(['ffmpeg', '-i', inputfile, outputfile]) + except: + print("An exception occurred") From 933d82b27bad95f74f037ca8b89cdf72149eadb0 Mon Sep 17 00:00:00 2001 From: Shreya Shrivastava <126598622+shrivastavanolo@users.noreply.github.com> Date: Tue, 10 Oct 2023 01:04:30 +0530 Subject: [PATCH 2/8] Rename connvert_vid_to_mp4 to vid_to_mp4/connvert_vid_to_mp4 --- connvert_vid_to_mp4 => vid_to_mp4/connvert_vid_to_mp4 | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename connvert_vid_to_mp4 => vid_to_mp4/connvert_vid_to_mp4 (100%) diff --git a/connvert_vid_to_mp4 b/vid_to_mp4/connvert_vid_to_mp4 similarity index 100% rename from connvert_vid_to_mp4 rename to vid_to_mp4/connvert_vid_to_mp4 From 8331a159031d3a90c488d2b091487e9f936a8b33 Mon Sep 17 00:00:00 2001 From: Shreya Shrivastava <126598622+shrivastavanolo@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:38:43 +0530 Subject: [PATCH 3/8] Create README.md --- vid_to_mp4/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 vid_to_mp4/README.md diff --git a/vid_to_mp4/README.md b/vid_to_mp4/README.md new file mode 100644 index 000000000..974002ade --- /dev/null +++ b/vid_to_mp4/README.md @@ -0,0 +1,3 @@ +-it is simple if you have python installed on your machine -you need to run vid_to_mp4.py in terminal -by typing 'python' for windows and 'python3' for Linux -it will go like this 'python vid_to_mp4.py' or 'python3 vid_to_mp4.py' -this will ask for prompts on the cmd. Fill in the required information + +-if you didn't install python on your machine. -here is the installation guide https://realpython.com/installing-python/ please refer to it. From cf7e9d5e8d12ede84180a87a446ef59f9ea14a2f Mon Sep 17 00:00:00 2001 From: Shreya Shrivastava <126598622+shrivastavanolo@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:39:05 +0530 Subject: [PATCH 4/8] Rename connvert_vid_to_mp4 to convert_vid_to_mp4 --- vid_to_mp4/{connvert_vid_to_mp4 => convert_vid_to_mp4} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename vid_to_mp4/{connvert_vid_to_mp4 => convert_vid_to_mp4} (100%) diff --git a/vid_to_mp4/connvert_vid_to_mp4 b/vid_to_mp4/convert_vid_to_mp4 similarity index 100% rename from vid_to_mp4/connvert_vid_to_mp4 rename to vid_to_mp4/convert_vid_to_mp4 From e2bd873c023d6419fe90767f5fbdc9d8fab43a6e Mon Sep 17 00:00:00 2001 From: Shreya Shrivastava <126598622+shrivastavanolo@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:39:13 +0530 Subject: [PATCH 5/8] Rename convert_vid_to_mp4 to vid_to_mp4 --- vid_to_mp4/{convert_vid_to_mp4 => vid_to_mp4} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename vid_to_mp4/{convert_vid_to_mp4 => vid_to_mp4} (100%) diff --git a/vid_to_mp4/convert_vid_to_mp4 b/vid_to_mp4/vid_to_mp4 similarity index 100% rename from vid_to_mp4/convert_vid_to_mp4 rename to vid_to_mp4/vid_to_mp4 From 646ef8fabd077ef4e78d51ea41c7a45f64a51c3f Mon Sep 17 00:00:00 2001 From: Shreya Shrivastava <126598622+shrivastavanolo@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:40:29 +0530 Subject: [PATCH 6/8] Update vid_to_mp4 --- vid_to_mp4/vid_to_mp4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vid_to_mp4/vid_to_mp4 b/vid_to_mp4/vid_to_mp4 index 750c8f688..a15afdd2e 100644 --- a/vid_to_mp4/vid_to_mp4 +++ b/vid_to_mp4/vid_to_mp4 @@ -1,8 +1,8 @@ import subprocess import os -src = './src' -dst = './mp4' +src = input("Enter the source file path: ") +dst = imput("Enter the destination file path: ") for root, dirs, filenames in os.walk(src, topdown=False): #print(filenames) From abb346fefd9edbe3e8c321dc3dae59d47eff81d1 Mon Sep 17 00:00:00 2001 From: Shreya Shrivastava <126598622+shrivastavanolo@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:50:13 +0530 Subject: [PATCH 7/8] Update vid_to_mp4 --- vid_to_mp4/vid_to_mp4 | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/vid_to_mp4/vid_to_mp4 b/vid_to_mp4/vid_to_mp4 index a15afdd2e..ff54fec36 100644 --- a/vid_to_mp4/vid_to_mp4 +++ b/vid_to_mp4/vid_to_mp4 @@ -2,22 +2,24 @@ import subprocess import os src = input("Enter the source file path: ") -dst = imput("Enter the destination file path: ") +dst = input("Enter the destination file path: ") for root, dirs, filenames in os.walk(src, topdown=False): - #print(filenames) + # Print the filename for filename in filenames: - print('[INFO] 1',filename) + print('[INFO] 1', filename) try: - #These are valid video formats that can be converted to .mp4 file - valid_formats=[".flv",".mp4",".avi",".mov"] + # These are valid video formats that can be converted to .mp4 file + valid_formats = [".flv", ".mp4", ".avi", ".mov"] _format = '' - dot=filename.index('.') - _format=filename[dot:] + dot = filename.index('.') + _format = filename[dot:] if _format in valid_formats: - inputfile = os.path.join(root, filename) - print('[INFO] 1',inputfile) - outputfile = os.path.join(dst, filename.lower().replace(_format, ".mp4")) - subprocess.call(['ffmpeg', '-i', inputfile, outputfile]) - except: + inputfile = os.path.join(root, filename) + print('[INFO] 1', inputfile) + new_file = filename.lower().replace(_format, ".mp4") + outputfile = os.path.join(dst, ) + caller = ['ffmpeg', '-i', inputfile, outputfile] + subprocess.call(caller, new_file) + except Exception: print("An exception occurred") From 4a47f9ef02eb292416dcc541b24e5aa1c8c8305b Mon Sep 17 00:00:00 2001 From: Shreya Shrivastava <126598622+shrivastavanolo@users.noreply.github.com> Date: Tue, 10 Oct 2023 15:07:55 +0530 Subject: [PATCH 8/8] Update README.md --- vid_to_mp4/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vid_to_mp4/README.md b/vid_to_mp4/README.md index 974002ade..58f1609f9 100644 --- a/vid_to_mp4/README.md +++ b/vid_to_mp4/README.md @@ -1,3 +1,12 @@ +#Description: **Other Video format to mp4 converter** + +#Setup instructions: -it is simple if you have python installed on your machine -you need to run vid_to_mp4.py in terminal -by typing 'python' for windows and 'python3' for Linux -it will go like this 'python vid_to_mp4.py' or 'python3 vid_to_mp4.py' -this will ask for prompts on the cmd. Fill in the required information -if you didn't install python on your machine. -here is the installation guide https://realpython.com/installing-python/ please refer to it. + +#Output: +File Saved! + +#Author: +[shrivastavanolo](https://github.com/shrivastavanolo)