Giter VIP home page Giter VIP logo

jumpcutter's People

Contributors

carykh avatar deflatedpickle avatar qixils avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jumpcutter's Issues

ImportError: No module named audiotsm

I tried jumpcutter.py but I got this:
$ python jumpcutter.py -h Traceback (most recent call last): File "jumpcutter.py", line 4, in <module> from audiotsmv import phasevocoder ImportError: No module named audiotsm
I swear I installed audiotsm, and it should have been fine (pip install audiotsm) so why can't Python find it? I'm kind of a noob to Python. Some help, please?

[Error]Memory Error

image
Jumpcutting a 2 hour long video having MemoryError, maybe we can process a long video file in 2 parts.

Permission denied: 'TEMP/tempStart.wav'

Traceback (most recent call last):
  File "jumpcutter.py", line 158, in <module>
    wavfile.write(sFile,SAMPLE_RATE,audioChunk)
  File "C:\Users\Patrick Mitchell\AppData\Local\Programs\Python\Python36-32\lib\site-packages\scipy\io\wavfile.py", line 328, in write
    fid = open(filename, 'wb')
PermissionError: [Errno 13] Permission denied: 'TEMP/tempStart.wav'

No clear install instructions

I'm looking to use this tool to help speed up simple let's plays videos that normally take a long time to edit when all I'm doing is removing silent periods. I would love to use this tool but I am having a hard time getting it to work. Please in the read me file (or another clearly marked file) can you leave install instructions on how to set this up
Thanks :D

p.s: I'm on Windows 10 if anyone can help me figure out what I need to do :)

Audio issues when sounded_speed is increased from default

Sample video - https://www.youtube.com/watch?v=vDXkpJw16os&t=172s

When changing speed on using the YouTube builtin tool to 1.25x their is very little change in the pitch of the audio, it sounds the same only faster.

When changing --sounded_speed to 1.25, their is a very noticeable change in the pitch of the audio on my system. The output video sounds deeper and slightly muffled compared to the original and the original speed up with youtubes speed tool.

When audio is speed up it normally has a higher pitch, for this reason I think the program is over correcting.

Is any one else having this issue with audio?

Modifiers not working

Hey,

I jus downloaded it, so i can edit out silence from my videos. Everything is up to date, as i downloaded Python and all modules just a few hours ago onto my laptop.

the program runs fine in total and does what it should, but when i add modifiers like "-- frame_rate 50", since it seems to have trouble detecting the framerate correctly, i get a error message close to the end stating

Unrecognized option '-frame_rate'. Error splitting the argument list: Option not found

causing the program to shut down. it also happens if i try to use the speed modifiers. haven't tried the others yet

error with audiotsm

Traceback (most recent call last):
File "jumpcutter.py", line 162, in
tsm.run(reader, writer)
File "/Library/Python/2.7/site-packages/audiotsm/base/tsm.py", line 76, in run
_, finished = self.write_to(writer)
File "/Library/Python/2.7/site-packages/audiotsm/base/analysis_synthesis.py", line 240, in write_to
n = self._out_buffer.write_to(writer)
File "/Library/Python/2.7/site-packages/audiotsm/utils/cbuffer.py", line 344, in write_to
n = writer.write(self._data[:, start:end])
File "/Library/Python/2.7/site-packages/audiotsm/io/wav.py", line 128, in write
frames = (buffer.T.reshape((-1,)) * 32676).astype(np.int16).tobytes()
AttributeError: 'numpy.ndarray' object has no attribute 'tobytes'

ffmpeg problem

I keep getting this as an error, "'ffmpeg' is not recognized as an internal or external command,
operable program or batch file.", I am on Windows 10 also I get the error, "FileNotFoundError: [Errno 2] No such file or directory: 'TEMP/audio.wav'"

could I get some insight into this please?

struct.error: 'L' format requires 0 <= number <= 4294967295

Whenever i try to use this, first of all it takes way longer than expected for the silent and sounded speeding up part, after that this stack trace happens

