Skip to content

'Error splitting video (ffmpeg returned 1) ' occurs while using 'split_video_ffmpeg' #392

Closed
@MqLeet

Description

@MqLeet

Description:

Here is my spliting code:

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



def split_video_into_scenes(video_path, 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()
    # import pdb; pdb.set_trace()
    split_video_ffmpeg(input_video_path=video_path, scene_list=scene_list, output_dir='test4longsplit', show_progress=True)


if __name__ == '__main__':
    video_path = 'sampled_videos/tokyo-walk.mp4'
    split_video_into_scenes(video_path=video_path)

Command:

I run the python python scene_detect.py in command line

Output:

And I got the error like this:

  Detected: 1 | Progress: 100%|██████████| 1799/1799 [00:03<00:00, 583.63frames/s]
  0%|          | 0/1799 [00:00<?, ?frame/s]Error splitting video (ffmpeg returned 1).
  0%|          | 0/1799 [00:00<?, ?frame/s]

How can I solve it?

Environment:
System Info

OS Linux-3.10.0-957.el7.x86_64-x86_64-with-glibc2.17
Python 3.9.18

Packages

av 12.0.4
click 8.1.7
cv2 4.9.0
moviepy Not Installed
numpy 1.26.4
platformdirs 4.2.0
scenedetect 0.6.3
tqdm 4.66.2

Tools

ffmpeg 9c33b2f
mkvmerge Not Installed

Media/Files:

Video link: https://cdn.openai.com/sora/videos/tokyo-walk.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions