Coder Social home page Coder Social logo

Comments (6)

mohannad57 avatar mohannad57 commented on August 22, 2024

I'm not sure about the inconsistency but I know that on version 0.4 this was changed but the documentations are still.

"•specifying -o OUTPUT_FILE.mkv will now automatically split the input video, generating a new video clip for each detected scene in sequence, starting with OUTPUT_FILE-001.mkv
•CSV file output is now specified with the -co / --csv-output option (note, used to be -o in versions of PySceneDetect < 0.4)"
source: https://github.com/Breakthrough/PySceneDetect/releases

from pyscenedetect.

alegaballo avatar alegaballo commented on August 22, 2024

Oh okay, I didn't notice that, thank you. Now the .csv file is correct but still the number of scenes if I try to use -o scene.mkv is different

from pyscenedetect.

mohannad57 avatar mohannad57 commented on August 22, 2024

That part works for me just fine. so I will leave it for the experts as I'm very new to all this. :) sorry

from pyscenedetect.

Breakthrough avatar Breakthrough commented on August 22, 2024

Hmm interesting... Using the new command-line options (-o for the video output, -co for the CSV output), could you provide the full output you get now? Of the scenes that are written to disk, are they cut at the appropriate place (near where the timecode in the CSV output is)?

from pyscenedetect.

alegaballo avatar alegaballo commented on August 22, 2024

Sorry for being this late, I was quite busy. Try with this video with the default configuration:
scenedetect -i video.mp4 -c scenes.csv -o out.mp4
the number of scenes is correct but their duration is different from the one described in the csv

from pyscenedetect.

Breakthrough avatar Breakthrough commented on August 22, 2024

Hello all;

This has been fixed in the most recent version of PySceneDetect (v0.5-beta). The stable v0.5 release should be out sometime this month.

The issue is that when just splitting videos without re-encoding, they can only be split in certain cases on keyframe boundaries. This also means that sometimes, when several scenes are very small and close together, they may be concatenated together, or not generated properly.

To fix this, I have integrated PySceneDetect v0.5 with ffmpeg to allow re-encoding the output video. To accomplish this in v0.5, you would use the split-video command with the -p/--precise option:

scenedetect -i input_video.mp4 -o output_dir detect-content split-video -p

By default, split-video will use ffmpeg in stream copy mode, similar to how mkvmerge works (e.g. how PySceneDetect v0.4 output scenes). If ffmpeg is not available, PySceneDetect will then attempt to use mkvmerge if possible; you can force the use of mkvmerge using the -m/--mkvmerge option with the split-video command.

Note that you can also save thumbnail images now via the save-images command.

scenedetect -i input_video.mp4 -o output_dir detect-content split-video -p save-images

I have just tested this on v0.5, and indeed, some output files were unreadable without either the -p (precise/re-encode) or -m (use mkvmerge) flags. Obviously using the -p flag is much slower than just copying the streams, but it is significantly more accurate in terms of where the output cuts are placed. You can also override the codec options, e.g.:

scenedetect -i input_video.mp4 -o output_dir detect-content split-video -f "-c:v libx264 -c:a aac"

Feel free to test the v0.5-beta if you have a chance and provide some feedback. If you find any issues in the new version using the -p flag, by all means, please bring it to my attention by opening a new issue.

Thank you for reporting this, and the feedback you both (@alegaballo @mohannad57) provided; feel free to share your thoughts on the new command line interface in the v0.5-beta as well.

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.