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

Closed
raj6996 opened this issue Sep 20, 2018 · 1 comment
Closed

IndexError: list index out of range #79

raj6996 opened this issue Sep 20, 2018 · 1 comment
Labels
Milestone

Comments

@raj6996
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:
  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)

@Breakthrough
Copy link
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!

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

No branches or pull requests

2 participants