sc0ty/subsync

Python script stuck

Closed this issue · 9 comments

Hi, I made a python script that calls subsync based on videofiles. Works great actually. But the last few weeks the script keeps hanging. When I force kill the python process the script continues. (But ends the current sync where it looks like it hangs).

Commandline
"/snap/bin/subsync --cli --verbose 3 --loglevel DEBUG --logfile /home/piet/Dockerd/subsync.log --max-point-dist 2.00 --min-points-no 0 --min-word-prob 0.30 --min-word-len 5 --min-correlation 0.9999 --min-words-sim 0.60 sync --sub-file \"%s.%s\" --sub-lang \"%s\" --ref-file \"%s.mkv\" --ref-lang eng --out-file \"%s.%s\" --effort 0.2 --overwrite"

Debuglog
https://pastebin.com/X0yXxy56

sc0ty commented

Unfortunately there is nothing in the logs that would tell me whats wrong. Looks like deadlock.
How reliably do you reproducing this?
Did you run different version before it started hanging? Did you build it yourself?

Hmm, oke thats too bad. Looks like its this one particular .mkv file that is causing this 'hanging'.

sc0ty commented

Could you mail me the link to this video? Assuming its not entirely legal, I'd like to not have such links here. You can find my address here. Also the subtitles if you will. I'd like to try to reproduce this myself.
Thanks.

Im sorry, missed the notification from github I guess. I dont have this video file anymore ;(
Trying to get it back

Link has been send to sc0typl [at] gmail [dot] com

sc0ty commented

Thanks, I know what's wrong now.
You have set --min-points-no 0 - setting this value to less than 2 has no sense. I should spot that earlier, sorry. I should add some sanity checks to prevent similar problems in the future. I've missed this because you are setting other options to they default values, so quick scan through arguments I've assumed everything is set as defaults. Can I ask why are you doing this?
In general setting --min-points-no to less than 10 points will yield false negatives (subsync will think that subtitles are synchronized before they really are).

I've set these default settings so I would be able to edit these on the fly. The reason min-points has been set to 0 is because sometimes a synchronisation isnt needed. But I still want it to output the .srt file. And this is because of how the script works, only .en.srt will be picked to synchronize.

Oops didnt mean to close it

sc0ty commented

Not only the points no is checked when it decides to save subtitles.
I'm planning to set exit code based on synchronization result, something like 0 for success, 1 for fail, other numbers for errors. That way it would be easy to script it e.g. to copy subtitles when it fails. I have to clean up headless code first since its a little tangled.

Also I've verified that this could only happen when --min-points-no is zero, its not some weird synchronization problem, so I'm closing it.