Breakthrough / PySceneDetect

:movie_camera: Python and OpenCV-based scene cut/transition detection program & library.

Home Page:https://www.scenedetect.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

url input ,1080p video much slower

babyta opened this issue · comments

as title,when test,i found that problem。Looking forward to your reply

I'm not sure this is enough information to go by, could you please provide:

Description:

Describe what the bug or issue is (e.g. crashes when setting X) and how it can be reproduced.

Command:

Place a full copy of the command line options you are using here, for example:

scenedetect -i some_video.mp4 -s some_video.stats.csv -o outdir detect-content --threshold 28 list-scenes save-images

Output:

Copy the output of running the application here. Where possible, generate a debug log by adding -v debug -l BUG_REPORT.txt to the beginning of your command, and attach BUG_REPORT.txt to your issue.

Environment:

The operating system and how you installed PySceneDetect may be relevant to the issue. Please run scenedetect version --all and copy the output here, or provide other details on how PySceneDetect was installed.

Media/Files:

Attach or link to any files relevant to the issue, including videos (or YouTube links), scene files, stats files, and log output.

https://drive.google.com/file/d/1h5tztZkpV6ziJzgtVieJqcnhF4Bo82f_/view?usp=sharing
=================This is the url
image
=================This is a speed comparison. The URL input is very slow, but the same video is downloaded locally as input and the strips are split very quickly.

from scenedetect import open_video, SceneManager, split_video_ffmpeg
from scenedetect.detectors import ContentDetector
from scenedetect.video_splitter import split_video_ffmpeg

video_path = '1080pvdieo.mp4'
threshold=27.0

Open our video, create a scene manager, and add a detector.

video = open_video(video_path)
scene_manager = SceneManager()
scene_manager.add_detector(
ContentDetector(threshold=threshold))
scene_manager.detect_scenes(video, show_progress=True)
scene_list = scene_manager.get_scene_list()

================= this is code

URL input is handled by OpenCV if you don't change anything, have you tried using a different backend? https://www.scenedetect.com/docs/0.6.2/api/backends.html

Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\test.py", line 9, in
video = open_video(video_path, backend='pyav')
File "D:\ProgramData\miniconda3\envs\py39pt1121\lib\site-packages\scenedetect_init_.py", line 143, in open_video
return backend_type(path, framerate, **kwargs)
File "D:\ProgramData\miniconda3\envs\py39pt1121\lib\site-packages\scenedetect\backends\pyav.py", line 107, in init
self._io = open(path_or_io, 'rb')
OSError: [Errno 22] Invalid argument

When I use pyav as backends, I get an error directly.

cv2.VideoCapture When reading a URL, if the video resolution corresponding to the URL is very high and the data rate is very high, it will be very slow.

Thank you for following up on this, I appreciate it. If you suspect this is due to OpenCV and isn't just an issue with using ffmpeg (or which ever backend OpenCV itself is using to process the stream), you might want to reach out in their repo.

Best regards!