VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Hi guys,

    I am a newbie for using Python. Pyscenedetect shows an error "Video file not found". Images are attached bellow. I do not know how to fix it. Please help.

    I installed their installer having scenedetect and ffmpeg and/or mkvmerge.
    I also tried to find the folder -i or --input. Even making one. But it does not work.
    Image
    [Attachment 65693 - Click to enlarge]


    I also installed
    pip install --upgrade scenedetect[opencv]
    pip install --upgrade scenedetect[opencv-headless]
    pip install opencv-python
    pip install numpy
    pip install Click
    pip install tqdm
    pip install appdirs
    pip install av
    Image
    [Attachment 65694 - Click to enlarge]


    Please helping me. Thank you in advance.

    After doing some researches, I found that Pyscenedetect is the best one for detect scenes in a footage. I have been recording news footage for studying how to shot and to choose locations for good composition and background. Watching 5-hour is a little tired and is motivation killer for me. As a result, I think just by viewing the keyframes, I can improve my skills faster.
    Quote Quote  
  2. One more thing, there is a youtuber made a bat file for detecting scenes using Pyscenedetect. Link is attached below.

    https://www.youtube.com/watch?v=7BhJqfCRBoA&t=29s

    I think this one is great. Easy and simple. But his instructions are too short and is for professional Python user. I wonder that can you guys tell me how to make this batch?

    Some of my colleague may not know how to use PySceneDetect. I think this bat file can help them a lot.

    Thank you so much in advance.
    Quote Quote  
  3. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    It looks like the command is trying to access the video file from the folder that the command is being run from.
    If the video is not there, you'll probably need a fully qualified path/name in quotes
    Quote Quote  
  4. Hi davexnet,

    Thankl you so much for answering my question. I found the solution. I need to fix their code a little bit for it to run.

    The code on their website (https://pyscenedetect.readthedocs.io/en/latest/examples/usage/).

    scenedetect -i video.mp4 detect-content split-video

    My fixed code.

    scenedetect.exe --input "C:\Users\tranb\OneDrive\Máy tính\New folder (2)\20220629.mp4" --output "C:\Users\tranb\OneDrive\Máy tính\New folder (3)" detect-content split-video




    Originally Posted by JeremyVN View Post
    Hi guys,

    I am a newbie for using Python. Pyscenedetect shows an error "Video file not found". Images are attached bellow. I do not know how to fix it. Please help.

    I installed their installer having scenedetect and ffmpeg and/or mkvmerge.
    I also tried to find the folder -i or --input. Even making one. But it does not work.
    Image
    [Attachment 65693 - Click to enlarge]


    I also installed
    pip install --upgrade scenedetect[opencv]
    pip install --upgrade scenedetect[opencv-headless]
    pip install opencv-python
    pip install numpy
    pip install Click
    pip install tqdm
    pip install appdirs
    pip install av
    Image
    [Attachment 65694 - Click to enlarge]


    Please helping me. Thank you in advance.

    After doing some researches, I found that Pyscenedetect is the best one for detect scenes in a footage. I have been recording news footage for studying how to shot and to choose locations for good composition and background. Watching 5-hour is a little tired and is motivation killer for me. As a result, I think just by viewing the keyframes, I can improve my skills faster.
    Last edited by JeremyVN; 2nd Jul 2022 at 19:58.
    Quote Quote  
  5. How to make PySceneDetect run.

    1. Download and Install the lastest PySceneDetect installer from https://pyscenedetect.readthedocs.io/en/latest/download/
    Download and Install the lastest Python from https://www.python.org/downloads/windows/

    2. Ctrl+R/cmd
    Copy and Paste on cmd

    pip install --upgrade scenedetect[opencv]
    pip install --upgrade scenedetect[opencv-headless]
    pip install opencv-python
    pip install numpy
    pip install Click
    pip install tqdm
    pip install appdirs
    pip install av

    3. on cmd, copy and paste code like this example

    scenedetect.exe --input "C:\Users\tranb\OneDrive\Máy tính\New folder (2)\20220629.mp4" --output "C:\Users\tranb\OneDrive\Máy tính\New folder (3)" detect-content split-video

    or

    scenedetect --input "C:\Users\tranb\OneDrive\Máy tính\New folder (2)\20220629.mp4" --output "C:\Users\tranb\OneDrive\Máy tính\New folder (3)" detect-content list-scenes -n save-images


    4. getting more codes from https://scenedetect.com/projects/Manual/en/latest/

    C:\Users\tranb>scenedetect
    Usage: scenedetect [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...

    For example:

    scenedetect -i video.mp4 -s video.stats.csv detect-content list-scenes

    Note that the following options represent [OPTIONS] above. To list the
    optional [ARGS] for a particular COMMAND, type `scenedetect help COMMAND`.
    You can also combine commands (e.g. scenedetect [...] detect-content save-
    images --png split-video).

    Options:
    -i, --input VIDEO [Required] Input video file. Also supports
    image sequences and URLs.
    -o, --output DIR Output directory for created files (stats
    file, output videos, images, etc...). If not
    set defaults to working directory. Some
    commands allow overriding this value.
    -f, --framerate FPS Force framerate, in frames/sec (e.g. -f
    29.97). Disables check to ensure that all
    input videos have the same framerates.
    -d, --downscale N Integer factor to downscale frames by (e.g. 2,
    3, 4...), where the frame is scaled to width/N
    x height/N (thus -d 1 implies no downscaling).
    Leave unset for automatic downscaling based on
    source resolution.
    -fs, --frame-skip N Skips N frames during processing (-fs 1 skips
    every other frame, processing 50% of the
    video, -fs 2 processes 33% of the frames, -fs
    3 processes 25%, etc...). Reduces processing
    speed at expense of accuracy. [default: 0]
    -m, --min-scene-len TIMECODE Minimum length of any scene. TIMECODE can be
    specified as exact number of frames, a time in
    seconds followed by s, or a timecode in the
    format HH:MM:SS or HH:MM:SS.nnn. [default:
    0.6s]
    --drop-short-scenes Drop scenes shorter than `min-scene-len`
    instead of combining them with neighbors.
    --merge-last-scene Merge last scene with previous if shorter than
    min-scene-len.
    -s, --stats CSV Path to stats file (.csv) for writing frame
    metrics to. If the file exists, any metrics
    will be processed, otherwise a new file will
    be created. Can be used to determine optimal
    values for various scene detector options, and
    to cache frame calculations in order to speed
    up multiple detection runs.
    -v, --verbosity LEVEL Level of debug/info/error information to show.
    Must be one of: debug, info, warning, error,
    none. Overrides `-q`/`--quiet`. Use `-v debug`
    for bug reports. [default: info]
    -l, --logfile LOG Path to log file for writing application
    logging information, mainly for debugging. Set
    `-v debug` as well if you are submitting a bug
    report. If verbosity is none, logfile is still
    be generated with info-level verbosity.
    -q, --quiet Suppresses all output of PySceneDetect to the
    terminal/stdout. Equivalent to `-v none`.
    -b, --backend BACKEND Backend to use for video input. Backends can
    be configured using -c/--config. Backends
    available on this system: opencv, pyav.
    [default: opencv].
    -c, --config FILE Path to config file. If not set, tries to load
    one from C:\Users\tranb\AppData\Local\PySceneD
    etect\scenedetect.cfg
    -h, --help Show this message and exit.

    Commands:
    about Print license/copyright info.
    detect-adaptive Perform adaptive detection algorithm on input video.
    detect-content Perform content detection algorithm on input video.
    detect-threshold Perform threshold detection algorithm on input video.
    export-html Export scene list to HTML file.
    help Print help for command (`help [command]`) or all...
    list-scenes Print scene list and outputs to a CSV file.
    save-images Create images for each detected scene.
    split-video Split input video using ffmpeg or mkvmerge.
    time Set start/end/duration of input video.
    version Print PySceneDetect version.
    Last edited by JeremyVN; 2nd Jul 2022 at 20:07.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!