Jump to content

Auto Sync for Subtitles


Recommended Posts

adminExitium
Posted

Auto Sync for Subtitles was recently added in Plex: https://support.plex.tv/articles/auto-sync-subtitles/

It uses the voice activity data so doesn't deal with signs etc. like in ASS subtitles, but it is still a significant improvement, especially when downloading subtitles on demand from OpenSubtitles etc.

  • Like 9
  • Disagree 1
  • Agree 3
  • Thanks 1
  • 2 months later...
AlexandreSOLA
Posted

Hi I do not know if this would help, but I installed this docker image :  https://hub.docker.com/r/domainvault/subsync.smacke

And then used this code : 

#!/bin/bash

/volume1/@appstore/inotify-tools/bin/inotifywait -m -r -e create --format '%w%f' "/movie1" "/movie2" "/series" | while read -r NEW_FILE
do
  if [[ "$NEW_FILE" == *.srt ]]; then
    # Extract the directory and base name
    DIR=$(dirname "$NEW_FILE")
    BASE_NAME=$(basename "$NEW_FILE" | sed -E 's/(\.[0-9]*)?(\.[a-z]{2})?(\.sdh)?(\.forced)?\.srt$//')
    VIDEO_FILE="$DIR/$BASE_NAME.mkv"
    
    if [[ -f "$VIDEO_FILE" ]]; then
    #subsync is used via docker to sync the newly added subtitle. ffsubsync is the container name.  
    sudo docker exec ffsubsync subsync "$VIDEO_FILE" -i "$NEW_FILE" -o "$NEW_FILE" >> log.txt 2>&1
    else
      echo "Video file $VIDEO_FILE not found for subtitle $NEW_FILE" >> log.txt 2>&1
    fi
  fi
done >> log.txt 2>&1

For me it does the trick. Everytime a new .srt is added to my folders with Emby subtitle download feature, then this script is trigerred  and the subtitle is synced to the associated video file. 

It is necessary to install inotifywait also which is available on the synology app store for me. 

 

  • 2 weeks later...
GoldenSpider
Posted

Piggybacking on this. even if a full on Audio sync is not possible it would be great to just overhaul the Subtitle Offset function in general. The ability to adjust it by Milliseconds is great. but often that is far too granular for what is needed. if a subtitle is off by milliseconds I rarely notice, my issue is that generally subtitles are off my minutes. meaning that if I want to use the subtitle offset function to fix it I have to click a lot of times in order to offset it properly. Would be great to have an additional set of buttons that let you offset subtitles by 1 second or 30 second intervals rather then just 50ms

  • Like 1
  • Agree 1
GoldenSpider
Posted
On 11/22/2024 at 4:27 PM, AlexandreSOLA said:

Hi I do not know if this would help, but I installed this docker image :  https://hub.docker.com/r/domainvault/subsync.smacke.

Could you possibly post a tutorial on how to do all that? I cant find inotify in my syno store and still can't figure out how to do it all with the dockers

  • Like 1
  • Agree 1
  • 3 weeks later...
Embodiment
Posted

I agree the Subtitle Offset function is a plus, but as above, I need it to go beyond the <20> ms limit. I am a new user to Emby and when I tried to sync a movie with the function, I needed just a bit more advancement, but was limited to 20. I am not sure why there needs to be a limit of 20. I have used Kodi's CC adjustment and it seems like it is unlimited.

  • 1 month later...
fricelander
Posted

I'm in for this feature as well, so far I'm using Subtitle Speech Synchronizer but would be great to have that automatic 

AlexandreSOLA
Posted
On 12/5/2024 at 6:44 PM, GoldenSpider said:

Could you possibly post a tutorial on how to do all that? I cant find inotify in my syno store and still can't figure out how to do it all with the dockers

Hi, to have inotify in the synology app store, you need to add the SynoCommunity (http://packages.synocommunity.com) as an additonal package source.  

  • 6 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...