`Traceback (most recent call last):
File "jumpcutter.py", line 162, in
tsm.run(reader, writer)
File "/home/adam/anaconda3/lib/python3.7/site-packages/audiotsm/base/tsm.py", line 76, in run
_, finished = self.write_to(writer)
File "/home/adam/anaconda3/lib/python3.7/site-packages/audiotsm/base/analysis_synthesis.py", line 240, in write_to
n = self._out_buffer.write_to(writer)
File "/home/adam/anaconda3/lib/python3.7/site-packages/audiotsm/utils/cbuffer.py", line 344, in write_to
n = writer.write(self._data[:, start:end])
File "/home/adam/anaconda3/lib/python3.7/site-packages/audiotsm/io/wav.py", line 129, in write
self._writer.writeframes(frames)
File "/home/adam/anaconda3/lib/python3.7/wave.py", line 440, in writeframes
self._patchheader()
File "/home/adam/anaconda3/lib/python3.7/wave.py", line 497, in _patchheader
self._file.write(struct.pack('<L', 36 + self._datawritten))
struct.error: 'L' format requires 0 <= number <= 4294967295

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "jumpcutter.py", line 162, in
tsm.run(reader, writer)
File "/home/adam/anaconda3/lib/python3.7/site-packages/audiotsm/io/wav.py", line 138, in exit
self.close()
File "/home/adam/anaconda3/lib/python3.7/site-packages/audiotsm/io/wav.py", line 118, in close
self._writer.close()
File "/home/adam/anaconda3/lib/python3.7/wave.py", line 447, in close
self._patchheader()
File "/home/adam/anaconda3/lib/python3.7/wave.py", line 497, in _patchheader
self._file.write(struct.pack('<L', 36 + self._datawritten))
struct.error: 'L' format requires 0 <= number <= 4294967295`

Jumpcutter can't handle inputs with spaces

./jump --input_file filename\ with\ spaces will try to load from filename

Definitely seems like a problem in argparse, but there might be an easy way to make it still work.

Obviously there is an easy workaround of naming a file without spaces, but it would be nice to allow it.

Suggestion: Use tempfile

Right now, the program creates it's own directory, and hopes that one with the same name doesn't exist. This is fine, however python's built-in tempfile module can create platform specific temporary directories. This is not a urgent problem, but is something that would be great to change when refactoring.

[Feature] Audio only input

Could it be possible to have an option to enable the program to process an audio file without generating the video and all?
Feeding it an audio file now generates an error.

Standardise CLI arguments to follow the UNIX/Linux formatting rules

Note: Compatibility may be broken with some of the changes listed below. You may want to keep the old arguments as well as the newly changed ones.

As commented on YouTube by me (link):

Why don't you allow -1 or better yet 0 for jumpcutting in the CLI arguments, could look a bit cleaner for value inputting! And I think using dashes instead of underscores in '--' arguments (for example --frame_rate should be --frame-rate or even --framerate (as framerate is quite a common word)) as that's like a standard in UNIX/Linux lol๏ปฟ

