From 929e65791460c73898f7932e134328940c1f64b5 Mon Sep 17 00:00:00 2001 From: Emanuel Acosta Date: Sun, 4 Apr 2021 22:17:27 -0400 Subject: [PATCH 1/8] Made ReadMe more noob friendly --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 35ee856..c0423c1 100644 --- a/README.md +++ b/README.md @@ -18,5 +18,19 @@ I want to use pyinstaller to turn this into an executable, so non-techy people can use it EVEN IF they don't have Python and all those libraries. Jabrils recommended this to me. However, my pyinstaller build did not work. :( HELP +## Install prerequisites +Do `pip install scipy, numpy, pillow, audiotsm, pytube` to get all the dependencies. + +**Make sure to install [ffmpeg codex](https://ffmpeg.org/download.html)** and to put the exe on `C:\Windows` folder (you will need admin rights to do so) + + +## Example command + +`python jumpcutter.py --input_file input_video.mp4 --output_file output_video.mp4 --sounded_speed 1 --silent_speed 999999 --frame_margin 2 ` +This takes the file `input_video.mp4` and gives it a jump cut effect on silent parts then saves it as output_video.mp4 +heres a fun one `python jumpcutter.py --url https://www.youtube.com/watch?v=DQ8orIurGxw --output_file output3_video.mp4 --sounded_speed 999999 --silent_speed 1 --frame_margin 2 ` +it keeps only silence in the video +Remember that if you need help use `python jumpcutter.py -h` it opens help, where you see more info about what each argument does. + ## Building with nix `nix-build` to get a script with all the libraries and ffmpeg, `nix-build -A bundle` to get a single binary. From 6e0fe40be73ebe1e86c311834339863645d7e14d Mon Sep 17 00:00:00 2001 From: Emanuel Acosta Date: Sun, 4 Apr 2021 22:55:52 -0400 Subject: [PATCH 2/8] =?UTF-8?q?Fixed=20typos=20and=20added=20an=20?= =?UTF-8?q?=E2=9C=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c0423c1..ba6b282 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# jumpcutter +# 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/ @@ -14,7 +14,7 @@ As the program runs, it saves every frame of the video as an image file in a temporary folder. If your video is long, this could take a LOT of space. I have processed 17-minute videos completely fine, but be wary if you're gonna go longer. -I want to use pyinstaller to turn this into an executable, so non-techy people +I wanted to use pyinstaller to turn this into an executable, so non-techy people can use it EVEN IF they don't have Python and all those libraries. Jabrils recommended this to me. However, my pyinstaller build did not work. :( HELP @@ -27,10 +27,13 @@ Do `pip install scipy, numpy, pillow, audiotsm, pytube` to get all the dependenc ## Example command `python jumpcutter.py --input_file input_video.mp4 --output_file output_video.mp4 --sounded_speed 1 --silent_speed 999999 --frame_margin 2 ` -This takes the file `input_video.mp4` and gives it a jump cut effect on silent parts then saves it as output_video.mp4 -heres a fun one `python jumpcutter.py --url https://www.youtube.com/watch?v=DQ8orIurGxw --output_file output3_video.mp4 --sounded_speed 999999 --silent_speed 1 --frame_margin 2 ` -it keeps only silence in the video -Remember that if you need help use `python jumpcutter.py -h` it opens help, where you see more info about what each argument does. +This takes the file `input_video.mp4` and gives it a jumpcut effect on silent parts then saves it as output_video.mp4 + +Heres a fun one `python jumpcutter.py --url https://www.youtube.com/watch?v=DQ8orIurGxw --output_file output2_video.mp4 --sounded_speed 999999 --silent_speed 1 --frame_margin 2 ` + +it takes carykh's video about this code keeps only silence in the video + +**Remember that if you need help use `python jumpcutter.py -h` it shows a more information about what each argument does.** ## Building with nix `nix-build` to get a script with all the libraries and ffmpeg, `nix-build -A bundle` to get a single binary. From 8d5f850a431f676e88692f308c142786e2e84d5f Mon Sep 17 00:00:00 2001 From: Emanuel Acosta Date: Sun, 4 Apr 2021 23:05:15 -0400 Subject: [PATCH 3/8] last fix up before pull --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ba6b282..e892027 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,10 @@ It works on Ubuntu 16.04 and Windows 10. (It might work on other OSs too, we jus This program relies heavily on ffmpeg. It will start subprocesses that call ffmpeg, so be aware of that! -As the program runs, it saves every frame of the video as an image file in a +**⚠ As the program runs, it saves every frame of the video as an image file in a temporary folder. If your video is long, this could take a LOT of space. -I have processed 17-minute videos completely fine, but be wary if you're gonna go longer. +I have processed 17-minute videos completely fine, but be wary if you're gonna go longer.** + I wanted to use pyinstaller to turn this into an executable, so non-techy people can use it EVEN IF they don't have Python and all those libraries. Jabrils From dca521980f93453f75ca50e67f219e4eba5df952 Mon Sep 17 00:00:00 2001 From: Emanuel Acosta Date: Sun, 4 Apr 2021 23:12:09 -0400 Subject: [PATCH 4/8] Fixing my grammar --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e892027..5c39f5d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ temporary folder. If your video is long, this could take a LOT of space. I have processed 17-minute videos completely fine, but be wary if you're gonna go longer.** -I wanted to use pyinstaller to turn this into an executable, so non-techy people +I wanted to use pyi nstaller to turn this into an executable, so non-techy people can use it EVEN IF they don't have Python and all those libraries. Jabrils recommended this to me. However, my pyinstaller build did not work. :( HELP @@ -31,8 +31,7 @@ Do `pip install scipy, numpy, pillow, audiotsm, pytube` to get all the dependenc This takes the file `input_video.mp4` and gives it a jumpcut effect on silent parts then saves it as output_video.mp4 Heres a fun one `python jumpcutter.py --url https://www.youtube.com/watch?v=DQ8orIurGxw --output_file output2_video.mp4 --sounded_speed 999999 --silent_speed 1 --frame_margin 2 ` - -it takes carykh's video about this code keeps only silence in the video +it takes carykh's video about this code and keeps only the silent parts in the video **Remember that if you need help use `python jumpcutter.py -h` it shows a more information about what each argument does.** From dfb810bf3093fa1a9df8454f2cb00e7b2eb8ba96 Mon Sep 17 00:00:00 2001 From: Emanuel Acosta Date: Sun, 4 Apr 2021 23:16:29 -0400 Subject: [PATCH 5/8] Improved gitinore to avoid commits with accidentals mp4s --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ea85fab..da93a7f 100644 --- a/.gitignore +++ b/.gitignore @@ -92,4 +92,8 @@ ENV/ .idea *.iml out -gen \ No newline at end of file +gen + +#Extra Gitnore for jumpcutter +*.mp4 +.vscode From 8094e7c6159fb5bd515c4491a5c84c3a7a1c9fcb Mon Sep 17 00:00:00 2001 From: Emanuel Acosta Date: Sun, 4 Apr 2021 23:33:15 -0400 Subject: [PATCH 6/8] Added to do --- README.md | 2 +- Todo.md | 12 ++++++++++++ jumpcutter.py | 1 - 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 Todo.md diff --git a/README.md b/README.md index 5c39f5d..32bcd08 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ temporary folder. If your video is long, this could take a LOT of space. I have processed 17-minute videos completely fine, but be wary if you're gonna go longer.** -I wanted to use pyi nstaller to turn this into an executable, so non-techy people +I wanted to use pyinstaller to turn this into an executable, so non-techy people can use it EVEN IF they don't have Python and all those libraries. Jabrils recommended this to me. However, my pyinstaller build did not work. :( HELP diff --git a/Todo.md b/Todo.md new file mode 100644 index 0000000..8ff39c8 --- /dev/null +++ b/Todo.md @@ -0,0 +1,12 @@ +## To Do +- [x] make pull request for the updated ReadMe +- [ ] Make a bat file so it can run easily without opening terminal +- [ ] Make a How long it took timer. +- [ ] Make an Auto-Name scheme for Output Videos. +- [ ] make it presets compatible like Jumpcut or silence only +- [ ] Make An output folder +- [ ] Comment carykh's code + +## Future +- [ ] make an audio separator script (pretty sure FFMpeg can do this by default) +- [ ] Make it a frontend app? (php perhaps) \ No newline at end of file diff --git a/jumpcutter.py b/jumpcutter.py index 8b59e3d..1f4fbb2 100644 --- a/jumpcutter.py +++ b/jumpcutter.py @@ -11,7 +11,6 @@ import os import argparse from pytube import YouTube - def downloadFile(url): name = YouTube(url).streams.first().download() newname = name.replace(' ','_') From 0986bf4a5a07ad940e5f1d3545a3f82e257cd3d1 Mon Sep 17 00:00:00 2001 From: Emanuel Acosta Date: Mon, 5 Apr 2021 00:39:28 -0400 Subject: [PATCH 7/8] made my own upgrades with instantJumpcut --- LICENSE | 21 --------------------- LICENSE.txt | 43 +++++++++++++++++++++++++++++++++++++++++++ README.md | 2 ++ Todo.md | 7 +++---- instantjumpcut.py | 32 ++++++++++++++++++++++++++++++++ jumpcutter.py | 7 +++++-- 6 files changed, 85 insertions(+), 27 deletions(-) delete mode 100644 LICENSE create mode 100644 LICENSE.txt create mode 100644 instantjumpcut.py diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 8bd7aeb..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 carykh - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..61d1bc5 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,43 @@ +MIT License + +Copyright (c) 2020 Emanvidmaker / Emanuel Acosta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +----------------------------------------------------------------------------- +MIT License + +Copyright (c) 2019 carykh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 32bcd08..83c97c8 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ Do `pip install scipy, numpy, pillow, audiotsm, pytube` to get all the dependenc **Make sure to install [ffmpeg codex](https://ffmpeg.org/download.html)** and to put the exe on `C:\Windows` folder (you will need admin rights to do so) +## instant jumpcut + `instantjumpcut.py` is a more user friendly version. It makes so you can run it without writing the command every time. Just remember to have the url or file name in hand. ## Example command diff --git a/Todo.md b/Todo.md index 8ff39c8..18a1e70 100644 --- a/Todo.md +++ b/Todo.md @@ -1,10 +1,9 @@ ## To Do - [x] make pull request for the updated ReadMe -- [ ] Make a bat file so it can run easily without opening terminal +- [x] Make a py file so it can run easily without opening terminal - [ ] Make a How long it took timer. -- [ ] Make an Auto-Name scheme for Output Videos. -- [ ] make it presets compatible like Jumpcut or silence only -- [ ] Make An output folder +- [x] make it presets compatible like Jumpcut or silence only +- [x] Make An output folder - [ ] Comment carykh's code ## Future diff --git a/instantjumpcut.py b/instantjumpcut.py new file mode 100644 index 0000000..028f4ae --- /dev/null +++ b/instantjumpcut.py @@ -0,0 +1,32 @@ +import subprocess +loop = True +while (loop): + loop = False + mode = str(input("Pick a modes: \n\t 0) JumpCut \n\t 1) only the silence \n\t 2) Procastinator \nMode: ")) + if (mode == "0"): + mode = "--sounded_speed 1 --silent_speed 999999" + elif (mode == "1"): + mode = "--sounded_speed 999999 --silent_speed 1" + elif (mode == "2"): + mode = "--sounded_speed 2 --silent_speed 8" + else: + loop = True + + +input_file = str(input("Input: ")) + +if ((input_file[0]+input_file[1]+input_file[2]+input_file[3]).lower() == 'http'): + input_file = "--url " + input_file +else: + input_file = "--input_file " + input_file + + +hd = str(input("HD? y/n: ")) +if (hd[0].lower() == "y") or (hd[0].lower() == "0"): + hd = "1" +else: + hd = "3" + +command = "python jumpcutter.py "+ input_file +" "+ mode +" --frame_margin 2 --frame_quality "+hd + +subprocess.call(command, shell=True) \ No newline at end of file diff --git a/jumpcutter.py b/jumpcutter.py index 1f4fbb2..7d197f4 100644 --- a/jumpcutter.py +++ b/jumpcutter.py @@ -76,7 +76,10 @@ def deletePath(s): # Dangerous! Watch out! INPUT_FILE = downloadFile(args.url) else: INPUT_FILE = args.input_file -URL = args.url + + + +# URL = args.url FRAME_QUALITY = args.frame_quality assert INPUT_FILE != None , "why u put no input file, that dum" @@ -196,7 +199,7 @@ def deletePath(s): # Dangerous! Watch out! copyFrame(int(audioSampleCount/samplesPerFrame)-1,endGap) ''' -command = "ffmpeg -framerate "+str(frameRate)+" -i "+TEMP_FOLDER+"/newFrame%06d.jpg -i "+TEMP_FOLDER+"/audioNew.wav -strict -2 "+OUTPUT_FILE +command = "ffmpeg -framerate "+str(frameRate)+" -i "+TEMP_FOLDER+"/newFrame%06d.jpg -i "+TEMP_FOLDER+"/audioNew.wav -strict -2 Output/"+OUTPUT_FILE subprocess.call(command, shell=True) deletePath(TEMP_FOLDER) From 2d7806e90576f49e0f679a358a273a8675e23eb2 Mon Sep 17 00:00:00 2001 From: Emanuel Acosta Date: Mon, 5 Apr 2021 00:40:02 -0400 Subject: [PATCH 8/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 83c97c8..e356875 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Do `pip install scipy, numpy, pillow, audiotsm, pytube` to get all the dependenc **Make sure to install [ffmpeg codex](https://ffmpeg.org/download.html)** and to put the exe on `C:\Windows` folder (you will need admin rights to do so) ## instant jumpcut - `instantjumpcut.py` is a more user friendly version. It makes so you can run it without writing the command every time. Just remember to have the url or file name in hand. + `instantjumpcut.py` is a more user friendly version. It makes so you can run it without writing the command every time, just run it. Just remember to have the url or file name in hand. ## Example command