GithubHelp home page GithubHelp logo

kenjitakahashi / mpdecimate_trim Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 3.0 16 KB

trim video clips based on mpdecimate output, keep audio synced

License: MIT License

Python 100.00%
trim video-clips ffmpeg-wrapper vaapi va-api videotoolbox

mpdecimate_trim's Issues

Can mpdecimate_trim create smaller sized videos that are the same length of time as the original video in order to retain all of the original audio?

I presume the following is far beyond the scope of this project, but I figured I'd ask just in case I am wrong.

Script to trim similar/duplicate fragments from video clips. While keeping audio in sync.

Does that mean only the audio associated with portions of the video that are not trimmed will be included in the video clips which mpdecimate_trim creates?

I intend to use OBS on Linux to create screencasts of my coding sessions which I will narrate. In other words, I intend to talk while I code. As a result, when I review my coding sessions I will be able to quickly be reminded that, for example, "Oh, yeah, that's what I was thinking when I wrote that line of code."

I presume that sometimes I will stop coding, yet continue narrating. Normally, in such cases, nothing would change on my monitor because I would neither be using my keyboard nor my mouse. Would mpdecimate_trim delete my narration (the audio) associated with the frames it had “mpdecimated”?

I don't want to lose any of my narration.

Is there a way to decrease the file size of my screencasts—say, by using mpdecimate_trim—yet not actually decrease the length of time of my screencasts so that all of my narration (the audio) would be synched up with the video, which would be precisely the same length as it was before mpdecimate_trim was used?

I know next to nothing about video files, but I assume my feature request would require the video player to be able to pause the video portion of a file—yet continue the audio portion of a file—at those points where mpdecimate_trim had removed duplicate video frames.

In other words, if a sequence of frames were frame A, frame B, frame C, and frame D and if all four frames were identical, and if mpdecimate_trim had removed frame B, frame C, and frame D, then I assume the video player would need to pause frame A so that sequence of frames consisting of frame A, frame B, frame C, and frame D would be replaced by sequence of frames consisting of frame A played for the first frame and then paused for the second, third, and fourth frames, yet play the audio that had been associated with frame B, frame C, and frame D.

My hunch is that this is not a feature which normal video players support. I use MPlayer which, as you might know, has a remarkable number of features. But I kind of doubt even “Mighty MPlayer” has that sort of ability.

A small issue with writing mpdecimate_filter into TEMP folder (I think)

That's the error I'm getting after calling python .\mpdecimate_trim.py --debug .\2021-04.mp4 :)

2023-11-18 20:56:23[I] Standard output capture: w:\Temp\mpdecimate_trim.tfljivxj\decimate.stdout.log
2023-11-18 20:56:23[I] Standard error capture: w:\Temp\mpdecimate_trim.tfljivxj\decimate.stderr.log
2023-11-18 20:56:24[I] The decimate phase took 00:00:01
2023-11-18 20:56:24[I] The filter creation phase is starting
2023-11-18 20:56:24[I] Filter definition: w:\Temp\mpdecimate_trim.tfljivxj\mpdecimate_filter
Traceback (most recent call last):
  File "X:\Videos\decim\mpdecimate_trim.py", line 199, in <module>
    write_filter()
  File "X:\Videos\decim\mpdecimate_trim.py", line 47, in a
    r = f(*args, **kwargs)
  File "X:\Videos\decim\mpdecimate_trim.py", line 181, in write_filter
    frames_to_keep, has_audio = get_frames_to_keep(mpdecimate_fn)
  File "X:\Videos\decim\mpdecimate_trim.py", line 151, in get_frames_to_keep
    for line in mpdecimate:
  File "C:\Users\Mik\AppData\Local\Programs\Python\Python310\lib\encodings\cp1250.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x88 in position 4249: character maps to <undefined>

Of course, I'm not launching Python with admin right (Windows 10 22H2).

filter_complex_script invalid argument

Error opening file C:\Users\EZOGAM~1\AppData\Local\Temp\mpdecimate_trim.tkcnog8i. Failed to set value 'C:\Users\EZOGAM~1\AppData\Local\Temp\mpdecimate_trim.tkcnog8i' for option 'filter_complex_script': Invalid argument Error parsing global options: Invalid argument

Script calling for a nonexistent file in my temp folder?

Basically, when attempting to use this script I get this error:
Error opening file C:\Users\DownT\AppData\Local\Temp\mpdecimate_trim.qevny2ob.
Failed to set value 'C:\Users\DownT\AppData\Local\Temp\mpdecimate_trim.qevny2ob' for option 'filter_complex_script': Invalid argument
Error parsing global options: Invalid argument

Any idea how to fix this? Thank you.

About "mpdecimate_trim.py: error: the following arguments are required: filepath" message

Hi!
It's not an issue, but I'd like to ask, what does the script "understand" as a ? I've tried almost every type of path (with Windows python.exe), or the video filename itself, but the script demands "mpdecimate_trim.py: error: the following arguments are required: filepath".
Is Python fundamentally different with paths and filenames even from Linux? I realize it's a noob-like question from someone, who never touched Python before... :)

Thank you in advance for any response. :)

obraz

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.