Suggestions (correct me on anything if I'm wrong ๐Ÿ˜‚):

  • For instant jumpcutting of video parts the value 0 should be used instead of 999999, it'll save someone from having to type 999999 all of the time and looks a bit nicer.
  • Dashes/hyphens (-) instead of underscores (_) should be used in the longer command line arguments where there is more than one word, such as --frame_rate would become --frame-rate โ”€ AFAIK I think this is a standard as I've seen it with a few CLI commands before, and it also makes it easier to type again as you don't have to press the Shift key midway through a lowercase sentence.
  • One little thing: Personally I think the phrase 'frame rate' should be 'framerate' but that's for you to decide ๐Ÿ˜‰

Other than that, it's a brilliant piece of software Cary! Thanks for sharing it with us.

Suggestion: add frameFormat option

Hey, I'm the author of ffmpeg-concat and ffmpeg-gl-transition which may be useful to make jumpcutter a little less "jumpy".

ffmpeg-concat takes a similar approach in terms of breaking up the input video(s) into their individual frames and storing them in a temp directory to work on them. One lesson I learned is it can be very useful to support a frameFormat option that allows the user to tradeoff between processing speed (raw format) versus temp disk usage (png or jpg formats).

Hope this helps & thanks for your awesome work!

Trying to add a NoneType

I'm not the best at python but by the looks of it inputFrame is Nothing/NoneType and that is causing an error. Using Python 3.7
Command: jumpcutter.py --input_file Mii.mp4 --output_file MiiBut.mp4 --sounded_speed 1 --silent_speed 999999 --frame_margin 0

Traceback (most recent call last): File "C:\Users\olive\Documents\Github\jumpcutter\jumpcutter.py", line 188, in <module> copyFrame(lastExistingFrame,outputFrame) File "C:\Users\olive\Documents\Github\jumpcutter\jumpcutter.py", line 27, in copyFrame src = TEMP_FOLDER+"/frame{:06d}".format(inputFrame+1)+".jpg" TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

How to run on Mac

Does anyone know how to run this on terminal on Mac?

Also, how do I install Pillow, audiotsm, scipy, numpy and pytube?

What is the nix-build and how do I use it?

Is it totally necesary to copy each frame?

When working with big files (about two hour long videos) the time-altered frame saving takes a very long while, and I was wondering if it wasn't possible to calculate which frames will disappear and just delete the frames you won't need and use the ones remaining as input for ffmeg. Am I mising something?

Remove shell=True from subprocess calls

See #23 #41.

I understand that my cleanup in #41 is massive and it can't be merged currently, so I suggest a part of that gets implemented -

subprocess.call(["ffmpeg", "-i", TEMP_FOLDER+"/input.mp4"], stderr=STDOUT, stdout=f)
subprocess.call(["ffmpeg", "-i", inputFile, "-qscale:v", str(FRAME_QUALITY), TEMP_FOLDER + "/frame%06d.jpg", "-hide-banner"])
subprocess.call(["ffmpeg", "-i", inputFile, "-ab", "160k", "-ac", 2, "-ar", str(sampleRate), "-vn", TEMP_FOLDER+"/audio.wav"])
subprocess.call(["ffmpeg", "-framerate", str(frameRate), "-i", TEMP_FOLDER+"/newFrame%06d.jpg", "-i", TEMP_FOLDER+"/audioNew.wav", "-strict", "-2", OUTPUT_FILE])
in particular.
This resolves #23 and removes all sorts of potential vulnerabilities.

Workflow for multiple audio channels

Hey,
I have the issue where I can't find the correct variables in the scripts according to which audio channel the "jumpcutter" should trim the video.
That would be rather important feature when it comes to recording anything that has better audio set-up.

Add audio only output

I see, we must have an option to enable audio mp3 file only generating with -x key, like in youtube-dl

[Bug] TEMP/input.mp4: No such file or directory

Problem:

The Input file location is incorrect in this line of code:

command = "ffmpeg -i "+TEMP_FOLDER+"/input.mp4 2>&1"

it must be instead as:

command = "ffmpeg -i " + INPUT_FILE + " 2>&1"

Since Input file location is User-Defined and certainly not the TEMP Folder. Also, this bug is causing the wrong output of params.txt which is resulting in overall m = None at every line in these lines of code:

for line in params:
    m = re.search('Stream #.*Video.* ([0-9]*) fps',line)
    if m is not None:
        frameRate = float(m.group(1))
        print(frameRate)

I've pushed related PR #29 with some optimizations and fixed this Bug by implementing Auto FrameRateDetection function. Thankyou

ModuleNotFoundError: No module named 'PIL' (totally new to python)

I installed Python 2.5.3, 3.4.1 and the newest Python, and ffmpeg is working, and pip seems to work. When I run pip list it shows Pillow (2.5.3) exists. I have the jumpcutter-master folder in my downloads folder (does it have to be in a specific location?) I drag jumpcutter.py into cmd and run it, and I get this:

C:\Users\pitot>C:\Users\pitot\Downloads\jumpcutter-master\jumpcutter-master\jumpcutter.py
Traceback (most recent call last):
  File "C:\Users\pitot\Downloads\jumpcutter-master\jumpcutter-master\jumpcutter.py", line 2, in <module>
    from PIL import Image
ModuleNotFoundError: No module named 'PIL'

I'm totally new to Python and the only coding experience I have is one semester of Java, so I barely understand anything I've read on the internet about this issue. Can you guys dumb it down a little for me? Do I have to add more things to the "PATH" variable or something? Do I need a special python terminal or is cmd prompt ok?

Actually, your script is written in Python 3

I just checked the script.
You're using print as a function, and using range() to iterate over numbers, so looks like python 3 to me.
You should probably just remove the disclaimer in your readme and everyone is going to be fine.

Start making stable releases

I'm making a AUR (Arch Linux) package for this and it'd be nice to have a stable release for obvious reasons.

P.S: GitHub has a release system in the Code tab.

Works on MacOS Mohave

The program is confirmed to work on MacOS Mohave.
Videos.zip
Terminal Output:
MyName-MacBook-Air:jumpcutter vlad$ python3 jumpcutter.py --input_file woooooww.mp4 --output_file wowalt.mp4 --silent_threshold 0.04 --sounded_speed 2 --silent_speed 8 --frame_margin 2
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'woooooww.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2017-10-24T08:30:59.000000Z
Duration: 00:00:17.18, start: 0.000000, bitrate: 667 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m), 1280x720 [SAR 1:1 DAR 16:9], 537 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc (default)
Metadata:
creation_time : 2017-10-24T08:30:59.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 10/24/2017.
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
creation_time : 2017-10-24T08:30:59.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 10/24/2017.
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x7fdabf864c00] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'TEMP/frame%06d.jpg':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
encoder : Lavf58.20.100
Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default)
Metadata:
creation_time : 2017-10-24T08:30:59.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 10/24/2017.
encoder : Lavc58.35.100 mjpeg
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 515 fps= 41 q=3.0 Lsize=N/A time=00:00:17.16 bitrate=N/A speed=1.36x
video:23904kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1_6 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'woooooww.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2017-10-24T08:30:59.000000Z
Duration: 00:00:17.18, start: 0.000000, bitrate: 667 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m), 1280x720 [SAR 1:1 DAR 16:9], 537 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc (default)
Metadata:
creation_time : 2017-10-24T08:30:59.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 10/24/2017.
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
creation_time : 2017-10-24T08:30:59.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 10/24/2017.
Stream mapping:
Stream #0:1 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to 'TEMP/audio.wav':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
ISFT : Lavf58.20.100
Stream #0:0(und): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s (default)
Metadata:
creation_time : 2017-10-24T08:30:59.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 10/24/2017.
encoder : Lavc58.35.100 pcm_s16le
size= 2960kB time=00:00:17.18 bitrate=1411.2kbits/s speed= 344x
video:0kB audio:2960kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.002573%
20 time-altered frames saved.
40 time-altered frames saved.
60 time-altered frames saved.
80 time-altered frames saved.
100 time-altered frames saved.
120 time-altered frames saved.
140 time-altered frames saved.
160 time-altered frames saved.
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1_6 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Input #0, image2, from 'TEMP/newFrame%06d.jpg':
Duration: 00:00:05.60, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 30 tbn, 30 tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, wav, from 'TEMP/audioNew.wav':
Duration: 00:00:05.60, bitrate: 5644 kb/s
Stream #1:0: Audio: pcm_f64le ([3][0][0][0] / 0x0003), 44100 Hz, stereo, dbl, 5644 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Stream #1:0 -> #0:1 (pcm_f64le (native) -> aac (native))
Press [q] to stop, [?] for help
[image2 @ 0x7fdf77000000] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
[libx264 @ 0x7fdf7886fa00] using SAR=1/1
[libx264 @ 0x7fdf7886fa00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fdf7886fa00] profile High, level 3.1
[libx264 @ 0x7fdf7886fa00] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'wowalt.mp4':
Metadata:
encoder : Lavf58.20.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuvj420p(pc, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc
Metadata:
encoder : Lavc58.35.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
Metadata:
encoder : Lavc58.35.100 aac
frame= 47 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= frame= 60 fps= 51 q=29.0 size= 0kB time=00:00:00.23 bitrate= 1.6kbits/frame= 74 fps= 44 q=29.0 size= 0kB time=00:00:00.70 bitrate= 0.5kbits/frame= 88 fps= 39 q=29.0 size= 256kB time=00:00:01.16 bitrate=1797.8kbits/frame= 104 fps= 37 q=29.0 size= 256kB time=00:00:01.70 bitrate=1233.8kbits/frame= 120 fps= 36 q=29.0 size= 512kB time=00:00:02.23 bitrate=1878.2kbits/frame= 136 fps= 35 q=29.0 size= 512kB time=00:00:02.76 bitrate=1516.1kbits/frame= 152 fps= 34 q=29.0 size= 768kB time=00:00:03.30 bitrate=1906.6kbits/frame= 168 fps= 33 q=29.0 size= 768kB time=00:00:03.83 bitrate=1641.3kbits/frame= 168 fps= 27 q=-1.0 Lsize= 1267kB time=00:00:05.59 bitrate=1855.3kbits/s speed=0.893x
video:1171kB audio:89kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.577291%
[libx264 @ 0x7fdf7886fa00] frame I:1 Avg QP:22.73 size: 21485
[libx264 @ 0x7fdf7886fa00] frame P:42 Avg QP:22.18 size: 15518
[libx264 @ 0x7fdf7886fa00] frame B:125 Avg QP:24.42 size: 4200
[libx264 @ 0x7fdf7886fa00] consecutive B-frames: 0.6% 0.0% 1.8% 97.6%
[libx264 @ 0x7fdf7886fa00] mb I I16..4: 29.6% 65.4% 5.0%
[libx264 @ 0x7fdf7886fa00] mb P I16..4: 8.2% 34.0% 0.3% P16..4: 28.3% 10.0% 3.6% 0.0% 0.0% skip:15.6%
[libx264 @ 0x7fdf7886fa00] mb B I16..4: 1.4% 4.2% 0.0% B16..8: 39.6% 4.4% 0.3% direct: 1.1% skip:49.0% L0:50.2% L1:46.5% BI: 3.3%
[libx264 @ 0x7fdf7886fa00] 8x8 transform intra:78.0% inter:90.3%
[libx264 @ 0x7fdf7886fa00] coded y,uvDC,uvAC intra: 39.4% 48.4% 2.9% inter: 7.5% 11.7% 0.1%
[libx264 @ 0x7fdf7886fa00] i16 v,h,dc,p: 40% 28% 13% 19%
[libx264 @ 0x7fdf7886fa00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 25% 34% 1% 1% 2% 1% 1% 1%
[libx264 @ 0x7fdf7886fa00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 28% 11% 3% 6% 7% 5% 3% 4%
[libx264 @ 0x7fdf7886fa00] i8c dc,h,v,p: 45% 23% 28% 4%
[libx264 @ 0x7fdf7886fa00] Weighted P-Frames: Y:11.9% UV:4.8%
[libx264 @ 0x7fdf7886fa00] ref P L0: 57.1% 13.0% 21.3% 7.8% 0.7%
[libx264 @ 0x7fdf7886fa00] ref B L0: 83.7% 13.1% 3.2%
[libx264 @ 0x7fdf7886fa00] ref B L1: 93.8% 6.2%
[libx264 @ 0x7fdf7886fa00] kb/s:1711.72
[aac @ 0x7fdf77206a00] Qavg: 140.668

Update README

The script is written in python 3, not python 2.
And it works fine on windows 10!.

Error when processing video

Hi. Can anyone help explain these errors to me? I already installed everything and got ffmpeg working (the temp folder was created and the individual frame jpegs are in the folder) but near the end there are these errors:

Traceback (most recent call last):
File "jumpcutter.py", line 162, in
tsm.run(reader, writer)
File "/Library/Python/2.7/site-packages/audiotsm/base/tsm.py", line 76, in run
_, finished = self.write_to(writer)
File "/Library/Python/2.7/site-packages/audiotsm/base/analysis_synthesis.py", line 240, in write_to
n = self._out_buffer.write_to(writer)
File "/Library/Python/2.7/site-packages/audiotsm/utils/cbuffer.py", line 344, in write_to
n = writer.write(self._data[:, start:end])
File "/Library/Python/2.7/site-packages/audiotsm/io/wav.py", line 128, in write
frames = (buffer.T.reshape((-1,)) * 32676).astype(np.int16).tobytes()
AttributeError: 'numpy.ndarray' object has no attribute 'tobytes'

[Suggestion] please do this changes in the code

1- import tempfile then use TEMP_FOLDER = tempfile.mkdtemp() to create a new temp directory and shutil.rmtree(TEMP_FOLDER) to delete it

2- add --input_dir to and import glob to do this for an entire folder of mp4 files

3- add --replace which if set to True replace output with input file

i will do this if i find some free time.

Integration in a server

I started working on a web interface to use the script to make very simple the use of it. So to convert a youtube video it's enough to copy the link and write in the browser localhost:port?url=...&silentSpeed=...&soundSpeed=... and the edited video will play in the browser. Someone is interested in this implementation?

Here's how to do hand gesture recognition:

Make a deep learning model to detect hand
Take pictures of thumbs up and thumbs down hands
Make sure they are square
Train new deep learning model on this data
???
Profit

Syntax Error and No such file or directory: 'TEMP/audio.wav'

Hello, when I run the code I have these error messages pop up:

/bin/sh: -c: line 0: syntax error near unexpected token (' /bin/sh: -c: line 0: ffmpeg -i video.MOV -qscale:v 3 TEMP/frame%06d.jpg -hide_banner'
/bin/sh: -c: line 0: syntax error near unexpected token (' /bin/sh: -c: line 0: ffmpeg -i video.MOV -ab 160k -ac 2 -ar 44100 -vn TEMP/audio.wav'
Traceback (most recent call last):
File "jumpcutter.py", line 108, in
sampleRate, audioData = wavfile.read(TEMP_FOLDER+"/audio.wav")
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/scipy/io/wavfile.py", line 151, in read
fid = open(filename, 'rb')
IOError: [Errno 2] No such file or directory: 'TEMP/audio.wav'

(Suggestion) Delete downloaded input file.

I was testing it out with a downloaded youtube video and I found it really annoying having to delete the videos it generated. It would be nice to delete the downloaded input file from the downloaded yt video.

Increase speed by parallel execution

We can speed up the process if we do all three steps at the same time - first ffmpeg process creates sound and images (sound should be in some sort of streaming container), python stuff does it's job frame by frame and feeds those frames to the second ffmpeg. This shouldn't be too hard to implement with pipes.

[Bug] Wrong video framerate

It changed my 60fps video to 30fps and made the output completely desynchronized. It could be fixed by ffprobing the video. Or at least add info to readme that you have to use --frame-rate

Need help for win10

Am i dumb? I seriously cant figure out how to make it work on windows 10. command prompt keeps saying python isnt a command. (I'm typing 'python jumpcutter.py -h')

[Error] No such file or directory: 'TEMP/audio.wav'

Was playing with this but getting an error every time:

/bin/sh: ffmpeg: command not found
/bin/sh: ffmpeg: command not found
Traceback (most recent call last):
  File "jumpcutter.py", line 93, in <module>
    sampleRate, audioData = wavfile.read(TEMP_FOLDER+"/audio.wav")
  File "/usr/local/lib/python3.7/site-packages/scipy/io/wavfile.py", line 233, in read
    fid = open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'TEMP/audio.wav'

The TEMP folder is created but left there. Any idea what could be wrong?

Running it in Mac OS 10.14, with all the libraries installed. Tried python 2 and 3, no changes. My file is a .MOV captured from an iPhone.

Spaces in the output name

Hello

I am having a few issues with adding spaces to the output name
I set it up where i have 2 folders, one called Vids and one called CompletedVids.
Vids are where the unedited files go, CompletedVids are where the edited files go.
This tankfully works, however, i am having trouble adding spaces to the output name
the command i am using is (windows):
py jumpcutter.py --input_file Vids\SiriQuadratic.mp4 --output_file CompletedVids\SiriQuadratic but im nervous for some reason.mp4 --sounded_speed 3 --silent_speed 0.5 --frame_margin 1
But when i run the command, i get the error:
[NULL @ 000002dda0f8bd00] Unable to find a suitable output format for 'CompletedVids\SiriQuadratic' CompletedVids\SiriQuadratic: Invalid argument

I have tried putting the file path in quotes and tried using a backslash

Any help with this?
Thanks in advance
-Birb

No file directory

I am getting an error when I try to input the video I want to plug into program.
the location of the video I am trying to plug in is where the program is and is in mp4 format. why would I be getting this error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.