A command-line tool written in Go to convert SBV (SubViewer) subtitle files to SRT (SubRip) format.
- ✅ Convert SBV files to SRT format
- ✅ Automatic output file naming (when no output path is specified)
- ✅ Comprehensive input validation and error handling
- ✅ Cross-platform support (Linux, Windows, macOS)
- ✅ CLI with Cobra framework for robust argument parsing
- ✅ Built with Go 1.24.3 and modern Go practices
- ✅ Comprehensive test coverage with unit and integration tests
git clone https://github.com/un-versed/go-sbv-to-srt.git
cd go-sbv-to-srt
go build -o go-sbv-to-srt
go install github.com/un-versed/go-sbv-to-srt@latest
This project uses minimal external dependencies:
- Cobra v1.9.1 - CLI framework for robust command-line interface
- Go standard library - For file I/O, string processing, and time handling
No additional runtime dependencies are required.
# Convert SBV file (output will be created in same directory with .srt extension)
go-sbv-to-srt -i input.sbv
# Specify custom output path
go-sbv-to-srt -i input.sbv -o output.srt
# Using long flags
go-sbv-to-srt --input video.sbv --output subtitles.srt
-i, --input
: Input SBV file path (required)-o, --output
: Output SRT file path (optional)-h, --help
: Show help informationversion
: Show version informationcompletion
: Generate shell completion scripts
# Convert subtitle.sbv to subtitle.srt in the same directory
go-sbv-to-srt -i subtitle.sbv
# Convert with custom output location
go-sbv-to-srt -i ./videos/movie.sbv -o ./subtitles/movie.srt
# Show help
go-sbv-to-srt --help
# Show version information
go-sbv-to-srt version
# Generate bash completion
go-sbv-to-srt completion bash > /etc/bash_completion.d/go-sbv-to-srt
# Generate zsh completion
go-sbv-to-srt completion zsh > "${fpath[1]}/_go-sbv-to-srt"
SBV (SubViewer) is a subtitle format commonly used by YouTube and other video platforms. It uses timestamps in the format HH:MM:SS.mmm,HH:MM:SS.mmm
followed by subtitle text.
Example SBV format:
0:00:01.000,0:00:04.000
This is a sample subtitle
that spans multiple lines.
0:00:05.500,0:00:08.200
This is another subtitle entry.
SRT (SubRip) is a widely supported subtitle format that can be used with most media players and video editing software.
Example SRT format:
1
00:00:01,000 --> 00:00:04,000
This is a sample subtitle
that spans multiple lines.
2
00:00:05,500 --> 00:00:08,200
This is another subtitle entry.
- Accurate timestamp conversion: Handles SBV's colon-separated format to SRT's arrow-separated format
- Multi-line text preservation: Maintains original line breaks and formatting
- Sequential numbering: Automatically generates SRT sequence numbers
- Error handling: Validates timestamp formats and provides helpful error messages
- Go 1.24.3 or later
- Make (optional, for using Makefile)
- Git (for version information)
# Clone and build
git clone https://github.com/un-versed/go-sbv-to-srt.git
cd go-sbv-to-srt
make build
# Or use the build script (includes version info)
./build.sh
# Or use Go directly
go build -o go-sbv-to-srt
make build
- Build the applicationmake test
- Run all testsmake test-coverage
- Run tests with coverage reportmake test-race
- Run tests with race detectionmake clean
- Clean build artifactsmake deps
- Install dependenciesmake fmt
- Format codemake vet
- Vet code for issuesmake lint
- Lint code (requires golangci-lint)make build-all
- Build for multiple platforms (Linux, Windows, macOS)make run-sample
- Run with sample test datamake dev
- Complete development workflow (deps, fmt, vet, test, build)make help
- Show all available targets
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes and add tests
- Run the full test suite (
make test
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- CLI scaffolding with proper argument parsing (Cobra framework)
- Input/output validation with comprehensive error handling
- SBV file parsing with robust timestamp handling
- SRT file generation with proper formatting
- Comprehensive test coverage (unit and integration tests)
- Cross-platform build support and automation
- Development tooling and Make targets
- GitHub Actions CI/CD pipeline (build, test, release workflows)
- Shell completion support (bash, zsh, fish, PowerShell)
- Version command and build information
- Batch conversion support (convert multiple files at once)