Coder Social home page Coder Social logo

Splitting Clips about pyscenedetect HOT 6 CLOSED

breakthrough avatar breakthrough commented on August 22, 2024
Splitting Clips

from pyscenedetect.

Comments (6)

Breakthrough avatar Breakthrough commented on August 22, 2024 1

Hey @rhefner1;

One last update for you, I managed to integrate calling mkvmerge into the latest version of PySceneDetect (v0.4), so now when the -o option is specified, the input video will be split into individual scenes (albeit as .mkv format).

from pyscenedetect.

Breakthrough avatar Breakthrough commented on August 22, 2024

Hi @rhefner1;

I've been meaning to add this to PySceneDetect for a while, but the OpenCV video encoding options are rather limited (only letting you select a codec, and nothing else, not even bitrate).

One quick tool you can use for this is mkvmerge (or mkvtoolnix-gui), and copy/paste the comma-separated timecodes into the file splitting section. This doesn't reencode the video, just re-muxes it. The section of the mkvmerge docs is here that covers using the --split flag:

mkvmerge -o output_scene.mkv --split timecodes:00:45:00.000,01:20:00.250,[...] input_file.avi

For ffmpeg, there's command line flags to set the start/end/duration of the input, copying the video container. This should achieve the same results as using mkvtoolnix, although I think you would have to make a call to ffmpeg for each scene you wanted to extract from the input file.

I'll look into adding support for integrated clip splitting by calling mkvmerge/ffmpeg directly from PySceneDetect, and I'll also work on a short tutorial/guide on splitting a video via timecodes to that page you pointed out.

Thanks for the comment & feedback, let me know what method you find works the best.

from pyscenedetect.

rhefner1 avatar rhefner1 commented on August 22, 2024

@Breakthrough: I just did a test with both mkvmerge with the command you provided and mkvtoolnix-gui and both worked perfectly!

I'm splitting up some home movies and a few years ago had tried doing it manually but gave up. All I have to do here is write a little Bash script and it's done. Thanks for the help and the great tool!

from pyscenedetect.

Breakthrough avatar Breakthrough commented on August 22, 2024

@rhefner1 glad you're finding it useful, that reminds me I have some older home video footage I need to apply this to myself.

Thanks again for your feedback, I've updated that particular section of the documentation (if you think this should be mentioned anywhere else, feel free to let me know).

from pyscenedetect.

rhefner1 avatar rhefner1 commented on August 22, 2024

👍 thanks!

from pyscenedetect.

rhefner1 avatar rhefner1 commented on August 22, 2024

@Breakthrough that's fantastic. Thanks for your work!

from pyscenedetect.

Related Issues (20)

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.