VideoHelp Forum
+ Reply to Thread
Results 1 to 29 of 29
Thread
  1. hi, sorry for my bad english,
    recently i found this software: http://py.scenedetect.com/,
    it works fine, but it does not have GUI,
    so i must type it manually for each video file that i want to split,
    after some time, i create the very basic of batch programming
    this is my code :

    Code:
    ::open PySceneDetect folder
    cd C:\PySceneDetect-0.5-beta-1\
    
    ::do split scene program
    scenedetect.py --input video01.mp4 --output C:\PySceneDetect-0.5-beta-1\ detect-content split-video 
    
    :delete original video
    del /q video01.mp4
    pause
    but of course my programming skill not that good,
    i must edit the "video01.mp4" with another file name everytime i like to split,

    can somebody in here :
    1. make the batch file have drag and drop feature so i not must edit that video01.mp4 every time
    2. make that batch for ready for the queue, so if i put multiple video files on it, the batch will do the task one by one by queue order
    3. if the software failed because of some reason, skip the "delete original video" part, and do the next queue order

    sorry if i ask to many, my english and my programming vocabulary is not great, it hard to get what term i must google to make the batch program,
    and thanks for the reading
    Quote Quote  
  2. To allow drag and drop on your current batch file (I'm assuming it's working, I don't have the program) change both occurrences of "video01.mp4" to %1.

    If the program returns a valid error code you can avoid deletion on erorrs with:

    Code:
    ::open PySceneDetect folder
    cd C:\PySceneDetect-0.5-beta-1\
    
    ::do split scene program
    scenedetect.py --input %1 --output C:\PySceneDetect-0.5-beta-1\ detect-content split-video 
    if errorlevel 1 goto skip_delete
    
    :delete original video
    del /q %1
    
    :skip_delete
    pause
    Quote Quote  
  3. Originally Posted by jagabo View Post
    To allow drag and drop on your current batch file (I'm assuming it's working, I don't have the program) change both occurrences of "video01.mp4" to %1.

    If the program returns a valid error code you can avoid deletion on erorrs with:

    Code:
    ::open PySceneDetect folder
    cd C:\PySceneDetect-0.5-beta-1\
    
    ::do split scene program
    scenedetect.py --input %1 --output C:\PySceneDetect-0.5-beta-1\ detect-content split-video 
    if errorlevel 1 goto skip_delete
    
    :delete original video
    del /q %1
    
    :skip_delete
    pause
    yes, it works, thanks a lot,
    for the queue, it not a big matter,
    anyway i just realize,
    the output is in "C:\PySceneDetect-0.5-beta-1\"
    can you set to --output "as same folder/path as input %1"
    again, thanks a lot, i really appreciate it
    Quote Quote  
  4. You can drag/drop multiple files onto this batch file:

    Code:
    :parse
    IF "%~1"=="" GOTO endparse
    call :handle_one_file %1
    SHIFT
    GOTO parse
    :endparse
    pause
    exit(0)
    
    
    :handle_one_file
    
    cd C:\PySceneDetect-0.5-beta-1\
    
    ::do split scene program
    scenedetect --input %1 --output C:\PySceneDetect-0.5-beta-1\ detect-content split-video 
    if errorlevel 1 goto skip_delete
    
    :delete original video
    del /q %1
    
    :skip_delete
    pause
    exit /b
    The first part of the batch file steps through the arguments on the command line, one by one. You can't drag/drop one file onto the batch, then drag/drop another, etc. You must drag/drop all at once. If you do the latter the conversions will run in parallel, not sequentially.
    Quote Quote  
  5. Originally Posted by jagabo View Post
    You can drag/drop multiple files onto this batch file:

    Code:
    :parse
    IF "%~1"=="" GOTO endparse
    call :handle_one_file %1
    SHIFT
    GOTO parse
    :endparse
    pause
    exit(0)
    
    
    :handle_one_file
    
    cd C:\PySceneDetect-0.5-beta-1\
    
    ::do split scene program
    scenedetect --input %1 --output C:\PySceneDetect-0.5-beta-1\ detect-content split-video 
    if errorlevel 1 goto skip_delete
    
    :delete original video
    del /q %1
    
    :skip_delete
    pause
    exit /b
    The first part of the batch file steps through the arguments on the command line, one by one. You can't drag/drop one file onto the batch, then drag/drop another, etc. You must drag/drop all at once. If you do the latter the conversions will run in parallel, not sequentially.
    owh my god, thanks, that what i looking for,
    i not have try it, but i will study it tonight.
    anyway i have made some modification
    Code:
    echo off
    :: open dir
    cd C:\PySceneDetect-0.5-beta-1\
    
    ::do split scene program
    C:\PySceneDetect-0.5-beta-1\scenedetect.py --input %1 --output %~p1 detect-content split-video 
    if errorlevel 1 goto skip_delete
    
    :delete original video
    del /q %1
    
    :skip_delete
    pause
    i just edit the "C:\PySceneDetect-0.5-beta-1\" with "%~p1",
    and it works like a charm, sort of
    but there have 2 problems,
    a.if you put a video in a folder that has space like "new folderz", the software will recognize the folderz in "new folderz" as command, and it will result as an error
    b.if you put a video outside of c drive, the software will missing some of the library of it, in my case "ffmpeg.exe", i dont know why it happen,

    again, thanks for reply and thanks for answer
    Quote Quote  
  6. For the space problem: try enclosing %~p1 in quotes: "%~p1"

    For the second problem I believe the CLI is started with the default directory on the other drive. So your CD C:\... doesn't put you in the correct folder. Before that line change to drive C with "C:".

    Code:
    :: open dir
    C:
    cd C:\PySceneDetect-0.5-beta-1\
    
    ::do split scene program
    C:\PySceneDetect-0.5-beta-1\scenedetect.py --input %1 --output "%~p1" detect-content split-video 
    if errorlevel 1 goto skip_delete
    
    :delete original video
    del /q %1
    
    :skip_delete
    pause
    You may also need to specify the drive for the output. Change "%~p1" to "%~dp1".

    With %~ format:

    d = drive
    p = path
    n = name (no extension)
    e = extension

    and the number indicates which argument on the command line (0 is the program or batch name, 1 is the first argument, 2 is the second, etc.). The output doesn't include quotes so you need to specify them yourself. So "%~dpne1" is the same as %1.
    Quote Quote  
  7. Originally Posted by jagabo View Post
    For the space problem: try enclosing %~p1 in quotes: "%~p1"

    For the second problem I believe the CLI is started with the default directory on the other drive. So your CD C:\... doesn't put you in the correct folder. Before that line change to drive C with "C:".

    Code:
    :: open dir
    C:
    cd C:\PySceneDetect-0.5-beta-1\
    
    ::do split scene program
    C:\PySceneDetect-0.5-beta-1\scenedetect.py --input %1 --output "%~p1" detect-content split-video 
    if errorlevel 1 goto skip_delete
    
    :delete original video
    del /q %1
    
    :skip_delete
    pause
    You may also need to specify the drive for the output. Change "%~p1" to "%~dp1".

    With %~ format:

    d = drive
    p = path
    n = name (no extension)
    e = extension

    and the number indicates which argument on the command line (0 is the program or batch name, 1 is the first argument, 2 is the second, etc.). The output doesn't include quotes so you need to specify them yourself. So "%~dpne1" is the same as %1.
    thanks again for the reply
    i have tried the code and update it
    Code:
    echo off
    
    :parse
    IF "%~1"=="" GOTO endparse
    call :handle_one_file %1
    SHIFT
    GOTO parse
    :endparse
    pause
    
    :handle_one_file
    cd C:\PySceneDetect-0.5-beta-1\
    
    ::do split scene program
    C:\PySceneDetect-0.5-beta-1\scenedetect.py --input %1 --output %~dp1 detect-content split-video 
    if errorlevel 1 goto skip_delete
    
    :delete original video
    del /q %1
    
    :skip_delete
    it works, it can do multiple video file, thanks,

    for problem number 1, this is output, maybe you can learn something:
    Code:
    C:\Users\ujang\Desktop\temp 2>echo off
    [PySceneDetect] Output directory set:
      C:\Users\ujang\Desktop\temp
    [PySceneDetect] Loaded 1 video, framerate: 29.98 FPS, resolution: 640 x 480
    [PySceneDetect] Downscale factor set to 3, effective resolution: 213 x 160
    [PySceneDetect] No scene detectors specified (detect-content, detect-threshold, etc...),
      or failed to process all command line arguments.
    Usage: scenedetect.py [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
    Try "scenedetect.py -h" for help.
    
    Error: No such command "2\".
    [PySceneDetect] Output directory set:
      C:\Users\ujang\Desktop\temp
    [PySceneDetect] Loaded 1 video, framerate: 25.00 FPS, resolution: 640 x 480
    [PySceneDetect] Downscale factor set to 3, effective resolution: 213 x 160
    [PySceneDetect] No scene detectors specified (detect-content, detect-threshold, etc...),
      or failed to process all command line arguments.
    Usage: scenedetect.py [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
    Try "scenedetect.py -h" for help.
    
    Error: No such command "2\".
    Press any key to continue . . .
    for the problem number 2, turn out i have 2 pyscenedetect folder, one with ffmpeg.exe, and one else is not, sorry my bad

    and the last, maybe i ask too many, the last hour i learn new command "start",
    that command is create a new window, and one of it feature is /wait, that /wait is waiting for other programs to finish,
    so, create 2 batch file:
    1. "AddVideoFileHereToSplit.bat" this batch is added file queue, the line/code is:
    Code:
    echo off
    
    :parse
    IF "%~1"=="" GOTO endparse
    call :handle_one_file %1
    SHIFT
    GOTO parse
    :endparse
    pause
    
    :handle_one_file
    start /wait ProcessingBatch.bat ProcessingBatch.bat *parameter*
    :: i don't know how to send parameter to another batch file
    2. "ProcessingBatch.bat"
    Code:
    cd C:\PySceneDetect-0.5-beta-1\
    
    ::do split scene program
    C:\PySceneDetect-0.5-beta-1\scenedetect.py --input %1 --output %~dp1 detect-content split-video 
    if errorlevel 1 goto skip_delete
    
    :delete original video
    del /q %1
    
    :skip_delete
    i don't know if this program will running or not, i just learn it an hour ago,
    if this code work, the list can be a lot but, the processing just 1 batch at the time

    anyway thanks again for reply, and sorry for my bad english
    Quote Quote  
  8. Don't turn echo off when debugging. I forget to put %~dp1 in quotes.
    Quote Quote  
  9. Originally Posted by jagabo View Post
    Don't turn echo off when debugging. I forget to put %~dp1 in quotes.
    ah yes, sorry, silly me

    Code:
    C:\Users\ujang\Desktop\temp 2>IF "C:\Users\ujang\Desktop\temp 2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4" == "" GOTO endparse
    
    C:\Users\ujang\Desktop\temp 2>call :handle_one_file "C:\Users\ujang\Desktop\temp 2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4"
    
    C:\Users\ujang\Desktop\temp 2>cd C:\PySceneDetect-0.5-beta-1\
    
    C:\PySceneDetect-0.5-beta-1>C:\PySceneDetect-0.5-beta-1\scenedetect.py --input "C:\Users\ujang\Desktop\temp 2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4" --output C:\Users\ujang\Desktop\temp 2\ detect-content split-video
    [PySceneDetect] Output directory set:
      C:\Users\ujang\Desktop\temp
    [PySceneDetect] Loaded 1 video, framerate: 29.98 FPS, resolution: 640 x 480
    [PySceneDetect] Downscale factor set to 3, effective resolution: 213 x 160
    [PySceneDetect] No scene detectors specified (detect-content, detect-threshold, etc...),
      or failed to process all command line arguments.
    Usage: scenedetect.py [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
    Try "scenedetect.py -h" for help.
    
    Error: No such command "2\".
    
    C:\PySceneDetect-0.5-beta-1>if errorlevel 1 goto skip_delete
    
    C:\PySceneDetect-0.5-beta-1>SHIFT
    
    C:\PySceneDetect-0.5-beta-1>GOTO parse
    
    C:\PySceneDetect-0.5-beta-1>IF "C:\Users\ujang\Desktop\temp 2\Lighthouse Family - High - YouTube.MKV" == "" GOTO endparse
    
    C:\PySceneDetect-0.5-beta-1>call :handle_one_file "C:\Users\ujang\Desktop\temp 2\Lighthouse Family - High - YouTube.MKV"
    
    C:\PySceneDetect-0.5-beta-1>cd C:\PySceneDetect-0.5-beta-1\
    
    C:\PySceneDetect-0.5-beta-1>C:\PySceneDetect-0.5-beta-1\scenedetect.py --input "C:\Users\ujang\Desktop\temp 2\Lighthouse Family - High - YouTube.MKV" --output C:\Users\ujang\Desktop\temp 2\ detect-content split-video
    [PySceneDetect] Output directory set:
      C:\Users\ujang\Desktop\temp
    [PySceneDetect] Loaded 1 video, framerate: 25.00 FPS, resolution: 640 x 480
    [PySceneDetect] Downscale factor set to 3, effective resolution: 213 x 160
    [PySceneDetect] No scene detectors specified (detect-content, detect-threshold, etc...),
      or failed to process all command line arguments.
    Usage: scenedetect.py [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
    Try "scenedetect.py -h" for help.
    
    Error: No such command "2\".
    
    C:\PySceneDetect-0.5-beta-1>if errorlevel 1 goto skip_delete
    
    C:\PySceneDetect-0.5-beta-1>SHIFT
    
    C:\PySceneDetect-0.5-beta-1>GOTO parse
    
    C:\PySceneDetect-0.5-beta-1>IF "" == "" GOTO endparse
    
    C:\PySceneDetect-0.5-beta-1>pause
    Press any key to continue . . .
    Quote Quote  
  10. You can see when PySceneDetect is called there are no quotes around the output folder spec.

    Code:
    --output C:\Users\ujang\Desktop\temp 2\ detect-content split-video
    because I forgot to put quotes around %~dp1.

    Spaces are considered delimiters in CLI commands -- unless they are within quotes. So a command like:

    Code:
    this is a test
    is seen as four different arguments

    Code:
    this
    is
    a
    test
    To be seen as a single argument you enclose the string in quotes:

    Code:
    "This is a test"
    So the sequence:

    Code:
    --output C:\Users\ujang\Desktop\temp 2\
    Is seen as three arguments:

    Code:
    --output
    C:\Users\ujang\Desktop\temp
    2\
    rather than two. The solution is to put quotes around the folder spec, ie, put quotes around the %~dp1 in the batch file.
    Quote Quote  
  11. Originally Posted by jagabo View Post
    You can see when PySceneDetect is called there are no quotes around the output folder spec.

    Code:
    --output C:\Users\ujang\Desktop\temp 2\ detect-content split-video
    because I forgot to put quotes around %~dp1.

    Spaces are considered delimiters in CLI commands -- unless they are within quotes. So a command like:

    Code:
    this is a test
    is seen as four different arguments

    Code:
    this
    is
    a
    test
    To be seen as a single argument you enclose the string in quotes:

    Code:
    "This is a test"
    So the sequence:

    Code:
    --output C:\Users\ujang\Desktop\temp 2\
    Is seen as three arguments:

    Code:
    --output
    C:\Users\ujang\Desktop\temp
    2\
    rather than two. The solution is to put quotes around the folder spec, ie, put quotes around the %~dp1 in the batch file.
    again, thanks for reply,
    this code that i edit from %1 to "%1" and %~dp1 to "%~dp1"
    Code:
    :parse
    IF "%~1"=="" GOTO endparse
    call :handle_one_file %1
    SHIFT
    GOTO parse
    :endparse
    pause
    
    :handle_one_file
    cd C:\PySceneDetect-0.5-beta-1\
    
    ::do split scene program
    C:\PySceneDetect-0.5-beta-1\scenedetect.py --input "%1" --output "%~dp1" detect-content split-video 
    if errorlevel 1 goto skip_delete
    
    :delete original video
    del /q %1
    
    :skip_delete
    and this is the result
    Code:
    C:\Users\ujang\Desktop\temp 2>IF "C:\Users\ujang\Desktop\temp 2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4" == "" GOTO endparse
    
    C:\Users\ujang\Desktop\temp 2>call :handle_one_file "C:\Users\ujang\Desktop\temp 2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4"
    
    C:\Users\ujang\Desktop\temp 2>cd C:\PySceneDetect-0.5-beta-1\
    
    C:\PySceneDetect-0.5-beta-1>C:\PySceneDetect-0.5-beta-1\scenedetect.py --input ""C:\Users\ujang\Desktop\temp 2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4"" --output "C:\Users\ujang\Desktop\temp 2\" detect-content split-video
    Usage: scenedetect.py [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
    Try "scenedetect.py -h" for help.
    
    Error: Invalid value for "--input" / "-i": Path "C:\Users\ujang\Desktop\temp" does not exist.
    
    C:\PySceneDetect-0.5-beta-1>if errorlevel 1 goto skip_delete
    
    C:\PySceneDetect-0.5-beta-1>SHIFT
    
    C:\PySceneDetect-0.5-beta-1>GOTO parse
    
    C:\PySceneDetect-0.5-beta-1>IF "C:\Users\ujang\Desktop\temp 2\Lighthouse Family - High - YouTube.MKV" == "" GOTO endparse
    
    C:\PySceneDetect-0.5-beta-1>call :handle_one_file "C:\Users\ujang\Desktop\temp 2\Lighthouse Family - High - YouTube.MKV"
    
    C:\PySceneDetect-0.5-beta-1>cd C:\PySceneDetect-0.5-beta-1\
    
    C:\PySceneDetect-0.5-beta-1>C:\PySceneDetect-0.5-beta-1\scenedetect.py --input ""C:\Users\ujang\Desktop\temp 2\Lighthouse Family - High - YouTube.MKV"" --output "C:\Users\ujang\Desktop\temp 2\" detect-content split-video
    Usage: scenedetect.py [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
    Try "scenedetect.py -h" for help.
    
    Error: Invalid value for "--input" / "-i": Path "C:\Users\ujang\Desktop\temp" does not exist.
    
    C:\PySceneDetect-0.5-beta-1>if errorlevel 1 goto skip_delete
    
    C:\PySceneDetect-0.5-beta-1>SHIFT
    
    C:\PySceneDetect-0.5-beta-1>GOTO parse
    
    C:\PySceneDetect-0.5-beta-1>IF "" == "" GOTO endparse
    
    C:\PySceneDetect-0.5-beta-1>pause
    Press any key to continue . . .
    anyway, this space does not really issue for me, i just need to rename the spaces in the folder into underscore if the splitting failed,
    my current issue make it queue, so i can leave my pc do splitting video while i am gone for a while,
    again thanks for reply
    Quote Quote  
  12. %1 automatically puts quotes around path\filename which contain spaces. Notice how there are two sets of quotes around the file names in the new log. Do not use "%1", only %1. Or change to "%~dpne1".
    Quote Quote  
  13. Originally Posted by jagabo View Post
    %1 automatically puts quotes around path\filename which contain spaces. Notice how there are two sets of quotes around the file names in the new log. Do not use "%1", only %1. Or change to "%~dpne1".
    thanks,
    this is result : --input %1 --output "%~dp1"
    Code:
    C:\Users\ujang\Desktop\temp2>IF "C:\Users\ujang\Desktop\temp2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4" == "" GOTO endparse
    
    C:\Users\ujang\Desktop\temp2>call :handle_one_file "C:\Users\ujang\Desktop\temp2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4"
    
    C:\Users\ujang\Desktop\temp2>cd C:\PySceneDetect-0.5-beta-1\
    
    C:\PySceneDetect-0.5-beta-1>C:\PySceneDetect-0.5-beta-1\scenedetect.py --input "C:\Users\ujang\Desktop\temp2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4" --output "C:\Users\ujang\Desktop\temp2\" detect-content split-video
    Usage: scenedetect.py [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
    Try "scenedetect.py -h" for help.
    
    Error: Missing command.
    
    C:\PySceneDetect-0.5-beta-1>if errorlevel 1 goto skip_delete
    
    C:\PySceneDetect-0.5-beta-1>SHIFT
    
    C:\PySceneDetect-0.5-beta-1>GOTO parse
    
    C:\PySceneDetect-0.5-beta-1>IF "" == "" GOTO endparse
    
    C:\PySceneDetect-0.5-beta-1>pause
    Press any key to continue . . .
    and this is : --input %1 --output %~dp1
    Code:
    C:\Users\ujang\Desktop\temp2>IF "C:\Users\ujang\Desktop\temp2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4" == "" GOTO endparse
    
    C:\Users\ujang\Desktop\temp2>call :handle_one_file "C:\Users\ujang\Desktop\temp2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4"
    
    C:\Users\ujang\Desktop\temp2>cd C:\PySceneDetect-0.5-beta-1\
    
    C:\PySceneDetect-0.5-beta-1>C:\PySceneDetect-0.5-beta-1\scenedetect.py --input "C:\Users\ujang\Desktop\temp2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4" --output C:\Users\ujang\Desktop\temp2\ detect-content split-video
    [PySceneDetect] Output directory set:
      C:\Users\ujang\Desktop\temp2\
    [PySceneDetect] Loaded 1 video, framerate: 29.98 FPS, resolution: 640 x 480
    [PySceneDetect] Downscale factor set to 3, effective resolution: 213 x 160
    [PySceneDetect] FFmpeg codec args set: -c:v libx264 -preset veryfast -crf 22 -c:a copy
    [PySceneDetect] Video output file name format: $VIDEO_NAME-Scene-$SCENE_NUMBER
    [PySceneDetect] Detecting scenes...
    100%|█████████████████████████████████████████████████████████████████████████| 4888/4888 [00:10<00:00, 473.30frames/s]
    [PySceneDetect] Processed 4888 frames in 10.3 seconds (average 473.30 FPS).
    [PySceneDetect] Detected 80 scenes, average shot length 2.0 seconds.
    [PySceneDetect] Comma-separated timecode list:
      00:00:01.668,00:00:04.137,00:00:07.606,00:00:08.540,00:00:09.841,00:00:10.809,00:00:13.778,00:00:14.412,00:00:15.713,00:00:19.382,00:00:21.150,00:00:24.753,00:00:26.254,00:00:28.856,00:00:29.657,00:00:32.359,00:00:34.127,00:00:36.096,00:00:36.830,00:00:39.432,00:00:41.100,00:00:42.167,00:00:44.769,00:00:48.172,00:00:49.273,00:00:49.973,00:00:52.642,00:00:53.743,00:00:55.044,00:01:00.949,00:01:02.450,00:01:05.085,00:01:06.887,00:01:08.755,00:01:09.989,00:01:11.991,00:01:15.327,00:01:18.430,00:01:19.564,00:01:22.566,00:01:24.368,00:01:30.940,00:01:31.907,00:01:33.909,00:01:35.210,00:01:35.977,00:01:37.011,00:01:39.146,00:01:41.982,00:01:45.785,00:01:47.186,00:01:47.820,00:01:48.754,00:01:50.055,00:01:52.223,00:01:56.760,00:01:57.494,00:02:00.030,00:02:01.097,00:02:05.601,00:02:06.134,00:02:07.369,00:02:08.269,00:02:09.537,00:02:11.339,00:02:13.707,00:02:14.941,00:02:16.576,00:02:18.711,00:02:20.980,00:02:24.516,00:02:25.650,00:02:27.051,00:02:28.419,00:02:29.853,00:02:31.321,00:02:34.257,00:02:35.825,00:02:40.762
    [PySceneDetect] Splitting input video using ffmpeg, output path template:
      C:\Users\ujang\Desktop\temp2\$VIDEO_NAME-Scene-$SCENE_NUMBER.mp4
      0%|                                                                                      | 0/4889 [00:00<?, ?frame/s]ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
      built with gcc 7.3.1 (GCC) 20180722
      configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
      libavutil      56. 14.100 / 56. 14.100
      libavcodec     58. 18.100 / 58. 18.100
      libavformat    58. 12.100 / 58. 12.100
      libavdevice    58.  3.100 / 58.  3.100
      libavfilter     7. 16.100 /  7. 16.100
      libswscale      5.  1.100 /  5.  1.100
      libswresample   3.  1.100 /  3.  1.100
      libpostproc    55.  1.100 / 55.  1.100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0000024ac2d7b100] st: 1 edit list: 1 Missing key frame while searching for timestamp: 0
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0000024ac2d7b100] st: 1 edit list 1 Cannot find an index entry before timestamp: 0.
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\ujang\Desktop\temp2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        creation_time   : 2014-08-16T04:53:05.000000Z
      Duration: 00:02:43.18, start: 0.000000, bitrate: 782 kb/s
        Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 653 kb/s, 29.98 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
        Metadata:
          creation_time   : 2014-08-16T04:53:05.000000Z
          handler_name    : VideoHandler
        Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
        Metadata:
          creation_time   : 2014-08-16T04:43:53.000000Z
          handler_name    : SoundHandler
    Stream mapping:
      Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
      Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    [libx264 @ 0000024ac2d7de40] using SAR=1/1
    [libx264 @ 0000024ac2d7de40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
    [libx264 @ 0000024ac2d7de40] profile High, level 3.0
    [libx264 @ 0000024ac2d7de40] 264 - core 155 r2901 7d0ff22 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=2 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=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=22.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'C:\Users\ujang\Desktop\temp2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka)-Scene-001.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf58.12.100
        Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc (default)
        Metadata:
          creation_time   : 2014-08-16T04:53:05.000000Z
          handler_name    : VideoHandler
          encoder         : Lavc58.18.100 libx264
        Side data:
          cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
        Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
        Metadata:
          creation_time   : 2014-08-16T04:43:53.000000Z
          handler_name    : SoundHandler
    frame=   50 fps=0.0 q=-1.0 Lsize=     163kB time=00:00:01.64 bitrate= 812.3kbits/s speed=7.54x
    video:134kB audio:26kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.924084%
    [libx264 @ 0000024ac2d7de40] frame I:1     Avg QP:17.80  size:  9574
    [libx264 @ 0000024ac2d7de40] frame P:25    Avg QP:19.71  size:  3907
    [libx264 @ 0000024ac2d7de40] frame B:24    Avg QP:20.97  size:  1234
    [libx264 @ 0000024ac2d7de40] consecutive B-frames: 24.0% 28.0% 24.0% 24.0%
    [libx264 @ 0000024ac2d7de40] mb I  I16..4: 35.7% 41.7% 22.7%
    [libx264 @ 0000024ac2d7de40] mb P  I16..4: 13.4% 13.9%  1.3%  P16..4: 20.8%  8.4%  3.9%  0.0%  0.0%    skip:38.2%
    [libx264 @ 0000024ac2d7de40] mb B  I16..4:  1.5%  1.8%  0.0%  B16..8: 16.1%  3.9%  0.5%  direct: 6.8%  skip:69.5%  L0:44.9% L1:38.8% BI:16.3%
    [libx264 @ 0000024ac2d7de40] 8x8 transform intra:48.3% inter:35.0%
    [libx264 @ 0000024ac2d7de40] coded y,uvDC,uvAC intra: 27.7% 55.1% 7.2% inter: 6.3% 12.5% 0.1%
    [libx264 @ 0000024ac2d7de40] i16 v,h,dc,p: 59% 20%  9% 12%
    [libx264 @ 0000024ac2d7de40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 26% 30%  2%  2%  4%  2%  3%  2%
    [libx264 @ 0000024ac2d7de40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 38% 24% 13%  4%  4%  5%  4%  5%  3%
    [libx264 @ 0000024ac2d7de40] i8c dc,h,v,p: 38% 30% 26%  6%
    [libx264 @ 0000024ac2d7de40] Weighted P-Frames: Y:32.0% UV:0.0%
    [libx264 @ 0000024ac2d7de40] kb/s:656.38
    [PySceneDetect] Output from ffmpeg for Scene 1 shown above, splitting remaining scenes...
    100%|█████████████████████████████████████████████████████████████████████████▉| 4888/4889 [00:30<00:00, 153.19frame/s]
    [PySceneDetect] Average processing speed 159.57 frames/sec.
    [PySceneDetect] Video splitting completed, individual scenes written to disk.
    Exception ignored in: <function tqdm.__del__ at 0x00000280A23629D8>
    Traceback (most recent call last):
      File "C:\Users\ujang\AppData\Local\Programs\Python\Python37\lib\site-packages\tqdm\_tqdm.py", line 931, in __del__
        self.close()
      File "C:\Users\ujang\AppData\Local\Programs\Python\Python37\lib\site-packages\tqdm\_tqdm.py", line 1133, in close
        self._decr_instances(self)
      File "C:\Users\ujang\AppData\Local\Programs\Python\Python37\lib\site-packages\tqdm\_tqdm.py", line 496, in _decr_instances
        cls.monitor.exit()
      File "C:\Users\ujang\AppData\Local\Programs\Python\Python37\lib\site-packages\tqdm\_monitor.py", line 52, in exit
        self.join()
      File "C:\Users\ujang\AppData\Local\Programs\Python\Python37\lib\threading.py", line 1029, in join
        raise RuntimeError("cannot join current thread")
    RuntimeError: cannot join current thread
    
    C:\PySceneDetect-0.5-beta-1>if errorlevel 1 goto skip_delete
    
    C:\PySceneDetect-0.5-beta-1>del /q "C:\Users\ujang\Desktop\temp2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4"
    
    C:\PySceneDetect-0.5-beta-1>SHIFT
    
    C:\PySceneDetect-0.5-beta-1>GOTO parse
    
    C:\PySceneDetect-0.5-beta-1>IF "" == "" GOTO endparse
    
    C:\PySceneDetect-0.5-beta-1>pause
    Press any key to continue . . .
    at this point i feel sorry for give this "space" in path problem to you, i just like to say this "space" problem is consider "answered",
    this batch is in working state, i will ask this open new batch in other post,
    thank you, sorry if i rude
    Quote Quote  
  14. It looks like the program is poorly written and doesn't accept an output path with quotes around it. That means the output path cannot include spaces. So you'll have to use your workaround of renaming all your folders to eliminate spaces.
    Quote Quote  
  15. DO NOT use parentheses in filenames in batch script or any other weird characters as a matter of fact

    would not be better to fire some exe version of pyscenedetect?
    Last edited by _Al_; 6th Nov 2018 at 19:35.
    Quote Quote  
  16. Originally Posted by jagabo View Post
    It looks like the program is poorly written and doesn't accept an output path with quotes around it. That means the output path cannot include spaces. So you'll have to use your workaround of renaming all your folders to eliminate spaces.
    that what i doing, but it easy to solve with some renaming software
    Quote Quote  
  17. Originally Posted by _Al_ View Post
    DO NOT use parentheses in filenames in batch script or any other weird characters as a matter of fact

    would not be better to fire some exe version of pyscenedetect?
    how to do "DO NOT use parentheses in filenames in batch script" i am not cmd programer,
    and sorry for my bad english, what "any other weird characters as a matter of fact" are you talking about?,
    what is fire"ing" an exe version?, that i know this version is the latest version (beta)
    Quote Quote  
  18. I downloaded pyscenedetect portable and there is scenedetect.exe as a main executable file, how to use it is here:
    https://pyscenedetect.readthedocs.io/en/latest/examples/usage-example/
    you might use that split-video parameter

    while downloading Source files , there is also scenedetect.py used https://pyscenedetect.readthedocs.io/en/latest/examples/usage-python/
    scenedetect.py is used while writing custom python scripts

    pyscenedetect.py might work, as well if you installed everything, it works as we can see, but give that scenedetect.exe version a shot, what if there is something fishy you executing python file instead of using that scenedetect.exe
    Quote Quote  
  19. Originally Posted by _Al_ View Post
    I downloaded pyscenedetect portable and there is scenedetect.exe as a main executable file, how to use it is here:
    https://pyscenedetect.readthedocs.io/en/latest/examples/usage-example/
    you might use that split-video parameter

    while downloading Source files , there is also scenedetect.py used https://pyscenedetect.readthedocs.io/en/latest/examples/usage-python/
    scenedetect.py is used while writing custom python scripts

    pyscenedetect.py might work, as well if you installed everything, it works as we can see, but give that scenedetect.exe version a shot, what if there is something fishy you executing python file instead of using that scenedetect.exe
    thanks for reply,
    yes i use that split-video parameter in that python program (as you can see in the code that previously i post)
    after i downloaded the protable one, i edit the batch
    and the result is :
    Code:
    C:\Users\ujang\Desktop\temp2>IF "C:\Users\ujang\Desktop\temp2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4" == "" GOTO endparse
    
    C:\Users\ujang\Desktop\temp2>call :handle_one_file "C:\Users\ujang\Desktop\temp2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4"
    
    C:\Users\ujang\Desktop\temp2>cd C:\PySceneDetect-0.4-win64-portable
    
    C:\PySceneDetect-0.4-win64-portable>C:\PySceneDetect-0.4-win64-portable\scenedetect.exe --input "C:\Users\ujang\Desktop\temp2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4" --output "C:\Users\ujang\Desktop\temp2\" detect-content split-video
    [PySceneDetect] Detecting scenes (threshold mode)...
    [PySceneDetect] Parsing video [PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4...
    [PySceneDetect] Video Resolution / Framerate: 640 x 480 / 29.976 FPS
    Verify that the above parameters are correct (especially framerate, use --force-fps to correct if required).
    [PySceneDetect] Processing complete, found 0 scenes in video.
    [PySceneDetect] Processed 4888 / 4888 frames read in 12.5 secs (avg 392.0 FPS).
    
    
    C:\PySceneDetect-0.4-win64-portable>if errorlevel 1 goto skip_delete
    
    C:\PySceneDetect-0.4-win64-portable>del /q "C:\Users\ujang\Desktop\temp2\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4"
    
    C:\PySceneDetect-0.4-win64-portable>SHIFT
    
    C:\PySceneDetect-0.4-win64-portable>GOTO parse
    
    C:\PySceneDetect-0.4-win64-portable>IF "" == "" GOTO endparse
    
    C:\PySceneDetect-0.4-win64-portable>pause
    Press any key to continue . . .
    the video not being split and the video file is deleted (because it did not count as an error)
    you can say i fishy why i use the .py one instead of the .exe file, but that is the result,
    i am not a cmd programmer, and the installations of python, numpy, cv2 even with GUI and tutorial on youtube, it still gives me a huge headache,
    as for this matter, i like to set the .py and .exe as solved,
    my current needs are batch of 2 files that i mention in my previous reply,
    anyway, thanks for the reply
    Quote Quote  
  20. First of all, script that deletes files after some action is always risky, do not do that, you should put new files into a new folder and delete originals manually afterwards. Because as you can see, there is always something you do not think thru. Like in your case, not throwing any error causes deletion.

    I have no idea what went wrong with that pyscenedetect.py. It is a python script and lots of things can happen, wrong python versions, operating system, paths, whatever. But forget it, work with that scenedetect.exe.

    It says it did not find any changes in scenes. Threshold parameter is missing there, follow that website example (bottom page), there is an example:
    Code:
    scenedetect -i goldeneye.mp4 -o output_dir detect-content -t 27 list-scenes save-images split-video
    you missed -t 27 , or whatever number would work for you, and maybe you should even follow that new syntax, like -o, -i etc.
    Last edited by _Al_; 6th Nov 2018 at 22:49.
    Quote Quote  
  21. Also, checking it now, that website, you should find your threshold first and then actually do stuff, it is three command lines or something
    Code:
    https://pyscenedetect.readthedocs.io/en/latest/examples/usage-example/
    it might not be straight forward just to use batch, first you have to find correct values for you type of video
    default threshold is 30
    Quote Quote  
  22. I gave up and downloaded the program. This works with and without spaces in file names and folder names.

    Code:
    :parse
    IF "%~1"=="" GOTO endparse
    call :handle_one_file %1
    SHIFT
    GOTO parse
    :endparse
    pause
    exit(0)
    
    :handle_one_file
    
    "C:\PySceneDetect-0.5-beta-1\scenedetect.exe" --input "%~dpnx1" --output "%~dpn1-%~x1"
    if errorlevel 1 goto skip_delete
    
    REM remove /q if you want automatic deletion.
    del /q %1
    
    :skip_delete
    exit /b
    The new files are created in the same folder as the original. The program wouldn't take the original file name as the output filename even though the output names have numbers appended to them.
    Quote Quote  
  23. Originally Posted by _Al_ View Post
    First of all, script that deletes files after some action is always risky, do not do that, you should put new files into a new folder and delete originals manually afterwards. Because as you can see, there is always something you do not think thru. Like in your case, not throwing any error causes deletion.

    I have no idea what went wrong with that pyscenedetect.py. It is a python script and lots of things can happen, wrong python versions, operating system, paths, whatever. But forget it, work with that scenedetect.exe.

    It says it did not find any changes in scenes. Threshold parameter is missing there, follow that website example (bottom page), there is an example:
    Code:
    scenedetect -i goldeneye.mp4 -o output_dir detect-content -t 27 list-scenes save-images split-video
    you missed -t 27 , or whatever number would work for you, and maybe you should even follow that new syntax, like -o, -i etc.
    thanks for the reply,
    i study it before, the -t 27 is a parameter to cut to more accurate, but i skip it because what point being accurate if the output does not appear,
    Quote Quote  
  24. Originally Posted by jagabo View Post
    I gave up and downloaded the program. This works with and without spaces in file names and folder names.

    Code:
    :parse
    IF "%~1"=="" GOTO endparse
    call :handle_one_file %1
    SHIFT
    GOTO parse
    :endparse
    pause
    exit(0)
    
    :handle_one_file
    
    "C:\PySceneDetect-0.5-beta-1\scenedetect.exe" --input "%~dpnx1" --output "%~dpn1-%~x1"
    if errorlevel 1 goto skip_delete
    
    REM remove /q if you want automatic deletion.
    del /q %1
    
    :skip_delete
    exit /b
    The new files are created in the same folder as the original. The program wouldn't take the original file name as the output filename even though the output names have numbers appended to them.
    can i get the link you got, my do not have "scenedetect.exe" on "PySceneDetect-0.5-beta-1", do you compile it by your self?
    Quote Quote  
  25. Originally Posted by ujang View Post
    can i get the link you got, my do not have "scenedetect.exe" on "PySceneDetect-0.5-beta-1", do you compile it by your self?
    I downloaded the portable version and extracted it to a folder of the same name you were using.
    https://github.com/Breakthrough/PySceneDetect/releases/download/v0.4/PySceneDetect-0.4...4-portable.zip
    Quote Quote  
  26. Originally Posted by jagabo View Post
    Originally Posted by ujang View Post
    can i get the link you got, my do not have "scenedetect.exe" on "PySceneDetect-0.5-beta-1", do you compile it by your self?
    I downloaded the portable version and extracted it to a folder of the same name you were using.
    https://github.com/Breakthrough/PySceneDetect/releases/download/v0.4/PySceneDetect-0.4...4-portable.zip
    thanks for the link,
    i have test this file before
    this is the code :
    Code:
    :parse
    IF "%~1"=="" GOTO endparse
    call :handle_one_file %1
    SHIFT
    GOTO parse
    :endparse
    pause
    exit(0)
    
    :handle_one_file
    
    "C:\PySceneDetect-0.4-win64-portable\scenedetect.exe" --input "%~dpnx1" --output "%~dpn1-%~x1"
    if errorlevel 1 goto skip_delete
    
    REM remove /q if you want automatic deletion.
    del /q %1
    
    :skip_delete
    exit /b
    and this is the result :
    Code:
    C:\Users\ujang\Desktop\New folder (3)>IF "C:\Users\ujang\Desktop\New folder (3)\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4" == "" GOTO endparse
    
    C:\Users\ujang\Desktop\New folder (3)>call :handle_one_file "C:\Users\ujang\Desktop\New folder (3)\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4"
    
    C:\Users\ujang\Desktop\New folder (3)>"C:\PySceneDetect-0.4-win64-portable\scenedetect.exe" --input "C:\Users\ujang\Desktop\New folder (3)\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4" --output "C:\Users\ujang\Desktop\New folder (3)\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka)-.mp4"
    [PySceneDetect] Detecting scenes (threshold mode)...
    [PySceneDetect] Parsing video [PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4...
    [PySceneDetect] Video Resolution / Framerate: 640 x 480 / 29.976 FPS
    Verify that the above parameters are correct (especially framerate, use --force-fps to correct if required).
    [PySceneDetect] Processing complete, found 0 scenes in video.
    [PySceneDetect] Processed 4888 / 4888 frames read in 14.8 secs (avg 330.0 FPS).
    
    
    C:\Users\ujang\Desktop\New folder (3)>if errorlevel 1 goto skip_delete
    
    C:\Users\ujang\Desktop\New folder (3)>REM remove /q if you want automatic deletion.
    
    C:\Users\ujang\Desktop\New folder (3)>del /q "C:\Users\ujang\Desktop\New folder (3)\[PV] Sha la la -AYAKASHI NIGHT- (Uura Saeka).mp4"
    
    C:\Users\ujang\Desktop\New folder (3)>exit /b
    
    C:\Users\ujang\Desktop\New folder (3)>SHIFT
    
    C:\Users\ujang\Desktop\New folder (3)>GOTO parse
    
    C:\Users\ujang\Desktop\New folder (3)>IF "" == "" GOTO endparse
    
    C:\Users\ujang\Desktop\New folder (3)>pause
    Press any key to continue . . .
    note that video not being split, but original video is deleted

    and this is same batch file and using another file, but result is different :
    Code:
    C:\Users\ujang\Desktop\New folder (3)>IF "C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube.MKV" == "" GOTO endparse
    
    C:\Users\ujang\Desktop\New folder (3)>call :handle_one_file "C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube.MKV"
    
    C:\Users\ujang\Desktop\New folder (3)>"C:\PySceneDetect-0.4-win64-portable\scenedetect.exe" --input "C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube.MKV" --output "C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube-.MKV"
    [PySceneDetect] Detecting scenes (threshold mode)...
    [matroska,webm @ 000000000090ce60] Duplicate element
    [matroska,webm @ 000000000090ce60] Duplicate element
    [matroska,webm @ 000000000090ce60] Duplicate element
    [PySceneDetect] Parsing video Lighthouse Family - High - YouTube.MKV...
    [PySceneDetect] Video Resolution / Framerate: 640 x 480 / 25.000 FPS
    Verify that the above parameters are correct (especially framerate, use --force-fps to correct if required).
    [PySceneDetect] Processing complete, found 46 scenes in video.
    [PySceneDetect] Processed 7818 / 7818 frames read in 20.1 secs (avg 388.5 FPS).
    [PySceneDetect] Comma-separated timecode output:
    00:00:10.000,00:00:28.520,00:00:30.920,00:00:40.560,00:00:44.880,00:00:49.920,00:00:59.440,00:01:01.480,00:01:08.800,00:01:13.640,00:01:18.800,00:01:21.080,00:01:23.120,00:01:24.840,00:01:28.240,00:01:39.920,00:01:44.920,00:01:46.720,00:01:53.360,00:01:55.560,00:02:05.320,00:02:10.080,00:02:14.760,00:02:24.480,00:02:43.640,00:02:52.520,00:03:02.320,00:03:04.080,00:03:08.360,00:03:11.720,00:03:21.200,00:03:26.200,00:03:27.560,00:03:33.520,00:03:41.280,00:03:44.840,00:03:51.440,00:03:56.360,00:03:59.840,00:04:01.960,00:04:03.120,00:04:12.520,00:04:23.560,00:04:27.320,00:04:32.680,00:04:36.760
    [PySceneDetect] Splitting video into clips...
    mkvmerge v9.7.1 ('Pandemonium') 64bit
    'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube.MKV': Using the demultiplexer for the format 'Matroska'.
    'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube.MKV' track 0: Using the output module for the format 'VP8/VP9'.
    'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube.MKV' track 1: Using the output module for the format 'Opus'.
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--001.MKV' has been opened for writing.
    Progress: 1%
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--002.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--003.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--004.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--005.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--006.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--007.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--008.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--009.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--010.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--011.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--012.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--013.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--014.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--015.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--016.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--017.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--018.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--019.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--020.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--021.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--022.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--023.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--024.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--025.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--026.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--027.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--028.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--029.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--030.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--031.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--032.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--033.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--034.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--035.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--036.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--037.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--038.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--039.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--040.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--041.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--042.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--043.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--044.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--045.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--046.MKV' has been opened for writing.
    
    The cue entries (the index) are being written...
    The file 'C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube--047.MKV' has been opened for writing.
    Progress: 100%
    The cue entries (the index) are being written...
    Multiplexing took 0 seconds.
    [PySceneDetect] Finished writing scenes to output.
    
    C:\Users\ujang\Desktop\New folder (3)>if errorlevel 1 goto skip_delete
    
    C:\Users\ujang\Desktop\New folder (3)>REM remove /q if you want automatic deletion.
    
    C:\Users\ujang\Desktop\New folder (3)>del /q "C:\Users\ujang\Desktop\New folder (3)\Lighthouse Family - High - YouTube.MKV"
    
    C:\Users\ujang\Desktop\New folder (3)>exit /b
    
    C:\Users\ujang\Desktop\New folder (3)>SHIFT
    
    C:\Users\ujang\Desktop\New folder (3)>GOTO parse
    
    C:\Users\ujang\Desktop\New folder (3)>IF "" == "" GOTO endparse
    
    C:\Users\ujang\Desktop\New folder (3)>pause
    Press any key to continue . . .
    the video is being splited and original video is deleted,
    thanks for reply
    Quote Quote  
  27. Video is deleted because it did not throw any error, it just did not found any scene change. Again with this sort of program, where result has to be tuned up or it is uncertain , you should change your script so it does not delete original files.

    When it finds scene changes for one video and does not for the other could mean that that default threshold is just working for one video but not well for the other.
    Understand there is a reason for that parameter to be there, check my input #20. Go slow and read that website. You can use command line to just get that listing of scene changes in cvs file (if I remember correctly). After you find proper threshold use it in your batch.
    Quote Quote  
  28. When the program finds no scene changes it doesn't produce any output file and returns errorlevel 0 (success). So you have to test for the existence of a filename-001.mkv in addition to checking the errorlevel. So after the line:

    Code:
    if errorlevel 1 goto skip_delete
    add:

    Code:
    if not exist "%~dpn1--001%~x1" goto skip_delete
    When no scene changes are found the original file will not be deleted and there will be no new file.

    But what happens on various error conditions? Does the program always return a non-zero error code? This is why others have suggest automated deletion is a bad idea.
    Quote Quote  
  29. Originally Posted by jagabo View Post
    When the program finds no scene changes it doesn't produce any output file and returns errorlevel 0 (success). So you have to test for the existence of a filename-001.mkv in addition to checking the errorlevel. So after the line:

    Code:
    if errorlevel 1 goto skip_delete
    add:

    Code:
    if not exist "%~dpn1--001%~x1" goto skip_delete
    When no scene changes are found the original file will not be deleted and there will be no new file.

    But what happens on various error conditions? Does the program always return a non-zero error code? This is why others have suggest automated deletion is a bad idea.
    like this
    Code:
    :parse
    IF "%~1"=="" GOTO endparse
    call :handle_one_file %1
    SHIFT
    GOTO parse
    :endparse
    pause
    exit(0)
    
    :handle_one_file
    
    "C:\PySceneDetect-0.4-win64-portable\scenedetect.exe" --input "%~dpnx1" --output "%~dpn1-%~x1"
    if errorlevel 1 goto skip_delete
    if not exist "%~dpn1--001%~x1" goto skip_delete
    
    REM remove /q if you want automatic deletion.
    del /q %1
    
    :skip_delete
    exit /b
    thanks, i have try it and if it failed to split, the original data do not deleted
    Last edited by ujang; 7th Nov 2018 at 16:19.
    Quote Quote  



Similar Threads

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