Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
ec92a91
bump cmake_minimum_required and C standard
csingleplus Feb 18, 2026
5454a8b
add <climits> for UINT_MAX
csingleplus Feb 18, 2026
a1b49d6
revert cmake version
csingleplus Feb 18, 2026
c672693
Update README.org
csingleplus Feb 18, 2026
f7908c1
Update README.org
csingleplus Feb 18, 2026
8e97608
Update README.org
csingleplus Feb 18, 2026
97cb4a8
Update README.org
csingleplus Feb 18, 2026
d92bd20
Fixed build-breaking typo on line 22
csingleplus Feb 18, 2026
5d36de9
Update README.org
csingleplus Feb 18, 2026
d538a05
Update README.org
csingleplus Feb 18, 2026
51a89ed
Update CMakeLists.txt
csingleplus Feb 18, 2026
fba8eb7
Update known issues
csingleplus Feb 19, 2026
e72b461
Update README.org
csingleplus Feb 20, 2026
586cb30
Update README.org
csingleplus Feb 20, 2026
d06c92b
Update README.org
csingleplus Feb 24, 2026
5fd819a
Update README.org
csingleplus Feb 24, 2026
05d9ece
Working release.
csingleplus Feb 27, 2026
fef372b
Add --debug option.
csingleplus Feb 27, 2026
3b8a8dc
--comment cleanup.
csingleplus Mar 1, 2026
16a1fd2
Small, important code change.
csingleplus Mar 1, 2026
ea28f1b
Update README.org
csingleplus Mar 1, 2026
052ee58
Update README.org
csingleplus Mar 1, 2026
625d491
Update README.org
csingleplus Mar 1, 2026
4c7af02
Update README.org
csingleplus Mar 1, 2026
14e230e
Create c-cpp.yml --testing
csingleplus Mar 1, 2026
295559c
Update c-cpp.yml
csingleplus Mar 1, 2026
0f1b4fb
Update c-cpp.yml
csingleplus Mar 1, 2026
3047188
Update c-cpp.yml
csingleplus Mar 1, 2026
5a9a03c
Update c-cpp.yml
csingleplus Mar 1, 2026
31c69e0
Update c-cpp.yml
csingleplus Mar 1, 2026
400c8de
Update c-cpp.yml
csingleplus Mar 1, 2026
eeae834
minor exit code change.
csingleplus Mar 1, 2026
9d96ef1
A bit of --help clarification
csingleplus Mar 1, 2026
c09572e
1 minute subtitles for testing
csingleplus Mar 1, 2026
c7b3586
change exit code for help to 0
csingleplus Mar 1, 2026
7c2ad07
run through a sample .idx/.sub
csingleplus Mar 1, 2026
e5bb67e
Forgot pathname to subtitles.
csingleplus Mar 1, 2026
dfce0bb
Update c-cpp.yml
csingleplus Mar 1, 2026
ccaa567
Set locale to en_US.UTF-8
csingleplus Mar 1, 2026
999016d
Update c-cpp.yml
csingleplus Mar 1, 2026
380e2bf
Update tested distros, clarify language setting
csingleplus Mar 1, 2026
6c94882
Update README.org
csingleplus Mar 1, 2026
50bed99
code improvement, removed unrar_exec.
csingleplus Mar 3, 2026
c155e6a
Delete mplayer/unrar_exec.c
csingleplus Mar 3, 2026
f793393
Delete mplayer/unrar_exec.h
csingleplus Mar 3, 2026
c2682b1
Add content source.
csingleplus Mar 3, 2026
6fc5cb2
Update README.org
csingleplus Mar 5, 2026
75d4e84
Update c-cpp.yml
csingleplus Mar 12, 2026
bef1e41
Delete tests directory
csingleplus Mar 24, 2026
985b213
Code modernization, RAII, other fixes/additions
Mar 24, 2026
4bba17b
Whoops. Forgot to add new files.
Mar 24, 2026
67feb59
Update c-cpp.yml
csingleplus Mar 24, 2026
8ae7500
Changed --help output to exit with code 0.
Mar 24, 2026
6b0c055
README.org fixed.
Mar 24, 2026
4b3f765
README.org fixed.
Mar 24, 2026
c78ac19
README.org proofread.
csingleplus Mar 24, 2026
1d27f46
Update README.org
csingleplus Mar 24, 2026
a4d6522
Update README.org
csingleplus Mar 25, 2026
b87dc2b
Update CMakeLists.txt
Mar 25, 2026
91d64ab
Update GPL3+ wording and copyright (2026).
csingleplus Mar 25, 2026
f468015
Update COPYING
csingleplus Mar 25, 2026
117f6df
Proper ISO639 handling.
csingleplus Mar 27, 2026
2353924
Much needed manpage update.
csingleplus Apr 3, 2026
de300b7
Now with scaling, mem leaks plugged, and UnRAR code removed.
csingleplus Apr 24, 2026
a2b8a9d
Update dependencies and remove locale setting step
csingleplus Apr 24, 2026
d80b8bf
Add libtiff5-dev to installation dependencies
csingleplus Apr 24, 2026
f1ac8ee
Return 0 instead of 1 for empty subtitle name
csingleplus Apr 24, 2026
e3336e8
Add libtiff5-dev to installation instructions
csingleplus Apr 26, 2026
31fd5e5
Update README to remove tired dev snark
csingleplus Apr 26, 2026
ecdf11a
Reformat maintenance notice in README.org
csingleplus Apr 26, 2026
727b744
Options cleanup, preliminary Leptonica code.
csingleplus Apr 28, 2026
9aeafdb
Remove Leptonica dependencies and image handling
csingleplus May 3, 2026
e46dcd9
Feature: PNG export. Fix: cast vobsubid to avoid left shift.
csingleplus Jun 17, 2026
a04819f
Update install dependencies in C/C++ workflow
csingleplus Jun 17, 2026
f26d752
Accuracy and speed improvements, scaling removed due to ineffectiveness.
csingleplus Jun 19, 2026
2f4e1e5
Fix: 352 byte leak when no file specified.
csingleplus Jun 20, 2026
62243b6
Fix: double free in vobsub_open.
csingleplus Jun 21, 2026
051acec
Now working again. No more coding w/o full testing
csingleplus Jun 21, 2026
44b5590
Update README with July 2026 rewrite plans
csingleplus Jul 1, 2026
6491028
Mad Max subtitles (German) for @milahu
csingleplus Jul 2, 2026
27c07f1
Delete test4milahu directory
csingleplus Jul 2, 2026
6163724
Improve png.h inclusion for compatibility
csingleplus Jul 5, 2026
7058f36
Update README with HTTPS links and build instructions
csingleplus Jul 5, 2026
d831ece
Fix conditional inclusion of libpng header
csingleplus Jul 5, 2026
f9f04aa
Fix conditional include for libpng header (again)
csingleplus Jul 9, 2026
3bb97a1
Revise project timeline and features in README
csingleplus Jul 23, 2026
fbdb45b
Removed unused #include <format>
csingleplus Jul 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: C/C++ CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- name: update-apt
run: sudo apt update
- name: install-deps
run: sudo apt install libpng-dev libtesseract-dev tesseract-ocr-eng libtiff5-dev g++ gcc cmake -y
- name: configure
run: ./configure
- name: make
run: make
- name: make install
run: sudo make install
- name: vobsub2srt-runtest
run: vobsub2srt --help
28 changes: 15 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
cmake_minimum_required(VERSION 3.10)
project(vobsub2srt)

cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)

if(NOT CMAKE_BUILD_TYPE)
set(
CMAKE_BUILD_TYPE
Debug
Release
CACHE
STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
Expand Down Expand Up @@ -53,17 +52,20 @@ include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)
include(CheckCXXSourceRuns)

set(CMAKE_C_FLAGS "-std=gnu99")
set(CMAKE_CXX_FLAGS "-ansi -pedantic -Wall -Wextra -Wno-long-long")
set(CMAKE_C_STANDARD 17)
set(CMAKE_C_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "-pedantic -Wall -Wextra")

set(CMAKE_CXX_FLAGS_RELEASE "-O3 -mtune=native -march=native -DNDEBUG -fomit-frame-pointer -ffast-math") # TODO -Ofast GCC 4.6
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -march=native -DNDEBUG")
set(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_DEBUG "-g3 -DDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-g3 -DDEBUG -fsanitize=address,undefined")
set(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
# TODO RelWithDebInfo MinSizeRel? maybe move -march=native -ffast-math etc. to a different build type

find_package(Leptonica REQUIRED)
find_package(Threads)
find_package(Tesseract)
find_package(Tesseract REQUIRED)
find_package(PNG REQUIRED)

add_subdirectory(mplayer)
add_subdirectory(src)
Expand Down Expand Up @@ -121,10 +123,10 @@ else()
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_PACKAGE_VERSION "${VOBSUB2SRT_VERSION}")
set(CPACK_PACKAGE_CONTACT "Rüdiger Sonderfeld <ruediger@c-plusplus.de>")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/ruediger/VobSub2SRT")
set(CPACK_PACKAGE_CONTACT "Christopher Ogloff <chris.ogloff@gmail.com>")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/csingleplus/VobSub2SRT")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Converts VobSub subtitles (.idx/.srt format) into .srt subtitles.")
set(CPACK_PACKAGE_DESCRIPTION "VobSub2SRT is a simple command line program to convert .idx / .sub subtitles\ninto .srt text subtitles by using OCR. It is based on code from the MPlayer\nproject - a really great movie player.\nTesseract is used as OCR software.")
set(CPACK_PACKAGE_DESCRIPTION "VobSub2SRT is a simple command line program to convert .idx / .sub subtitles\ninto .srt text subtitles by using OCR. It is based on code from the MPlayer\nproject.\nTesseract is used as OCR software.")

set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/debian/copyright")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.org")
Expand All @@ -144,7 +146,7 @@ else()
include(CPack)

if(ENABLE_PPA)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "any") # can be build on any system
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "any") # can be built on any system
include(UploadPPA)
endif()
endif()
26 changes: 26 additions & 0 deletions CMakeModules/FindLeptonica.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
find_path(Leptonica_INCLUDE_DIR
NAMES leptonica/allheaders.h allheaders.h
HINTS
/usr/include
/usr/local/include
)

find_library(Leptonica_LIBRARY
NAMES leptonica lept
HINTS
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/local/lib
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Leptonica
REQUIRED_VARS Leptonica_LIBRARY Leptonica_INCLUDE_DIR
)

if(Leptonica_FOUND)
set(Leptonica_LIBRARIES ${Leptonica_LIBRARY})
set(Leptonica_INCLUDE_DIRS ${Leptonica_INCLUDE_DIR})
endif()

mark_as_advanced(Leptonica_INCLUDE_DIR Leptonica_LIBRARY)
11 changes: 0 additions & 11 deletions CMakeModules/FindTesseract.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ if(TESSERACT_DATA_PATH)
endif()

set(CMAKE_REQUIRED_INCLUDES ${Tesseract_INCLUDE_DIR})
check_cxx_source_compiles(
"#include \"tesseract/baseapi.h\"
using namespace tesseract;
int main() {
}"
TESSERACT_NAMESPACE)
if(TESSERACT_NAMESPACE)
add_definitions("-DCONFIG_TESSERACT_NAMESPACE")
else()
message(WARNING "You are using an old Tesseract version. Support for Tesseract 2 is deprecated and will be removed in the future!")
endif()
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${Tesseract_INCLUDE_DIR})

if(BUILD_STATIC)
Expand Down
21 changes: 21 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Most code is from the MPlayer project.
- Chris Ogloff <chris.ogloff@gmail.com> Mar. 2026: added memory safety,
modern Tesseract calls, validated with Valgrind, separated MPlayer verbosity
from displaying realtime subtitle decoding, ensured compatibility across Linux distributions.
Apr. 2026: Scaling code implemented (though it needs preprocessing).
Jun. 2026: PNG writing implemented.
- Ethan Dye <mrtops03@gmail.com> https://github.com/ecdye/VobSub2SRT
Image inversion code, resulting in cleaner and quicker output.
- Armin Häberling <armin.aha@gmail.com> wrote a patch to fix an issue with
multiple instances of the same subtitle in result file (21af426)
- James Harris <jimmy@jamesharris.org> wrote the formula for Homebrew (54f311d6)
- Leo Koppelkamm reported and fixed issue #5 and problems with long filenames
(b903074c, 36ec8da, d3602d6)
- Till Korten <webmaster@korten-privat.de> wrote the ebuild script (#13)
- Andreasf fixed missing libavutil include path (3a175eb, #15)
- Michal Gawlik fixed the overlapping issue (5b2ccabc55f, #29, #32)
- "bit" made sure no trailing whitespace are written to the SRT (3a59dc278abc2, #38)
- Baudouin Raoult for various fixes (028f742, #44, b722a03, #42, 7293ac2, #40)
- Justyn Butler added the y-threshold support (f873761, #43)
- James Laird-Wah added min-width/height support and fixed other issues (41c6844, #48, #46)
- Filirom1 fixed a minor issue (4ed58c2, #49)
53 changes: 0 additions & 53 deletions COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -619,56 +619,3 @@ Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Loading