Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: list index out of range #79

raj6996 opened this issue Sep 20, 2018 · 1 comment

IndexError: list index out of range #79

raj6996 opened this issue Sep 20, 2018 · 1 comment


Copy link

raj6996 commented Sep 20, 2018

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:
[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:
[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:
[PySceneDetect] Scene List:
 | Scene # | Start Frame |  Start Time  |  End Frame  |   End Time   |


[PySceneDetect] Splitting input video using mkvmerge, output path template:
Traceback (most recent call last):
  File "c:\python37\lib\site-packages\click\", line 700, in main
  File "c:\python37\lib\site-packages\click\", line 484, in exit
SystemExit: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\python37\lib\", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python37\lib\", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python37\Scripts\scenedetect.exe\", line 9, in <module>
  File "c:\python37\lib\site-packages\scenedetect\", line 58, in main
    cli.main(obj=cli_ctx)   # Parse CLI arguments with registered callbacks.
  File "c:\python37\lib\site-packages\click\", line 700, in main
  File "c:\python37\lib\site-packages\click\", line 331, in __exit__
  File "c:\python37\lib\site-packages\click\", line 420, in close
  File "c:\python37\lib\site-packages\scenedetect\cli\", line 425, in process_input
    suppress_output=self.quiet_mode or self.split_quiet)
  File "c:\python37\lib\site-packages\scenedetect\", 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)

Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants