From fea0d787ba46f4bddb30aaf5fd2783dee022bf95 Mon Sep 17 00:00:00 2001 From: "Manuel Schmid (schmim62)" Date: Wed, 6 Jan 2021 11:25:22 +0100 Subject: [PATCH 1/7] Detect the frame rate with ffprobe --- jumpcutter.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/jumpcutter.py b/jumpcutter.py index 8b59e3d..f0b2f14 100644 --- a/jumpcutter.py +++ b/jumpcutter.py @@ -99,24 +99,17 @@ def deletePath(s): # Dangerous! Watch out! subprocess.call(command, shell=True) -command = "ffmpeg -i "+TEMP_FOLDER+"/input.mp4 2>&1" -f = open(TEMP_FOLDER+"/params.txt", "w") -subprocess.call(command, shell=True, stdout=f) - - - sampleRate, audioData = wavfile.read(TEMP_FOLDER+"/audio.wav") audioSampleCount = audioData.shape[0] maxAudioVolume = getMaxVolume(audioData) -f = open(TEMP_FOLDER+"/params.txt", 'r+') -pre_params = f.read() -f.close() -params = pre_params.split('\n') -for line in params: - m = re.search('Stream #.*Video.* ([0-9]*) fps',line) - if m is not None: - frameRate = float(m.group(1)) +# Get frame rate with ffprobe +command = "ffprobe -v error -select_streams v:0 -show_entries stream=avg_frame_rate -of " \ + "default=noprint_wrappers=1:nokey=1 " + INPUT_FILE +stdout = subprocess.run(command, capture_output=True, text=True).stdout +print("Detected frame rate: " + str(stdout)) +return_values = [int(val) for val in stdout.split('/')] +frameRate = return_values[0] / return_values[1] samplesPerFrame = sampleRate/frameRate From 99a4d73f9b2634982854be0f6a44443ad9f3ca32 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Tue, 23 Mar 2021 11:25:53 +0100 Subject: [PATCH 2/7] Revert "Update README.md" This reverts commit 389c1a561cfffcc949fe66563c2dff39b5be205b. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 35ee856..847f55c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # jumpcutter Automatically edits videos. Explanation here: https://www.youtube.com/watch?v=DQ8orIurGxw -Go here for a more polished version of this software that my friends and I have been working on for the last year or so: https://jumpcutter.com/ ## Some heads-up: From 6216049131487121e92d1904d2d142784f0d86c6 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Tue, 23 Mar 2021 12:01:31 +0100 Subject: [PATCH 3/7] Revert "Revert "Update README.md"" This reverts commit 99a4d73f9b2634982854be0f6a44443ad9f3ca32. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 847f55c..35ee856 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # jumpcutter Automatically edits videos. Explanation here: https://www.youtube.com/watch?v=DQ8orIurGxw +Go here for a more polished version of this software that my friends and I have been working on for the last year or so: https://jumpcutter.com/ ## Some heads-up: From d0972b2a76369e331fde7163202ae4cd2c4e170c Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Tue, 23 Mar 2021 12:01:40 +0100 Subject: [PATCH 4/7] Revert "Merge pull request #1 from carykh/master" This reverts commit 6d2d92a2e07850c85d3afdf26361aefdbb9ba514, reversing changes made to fea0d787ba46f4bddb30aaf5fd2783dee022bf95. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 35ee856..847f55c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # jumpcutter Automatically edits videos. Explanation here: https://www.youtube.com/watch?v=DQ8orIurGxw -Go here for a more polished version of this software that my friends and I have been working on for the last year or so: https://jumpcutter.com/ ## Some heads-up: From 602c1d9d01a6f1765fcfae5c06369fcd8c0a5d31 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Tue, 23 Mar 2021 12:01:47 +0100 Subject: [PATCH 5/7] Revert "Revert "Update README.md"" This reverts commit 99a4d73f9b2634982854be0f6a44443ad9f3ca32. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 847f55c..35ee856 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # jumpcutter Automatically edits videos. Explanation here: https://www.youtube.com/watch?v=DQ8orIurGxw +Go here for a more polished version of this software that my friends and I have been working on for the last year or so: https://jumpcutter.com/ ## Some heads-up: From 7c717be5484814a4febd8e8502409e2b54864611 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Tue, 23 Mar 2021 12:01:56 +0100 Subject: [PATCH 6/7] Revert "Merge pull request #1 from carykh/master" This reverts commit 6d2d92a2e07850c85d3afdf26361aefdbb9ba514, reversing changes made to fea0d787ba46f4bddb30aaf5fd2783dee022bf95. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 35ee856..847f55c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # jumpcutter Automatically edits videos. Explanation here: https://www.youtube.com/watch?v=DQ8orIurGxw -Go here for a more polished version of this software that my friends and I have been working on for the last year or so: https://jumpcutter.com/ ## Some heads-up: From 4c0850ce2c66cadbeee0e79b6033dd699a2824b4 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Tue, 23 Mar 2021 12:01:58 +0100 Subject: [PATCH 7/7] Revert "Revert "Update README.md"" This reverts commit 99a4d73f9b2634982854be0f6a44443ad9f3ca32. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 847f55c..35ee856 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # jumpcutter Automatically edits videos. Explanation here: https://www.youtube.com/watch?v=DQ8orIurGxw +Go here for a more polished version of this software that my friends and I have been working on for the last year or so: https://jumpcutter.com/ ## Some heads-up: