Sign inSign up

brunopoiano/subtitle-extract

By brunopoiano

•Updated 10 months ago

SubExtract is a Go application that automatically extracts embedded subtitles from video files

Image
Web servers
1

899

brunopoiano/subtitle-extract repository overview

⁠SubExtract

SubExtract is a Go application that automatically extracts embedded subtitles from video files. It recursively searches through directories, detects video files with embedded subtitle tracks, and extracts them into separate SRT files.

⁠Features

  • Automatic discovery of video files in folders and subfolders
  • Multi-language subtitle extraction (preserves original language codes)
  • Parallel processing using worker pools for improved performance
  • Skips files that already have extracted subtitles
  • Supports multiple video formats (MP4, MKV, AVI, MOV, WMV, FLV, WEBM)

⁠Requirements (locally)

  • Go 1.16 or higher
  • FFmpeg (must be installed and available in your system PATH)

⁠Deployment Options

⁠Option 1: Pull from Docker Hub
docker run -d \
  --name subextract \
  --restart unless-stopped \
  -e TZ=America/Sao_Paulo \
  -v /location/of/videos:/app/subextract/videos:rw \
  docker.io/brunopoiano/subtitle-extract
⁠Option 2: Using Docker Compose
git clone https://github.com/BrunoPoiano/subtitle-extract-go
cd subtitle-extract-go
docker compose up -d
⁠Running from Source
  1. Clone the repository:

    git clone https://github.com/BrunoPoiano/subtitle-extract-go
    cd subtitle-extract-go
    
  2. Configure the root directory where your videos are stored by modifying the rootFolder variable in main.go:

    var rootFolder = "/path/to/your/videos"
    
  3. Test the application:

    go run .
    
  4. Build the application:

    go build -o subextract .
    
  5. Run the compiled binary:

    ./subextract
    

⁠Performance Considerations

  • The application uses a worker pool pattern to process multiple video files concurrently
  • By default, it utilizes all available CPU cores minus one to avoid system overload
  • For large libraries, the initial scan may take some time

⁠Troubleshooting

  • Ensure FFmpeg is properly installed and accessible in your PATH
  • Check permissions on your video directories
  • Review logs for any error messages
  • For Docker installations, ensure your volume mounts are correct

⁠Acknowledgments

  • FFmpeg for the underlying subtitle extraction functionality

Tag summary

Content type

Image

Digest

sha256:1c076e642…

Size

49.7 MB

Last updated

10 months ago

docker pull brunopoiano/subtitle-extract