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

Ocr does not start from 0 #6

Open
Alexisback opened this issue Feb 27, 2025 · 7 comments
Open

Ocr does not start from 0 #6

Alexisback opened this issue Feb 27, 2025 · 7 comments

Comments

@Alexisback
Copy link

Alexisback commented Feb 27, 2025

Congratulations for the program, really well done and working.
There are some things I would like to report.

  1. Ocr does not start from 0 but after 5 seconds, there are some subs that it leaves out in this case.

  2. I would like the subs to be generated like the originals, if there are line changes then the program should also do it.

I don't know anything else.. I'm testing the program (the desktop version VSE-windows-cpu) and in case of other doubts I will insert them here
Thanks

Ps: Some guidance for the Preferences menu would be helpful

@voun7
Copy link
Owner

voun7 commented Feb 27, 2025

  1. I have not experienced this. Does this happen with just one video?
  2. I'm not sure what you mean by line changes, but srt doesn't allow for much customization of text.

Which part of the preference menu do you need help with?

@Alexisback
Copy link
Author

Alexisback commented Feb 28, 2025

Hi voun7

He does this with all his videos..
I'm referring to the time cursor, 00.00.00.000 does not correspond exactly to the beginning,
I open the video and even if it says 00.00.00.000 it is actually 5 seconds ahead, moving with <--- on the keyboard the video should stop at the beginning but instead it continues from the end,
maybe it's a bug in the cursor

Image

@voun7
Copy link
Owner

voun7 commented Feb 28, 2025

Sorry about that. I have been unable to reproduce this, and I have not experienced it before. The video in the project's test folder also doesn't give this problem. Could you make a similar above image with this video.

@Alexisback
Copy link
Author

Alexisback commented Feb 28, 2025

Try this , You will see that ocr starts after 5 seconds, exactly from Sceneggiatura, but before that there is some more text
https://odysee.com/@cinemarusso:c/Winnie-Puh:7

you can download it from here

Image

@Alexisback
Copy link
Author

I don't see the other OCR languages

Image

@voun7
Copy link
Owner

voun7 commented Feb 28, 2025

Use the latest version to see all supported languages.

Something is definitely wrong with the encoding of the Winnie Puh video or the way the site encodes downloads. I had to download it 3 times before I could get a copy of the video that wasn't frozen towards the end.

The video is processed by OpenCV in a strange way. The first frame OpenCV sees is not the first frame of the video when played with a media player.

import cv2 as cv

file = "Winnie Puh-sub.mp4"
capture = cv.VideoCapture(file)

capture.set(cv.CAP_PROP_POS_FRAMES, 0)  # 0 should represent the first frame of the video

_, image = capture.read()

cv.imshow(file, image)  # but the frame show isn't the first frame
cv.waitKey()
cv.destroyAllWindows()
capture.release()

For now, I'm unable to fix this. Try videos from other sites and see if the same thing happens. As for the line changes you mentioned previously, after seeing this video, I think I understand what you mean. You want the extracted subtitles to maintain their different lines of the text instead of being joined on the same line. I should be able to do something about that.

@Alexisback
Copy link
Author

Alexisback commented Feb 28, 2025

I downloaded the latest version and I see all the ocr languages ​​now.
If you have problems downloading from the browser try with yt-dlp (it is on Github)

yt-dlp.exe https://odysee.com/@cinemarusso:c/Winnie-Puh:7

exactly you understood, the generated subs are on the same line, it would be convenient to place them like the original in a new line or many

Before your software I used VideoSubFinder, great program but requires an external ocr and many steps before getting the result.
This allows you to load the video with both OpenCV and FFMPEG.
Maybe the problem is OpenCV?

Image

https://www.videohelp.com/software/VideoSubFinder

anyway even with that and open with FFMPEG the OCR is positioned a little ahead, 2 seconds against the 5-8 of Video_Sub_Extractor

I'll try with other videos and let you know.

Thanks

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

No branches or pull requests

2 participants