Sign inSign up

zzeneg/mergesrt

By zzeneg

•Updated about 5 years ago

Docker container for monitoring subtitle files and merging them into video

Image
1

4.0K

zzeneg/mergesrt repository overview

⁠docker-mergesrt

Docker container for monitoring subtitle files and merging them into video

Source code on GitHub⁠

⁠Features

  • search for existing *.lang.srt files
  • monitor for new *.lang.srt files
  • merge subtitles to mkv/mp4 files
  • replace existing subtitles with the same language
  • remove merged *.lang.srt files
  • send notification to a webhook after a merge (success/fail)

⁠Requirements

  • a folder with media files should be mapped to /data
  • SRT file should have a language in its name in ISO 639-2⁠ format, e.g. name.eng.srt. If you're using Bazarr⁠ to automatically download subtitles, you can set a post-processing script to automatically convert ISO 639-1 to ISO 639-2:
    mv "{{subtitles}}" "{{directory}}/{{episode_name}}.{{subtitles_language_code3}}.srt" && echo
    
    (&& echo is required because bazarr can't handle scripts ending with quotes)

⁠Usage

  • specify environment variables for a webhook (optional):

    • WEBHOOK_URL - URL for the POST request. For example you can use Apprise⁠
    • WEBHOOK_TEMPLATE - template for the POST request body. Note that all double quotes " should be escaped by a backslash \ and dollar signs $ should be doubled. You can use variables in this template:
      • $SRT_FILE - full path to the subtitle file
      • $VIDEO_FILE - full path to the video file
      • $LANG - ISO 639-2 language code of the subtitles
      • $RESULT - merge result, returns merge succeeded, merge completed with warnings or merge failed
  • docker-compose example

    mergesrt:
      container_name: mergesrt
      image: zzeneg/mergesrt
      restart: unless-stopped
      environment:
        WEBHOOK_URL: http://apprise:8000/notify
        WEBHOOK_TEMPLATE: '{\"title\":\"*MergeSRT - $$RESULT*\", \"body\":\"$$SRT_FILE\"}'
      volumes:
        - /media:/data
    

Tag summary

Content type

Image

Digest

Size

11.5 MB

Last updated

about 5 years ago

docker pull zzeneg/mergesrt