victorjoh / hard-subs-to-srt

Creates an SRT file from a video file that has hardcoded subtitles
MIT License
23 stars 2 forks source link

Empty output srt file, with the same error repeated hundreds of times #4

Open chaitanyathengdi opened 3 months ago

chaitanyathengdi commented 3 months ago

This is what I got when I tried to run an mkv file through the script:

  1 [NULL @ 0000012864b27400] non-existing PPS 0 referenced
...
219 [NULL @ 0000012864b27400] non-existing PPS 0 referenced
220 [NULL @ 0000012864b27400Traceback (most recent call last):
      File "E:\Projects\hard-subs-to-srt\hard_subs_to_srt.py", line 295, in <module>
        main()
      File "E:\Projects\hard-subs-to-srt\hard_subs_to_srt.py", line 77, in main
        extract_srt(args.video_file, args.srt_file)
      File "E:\Projects\hard-subs-to-srt\hard_subs_to_srt.py", line 89, in extract_srt
        convert_frames_to_srt(video, FIRST_FRAME)
      File "E:\Projects\hard-subs-to-srt\hard_subs_to_srt.py", line 129, in convert_frames_to_srt
        monochrome_frame = to_monochrome_subtitle_frame(cropped_frame)
      File "E:\Projects\hard-subs-to-srt\hard_subs_to_srt.py", line 248, in to_monochrome_subtitle_frame
        img = cv2.cvtColor(cropped_frame, cv2.COLOR_BGR2GRAY)
    cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

233 ] non-existing PPS 0 referenced
234 [NULL @ 0000012864b27400] non-existing PPS 0 referenced
...
263 [h264 @ 0000012864b53a80] co located POCs unavailable
264 [NULL @ 0000012864b27400] non-existing PPS 0 referenced
265 [h264 @ 0000012877f8d140] co located POCs unavailable
266 [NULL @ 0000012864b27400] non-existing PPS 0 referenced
...
279 [NULL @ 0000012864b27400] non-existing PPS 0 referenced

The numbers are line numbers. 1 .... 219 means it repeats 219 times.

Also the stacktrace seems to come between the ...b27400 (line 220) and ] (line 233). Don't know what that is supposed to mean.

Also, if this is relevant: the file in question has hardcoded subtitles in Spanish, a size of about 1 GB, and a run time of 48 minutes 36 seconds.