Skip to content

IndexError: list index out of range #79

Closed

Description

@raj6996

Bug/Issue Description:

PS C:\Users\YL> scenedetect -i "G:\MGPM\Mo.mp4" -o "G
:\MGPM\1" detect-threshold -t 12 -p 95 list-scenes split-video --copy
[PySceneDetect] Output directory set:
  G:\MGPM\1
[PySceneDetect] Loaded 1 video, framerate: 50.00 FPS, resolution: 720 x 404
[PySceneDetect] Downscale factor set to 3, effective resolution: 240 x 134
[PySceneDetect] Scene list CSV file name format:
  $VIDEO_NAME-Scenes.csv
[PySceneDetect] Video output file name format: $VIDEO_NAME-Scene-$SCENE_NUMBER
[PySceneDetect] Detecting scenes...
100%|████████████████████████████████████████████████████████████████████▉| 129408/129409 [02:19<00:00, 928.74frames/s]
[PySceneDetect] Processed 129408 frames in 139.3 seconds (average 928.74 FPS).
[PySceneDetect] No scenes detected.
[PySceneDetect] Writing scene list to CSV file:
  G:\MGPM\1\Mo.csv
[PySceneDetect] Scene List:
-----------------------------------------------------------------------
 | Scene # | Start Frame |  Start Time  |  End Frame  |   End Time   |
-----------------------------------------------------------------------

-----------------------------------------------------------------------

[PySceneDetect] Splitting input video using mkvmerge, output path template:
  G:\MGPM\1\$VIDEO_NAME-Scene-$SCENE_NUMBER.mkv
Traceback (most recent call last):
  File "c:\python37\lib\site-packages\click\core.py", line 700, in main
    ctx.exit()
  File "c:\python37\lib\site-packages\click\core.py", line 484, in exit
    sys.exit(code)
SystemExit: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python37\Scripts\scenedetect.exe\__main__.py", line 9, in <module>
  File "c:\python37\lib\site-packages\scenedetect\__main__.py", line 58, in main
    cli.main(obj=cli_ctx)   # Parse CLI arguments with registered callbacks.
  File "c:\python37\lib\site-packages\click\core.py", line 700, in main
    ctx.exit()
  File "c:\python37\lib\site-packages\click\core.py", line 331, in __exit__
    self.close()
  File "c:\python37\lib\site-packages\click\core.py", line 420, in close
    cb()
  File "c:\python37\lib\site-packages\scenedetect\cli\context.py", line 425, in process_input
    suppress_output=self.quiet_mode or self.split_quiet)
  File "c:\python37\lib\site-packages\scenedetect\video_splitter.py", line 157, in split_video_mkvmerge
    total_frames = scene_list[-1][1].get_frames() - scene_list[0][0].get_frames()
IndexError: list index out of range
PS C:\Users\YL>

Computing Environment:

  • OS: x64 Win10 Pro
  • Python Version: x64 3.7
  • OpenCV Version: Latest
    Additional Information:
    csv file content:

Scene Number,Start Frame,Start Timecode,Start Time (seconds),End Frame,End Timecode,End Time (seconds),Length (frames),Length (timecode),Length (seconds)

Activity

  1. Breakthrough commented on Sep 23, 2018

    @Breakthrough
    Owner

    Hi @raj6996;

    Good find. This bug is triggered when no scenes have detected, and the split-video command was specified.

    I will push a fix to the master branch, and include the bugfix in the next official release of PySceneDetect. I will close this issue when the push has been added; you can download it by installing the latest version of PySceneDetect from source manually in the meantime.

    Thank you for your submission!

  2. added this to the v0.5.1 milestone on Jul 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions