Giter Club home page Giter Club logo

Comments (17)

smacke avatar smacke commented on August 15, 2024 2

@BramFr since you posted, there have been a number of improvements to subsync -- I know this issue is super old, but I'd love to hear whether it's working for your case after the recent improvements, if/when you have time. The latest version can be grabbed via:

pip install --upgrade git+https://github.com/smacke/subsync@stable

If the sync still doesn't work, I would love to try to investigate further. It's now possible to build a tarball containing most of the data I need to investigate (without violating copyright), as follows:

subsync reference.mp4 -i unsynced.srt -o still-unsynced.srt --make-test-case

The resulting test archive will be named reference.mp4.${TIMESTAMP}.tar.gz and will probably be a few KiB in size. If sync is still not working and if you send it to me, I promise to do a detailed investigation!

from ffsubsync.

smacke avatar smacke commented on August 15, 2024

Thanks for filing an issue. It's likely that your video contains splits / breaks in the middle -- unfortunately, this project is geared toward the common case when there's extra stuff present / missing from the beginning or end of the video. I want to extend the algorithm to handle these cases (I believe it is possible), but I'm afraid I don't have the cycles at the moment. See #10 for more details.

from ffsubsync.

BramFr avatar BramFr commented on August 15, 2024

@smacke

Thanks for reopen this case..

After few trys ill find one:

# /usr/local/bin/subsync Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.mkv -i Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.en.srt -o Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.en2.srt --make-test-case
INFO:subsync.subsync:extracting speech segments from reference 'Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.mkv'...
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2573.472/2573.472 [00:29<00:00, 87.97it/s]
INFO:subsync.subsync:...done
INFO:subsync.subsync:serializing speech...
INFO:subsync.subsync:...done
INFO:subsync.subsync:extracting speech segments from subtitles 'Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.en.srt'...
INFO:subsync.subtitle_parser:detected encoding: UTF-8
INFO:subsync.subsync:...done
INFO:subsync.subsync:computing alignments...
INFO:subsync.subsync:...done
INFO:subsync.subsync:offset seconds: -96.130
INFO:subsync.subsync:framerate scale factor: 0.959
INFO:srt:Skipped subtitle at index 1: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 2: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 3: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 4: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 5: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 6: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 7: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 8: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 9: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 10: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 11: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 12: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 13: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 14: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 15: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 16: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 17: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 18: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 19: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 20: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 21: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 22: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 23: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 24: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 25: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 26: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 27: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 28: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 29: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 30: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 31: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 32: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 33: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 34: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 35: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 36: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 37: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 38: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 39: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 40: Start time < 0 seconds
INFO:subsync.subsync:creating test archive Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.mkv.2020-03-16-12:59:19.tar.gz...

After waiting a bit tar didn't succesful.

root@docker /m/n/0/M/Season 2# ls -hal | grep tar
-rw-rw-rw-+ 1     99     99 2.6G Mar 16 14:03 Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.mkv.2020-03-16-12:59:19.tar.gz
root@docker /m/n/0/M/Season 2# ls -hal | grep tar
-rw-rw-rw-+ 1     99     99 3.8G Mar 16 14:05 Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.mkv.2020-03-16-12:59:19.tar.gz
root@docker /m/n/0/M/Season 2# 

and still growing...

from ffsubsync.

smacke avatar smacke commented on August 15, 2024

@BramFr really appreciate your taking the time to take another look! Bummer about the test archive -- not sure exactly why that's happening. Possibly a problem with shutil on some version of Python -- what does python --version give you?

from ffsubsync.

smacke avatar smacke commented on August 15, 2024

@BramFr I think I figured out the issue; creating the test archive should work now if you install from the latest branch:

pip install --upgrade git+https://github.com/smacke/subsync@latest

Please let me know if you have a chance to try to make the test case and whether it works -- would love to take a closer look if so.

from ffsubsync.

BramFr avatar BramFr commented on August 15, 2024

python --version

# python --version
Python 3.7.5

from ffsubsync.

BramFr avatar BramFr commented on August 15, 2024

@BramFr I think I figured out the issue; creating the test archive should work now if you install from the latest branch:

pip install --upgrade git+https://github.com/smacke/subsync@latest

Please let me know if you have a chance to try to make the test case and whether it works -- would love to take a closer look if so.

# /usr/local/bin/subsync Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.mkv -i Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.en.srt -o Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.en2.srt --make-test-case
INFO:subsync.subsync:extracting speech segments from reference 'Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.mkv'...
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2573.472/2573.472 [00:29<00:00, 87.29it/s]
INFO:subsync.subsync:...done
INFO:subsync.subsync:serializing speech...
INFO:subsync.subsync:...done
INFO:subsync.subsync:extracting speech segments from subtitles 'Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.en.srt'...
INFO:subsync.subtitle_parser:detected encoding: UTF-8
INFO:subsync.subsync:...done
INFO:subsync.subsync:computing alignments...
INFO:subsync.subsync:...done
INFO:subsync.subsync:offset seconds: -96.130
INFO:subsync.subsync:framerate scale factor: 0.959
INFO:srt:Skipped subtitle at index 1: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 2: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 3: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 4: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 5: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 6: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 7: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 8: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 9: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 10: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 11: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 12: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 13: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 14: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 15: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 16: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 17: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 18: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 19: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 20: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 21: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 22: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 23: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 24: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 25: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 26: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 27: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 28: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 29: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 30: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 31: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 32: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 33: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 34: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 35: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 36: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 37: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 38: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 39: Start time < 0 seconds
INFO:srt:Skipped subtitle at index 40: Start time < 0 seconds
INFO:subsync.subsync:creating test archive Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.mkv.2020-03-16-16:09:04.tar.gz...
INFO:subsync.subsync:...done

Manifest.S02E09.iNTERNAL.1080p.WEB.H264-GHOSTS.mkv.2020-03-16-16:09:04.tar.gz

from ffsubsync.

smacke avatar smacke commented on August 15, 2024

@BramFr I think I see what is happening here. Those subtitles look like they're the 1st choice from opensubtitles.org, but they seem to be mislabeled -- perhaps they are for a different episode of that TV show. I'd love to know if these ones work, if you have a chance to try them instead. (You'll be able to see that the text content differs significantly from the ones you attached.)

manifest.s02.e09.airplane.bottles.(2020).eng.1cd.(8121898).zip

from ffsubsync.

BramFr avatar BramFr commented on August 15, 2024

sorry indeed wrong test i`ll find another one. Every subtitle came from bazarr (automatic)

from ffsubsync.

smacke avatar smacke commented on August 15, 2024

Gotcha. I need to see whether I can convince SubZero / Bazarr folks to use subsync as a tool for picking out already synced subtitles out of a batch of candidates; could potentially help filter these kinds of cases where the metadata is bad. And please @BramFr no need to apologize -- it's thanks to these kinds of test cases that I can continue making improvements, so I really appreciate the time you've already spent so far.

from ffsubsync.

BramFr avatar BramFr commented on August 15, 2024

i found one :)

# /usr/local/bin/subsync Man.with.a.Plan.S03E13.iNTERNAL.720p.WEB.x264-BAMBOOZLE.mkv -i Man.with.a.Plan.S03E13.iNTERNAL.720p.WEB.x264-BAMBOOZLE.en.srt -o Man.with.a.Plan.S03E13.iNTERNAL.720p.WEB.x264-BAMBOOZLE.en2.srt --make-test-case
INFO:subsync.subsync:extracting speech segments from reference 'Man.with.a.Plan.S03E13.iNTERNAL.720p.WEB.x264-BAMBOOZLE.mkv'...
100%|████████████████████████████████████████████████████████████████████▉| 1251.392/1251.416 [00:09<00:00, 133.55it/s]
INFO:subsync.subsync:...done
INFO:subsync.subsync:serializing speech...
INFO:subsync.subsync:...done
INFO:subsync.subsync:extracting speech segments from subtitles 'Man.with.a.Plan.S03E13.iNTERNAL.720p.WEB.x264-BAMBOOZLE.en.srt'...
INFO:subsync.subtitle_parser:detected encoding: ASCII
INFO:subsync.subsync:...done
INFO:subsync.subsync:computing alignments...
INFO:subsync.subsync:...done
INFO:subsync.subsync:offset seconds: 6.190
INFO:subsync.subsync:framerate scale factor: 1.000
INFO:subsync.subsync:creating test archive Man.with.a.Plan.S03E13.iNTERNAL.720p.WEB.x264-BAMBOOZLE.mkv.2020-03-17-06:52:55.tar.gz...
INFO:subsync.subsync:...done

The first 5min`s of this file "en.srt" is good. After 5min i get a intro with a black screen. After that subtile is out of sync.

This file "en2.srt" already out-of-sync from the beginning.

Man.with.a.Plan.S03E13.iNTERNAL.720p.WEB.x264-BAMBOOZLE.mkv.2020-03-17-06:52:55.tar.gz

from ffsubsync.

hboetes avatar hboetes commented on August 15, 2024

Forget about it, this srt is toast

from ffsubsync.

smacke avatar smacke commented on August 15, 2024

@BramFr unfortunately it looks like I need the exact video (and not just the speech trace) to debug, and I'm afraid I'm having trouble locating it. One workaround would be if the mkv has embedded subs -- that would serve as a good proxy. If the following command succeeds, I can debug by looking at the resulting extracted subs:

ffmpeg -i Man.with.a.Plan.S03E13.iNTERNAL.720p.WEB.x264-BAMBOOZLE.mkv -map 0:s:1 out.srt

from ffsubsync.

BramFr avatar BramFr commented on August 15, 2024

@BramFr unfortunately it looks like I need the exact video (and not just the speech trace) to debug, and I'm afraid I'm having trouble locating it. One workaround would be if the mkv has embedded subs -- that would serve as a good proxy. If the following command succeeds, I can debug by looking at the resulting extracted subs:

ffmpeg -i Man.with.a.Plan.S03E13.iNTERNAL.720p.WEB.x264-BAMBOOZLE.mkv -map 0:s:1 out.srt

Stream map '0:s:1' matches no streams.

i`ll send you a mail trough gmail with the episode.

from ffsubsync.

Kitof avatar Kitof commented on August 15, 2024

I've got another exemple of out-sync. Subsync detect -0.8 offset instead of -3.840.
files.zip

from ffsubsync.

kocane avatar kocane commented on August 15, 2024

In my case, Bazarr downloads a subtitle that is actually in sync but then ffsubsync decides to unsync it by a tiny bit. Trying to figure out why. I'd like Bazarr to sync all subtitles regardless of score so I'm trying to figure out why it doesn't just leave this one alone.

The.Wire.S01E11.The.Hunt.1080p.WEB-DL.DD5.1.H.264-NTb.mkv.2020-07-01-00 33 07.tar.gz

@smacke

from ffsubsync.

BramFr avatar BramFr commented on August 15, 2024

@smacke do you have a update? Do you need any more information from me?

from ffsubsync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.