Compare commits

...

545 Commits
v0.83 ... v0.86

Author SHA1 Message Date
Carlos Fernandez
03646de1a5 Added release date (today) to CHANGES.TXT
Edited docs/README.TXT a bit
2018-01-09 14:51:22 -08:00
Carlos Fernandez
811a9a4992 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2018-01-09 14:49:03 -08:00
Carlos Fernandez
fa545d2806 Added release date for 0.86 (today), and modified README.TXT a bit. 2018-01-09 14:48:34 -08:00
Saurabh Shrivastava
5079d57766 Move show specific dictionaries to separate repo. (#891)
Show specific decitionaries are moved to https://github.com/CCExtractor/show_specific_dictionaries .
2018-01-09 12:14:18 -08:00
Carlos Fernandez
2d7c1718b4 Added FT2_BUILD_LIBRARY to the preprocessor definitions in debug_full, release and release_full configurations in the VS solution files - required for building. 2018-01-09 12:04:44 -08:00
Carlos Fernandez
b947601083 Minor change in params.c - specify that the value for -font is a full path. 2018-01-09 11:04:54 -08:00
Carlos Fernandez
fe8ef083aa Updated CHANGES.TXT 2018-01-09 10:58:28 -08:00
Null
930ca716ca [FEATURE] FreeType-based text renderer (-out=spupng with teletext/EIA608) (#877)
* Implementation of text renderer

* Fix some characters being cut

* Fix encoding and other bugs

* Add black background & fix bugs

* Fix more bugs

* Change to relative path

* Add a font option & Default font for MacOS & Fix anti-aliasing

* Document -font & enlarge default canvas
2018-01-09 10:24:26 -08:00
Null
8f0294b763 Add FreeType (#876) 2018-01-09 10:24:06 -08:00
Willem
377dc2a48d Merge pull request #873 from AbhijithGanesan/development
Change contributor guide link
2018-01-02 19:58:50 +01:00
Abhijith Ganesan
97cc3ee2a7 Change contributor guide link
Original link no longer exists; replaced with User link
2018-01-01 21:05:50 +00:00
DHSYongJun
12e38343f8 New README for GCI (#872)
Documentation: Write a better README for our GitHub page
2018-01-01 10:50:16 +01:00
Aadi Bajpai
151d04a870 [IMPROVEMENT] Minor typographical fix (#868)
Looks better now
2018-01-01 10:46:44 +01:00
William
c8008b441a {IMPROVEMENT] Whitespace changes (Part of libGPAC update) (#870)
* Whitespace changes

* Update tools.h
2017-12-31 13:05:44 +01:00
Null
d4f3c9c6a1 Fix dvb subtitle not extracted if there's no display segment (#866) 2017-12-31 09:41:51 +01:00
Null
f7d16d846c Fix a bug that caused -out=spupng sometimes crashes (#864) 2017-12-31 09:39:02 +01:00
Null
dd4032e515 Fix a heap corruption in add_ocrtext2str (#865) 2017-12-31 09:20:30 +01:00
Null
84a9ea5572 Fix OCR issue caused by separated dvb subtitle regions (#857) 2017-12-28 09:19:04 +01:00
Alex Huang
5e8a5590ce reworks scanning newlines to look for content in a line (#858) 2017-12-28 08:33:59 +01:00
Null
fb55d6d6d3 [Fix] Put OCR specific code inside ifdef (#855)
* Fix failing travis build.

Removed debug code. No idea why it causes travis fails to build

* Fix debug code
2017-12-27 07:33:16 +01:00
Null
b0afb983c9 [FIX] Fix a crash while processing DVB subtitles (#850)
* Add more debug info

* Fix crash in dvb process
2017-12-26 10:08:26 +01:00
Null
e56bab67b8 [Fix] Fix DVB bug (Multiple-line subtitle; Missing last line) (#844)
* multiple line & trying to fix the missing last line

* Fix format; move code into loop

* Revert some format changes
2017-12-26 06:14:11 +01:00
Carlos Fernandez Sanz
f3fd6762c3 Update CHANGES.TXT 2017-12-24 06:11:15 +01:00
Chuck Wilson
59b8f81283 [FEATURE] Support for Source-Specific Multicast (#802)
* Support for Source-Specific Multicast

* fixing whitespace issues

* updating changelog
2017-12-24 06:10:14 +01:00
Theodore Fabian Rudy
44a9e8b2af Added Supports and replace some things (#843)
* Added Supports and replace some things

* Update README.md
2017-12-24 05:01:31 +01:00
Null
31c39eea55 [FIX] Fix crash when image passed into OCR is empty (#841)
* Fix crash when image passed into OCR is empty

* Avoid OCR
2017-12-23 01:20:41 +01:00
Manish Mahalwal
f9a0874e58 Fixed -sentencecap for teletext samples (#842) 2017-12-23 01:20:16 +01:00
Anshul Maheshwari
1858425944 Merge pull request #822 from MatejMecka/master
[IMPROVEMENT] Upgrade UTF8proc
2017-12-16 15:43:59 +05:30
Anshul Maheshwari
b04228f0fd Merge pull request #833 from harrynull/cmake-windows
[FIX] Make CMakeFiles work with Windows Visual Studio
2017-12-16 15:35:37 +05:30
Null
4263a341e1 Turn on optimization 2017-12-16 10:41:40 +08:00
Willem
8b9f7a929b Merge pull request #837 from MatejMecka/master
[IMPROVEMENT]Improve README a little
2017-12-14 21:10:13 +01:00
MatejMecka
4d7edfd687 Remove a part from README 2017-12-14 21:05:02 +01:00
MatejMecka
289e9ca02a Update something with the header 2017-12-14 20:17:34 +01:00
MatejMecka
d7ce96a5d0 Revert badge back 2017-12-14 19:59:55 +01:00
MatejMecka
bf13b5c1e0 Update README part 3 2017-12-14 17:11:41 +01:00
Saurabh Shrivastava
0b31e5d7a1 Add compilation section to readme and improve instructions. (#836)
Also moved remaining .md files in docs.
2017-12-13 13:01:10 -08:00
Willem
f78303abef Update README.md
Update links to relative files
2017-12-13 20:48:47 +01:00
Willem
06c735ba8a Merge pull request #835 from MatejMecka/master
[IMPROVEMENT] Update README and add Installation file.
2017-12-13 20:09:17 +01:00
MatejMecka
e7fab1da26 Fix Installation instructions. 2017-12-13 19:51:21 +01:00
MatejMecka
22ff01e2a5 Fix some stuff 2017-12-13 17:18:16 +01:00
Matej Plavevski
f8f0d91386 Update README and add Installation file.
Add INSTALLATION file and update README
2017-12-12 21:02:29 +01:00
Null
d70c81d1d1 Make CMake work with Windows 2017-12-12 17:45:04 +08:00
Null
8e53d91682 histogram (#832) 2017-12-11 20:53:42 -08:00
Carlos Fernandez Sanz
c32d350550 Added mxf demuxer to mac/Makefile.am 2017-12-07 13:31:53 -08:00
Carlos Fernandez Sanz
fe17cddec8 Fixed 8 warnings 2017-12-07 13:17:09 -08:00
Carlos Fernandez
33c4c5a021 Import teletext.h from lib_ccx.h for function definitions that are used from general_loop 2017-12-07 12:34:15 -08:00
Carlos Fernandez
04ea39073b Moved some declarations from telxcc.c to teletext.h - needed to avoid some warnings about implicit declarations.
gzguts.h: Moved UNIX-only include to #ifdef to prevent build errors on Windows.
2017-12-07 12:29:30 -08:00
Carlos Fernandez Sanz
d7aa1f1bf4 - Fix some warnings (wrong parameter type, implicit function declarations...) 2017-12-07 12:14:50 -08:00
Carlos Fernandez
2c0e21b28b Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2017-12-07 09:25:53 -08:00
Carlos Fernandez
487ac86d47 - Added MXF demuxer to Makefile 2017-12-07 09:25:26 -08:00
Matej Plavevski
726d87d15a Add leptonica and tesseract (#827) 2017-12-07 09:09:12 -08:00
Carlos Fernandez
d50e05315f The #ifdef PYTHON_API crap was preventing the write context to be deinitialized - meaning files not being closed, semaphores not deleted... 2017-12-06 18:25:22 -08:00
Null
3fb5bab343 Fix delay in DVB (#826) 2017-12-06 07:53:21 -08:00
Anshul Maheshwari
4bcd1edff5 Merge pull request #825 from anshul1912/master
Add MXF support
2017-12-06 14:14:46 +05:30
Anshul Maheshwari
42ab16405d Add MXF support 2017-12-06 11:36:41 +05:30
Null
c78db1dd24 Fix delay option (#824) 2017-12-05 08:45:47 -08:00
Willem
200b6a7eb9 Merge pull request #823 from MatejMecka/fixtravis
[FIX] Fix One of the Travis Builds
2017-12-04 23:50:20 +01:00
MatejMecka
410335c46d Fix One of the Travis Builds
Fix one of the builds for Travis

Revert "Upgrade UTF8proc"

This reverts commit 76dc969363.
2017-12-04 22:05:56 +01:00
MatejMecka
76dc969363 Upgrade UTF8proc 2017-12-04 21:41:53 +01:00
Willem
3772f83fe0 Update README.md 2017-12-04 21:25:43 +01:00
Willem
f2258e3eac Merge pull request #818 from MatejMecka/master
[IMPROVEMENT] Add Travis Ci
2017-12-04 11:19:06 +01:00
Matej Plavevski
a40c9e2ca1 Create .travis.yml
Update .travis.yml

Update .travis.yml
2017-12-03 21:36:14 +01:00
Null
241e2f5e14 Upgrade win_iconv (#815) 2017-12-02 20:52:29 -08:00
Matej Plavevski
afdf4e74be Upgrade zlib to 1.2.11 (#814) 2017-12-02 20:49:41 -08:00
govindbalaji-s
a9180719b6 Made fatal errror messages clearer (#811) 2017-12-01 07:38:41 -08:00
Matej Plavevski
88844fea42 Update LibPNG from 1.6.27 to 1.6.34 (#809) 2017-11-30 12:24:01 -08:00
HemangRajvanshy
f5700d5304 Making error messages clearer and less ambiguous. (#808) 2017-11-30 08:40:53 -08:00
Carlos Fernandez
dacd05b9fb Merge branch 'master' of https://github.com/CCExtractor/ccextractor
# Conflicts:
#	src/lib_ccx/ccx_encoders_python.c
2017-11-07 12:42:27 -08:00
Carlos Fernandez
5db65fa3a1 #fidef ENABLE_PYTHON in ccx_encoders_python.c. 2017-11-07 12:38:25 -08:00
Anshul Maheshwari
b7eb9e22d6 Make code compilable on windows 2017-11-05 18:52:58 +05:30
Saksham Gupta
b9de954690 Update dict_mr_robot.txt (#804) 2017-11-02 21:15:08 -07:00
Matej Plavevski
07c933e677 More Google Code In Participants (#801) 2017-11-01 15:48:51 -07:00
AlexBratosin2001
bdb8221213 Replace incorrect memset (#800) 2017-10-23 19:38:07 -07:00
Mayank Gupta
4573f5e8f6 [IMPROVEMENT]Modify Autoconf scripts to generate mac compatible tarball (#798)
* Modify Autoconf scripts to generate mac compatible tarball

* Update list of GSoC 2017 students
2017-10-18 17:33:58 -07:00
Evgeny Shulgin
a170f55a22 Merge pull request #799 from Izaron/something
Temporarily wrapped the Python API
2017-10-18 13:22:51 -07:00
Evgeny Shulgin
a6f0a07bf9 Merge branch 'master' into something 2017-10-18 13:22:23 -07:00
Evgeny Shulgin
1816894ccf Temporarily wrapped the Python API 2017-10-18 23:15:54 +03:00
Carlos Fernandez
07f289d1e0 Added missing function prototype.
Added ccextractor.h to solution.
2017-10-18 12:55:46 -07:00
Carlos Fernandez
b61918d516 Updated CHANGES.TXT 2017-10-13 15:26:16 -07:00
Vitor Massaru Iha
824dfeb166 [IMPROVEMENT] function header in "get_more_data" functions were standarlized. (#786)
* function header in "get_more_data" functions were standarlized.

* Unnecessary stream_mode check inside the while loop was removed.

* terminate_asap if condition was moved to while condition.

* Unnecessary condition was removed.
2017-10-13 14:53:37 -07:00
Vitor Massaru Iha
6aa90fc091 [gpacmp4/avilib.c]: Fix redefinition of VERSION and PACKAGE (#790)
compilation warnings before:

../src/gpacmp4/avilib.c:35:0: warning: "PACKAGE" redefined
 #define PACKAGE "GPAC/avilib"

<command-line>:0:0: note: this is the location of the previous definition
../src/gpacmp4/avilib.c:36:0: warning: "VERSION" redefined
 #define VERSION GPAC_FULL_VERSION
2017-10-13 14:47:27 -07:00
Saksham Gupta
5641c3116e Fixes Undeclared-Variable Warnings in extractor.c (#795)
Fixes https://github.com/CCExtractor/ccextractor/issues/780

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
2017-10-13 14:42:29 -07:00
Mayank Gupta
e5c80a2c84 Add documentation for GUI (#796) 2017-10-13 14:42:03 -07:00
Mayank Gupta
fc3f505189 Add GUI for CCExtractor (GSoC 2017) (#794) 2017-10-11 14:11:39 -07:00
Mayank Gupta
ff950a035d Update Makefile.am for working Autotools build on mac (#791) 2017-10-09 12:30:42 -07:00
Jason Hancock
98114bd294 [IMPROVEMENT] Modify rpm.sh package script to preserve the source rpm (#788) 2017-10-06 16:35:35 -07:00
Jason Hancock
37d497d47a [IMPROVEMENT]: change rpm installation location from /usr/local/bin to /usr/bin (#789) 2017-10-06 16:35:07 -07:00
Jason Hancock
fae4957a71 Fix path to wrapper.h in Makefile.am (#787) 2017-10-06 16:34:56 -07:00
Saurabh Shrivastava
0d9872021d ¯\_(ツ)_/¯ Fix typo in name of Zlib directory in cmakefile. (#784) 2017-10-03 12:30:10 -07:00
Saurabh Shrivastava
30443a5b9a Use proper newlines while printing SRT from bitmaps. (#783)
Probably fixes #767 .
2017-10-03 08:24:34 -07:00
Saurabh Shrivastava
2eb5fd26de [FIX] Move files into appropriate directories & fix build scripts. (#781)
* Move wrappers and extracters inside src/ and update CMakeLists.

* Reflect change in path across build scripts.

* Remove redundant source file inclusion.

* Always use supplied libpng.
2017-10-02 12:16:04 -07:00
Hugh Mackworth
01852ef055 Compilation on the Mac (#777)
* Update README.md

* Delete README.MAC.TXT

No longer accurate given work done to integrate Mac into build processes.

* Change to use project's PNG/ZLIB libraries

* Fix Mac build command
Makes OCR an optional parameter
Adds python API file to build

* Update README.md
2017-10-02 11:59:00 -07:00
AlexBratosin2001
59c0de46e2 Fix Windows project files (#782) 2017-10-02 11:58:15 -07:00
Vinícius Lugão
f8d9e042bb Fix to output CC data when -out=raw is used (#775)
When the -out=raw option is used, the ccextractor jumped to spupng output
format, generating broken files in spupng format without CC data.
With this fix, now it generates CC data in McPoodle's Broadcast format.
2017-09-08 10:06:00 -07:00
Diptanshu Jamgade
0596d375b7 Python Extension Module (#773)
* Added self as contributor

* Added extension module documentation to docs/
2017-09-03 15:37:24 -07:00
Diptanshu Jamgade
47c5a6e73b Cleaning up the codebase and additional changes in Python SRT generator. (#771)
* Removed all extractors except the grid extractor.
Removed the call to transcript extractor in ccx_encoders_transcript.c

* Removed unnecessary array appening statements in python_grid_extractor.
WIP: switch in extractor.

* Added switch in g608 grid extractor.

* Deleted comments from wrappers.

* Refactored code in ccextractor.c and .h files.
Removed all the commented part.
Made proper changes according to the coding conventions.

* Removed calls to extractor from all the encoders.
The only call made to extractor is from ccx_encoders_python.c.

* Removed a comment from wrapper.c.
In init_write function of output.c added a call to free the output string returned by asprintf in case of
sending filename to callback function.

* Added calls to free the char* which is malloced by asprintf in
extractor.c
WIP: Free the global variable elements.

* Sample testing correctly for italics tag.
Also added a hack to print only 32 characters when unicode fails.
WIP: Font tag.

* Added support for handling font and italics in Python SRT generator.

* modified the font generator.
Also, added count method for checking blank strings in
python_srt_generator.

* Added free statements for avoiding memory leaks.

* added return code for failure of asprintf calls.

* Removing unnecessary code from api_testing.py

* Made modifications to Makefile and build script.

* Added recursive_tester.py
Autoconf builds successfully.

* BUG: Made change to get_line_encoded to encode the last \0 character in a
line. Otherwise the EOL characted is absent causing garbage value to be
present in SRT.

* Exporting the encoding of the captions from CCExtractor to Python so
that the python SRT generator can generate proper SRT files.

* Modified the include statement in extractor.h
2017-08-25 11:03:00 -07:00
Carlos Fernandez
022463b9a2 Moved ccx_encoders_python to right filter in project. 2017-08-21 14:25:35 -07:00
Saurabh Shrivastava
d19f471352 Correctly handle return codes. (#763)
Return code after parameter parsing were incorrectly handles leading to errors such as `Error: Invalid option to CCextractor Library`.
2017-08-21 14:11:19 -07:00
Saurabh Shrivastava
8f2f38bf07 Fix builddebug to include Python API changes. (#770) 2017-08-21 13:21:48 -07:00
Saurabh Shrivastava
4fe82abbfc Get commit hash and compilation date when built using cmake. (#764)
Who knew I would have to read so much documentation for such trivial task 😒
2017-08-20 08:55:09 -07:00
Mayank Gupta
32710eff1d Fix failing build with autoconf due to ccextractor.h (#765) 2017-08-20 08:54:51 -07:00
Diptanshu Jamgade
21eaa3de04 Python bindings with extraction of CE608 grid and writing to a SRT output. (#768)
* added python_extract to encoders_srt and the captions are being
extracted in needed format. Search for an alternative to asprintf

* Checking if the alternative to asprintf generate proper srts

* CC captions accessible via python script

* Removing python caption code from __wrap_write function

* removing old cc_to_python functions

* Removing python_subs structure and all the changes done for that struct

* Removing filename functions from ccextractor.*

* Renaming make_message to time_wrapper

* Applying to python_extract codebase: SSA format

* Added python_extract_time_based and done validation for ssa

* pplying python_extract_time_based: Done validation for srt and webvtt

* led attempt for SAMI support of python_extract. Code is commented

* Appluing python_extract_time_based: validate support for SMPTETT

* Added python_extract_transcript and made changes for time printing.

* added show_extracted_captions_wtih_timings function

* Added show_extracted_captions_with_timings to python script for testing
purpose.

* refactored extractors to api directory. commented out show captions in main()

* build and build library working for the extractors.

* made caption generator work with a 0.1 time sleep. Start refactoring

* added asprintf for windows.

* file being written in the running directory

* Auto -deletion of python temporary file

* Python captions printing status set to proper.

* termination of tail successful

* Writing successful for the sample

* Generating unalternating output

* adding api_support.py

* Adding bld_flags in build_api

* Added  to build_library

* Auto deletion of temporary file on SIGINT

* Discussing Seg fault with Izaron

* working for python and linux with samples. testing -out=pythonapi with stream

* Done adding bitmap support

* added -out=pythonapi support for bitmap

* Setting the messages_target to 0 for output = pythonapi

* Added wrapper for setting -out=pythonapi. Checking if -stdout value can be used in python.

* adding the cc_to_stdout=1 value for -out=pythonapi. Thus generation of output file has been avoided. May be needed to change in future.

* added extractor for g608 grid. removed sami extractor. need to work on overlap of -out=pythonapi and -out=g608

* Removed overlap of -out=pythonapi by adding -pythonapi and
signal_python_api global variable.

* added support for seperate c608 grid catching. Need to test the output
via python.

* added support for seperate printing of text font and color in CE608.
Need to make sure that the function is inbuilt.

* ADDED ce608 GRID SUPPORT FROM PYTHON
need to discuss whether to keep the print_cc_grid function specific to
the module or make it user accessible.
Mostly it would be better to make it user accessible.

* made changes in the call_from_python_api function such that only
api_options is needed to be passed.
An if statement before the call to g608_extractor has also been added.
Waiting for Carlos to comment on the output generated till this stage.

* added a signal_python_api check before calling every write function.
Thus basic writing output can be avoided.

* Commented all calls to python_extract_time_based.
making changes to python_extract_g608 to be called only from the point
when a g608 caption is detected.

* Added pass_cc_buffer_to_python in encoders_common.c temporarily
redefined get_*_encoded from static to normal
included the above functions in encoders_common.h

* Added if-else statement for switch in encode_sub function.
This is done mainly for making sure no output is generated in the api
call.

* Added ccx_encoders_python.c
Defined pass_cc_buffer_to_python in ccx_encoders_python.c
added if else statement in encode_sub's switch to make sure that the output is not generated in case of -pythonapi call

* Removed __wrap_write from the entire code base.
It's declaration and definition are only present in CCExtractor.*

* Commented out the /dev/null part in ccx_encoders_common.c.
Proceeding further on checking for file generation.

* Added output_filename in array global variable and is generated in
init_write function.
included ccextractor.h in output.c to access global variable
signal_python_api for avoiding output generation in init_write and
invalid free in dinit_write.

* Modified the definition of init_write function for accessing
signal_python_api.

* Deleted the commented part of /dev/null in ccx_encoders_common.c.

* Added target_message=0 in -pythonapi param parsing in param.c to avoid
the API from printing to STDOUT.
Deleted the commented part of -out=pythonapi.
Thinking of adding a different param for silencing the output when the
call is made from python api.

* Removed __wrap_write from ccextractor.c and ccextractor.h.

* Added ccx_to_python_g608 and modified api_support.py file.
added documentation in ccextractor.c.

* added the generate srt script. However, some random characters are
coming in first line. Need to talk about this.

* Added SRT generator for python.
Using string to remove the garbage value.
Add code for srt counter and also the start_time and end_time
conversion.

* removed the trash characters and added code to print the timings.
However, the last blank frame also results in a print. Need to take care
of this.

* rectified the mistake of writing only timings and not captions.
now next step is to just make the timings print properly

* some minor changes before diving into extracting srt_counter from the made codebase

* Added extraction of srt_counter in python_extract via fflush
srt_counter-value.
Need to modify the processing in python.

* Added the entire method to extract captions and generate srt files. Next, step would be a to define a concise function for writing the srt

* Processing into a srt working properly.
Next step is to add the information of font into the caption text.

* the data is getting generated for proper SRT counters.

* A turning point to the appraoch.
Added END OF FRAME line for printing the data for every particular
srt_counter.
Proceeding further with the generation of srt by data manipulation.

* some minor bugs but the output srt is being generated correctly. However, The font and colour encoding needs to be done.

* Taken care of random characters. Need to discuss this with Carlos. Moving further to font/color processing.

* Taken care of random characters. Need to discuss this with Carlos. Moving further to font/color processing.

* Added fflush and cleaned up the python code of srt generation

* Added <i> tag for italics.
Proceeding further with other types.

* Added the code to check for underline.
However, need to check how CCExtractor generates srt when both italics
and underline are present. For now a new line is added if both are
present.

* Shifting for making changes in th i/O work.

* Stable ouput for samples with italics is being generated.

* Added the PYTHONAPI macro definition and testing for its existence in the set_python_api function.

* build script for linux is working correctly.
Build_library is showing error of invalid def of set_pythonapi.
Moreover, extractor has some memory seg fault.

* Added mod to set a MACRO as my_python_api to set the callback function.
Till now all calls to the reporter are commented.
Working on getting the reporter to print the lines.

* Changes have been implemented to bring reporter in working state.
For now a constant string is passed from extractor. Need to make the
proper parsing possible.

* Changed the code in extractor such that entire grid is returned to the
callback function.
Need to provide this grid to the write function and also cleanup the
codebase.

* Writing the outputted srt in a file called "temp.srt".
Need to modify init_write to push filename that is to be created in
python using callback.

* Added code to get start and end time simultaneously.
entire SRT is getting generated.

* removed ccx_python_encoders.c

* Compiling and executing on Windows

* Moved definitions get_line_encoded, get_color_encoded, get_font_encoded from ccx_encoders_g608.c to ccx_encoders_common.c.
Also, deleted the static definition of get_font_encoded from
ccx_encoders_webvtt.c

* added a write statement in write_cc_bitmap_as_srt

* Rectified transfer of get_line_encoded, get_color_encoded and
get_font_encoded from ccx_decoders_common.c to ccx_encoders_common.c.
2017-08-20 08:54:35 -07:00
Carlos Fernandez Sanz
773ddf8bc2 Merge pull request #769 from Izaron/patch-1
**[IMPROVEMENT]** Added gui mode reports for Matroska decoder
2017-08-20 08:54:05 -07:00
Evgeny Shulgin
14e0d86df8 Added gui mode reports for Matroska decoder 2017-08-20 15:08:20 +03:00
Saurabh Shrivastava
333fb6eb6e Cleanly format the compiling documentation and cmake instructions. 2017-07-26 04:24:19 +05:30
Saurabh Shrivastava
da0893fdb3 Fix CMakeLists for MacOS and Linux.
With #742 and this, CCExtractor could be build across all three platforms using CMake.
2017-07-26 04:23:48 +05:30
Carlos Fernandez
ce2b680a43 Merge branch 'pr/n759_Abhinav95' 2017-07-21 11:25:24 -07:00
Abhinav95
b1cc95d972 Adding grayscale conversion for better OCR 2017-07-21 12:12:50 +05:30
Diptanshu8
10eb52e651 pushing 4 wrapper codes 2017-07-20 02:50:53 +00:00
Diptanshu8
13b3dadb45 Wrapper for debugdvbsub and pesheader 2017-07-20 02:50:53 +00:00
Diptanshu8
cff69bef5e added wrapper code for setstdout and setautoprogram 2017-07-20 02:50:53 +00:00
Carlos Fernandez
536082ae6e Merge branch 'pr/n751_Diptanshu8' 2017-07-19 10:59:56 -07:00
Diptanshu8
3f069b84c9 fixed -out=dvdraw sample error. 2017-07-18 04:48:08 +00:00
Carlos Fernandez
ddca8001cc Merge branch 'pr/n755_Abhinav95' 2017-07-17 11:44:11 -07:00
Diptanshu8
02b4427260 making changes to write wrapper 2017-07-17 08:59:00 +00:00
Abhinav95
ec5618dd1f Fixing end timestamp in DVB transcripts + spelling/readme improvements 2017-07-17 04:23:34 +05:30
Carlos Fernandez
e8f742a627 Corrected function prototype 2017-07-14 13:01:39 -07:00
Saurabh Shrivastava
45946e3ac9 Initialise timing for MP4 webvtt.
Fixes #753 .
2017-07-14 18:59:02 +05:30
Diptanshu8
e3e5f8b36e Apply write wrapper across entire database. 2017-07-13 07:26:49 +00:00
Diptanshu8
1435411861 Commenting out the file name related functions. 2017-07-13 05:48:14 +00:00
Diptanshu8
86b7e7348e Added extension to python_subs 2017-07-11 21:34:05 +00:00
Diptanshu8
d2bd2d1397 added basefilename to python_subs 2017-07-11 21:21:18 +00:00
Diptanshu8
8895b27552 CC being shown in python script. 2017-07-11 21:21:18 +00:00
Diptanshu8
57424857b0 Working on PR 2017-07-11 21:21:18 +00:00
Diptanshu8
2ced408994 build and build_library working correctly 2017-07-11 21:21:18 +00:00
Diptanshu8
976f01cee1 CCs to python_subs extracted properly 2017-07-11 21:17:46 +00:00
Diptanshu8
4d5f80a01d Found wrapper for write. Check file_handle and start processing. 2017-07-11 21:17:46 +00:00
Carlos Fernandez
0327e676dd Merge branch 'pr/n747_Diptanshu8' 2017-07-11 11:40:10 -07:00
Diptanshu8
91ea65d2a3 Removed ccextractor.pyc 2017-07-11 11:18:20 +00:00
Diptanshu8
de5fcf27f3 adding .pyc to gitignore 2017-07-06 23:34:08 +00:00
Diptanshu8
fe6813736c segregating the code and changing myarguments and argument_count. Also, gsoc directory has been created. 2017-07-06 22:58:23 +00:00
Diptanshu8
dc35af0bc0 Modifications to the code. 2017-07-06 22:22:59 +00:00
Carlos Fernandez
0c0bf1aafd -Added -nospupngocr (don't OCR bitmaps when generating spupng, faster) 2017-07-06 13:37:20 -07:00
Carlos Fernandez
62dab0dde9 Merge branch 'pr/n746_Abhinav95' 2017-07-06 12:59:26 -07:00
=
31a2d46996 Forcing -noru to cause deduplication in ISDB 2017-07-07 01:22:11 +05:30
Carlos Fernandez
710a205f99 Add support for file split on keyframe (-segmentonkeyonly)
Segmenting now doesn't destroys the whole encoding context, just closes and reopens the output file
Correct a wrong function prototype for process_hex()
OCR: Attempt to correctly deal with TessBaseAPIRecognize returning an error
Changed output for parse PMT to CCX_DMT_PMT instead of CCX_DMT_VERBOSE
2017-07-06 11:57:17 -07:00
Diptanshu8
69a956f3c2 removing api.so 2017-07-04 09:48:44 +00:00
Diptanshu8
7839403266 adding .so to .gitignore 2017-07-04 09:07:14 +00:00
Diptanshu8
6e50104da4 Cyclic rotation and python script argv passing solved 2017-06-28 21:35:32 +00:00
Diptanshu8
edb2431cf9 Cyclic rotation patch 2017-06-28 19:07:44 +00:00
Diptanshu8
67204d8e3c modifying the return value from main 2017-06-28 07:57:44 +00:00
Diptanshu8
a0047a9d3e changing the return status to EXIT_ON 2017-06-28 07:01:32 +00:00
Diptanshu8
cf4aa9021d Modified build_library script for generating the python module 2017-06-27 10:00:47 +00:00
Diptanshu8
3e99dc2955 Reflecting changes of library source code in the ccextractor source code 2017-06-27 10:00:47 +00:00
Diptanshu8
2ed2c27906 First phase evaluation outputs generated 2017-06-27 10:00:47 +00:00
Diptanshu8
a79bab670f modifying the test code for 5 samples 2017-06-27 10:00:47 +00:00
Diptanshu8
a7e2ac7686 Adding auto deletion of obj files to build_library 2017-06-27 10:00:47 +00:00
Diptanshu8
98e295e768 Commiting the build_library file 2017-06-27 10:00:47 +00:00
Diptanshu8
751a22fe68 Resolving merge conflicts in .gitignore 2017-06-27 10:00:47 +00:00
Diptanshu8
dba1d7b6eb Debugging the core dumped error 2017-06-27 10:00:07 +00:00
Diptanshu8
9fa2e3ebb0 adding the ccextractorapi.py file 2017-06-27 10:00:07 +00:00
Diptanshu8
f70f34e009 pushing the api code 2017-06-27 10:00:07 +00:00
Diptanshu8
644d26546c Facing VERSION attribute error in generated module 2017-06-27 10:00:07 +00:00
Diptanshu8
b0a0c92e50 library development done till api_start. Implementation of stop and status function is left. 2017-06-27 10:00:07 +00:00
diptanshuj@gmail.com
d3540ccc0a Made temp changes to initiate library coding 2017-06-27 10:00:07 +00:00
Carlos Fernandez
735f4392dd Merge branch 'pr/n742_saurabhshri' 2017-06-05 13:22:21 -07:00
Carlos Fernandez
95cd2370fc Merge branch 'pr/n743_anshul1912' 2017-06-05 13:21:24 -07:00
Carlos Fernandez
a0bea44274 Corrected CHANGES.TXT 2017-06-05 13:20:23 -07:00
Carlos Fernandez
989adde3ef Merge branch 'pr/n738_techfreakworm'
# Conflicts:
#	docs/CHANGES.TXT
2017-06-05 13:20:00 -07:00
Carlos Fernandez
399f59981d Added --analyzevideo to help page. 2017-06-05 11:00:03 -07:00
Anshul Maheshwari
37956ea4ef Adding info for ocr 2017-06-04 18:15:48 +05:30
Saurabh Shrivastava
51d936bc90 Fix CMake build for windows.
Thank you linker flags for eating my 3+ hours.
2017-06-03 22:32:15 +05:30
Carlos Fernandez
d9796410bc Added --analyzevideo 2017-06-02 12:32:45 -07:00
AlexBratosin2001
a842e1f7db Fix PTS and Length in preview section (Teletext subtitles) 2017-06-02 19:12:31 +03:00
Mayank Gupta
bc361a2e86 Add ocr, hardsubx and autotools support for mac 2017-05-11 06:19:16 +03:00
Carlos Fernandez Sanz
4d6ae27518 Merge pull request #734 from techfreakworm/rpm
[FEATURE]Add .rpm package generation script
2017-05-09 11:11:18 -07:00
Carlos Fernandez
adacb6235e Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2017-04-24 12:07:00 -07:00
Carlos Fernandez
78c410cf50 Added -nolevdist to disable automatic typo fixing in teletext 2017-04-24 12:06:33 -07:00
Mayank Gupta
f2755ae5bb Add .rpm package generation script 2017-04-18 16:20:15 +05:30
Carlos Fernandez Sanz
fdd5b6bf9d Merge pull request #725 from Amey-Jain/master
Issue 699 solved
2017-04-11 09:23:03 -07:00
Carlos Fernandez Sanz
4438e6c780 Merge pull request #728 from fandango-/arch
[FEATURE] Arch Linux installation script (create .pkg.tar.xz archive or install directly)
2017-04-11 08:05:38 -07:00
Amey Jain
1513b7c42f Timing for sample #70 corrected. 2017-04-11 10:44:44 +05:30
Carlos Fernandez
76eea831ca When NAL decoding fails, don't dump the whole decoded thing, limit to 160 bytes. 2017-04-10 17:11:45 -07:00
Carlos Fernandez
1b6e05083d - TS: Skip NULL packets
- TS: If we don't have pinfo don't pay attention to the current_next_indicator bit.
(fixes problem with The Lion Guard_20170321_09301000.ts). Not sure this fix is the correct one but that's what VLC does.
2017-04-10 11:46:01 -07:00
Abhinav Baid
fddede57fd Update README.md 2017-04-10 17:47:54 +05:30
Abhinav Baid
58f7345b42 Update CHANGES.TXT 2017-04-10 17:37:59 +05:30
Abhinav Baid
83704e306f Update gitignore for pkg.tar.xz files 2017-04-10 17:33:29 +05:30
Abhinav Baid
27311f53e6 Use sudo when available; fallback to su 2017-04-10 17:30:34 +05:30
Abhinav Baid
d3946450eb Fix small grammatical mistake 2017-04-10 11:50:57 +05:30
Abhinav Baid
96ca325a25 Use bash as shell; su instead of sudo; don't proceed if a command fails; change default to not installing 2017-04-10 11:46:15 +05:30
Abhinav Baid
90f94d6053 Merge branch 'master' of https://github.com/CCExtractor/ccextractor into arch 2017-04-10 11:22:11 +05:30
Amey Jain
1b3598b2fe Timing mis-match corrected. 2017-04-08 08:34:18 +05:30
Carlos Fernandez Sanz
58e6bac74d Merge pull request #729 from LucasYoung/master
[FEATURE] Add WebVTT output from Matroska (Issue #724)
2017-03-31 11:42:08 -07:00
LucasYoung
5ffa442c5f Removed changes to ccextractor.vcxproj 2017-03-31 04:37:52 -07:00
LucasYoung
dd5c1ee243 Added WebVTT output from Matroska 2017-03-30 00:09:40 -07:00
Abhinav Baid
4c73649b9c Add --enable-ocr as a configure option by default 2017-03-30 11:42:15 +05:30
Abhinav Baid
8878aebe0b Allow option to build .pkg.tar.xz archive without installing package 2017-03-30 11:25:41 +05:30
Abhinav Baid
236840919d Use gcc as the C compiler during configure 2017-03-30 11:24:55 +05:30
Abhinav Baid
ab5544691a Initial commit 2017-03-29 19:52:22 +05:30
Carlos Fernandez Sanz
19557551fe Merge pull request #717 from techfreakworm/master
[IMPROVEMENT]Make CCExtractor more linux standard compliant #678
2017-03-22 08:53:56 -07:00
Mayank Gupta
8aa6aac2a7 Updated execution permissions for cleanup script 2017-03-22 11:17:38 +05:30
Mayank Gupta
23e6e44073 Updated cleanup script for complete cleanup after build 2017-03-22 11:16:26 +05:30
Mayank Gupta
5342b83345 Updated execute permissions for autogen.sh and tarball.sh 2017-03-22 10:49:38 +05:30
Mayank Gupta
b80e466533 Changed text in AC_MSG_ERROR to remove configure error 2017-03-21 23:06:08 +05:30
Mayank Gupta
77b54feeb6 Added check for pkg-config m4 macros 2017-03-21 19:33:21 +05:30
Mayank Gupta
6b08c123e2 Redirected error stderr stream to stdout stream 2017-03-21 14:59:01 +05:30
Mayank Gupta
c710b4c9b2 Corrected wrong flag order of LDADD 2017-03-21 12:07:58 +05:30
Amey Jain
094a8f295a Issue 699 solved. 2017-03-21 01:06:00 +05:30
Carlos Fernandez Sanz
753ece23d6 Merge pull request #722 from barun511/webvtt_another_fix
[FIX] # 680 Add missing line terminator in webvtt
2017-03-20 10:44:47 -07:00
Amey Jain
d2bea3802e In ref. to issue 699. 20 ms timing mis-match.
modified:   src/lib_ccx/general_loop.c
	modified:   src/lib_ccx/telxcc.c
2017-03-20 14:03:41 +05:30
Mayank Gupta
3ecacd3fa9 Updated .gitignore and configure.ac 2017-03-19 23:25:06 +05:30
Barun Parruck
4f692138fc Add missing line terminator in webvtt
Fix #680
2017-03-18 19:43:30 +05:30
Mayank Gupta
cb42a5fc2a gitignore packages created from package creation scripts 2017-03-17 23:58:47 +05:30
Mayank Gupta
316f959234 Corrected minor mistake in configure.ac 2017-03-17 23:48:27 +05:30
Mayank Gupta
6fdd4b75e8 Updated .gitignore, README.md, added checks in configure.ac, updated package creation scripts 2017-03-17 23:18:26 +05:30
Mayank Gupta
486d7ea002 Changed location of scripts and made tarball creation to work 2017-03-17 17:29:54 +05:30
Carlos Fernandez Sanz
ce9416e943 Merge pull request #721 from Diptanshu8/matroska
**[FIX]** Fixes issue #705
2017-03-16 11:40:27 -07:00
Diptanshu8
baa70a104a char pointer misconception for newline characters 2017-03-16 16:09:06 +05:30
Diptanshu8
7212d6848a Refactoring 2017-03-16 15:58:38 +05:30
Diptanshu8
b723378eb2 Quick fixes 2017-03-16 02:39:25 +05:30
Diptanshu8
5889d1edcd Quick fixes 2017-03-16 02:29:26 +05:30
Diptanshu8
c11ff21499 Done with mkvlang options basic checking 2017-03-16 01:45:31 +05:30
Mayank Gupta
31c8f85ba5 Merge branch 'autoconf' 2017-03-16 00:06:29 +05:30
Diptanshu8
b08c6285e6 Checking of the mkvlan for last option is left and checking for '-' in the code is left 2017-03-15 23:37:43 +05:30
Mayank Gupta
56f4c14318 Corrected package version in debian.sh 2017-03-15 23:31:53 +05:30
Mayank Gupta
c44e9ecfed Modifications for man pages to work 2017-03-15 22:12:12 +05:30
Diptanshu8
6aaaf6d9ae MKVlang support for a multi-language extraction has been added. 2017-03-15 16:57:52 +05:30
Diptanshu8
3b0031c251 MKVlang support for a single language has been added. 2017-03-15 16:47:26 +05:30
Diptanshu8
75a010fe77 Static option _eng_ for only english subtitles has been set 2017-03-15 15:14:06 +05:30
Diptanshu8
712e44e26c Checking the concatenated videos for subtitle errors and resolved 2017-03-15 14:36:43 +05:30
Mayank Gupta
44adf6427b Corrected debian.sh and Makefile.am for package creation 2017-03-15 13:14:34 +05:30
Mayank Gupta
0bc2dbac4a Merge remote-tracking branch 'upstream/master' 2017-03-15 00:50:34 +05:30
Diptanshu8
9bbab6b595 ASS/SSA newline character covered 2017-03-15 00:48:45 +05:30
Mayank Gupta
460f4e9866 Changes to create release tarball scripts 2017-03-15 00:46:36 +05:30
Diptanshu8
f944c93faa yet to cover ass/ssa subtitiles' newline 2017-03-15 00:35:40 +05:30
Diptanshu8
2c7bfef0f0 ASS/SSA support added for avoiding newline chars at the beginning of sentence. 2017-03-15 00:35:40 +05:30
Diptanshu8
6f5b2aa360 Changes made to avoid breakline/newline at the beginning of sentence. 2017-03-15 00:35:40 +05:30
Diptanshu8
d08cad3642 Rebasing 2017-03-15 00:35:17 +05:30
Diptanshu8
d2d055dd37 Done with removal of MATROSKA_MAX_TRACKS 2017-03-15 00:33:58 +05:30
Diptanshu8
7feb705d73 Rebasing 2017-03-15 00:33:12 +05:30
Mayank Gupta
b0ec1a073b Added man pages for ccextractor 2017-03-15 00:30:42 +05:30
Carlos Fernandez Sanz
c0a40529a9 Merge pull request #714 from saurabhshri/Cleaning
[IMPROVEMENT] Cleaning and replacing redundant code with already existing functions.
2017-03-13 22:54:16 -07:00
Mayank Gupta
7bb9a5f783 Updated Makefile.am and configure.ac 2017-03-13 13:17:30 +05:30
Mayank Gupta
00522bc950 Updated README.md 2017-03-13 11:40:11 +05:30
Mayank Gupta
0632c3a023 Updated configure.ac 2017-03-13 10:54:00 +05:30
Mayank Gupta
6f9b8a6d42 Corrected autogen.sh 2017-03-13 10:18:13 +05:30
Mayank Gupta
72c797bf83 created autogen.sh 2017-03-13 10:11:51 +05:30
Mayank Gupta
5f12bd7538 Autoconf scripts added 2017-03-13 10:05:30 +05:30
Saurabh Shrivastava
7b4c3bb26d Removed depricated function. 2017-03-12 00:39:57 +05:30
Saurabh Shrivastava
4bcc79fdb7 Use already available functions.
Removed code with redundant functionality.
-extracting filename without extension
-generating timestamp for srt format from milliseconds
2017-03-12 00:28:33 +05:30
Carlos Fernandez Sanz
7d4a6fb8d3 Merge pull request #712 from canihavesomecoffee/contributor-guide
[IMPROVEMENT] Add templates for issues and PR's
2017-03-06 12:33:24 -08:00
canihavesomecoffee
5194dea1b8 Add contributors guide, update readme 2017-03-06 21:29:21 +01:00
Carlos Fernandez
5f510cdfa2 filename_non_ext instead of filename_without_ext in matroska.c 2017-03-06 11:32:06 -08:00
Carlos Fernandez Sanz
564aff23a6 Merge pull request #711 from Izaron/platform-lld-spec
Added multiplatform LLD and LLU specs
2017-03-06 10:21:21 -08:00
Evgeny Shulgin
f057a7db05 Added multiplatform LLD and LLU specs 2017-03-06 16:48:54 +03:00
Carlos Fernandez Sanz
47c0bdcd47 Merge pull request #709 from kapilkd13/master
modified subtitle file name genrated by matroska(mkv) - remove 'mkv'
2017-03-05 11:36:43 -08:00
kapil kumar
d80a4f4b3c modified subtitle file name genrated by matroska(mkv) -some changes 2017-03-05 23:57:57 +05:30
kapil kumar
fac11ec5ed modified subtitle file name genrated by matroska(mkv) 2017-03-05 23:45:43 +05:30
Carlos Fernandez Sanz
66e8b280de Merge pull request #707 from Izaron/matroska
Replaced %lld with %I64d
2017-03-05 10:05:05 -08:00
Carlos Fernandez Sanz
ceed0e42b3 Merge pull request #708 from Izaron/bytestream
Removed builtin code in Matroska
2017-03-05 10:03:54 -08:00
Evgeny Shulgin
564093e0ec Removed builtin code in Matroska 2017-03-05 20:18:13 +03:00
Evgeny
af3fff4034 Replaced %lld with %I64d 2017-03-05 15:05:07 +03:00
Carlos Fernandez
254ffb3f39 Updated GSoC status in README.md 2017-03-02 15:05:36 -08:00
Evgeny
a66f3c3973 Added "No captions" code support in Matroska 2017-03-02 16:46:10 +03:00
Evgeny
edaa3b828b Fixed bug with sub name in Windows 2017-03-02 16:38:47 +03:00
Evgeny
76cb7b91ee Added matroska.c to filters and fixed _MSC_VER 2017-03-02 16:18:03 +03:00
Evgeny Shulgin
2048827c45 Added time for the activity progress 2017-03-02 15:49:22 +03:00
Evgeny Shulgin
1f478cfb22 Added matroska warnings about "-out=" 2017-03-02 15:43:02 +03:00
Evgeny Shulgin
e74074ffd0 Removed matroska int and byte types 2017-03-02 14:44:43 +03:00
Evgeny Shulgin
20b557ff97 Matroska main part integrated 2017-03-01 21:50:20 +03:00
Evgeny Shulgin
28f84c768e Added Matroska decoder skeleton 2017-03-01 19:40:09 +03:00
Carlos Fernandez
1d281004e7 Merge branch 'pr/n700_saurabhshri' 2017-02-28 16:35:22 -08:00
Carlos Fernandez
f6f0f79954 Merge branch 'pr/n702_kapilkd13' 2017-02-28 16:34:32 -08:00
Carlos Fernandez
656bac1a6f Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2017-02-28 16:33:56 -08:00
Carlos Fernandez
66344c51fb Merge branch 'pr/n703_Izaron' 2017-02-28 16:33:44 -08:00
kapil kumar
23947beecc typo error 2017-02-28 21:14:22 +05:30
kapil kumar
876a442362 added usage for Levenshtein. fixed issue 701 2017-02-28 20:31:09 +05:30
Saurabh Shrivastava
4ef4a9b03e Teltext from .bin now honours -unixts
Also, fixed no caption found even when it was found from .bin for
teltext.
2017-02-26 23:28:17 +05:30
Saurabh Shrivastava
e9dd3d5845 Ignore CMake Build Stuff 2017-02-26 23:26:22 +05:30
Carlos Fernandez Sanz
eb24e34899 Merge pull request #697 from AlexBratosin2001/master
Sync Teletext to Private Stream 1 instead of all streams
2017-02-23 16:11:37 -08:00
Saurabh Shrivastava
b44fbefc97 Merge remote-tracking branch 'refs/remotes/CCExtractor/master' into ucla 2017-02-24 01:43:15 +05:30
AlexBratosin2001
cbffbb0358 Sync Teletext to Private Stream 1 instead of all streams 2017-02-23 16:33:07 +02:00
Evgeny Shulgin
52c7a8474f Added missing swscale library 2017-02-22 16:40:40 +03:00
Evgeny Shulgin
4f5f564b59 Automatically enable HARDSUBX whed FFMPEG used 2017-02-22 16:36:40 +03:00
Evgeny Shulgin
00ead85ab7 Fixed FFMPEG libs and set all libs non-static 2017-02-21 19:31:12 +03:00
Carlos Fernandez Sanz
9330b95147 Merge pull request #693 from Izaron/korean-fix
Rewritten output handler
2017-02-20 12:13:21 -08:00
Evgeny Shulgin
4ee9c847da Fixed CMake for OCR 2017-02-20 19:31:58 +03:00
Evgeny Shulgin
29180a95b1 Rewritten output handler 2017-02-20 17:39:43 +03:00
Carlos Fernandez Sanz
1124d82687 Merge pull request #685 from sidgairo18/fix_defects
Fix defects
2017-02-15 09:29:25 -08:00
Carlos Fernandez Sanz
795abf74ab Merge pull request #686 from barun511/webvtt_new_fix
Webvtt new fix
2017-02-15 09:27:35 -08:00
Carlos Fernandez Sanz
47cbdd9c1d Merge pull request #688 from Izaron/fedora-build
Updated "Compiling" section with Fedora
2017-02-15 09:26:38 -08:00
Evgeny Shulgin
9b527b7793 Updated "Compiling" section with Fedora 2017-02-15 20:20:42 +04:00
Barun Parruck
e919f1b9f5 Add comments, change array iteration 2017-02-15 01:49:58 +05:30
Barun Parruck
73f3c83940 Add -lf support | make line terminator consistent 2017-02-14 16:22:27 +05:30
Siddhartha Gairola
1425f426dc Update stbl_write.c 2017-02-14 12:28:17 +05:30
Siddhartha Gairola
3e37250d44 Update networking.c 2017-02-12 15:29:48 +05:30
sidgairo18
3be78775ca Fixing memory defects 2017-02-12 15:08:45 +05:30
Saurabh Shrivastava
ab1c7ab563 Fixed missing tpage number in UCLA from BIN. 2017-02-12 14:17:34 +05:30
Barun Parruck
7c2483d73e Fix webvtt formatting
The lack of CRLF after the header led to an invalid webvtt format.
2017-02-10 14:54:42 +05:30
Carlos Fernandez
1975848ecc Removed doku.php reference in README.md 2017-02-08 15:17:28 -08:00
Carlos Fernandez Sanz
e79506b303 Merge pull request #681 from Abhinav95/master
Template for upcoming additions to burned in extraction
2017-02-08 13:16:25 -08:00
Abhinav Shukla
9f32edad63 Merging change to Tesseract OEM mode with new hardsubx code 2017-02-09 02:40:01 +05:30
Abhinav Shukla
3278b31a8f Setting up tickertape parameter 2017-02-09 02:30:51 +05:30
Carlos Fernandez
ec6c7aede8 Typo in README.md 2017-02-07 15:09:46 -08:00
Carlos Fernandez
0516232bb3 Changes in README.md 2017-02-07 15:09:01 -08:00
Carlos Fernandez
44f97181ae Mentioned GSoC 2017 in README.md 2017-02-07 15:06:49 -08:00
Carlos Fernandez
cf762df972 Minor typo 2017-02-06 11:11:44 -08:00
Carlos Fernandez Sanz
6a90829744 Merge pull request #679 from saurabhshri/print_usage
Changes regarding output file name and minor print_usage corrections.
2017-02-06 11:09:37 -08:00
Saurabh Shrivastava
d37086a434 Removed depricated pramams and added missing one.
-o1 and -o2 were depricated in commit
0541a2fb62

--version was missing.
2017-02-06 03:21:34 +05:30
Saurabh Shrivastava
5ce5dc7fae Fix for NULL output filename.
If no -o is suppled with stdin/network etc, the output name generated
was NULL, leading to creation of files like `.srt` which were in
category of hidden files.
2017-02-06 03:11:53 +05:30
Saurabh Shrivastava
851894dceb Fatal if unable to open output file. 2017-02-06 03:11:53 +05:30
Saurabh Shrivastava
6837a1070b Printing end message after fatal. 2017-02-06 02:11:53 +05:30
Carlos Fernandez
dbad5f4cda Started 0.86 changelist. 2017-01-30 15:54:32 -08:00
Carlos Fernandez
482a20430d ffmpeg_intgr.c: Wrong directory was being used in ffmpeg #include. 2017-01-30 15:54:05 -08:00
Carlos Fernandez
85751cee2b dvbsub_parse_clut_segment: Changed return on fail (from 0 to -1, as expected by the caller). 2017-01-30 15:14:16 -08:00
Carlos Fernandez
12467815ae Closes #675
Moved final text after dinit().
2017-01-30 13:06:48 -08:00
Carlos Fernandez
883d5ccc77 Added windows/enc_temp_folder to .gitignore 2017-01-30 12:59:39 -08:00
Carlos Fernandez
0d7b33c362 Merge branch 'pr/n673_AlexBratosin2001' 2017-01-30 12:58:25 -08:00
Carlos Fernandez
79a6d3d04a Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2017-01-30 12:57:01 -08:00
Carlos Fernandez
6bbb649ee6 Fix crash on -xmltv -out=null due to not having an encoder context. 2017-01-30 12:56:44 -08:00
AlexBratosin2001
919d3ec3b0 Fixed timing error caused by last commit 2017-01-28 23:24:50 +02:00
AlexBratosin2001
c5ea59aeb1 Fixed huge memory leak related to OCR init 2017-01-28 22:20:08 +02:00
Carlos Fernandez Sanz
b3010afba7 Merge pull request #672 from canihavesomecoffee/ds_store-fix
Delete .DS_Store files and add it to .gitignore file
2017-01-28 10:28:26 -08:00
Willem
de958c9383 Delete .DS_Store files and add it to .gitignore file 2017-01-28 18:03:22 +01:00
Carlos Fernandez
1bd3a43dbe Added 0.85b to CHANGES.TXT 2017-01-26 17:08:01 -08:00
Carlos Fernandez
5fa83394a0 Merge branch 'pr/n670_Izaron' 2017-01-26 10:20:13 -08:00
Carlos Fernandez
51537e8725 networking, multicast: In linux, bind to the specific IP address of the multicast source.
OCR: init some variables that didn't have a default value.
2017-01-26 10:16:52 -08:00
Evgeny
071386d552 Fixed DLL requiring in non-full version 2017-01-26 12:27:39 +03:00
Carlos Fernandez
ec9a0985ce Rework signals 2017-01-24 11:06:09 -08:00
Carlos Fernandez
71dffd6eb3 Use TessDeleteText to delete strings received from Tesseract 2017-01-23 16:05:05 -08:00
Carlos Fernandez
560a88b0b9 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2017-01-23 12:34:06 -08:00
Carlos Fernandez
626717cc28 Added release date for 0.85 and new changes to CHANGES.TXT 2017-01-23 12:33:53 -08:00
Carlos Fernandez Sanz
8dc1964f8c Merge pull request #660 from Izaron/708-adventures
Fixed ttxt 708 files segfault
2017-01-23 10:05:10 -08:00
Evgeny Shulgin
d72e946213 Fixed ttxt 708 files segfault 2017-01-23 19:29:28 +04:00
Carlos Fernandez Sanz
24edbff859 Merge pull request #655 from saurabhshri/patch-1
Ability to extract Chapters from MP4 files.
2017-01-20 13:01:43 -08:00
Saurabh Shrivastava
77da2dc873 Added -chapters paramater for chapter extaraction from MP$. 2017-01-21 01:43:41 +05:30
Saurabh Shrivastava
d9414782b2 Function prototype for chapter extraction. 2017-01-21 01:38:12 +05:30
Saurabh Shrivastava
d1b127164e Option for chapter extraction. 2017-01-21 01:37:13 +05:30
Saurabh Shrivastava
db8d9c67b6 By default don't extract chapters. 2017-01-21 01:35:58 +05:30
Saurabh Shrivastava
c9a3a0c7f2 Extract chapters from mp4 file and write it in a file. 2017-01-21 01:33:59 +05:30
Saurabh Shrivastava
0e4d211eaf Extract chapter instead of subtitles if extract_chapters is True. 2017-01-21 01:29:04 +05:30
Carlos Fernandez
57daaf3e4d - Correct identing in ccextractor.c
- Correct return code for multiprogram transport streams
2017-01-19 15:14:54 -08:00
Carlos Fernandez
bc1e309b13 Added "CCX_DTVCC_C0_NUL" (do nothing, but prevent the "unhandled" warning) 2017-01-19 14:53:15 -08:00
AlexBratosin2001
09778b2d14 Sped up min_pts calculation (avoided lots of unnecessary loop iterations) 2017-01-19 22:06:39 +02:00
Evgeny
89c00a7e21 Added OEM mode parameter 2017-01-19 20:57:35 +03:00
Carlos Fernandez
bb026a7318 Merge branch 'pr/n649_sidgairo18' 2017-01-17 11:53:13 -08:00
maxkoryukov
566d1284f2 Remove SBS stuff from decoder_init 2017-01-15 23:55:41 +05:00
maxkoryukov
b5b2a7d70d Probably fix the maxkoryukov/ccextractor#1 : split to sentences
This version returns enough readable subs , splitted into sentences
2017-01-15 22:37:51 +05:00
maxkoryukov
93e407f4a5 Improve SBS: fix for #639 and non-gready similarity detection
* Use own SBS-context structure to store SBS-data (fix CCExtractor/ccextractor#639)
* Search for BEST match of new string and SBS-buffer (instead of first appropriate..)
* all tests are fixed and passed
2017-01-15 22:37:51 +05:00
maxkoryukov
ad7b141cc6 Tiny fixes 2017-01-15 22:37:51 +05:00
maxkoryukov
f23beab07e Fix error with uninitialed sbs_handled_len. Free sbs_buffer on dinit_encoder_context
* more debug for SBS
2017-01-15 22:37:51 +05:00
maxkoryukov
c582175d35 Wrap debug instructions in #ifdef 2017-01-15 22:37:51 +05:00
maxkoryukov
1b1a572f73 SBS: use Levenshtein distance to detect duplicates in subs
see maxkoryukov/ccextractor#1
2017-01-15 22:37:51 +05:00
maxkoryukov
7c9ffbbde9 Levenshtein for char * in utility.c
see maxkoryukov/ccextractor#1
2017-01-15 22:37:51 +05:00
maxkoryukov
5404108cc1 Some improvements for test-environment
see maxkoryukov/ccextractor#1
2017-01-15 22:37:51 +05:00
maxkoryukov
5c2d6956fd Fixed format specifiers for debug output 2017-01-15 22:37:51 +05:00
Siddhartha Gairola
fad623ed6a Update general_loop.c 2017-01-15 14:08:16 +05:30
Siddhartha Gairola
263dd2cb40 Update ccx_encoders_webvtt.c 2017-01-15 14:07:04 +05:30
sidgairo18
2d56d067e3 Fixed issue #648 2017-01-15 14:02:49 +05:30
Carlos Fernandez Sanz
759507f196 Merge pull request #645 from Izaron/708-adventures
708 fixes
2017-01-14 10:04:06 -08:00
Evgeny
e048c65cdb [CEA-708] Added BS command 2017-01-14 19:30:03 +03:00
Evgeny
41cd5f00bc Updated 708 window dump 2017-01-14 18:17:31 +03:00
AlexBratosin2001
7ab968c4a6 Merge remote-tracking branch 'upstream/master' 2017-01-13 23:35:59 +02:00
AlexBratosin2001
462f63a294 Fixed DVB multiprogram. 2017-01-13 23:35:34 +02:00
Carlos Fernandez
f75793c5e4 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2017-01-13 11:32:22 -08:00
Carlos Fernandez
521ee29ab8 Corrections in dvbcolor help and code comments. 2017-01-13 11:32:11 -08:00
Carlos Fernandez Sanz
91690f9453 Merge pull request #643 from Izaron/708-stuff
CEA-708 subtitle counter
2017-01-13 09:55:12 -08:00
Evgeny
aa0db3c528 Using correct CEA-708 subs counter 2017-01-13 20:34:50 +03:00
Evgeny
a727d2df26 Fixed hot bug with CEA-708 counter 2017-01-13 20:32:29 +03:00
Carlos Fernandez Sanz
8f818051b0 Merge pull request #642 from Izaron/708-stuff
CEA-708 improvements
2017-01-13 06:54:12 -08:00
Evgeny
1fb98118c6 Added CEA-708 counter for EXIT_NO_CAPTIONS 2017-01-13 16:40:08 +03:00
Evgeny
967e2bc695 decoder->tv refactoring 2017-01-13 16:15:43 +03:00
Evgeny
0855c0a41d Added support of SAMI and TTXT in CEA-708 2017-01-13 16:04:37 +03:00
Evgeny
bff384e677 Refactored CEA-708 symbol struct 2017-01-13 15:46:41 +03:00
Evgeny
3b2545cf82 Fixed timing bug catching in CEA-708 2017-01-13 14:06:49 +03:00
Evgeny
762ab7ce36 Merge remote-tracking branch 'refs/remotes/CCExtractor/master' 2017-01-13 10:30:35 +03:00
Naman Yadav
ab31e7b4d4 Check for language tesseract data in /usr/share/tessdata/ (#638)
Closes https://github.com/CCExtractor/ccextractor/issues/448
2017-01-12 15:07:28 -08:00
gonzaloUran
cd17aa3a53 make -ignoreptsjumps and -dvbcolor default (#637)
* default-arguments

* default-arguments
2017-01-12 14:44:56 -08:00
Carlos Fernandez
d99fda59a3 Merge branch 'pr/n640_Izaron' 2017-01-12 10:33:19 -08:00
Evgeny
ddbd03760b Added max macro for non-Visual Studio IDE 2017-01-12 21:27:36 +03:00
Evgeny
7078f10150 Fixed 708 pen handling from line by line to correct 2017-01-12 21:07:16 +03:00
Siddhartha Gairola
6c733e96c9 Fix defects (#630)
* Fixed memory leaks issue #615

* Fixed memory leaks issue #615

* Update lib_ccx.c

* Fixing issue #629

* Update networking.c
2017-01-11 13:06:56 -08:00
Saurabh Shrivastava
720008f9fb Update params.c 2017-01-12 02:03:08 +05:30
AlexBratosin2001
ade11eb80f Fixed DVB multiprogram (timing is still broken) 2017-01-11 22:30:39 +02:00
Saurabh Shrivastava
d8a6642d5f Exit if input source is stdin for MP4. 2017-01-12 01:58:25 +05:30
Saurabh Shrivastava
2464064226 Stop GPAC from analyzing if input source is stdin. 2017-01-12 01:54:31 +05:30
Carlos Fernandez
591d74d0c5 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2017-01-11 11:53:56 -08:00
Carlos Fernandez
14286a0025 Avoid calling fatal() on warning.
Minor indenting.
2017-01-11 11:53:43 -08:00
Evgeny
ddce5829d5 Musical note should replace 'Delete' in G0 Table 2017-01-11 19:18:32 +03:00
Evgeny
ebd9fc4bfe Minor mistake in bitsream fixed 2017-01-11 14:14:35 +03:00
gonzaloUran
6f8d99b39e pesheader-option (#628) 2017-01-10 16:56:30 -08:00
saurabhkapur
65634a18d1 Fixes #618 (#619) 2017-01-10 16:27:28 -08:00
Saurabh Shrivastava
827ace8dca SMPTE-TT : Removed appearance of garbage value in color code. (#625)
Also polished and improved existing code. More details : CCExtractor#620
2017-01-10 16:26:23 -08:00
AlexBratosin2001
baa5b0d14f Fixed error regarding last commit 2017-01-11 00:24:07 +02:00
AlexBratosin2001
b633491b91 Perfected DVB timing and cleaned up code 2017-01-11 00:00:06 +02:00
AlexBratosin2001
9f331b6a92 Merge remote-tracking branch 'upstream/master' 2017-01-10 23:59:16 +02:00
Carlos Fernandez
b5de22ff13 Solve crash caused by boxdestroy? 2017-01-10 13:06:34 -08:00
Carlos Fernandez
e4c9a95f7c Memory leaks in ocr.c 2017-01-10 12:59:23 -08:00
Carlos Fernandez
90001b6c23 Fix in memory free 2017-01-10 12:20:15 -08:00
Carlos Fernandez
19fec61902 Fix: Memory leak in ccx_encoders_smptett.c 2017-01-10 12:16:05 -08:00
Carlos Fernandez
acc63cc478 Merge branch 'pr/n623_Izaron' 2017-01-10 11:35:24 -08:00
Carlos Fernandez
7a4bcd3b52 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2017-01-10 11:18:41 -08:00
Carlos Fernandez
4017b59f97 Init saw_caption_block in decoder context. 2017-01-10 11:18:18 -08:00
Evgeny
407a40e32e Fixed italics and underline bit flags 2017-01-10 22:17:13 +06:00
Evgeny
714700f6b5 Fixed column count to correct values 2017-01-10 22:03:50 +06:00
Evgeny
d60baf1895 Added support of UTF16 2017-01-10 12:12:13 +06:00
Carlos Fernandez
14418d6fa1 Added +x to build-static.sh 2017-01-09 22:42:20 +00:00
Carlos Fernandez
2db16f09c7 Added static binary build script (linux). 2017-01-09 12:08:36 -08:00
Carlos Fernandez
178aa1de9c Typo in CHANGES.TXT 2017-01-09 11:41:48 -08:00
Carlos Fernandez
6716704dc3 Added more content to CHANGES.TXT 2017-01-09 11:08:27 -08:00
Carlos Fernandez
d7d7d62971 Updated CHANGES.TXT with the new stuff for 0.85. 2017-01-09 11:06:19 -08:00
AlexBratosin2001
737c0f4205 Added Alexandru Bratosin to README.TXT 2017-01-09 20:15:36 +02:00
Carlos Fernandez
766145275a Merge branch 'pr/n622_AlexBratosin2001'
Version change from 0.84 to 0.85.
2017-01-09 10:09:13 -08:00
Carlos Fernandez
7517a5448e Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2017-01-09 10:04:27 -08:00
Carlos Fernandez
80a0f1a1c1 Changed where to report bugs. 2017-01-09 10:04:10 -08:00
Abhinav Shukla
5933194570 Progress activity and more context 2017-01-09 21:14:52 +05:30
AlexBratosin2001
898ce5bf87 Fixed Teletext related issues (+DVB) and added other stuff 2017-01-09 16:14:05 +02:00
Abhinav Shukla
fbc7cb5452 Setting up skeleton for tickertext based burned in detection 2017-01-09 17:51:15 +05:30
Abhinav Shukla
5c646d214c Merge remote-tracking branch 'upstream/master' 2017-01-08 21:59:36 +05:30
Carlos Fernandez
6f11230a87 Merge branch 'master' of https://github.com/CCExtractor/ccextractor.git 2017-01-08 07:51:58 -08:00
Carlos Fernandez
a63acf4f45 Changed minor text in a debug function. 2017-01-08 07:51:44 -08:00
Evgeny
a41cd3f0c4 Added spaces as in 608 subs
Length of the string is equal to 32, and so subtitles are displayed in
VLC with spaces, not the text without spaces in the middle of screen.
2017-01-08 21:50:56 +06:00
Siddhartha Gairola
9fc0402b0f Fixed memory leaks. refer issue #615 (#617)
* Fixed memory leaks issue #615

* Fixed memory leaks issue #615

* Update lib_ccx.c
2017-01-08 07:29:15 -08:00
Anukul Sangwan
4852987aae return a non-zero return code if no subtitles were found (#553)
* return a non-zero return code if no subtitles were found

* fix for mp4
2017-01-08 01:08:45 -08:00
saurabhkapur
83632761a4 tesseract library file included in mac build command (#612)
* tesserac file added in mac build command

* tesserac file added in mac build command

* Delete .DS_Store
2017-01-07 11:52:39 -08:00
Evgeny Shulgin
2229a51b66 Added FFMPEG 3.0 what compatible with XP (#610) 2017-01-07 11:52:13 -08:00
Siddhartha Gairola
86a826edaf GPAC double free issue resolved. Issues 608 and 609 also resolved. (#611)
* A pointer was freed twice in file

* The double free issue in GPAC is updated according to the latest source code. Issues 608 and 609 also resolved.

* Update wtv_functions.c
2017-01-07 11:51:20 -08:00
cfsmp3
b6dc6dd876 Merge branch 'pr/n605_brooss' 2017-01-06 09:28:01 +01:00
Brooss
4ed60073d2 Fix for bad WTV timings (#452) 2017-01-06 15:12:18 +11:00
cfsmp3
7d01c963b8 Merge branch 'pr/n600_grave-w-grave' 2017-01-05 10:26:12 +01:00
cfsmp3
80047e536d Merge branch 'pr/n601_AlexBratosin2001' 2017-01-05 10:25:17 +01:00
cfsmp3
4bcabff630 Merge branch 'pr/n602_Lord-AJ' 2017-01-05 10:24:41 +01:00
cfsmp3
be4ad97832 Merge branch 'pr/n603_Izaron' 2017-01-05 10:23:43 +01:00
Evgeny
f2b8b43bae Added PAC row positioning 2017-01-05 11:38:04 +03:00
Lord-AJ
00f1ec7906 Added names of characters from S4E01 2017-01-05 02:02:25 +05:30
cfsmp3
f8aae84bc4 Merge branch 'pr/n599_Izaron' 2017-01-04 17:59:06 +01:00
AlexBratosin2001
2a7df734de Added -pesheader dump support for teletext packets too 2017-01-04 18:57:39 +02:00
Evgeny
4308247624 Added .css styling both inline and outline 2017-01-04 17:44:27 +03:00
grave-w-grave
5f19a9f89d Skip the packet if the adaptation field length is broken 2017-01-04 12:39:02 +11:00
Evgeny
34a21a931d Enabled the support of raw WebVTT 2017-01-03 22:57:28 +03:00
Evgeny
2b0c8ba7a0 Added WebVTT color and font support 2017-01-03 22:48:50 +03:00
Evgeny
2c30f5eb5b Fixed file invalidation
Don't need to add CRLF because file becomes invalid. We need to write
cue just after the timestamp.
2017-01-03 20:55:15 +03:00
cfsmp3
dfb7d8472c Merge branch 'pr/n598_Izaron' 2017-01-03 13:45:29 +01:00
Evgeny
d87b269bae Fixed bug with multiple headers 2017-01-02 20:43:17 +03:00
cfsmp3
c84c7b5fa0 Commented out nanoseconds in PCR 2017-01-02 18:27:00 +01:00
cfsmp3
03de867572 Attempt at solving the PTS overflow in the first 2 PTS set (Hercules.ts problem) 2017-01-02 18:25:35 +01:00
Evgeny
483540488a Added webvtt-full parameter 2017-01-02 20:22:02 +03:00
Evgeny
f55876514f Updated libpng from 1.6.26 to 1.6.27 2017-01-02 18:18:15 +03:00
cfsmp3
bf7ec06957 Made rollover_bits parts of decoder context 2017-01-02 15:07:35 +01:00
cfsmp3
874a850087 Correctly write PTS on debug 2017-01-02 14:28:22 +01:00
cfsmp3
4b0a455147 Merge branch 'pr/n594_Izaron' 2017-01-02 13:43:42 +01:00
Evgeny Shulgin
624f1722b6 The proposal to update the "Compiling" section 2017-01-02 13:22:19 +03:00
Evgeny
72f12bbff5 Hot fix for non-full configuration 2017-01-02 12:59:43 +03:00
cfsmp3
57ef958250 Corrected header directories in non-full versions. 2017-01-01 22:12:35 +01:00
cfsmp3
2814599943 Merge branch 'pr/n592_Izaron' 2017-01-01 21:53:20 +01:00
Evgeny
2942e84a6f Solved the Windows dependency hell 2017-01-01 21:34:43 +03:00
AlexBratosin2001
148a70ccb8 Fixed SPUPNG possible subtitle overlapping 2017-01-01 19:44:38 +02:00
AlexBratosin2001
5f0c6cb961 Merge remote-tracking branch 'upstream/master' 2017-01-01 19:43:22 +02:00
Lia
bb3ae7eb88 align comments (#573) 2017-01-01 16:34:53 +01:00
cfsmp3
64d2805c72 Merge branch 'pr/n588_emquantum' 2017-01-01 16:29:05 +01:00
cfsmp3
533599e5d4 Merge branch 'pr/n589_emquantum' 2017-01-01 16:27:57 +01:00
cfsmp3
cec527453a Merge branch 'pr/n587_emquantum' 2017-01-01 16:27:38 +01:00
AlexBratosin2001
2d35bbb4da Fixed SAMI unnecessary empty subtitle when extracting DVB subs (continuity check). 2016-12-31 16:50:57 +02:00
cfsmp3
7091101b04 Merge branch 'pr/n586_AlexBratosin2001' 2016-12-31 15:11:05 +01:00
emquantum
848ad08efc Create dict_smash.txt 2016-12-30 15:48:42 -05:00
emquantum
2620373fb6 Create dict_glee.txt 2016-12-30 15:39:06 -05:00
Saurabh Shrivastava
afc8a3d764 Added support for font color.
Font color support as per SMPTE-TT Specification.
2016-12-31 02:00:54 +05:30
Saurabh Shrivastava
6c1ba95f89 Proper string termination.
Replaced `strncpy` with `strncat` as `strncpy` doesn't copy null character and was causing undesirable effects.
2016-12-31 00:30:39 +05:30
emquantum
c5cd400eb8 Create dict_white_collar.txt 2016-12-30 13:45:19 -05:00
AlexBratosin2001
bd2868746d Fixed DVB to SAMI extraction (subtitle overlapping when subtitle had more than 1 line). 2016-12-30 20:43:42 +02:00
AlexBratosin2001
cc7692d7eb Fixed crash regarding memory leak 2016-12-30 19:11:33 +02:00
AlexBratosin2001
fd01232a26 Fixed SSA, SPUPNG and VTT timing and skipping of subtitles for SAMI and TTML. 2016-12-30 16:46:23 +02:00
AlexBratosin2001
5fa93764b2 Fixed SSA, SPUPNG and VTT timing and skipping of subtitles for SAMI and TTML. 2016-12-30 16:44:07 +02:00
cfsmp3
588ed3c77e Merge branch 'pr/n582_saurabhshri' 2016-12-30 08:50:57 +01:00
Saurabh Shrivastava
6e3f669c13 Corrected improper encoding.
It was present due to uninitialised variables. Also memory leak fixed. :)
2016-12-30 11:26:21 +05:30
Saurabh Shrivastava
23a9c5da4d Probable Memory Leak Fix. 2016-12-30 00:44:25 +05:30
Saurabh Shrivastava
344a3e633a Fixed minor mistake. 2016-12-29 23:33:42 +05:30
Saurabh Shrivastava
0a0881017a Revert Incorrect Commit. 2016-12-29 23:24:12 +05:30
Saurabh Shrivastava
76e0987c57 Adobe Premier Pro Compatibility and Proper HTML formatting.
These changes were required for Adobe Premier Pro Compatibility. Previous ones were ignored.

a. ITALICS:

This:
      <p ...>
        <span>Hello<i> italic</i>!
        <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/></span>
      </p>
Premiere expects:
      <p ...>
        <style/>
        <span>Hello 
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
        <span>italics
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px" tts:fontStyle="italic"/>
        </span>
        <span>!
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
      </p>

2.b. UNDERLINE:

This:
      <p ...>
        <span>Hello<u> underline</u>!
        <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/></span>
      </p>
Premiere expects:
      <p ...>
        <style/>
        <span>Hello 
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
        <span>underline
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px" tts:textDecoration="underline"/>
        </span>
        <span>!
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
      </p>
2016-12-29 23:13:01 +05:30
Saurabh Shrivastava
e0b6ae275d Adobe Premier Pro Compatibility and Proper HTML formatting.
These changes were required for Adobe Premier Pro Compatibility. Previous ones were ignored.

a. ITALICS:

This:
      <p ...>
        <span>Hello<i> italic</i>!
        <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/></span>
      </p>
Premiere expects:
      <p ...>
        <style/>
        <span>Hello 
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
        <span>italics
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px" tts:fontStyle="italic"/>
        </span>
        <span>!
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
      </p>

2.b. UNDERLINE:

This:
      <p ...>
        <span>Hello<u> underline</u>!
        <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/></span>
      </p>
Premiere expects:
      <p ...>
        <style/>
        <span>Hello 
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
        <span>underline
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px" tts:textDecoration="underline"/>
        </span>
        <span>!
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
      </p>
2016-12-29 23:08:45 +05:30
Saurabh Shrivastava
c9fe87014e Rebasing with current memory leak fix. 2016-12-29 22:53:40 +05:30
Saurabh Shrivastava
2b94b5e316 Updated SMPTE-TT header.
Updated header according to SMPTE-TT TTML guidelines.
2016-12-29 22:50:15 +05:30
AlexBratosin2001
0c4bf2a6b1 Added -ignoreptsjumps parameter to ignore pts jumps (needed for some formats). Updated help page (added documentation for latest parameters). Replaced some printf() calls with mprint(). 2016-12-29 17:18:42 +02:00
AlexBratosin2001
b9448026d7 Updated -debugdvbsub traces to get the most relevant info. 2016-12-29 15:36:26 +02:00
AlexBratosin2001
90745b07ac Updated -debugdvbsub traces to get the most relevant info. 2016-12-29 15:33:48 +02:00
AlexBratosin2001
40d97292d2 Fixed memory leak for DVB subs. 2016-12-29 13:16:09 +02:00
AlexBratosin2001
06fdd51104 Fixed memory leak for DVB subs. 2016-12-28 22:04:23 +02:00
AlexBratosin2001
a09a7e4930 Fixed DVB subtitle timing and added -debugdvbsub parameter for DVB sub debug traces. 2016-12-28 21:35:26 +02:00
AlexBratosin2001
121ac2bdfe Fixed DVB subtitle timing and added -debugdvbsub parameter for DVB sub debug traces 2016-12-28 21:06:55 +02:00
AlexBratosin2001
e9c088a86b Fixed DVB subtitle timing and added -debugdvbsub parameter for DVB sub debug traces 2016-12-28 20:55:10 +02:00
cfsmp3
d4e03ec759 Merge branch 'master' of github.com:CCExtractor/ccextractor 2016-12-27 04:29:28 +01:00
cfsmp3
2d767569c9 Removed ptr->bufferdatatype fromc all to pess_header_dump. 2016-12-27 04:28:53 +01:00
Evgeny Shulgin
eecec39725 Fix SubStation Alpha subtitles in bitmap (#571) 2016-12-26 21:32:06 +01:00
Evgeny Shulgin
99ec42bf35 Fixed lept msg severity in linux (#576) 2016-12-26 21:31:33 +01:00
Evgeny Shulgin
e2f6fce850 Added build script for .deb (#574)
* Added build script for .deb

* Added tip for users and automatically build
2016-12-26 21:31:00 +01:00
AlexBratosin2001
9f2cd33a82 Added -pesheader parameter for PES packet header dumping (#572)
* Added -pesheader parameter for PES packet header dumping

* Added -pesheader parameter for short PES Header dump to console

* Added -pesheader parameter for short PES Header dump to console

* Fixed DVB subs start time and added -pesheader parameter for PES Header dumping

* Fixed DVB sub start time and added -pesheader parameter for PES packet header dumping
2016-12-26 18:21:10 +01:00
ManveerBasra
556cc482d8 Added Manveer Basra to README.txt 2016-12-24 16:29:46 -08:00
Evgeny
fe9cd61d1d Fixed bad tesseract library 2016-12-24 22:19:23 +03:00
Evgeny
08b2bcb88b Added dependencies .dll-s and copy command 2016-12-24 18:26:06 +03:00
Evgeny
0072e98fad Fixed Tesseract OCR mode, removed Lept info msg 2016-12-24 18:23:23 +03:00
Evgeny
0befb3c5b1 Renamed tess version from 3.05 to 4.00 2016-12-24 10:59:52 +03:00
Evgeny
5e0f9a4898 Disabled info and warnings from Tesseract 2016-12-24 10:42:35 +03:00
Abhinav Shukla
588a8d6b7c Merge remote-tracking branch 'upstream/master' 2016-12-23 23:59:56 +05:30
Evgeny
331a64e387 Added working tesseract 4.00 2016-12-23 18:01:12 +03:00
Evgeny
f40781a9eb Updated zlib 2016-12-23 14:37:07 +03:00
Evgeny
490fedf463 Updated libpng from 1.6.10 to 1.6.26 2016-12-23 14:25:12 +03:00
Evgeny Shulgin
12466ef9cb Memory optimization in edit_distance (#564) 2016-12-23 09:31:17 +01:00
cfsmp3
c75fc7f1eb Readded the old windows directories to .gitignore to avoid crap being committed by mistake. 2016-12-22 19:59:55 +01:00
Evgeny
4c78e47404 Fixed mess in the filters 2016-12-22 18:37:02 +03:00
Evgeny
4b80441164 Renamed OCR to Full and copy ffmpeg DLLs to folder 2016-12-22 18:19:42 +03:00
cfsmp3
e2cc2f9fd7 ImageHasSafeExceptionHandlers>false 2016-12-22 09:21:24 +01:00
cfsmp3
b669733bd8 Added pre-build.bat to Release-OCR 2016-12-22 08:54:59 +01:00
Evgeny Shulgin
5a769fa22b Fixed bug with -udp address (#549) 2016-12-22 07:40:50 +01:00
cfsmp3
8bbf27526e Merge branch 'pr/n557_Izaron' 2016-12-22 07:29:29 +01:00
cfsmp3
4270450a03 Merge branch 'pr/n554_Izaron' 2016-12-22 07:18:17 +01:00
Evgeny
802360b008 Ported HARDSUBX to Windows 2016-12-18 19:42:23 +03:00
Evgeny
ccd11d38f8 Fixed -stdin option in Windows 2016-12-18 11:21:03 +03:00
Izaron
996c18fca0 Reopen: fixed memory leaks 2016-12-17 19:00:34 +03:00
Abhinav Shukla
0cb7cbcb49 Merge remote-tracking branch 'upstream/master' 2016-12-17 20:11:11 +05:30
Carlos Fernandez
19f12038cd Added new stuff to CHANGES.TXT 2016-12-16 10:50:04 -08:00
Carlos Fernandez
ebc7c070f3 Merge branch 'pr/n545_Izaron' 2016-12-16 10:44:14 -08:00
Carlos Fernandez
7acb3c3874 Version bump (to 0.84). Rename target name of the Windows OCR binaries. 2016-12-16 10:41:02 -08:00
Carlos Fernandez
e3ca2c3fbc Merge branch 'pr/n537_maxkoryukov' 2016-12-16 10:06:18 -08:00
Carlos Fernandez
ac1accce96 Merge branch 'pr/n544_Izaron' 2016-12-16 10:04:19 -08:00
Carlos Fernandez
c39185abab Merge branch 'pr/n541_saurabhshri' 2016-12-16 10:03:37 -08:00
Carlos Fernandez
6729c9c33f Merge branch 'pr/n524_DanilaFe' 2016-12-16 10:02:18 -08:00
Carlos Fernandez
4e4a7aa19e Merge branch 'pr/n522_DanilaFe' 2016-12-16 10:01:24 -08:00
Izaron
5d8ce8bfb8 Added configurable curl post url 2016-12-16 15:07:01 +03:00
Izaron
92b811b329 Added myself to credits 2016-12-16 14:02:37 +03:00
Saurabh Shrivastava
8c8a357aa7 Corrected filename. 2016-12-16 11:00:34 +05:30
Saurabh Shrivastava
f2770b4609 Corrected filename. 2016-12-16 10:59:20 +05:30
Danila Fedorin
7c21754b74 Update with upstream changes and fix merge conflict. 2016-12-15 14:05:08 -08:00
Carlos Fernandez
547a9e9fbf Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-12-15 13:53:57 -08:00
Carlos Fernandez
fd6a223876 Merge branch 'pr/n520_DanilaFe' 2016-12-15 13:53:37 -08:00
captions
2fd71f00d6 Minor gramatical error 2016-12-15 11:32:17 -08:00
Carlos Fernandez
0301a40560 Merge branch 'pr/n538_Izaron' 2016-12-15 11:31:38 -08:00
Evgeny Shulgin
5bbf27de9c Fixed linux/build script
Last PR #534
2016-12-15 21:07:29 +04:00
maxkoryukov
54f628f7a6 remove debug-files, increase verbosity for tests
fix maxkoryukov/ccextractor#1
2016-12-15 21:23:16 +05:00
maxkoryukov
4743eb46c1 Try to make changes compatible with upstream 2016-12-15 20:25:06 +05:00
maxkoryukov
66393a80f2 Break incoming subs into sentences (through a buffer), and remove duplicates 2016-12-15 20:21:43 +05:00
Danila Fedorin
c6c8de7357 Rename mstotime to millis_to_time in ccx_encoders_ssa. 2016-12-14 17:43:59 -08:00
Danila Fedorin
cbbbb20751 Merge remote-tracking branch 'upstream/master' into cleanup-ccx-common-h 2016-12-14 17:37:55 -08:00
Danila Fedorin
5846093a7f Merge remote-tracking branch 'upstream/master' into refactor-msprint
# Conflicts:
#	src/lib_ccx/general_loop.c
2016-12-11 14:20:15 -08:00
Danila Fedorin
f1d276c988 Merge upstream changes. 2016-12-11 14:13:27 -08:00
Danila Fedorin
0d0cb83ed6 Merge upstream changes 2016-12-11 14:05:49 -08:00
Danila Fedorin
08e9c3d596 Rename previously not renamed function. 2016-12-11 01:16:52 -08:00
Danila Fedorin
edcd2df6bc Fix variable names in asf_functions.c 2016-12-11 01:11:25 -08:00
Danila Fedorin
3f679d72cf Fix typo in asf_cuntions.c. It looks like a typo from the surrounding
code.
2016-12-11 01:05:45 -08:00
Danila Fedorin
2e09541c84 Rename another function. 2016-12-11 01:05:35 -08:00
Danila Fedorin
27417cda70 Rename more mstotime's to millis_to_time. 2016-12-10 23:22:10 -08:00
Danila Fedorin
2959d2a2ae Rename function to new name. 2016-12-10 23:22:03 -08:00
Danila Fedorin
289aecc1ed Refactor code surrounding print_mstime_static.
This should decrease code duplication - print_mstime2buf was doing
the same thing as mstime_sprintf, but with a hardcoded format and
a different return value. print_mstime (renamed to print_mstime_static)
could therefore be reworked into simply calling mstime_sprintf
 (renamed to print_mstime_buff).
2016-12-10 23:20:57 -08:00
Danila Fedorin
ea980a4150 Add underscores to debug_608toASC. 2016-12-10 23:12:37 -08:00
Danila Fedorin
2910b10f99 Rename mstotime to millis_to_time. 2016-12-10 23:11:01 -08:00
Abhinav Shukla
b25a9f2ae4 Fix #454 : Removed ugly debug statement with local path 2016-12-11 10:01:55 +05:30
1038 changed files with 349641 additions and 22755 deletions

36
.github/CONTRIBUTING.md vendored Normal file
View File

@@ -0,0 +1,36 @@
# Contributors Guide
Please read and understand the contribution guide before creating an issue or pull request. We would like to thank [Nishad TR](https://github.com/nishad) for their contributor's guide, upon which we based ours.
## Etiquette
This project is open source, and as such, we (the maintainers) give our **free time** to build, maintain and **provide user support** for the CCExtractor program. We make the code freely available in the hope that it will be of use to other developers and users. It would be extremely unfair for us to suffer abuse or anger for our hard work.
Please be considerate towards the developers and other users when raising issues or presenting pull requests.
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the decision of the maintainers, and do not be upset or abusive if your submission is not used.
## Viability
When requesting or submitting new features, first consider whether it might be useful to others. Open source projects are used by many developers, who may have entirely different needs to your own. Think about whether or not your feature is likely to be used by other users of the project.
## Procedure
**Before filing an issue**:
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
- Check to make sure your feature suggestion isn't already present within the project.
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
- Check the pull requests tab to ensure that the feature isn't already in progress.
**Before submitting a pull request**:
- Ensure that your submission is [viable](#viability) for the project.
- Check the codebase to ensure that your feature doesn't already exist.
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
## Technical requirements
- Before Submitting your Pull Request, merge `master` with your new branch and fix any conflicts. (Make sure you don't break anything in development!)
- Commit Unix line endings.
- Make sure to reasonably test your code. We have a sample platform that runs a test-suite for you, but it only covers a general set of tests.

36
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,36 @@
Please prefix your issue with one of the following: [BUG], [PROPOSAL], [QUESTION].
CCExtractor version (using the --version parameter preferably) : **X.X**
**In raising this issue, I confirm the following (please check boxes, eg [X]):**
- [ ] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md).
- [ ] I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
- [ ] I have checked that the issue I'm posting isn't already reported.
- [ ] I have checked that the issue I'm porting isn't already solved and no duplicates exist in [closed issues](https://github.com/CCExtractor/ccextractor/issues?q=is%3Aissue+is%3Aclosed) and in [opened issues](https://github.com/CCExtractor/ccextractor/issues)
- [ ] I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.
- [ ] I have used the latest available version of CCExtractor to verify this issue exists.
**My familiarity with the project is as follows (check one, eg [X]):**
- [ ] I have never used CCExtractor.
- [ ] I have used CCExtractor just a couple of times.
- [ ] I absolutely love CCExtractor, but have not contributed previously.
- [ ] I am an active contributor to CCExtractor.
**Necessary information**
- Is this a regression (did it work before)? [ ] NO | [ ] YES - *please specify the last known working version*
- What platform did you use? [ ] Windows - [ ] Linux - [ ] Mac
- What where the used arguments? `-autoprogram`
**Video links**
Please make the affected input file available for us (no screenshots, those don't help!). Public links to Dropbox, Google Drive, etc, are all fine. If it is not possible to make it available publicly, send us a private invitation (both Dropbox and Google Drive allow that). In this case we will download the file and upload it to the private developer repository.
Do *not* upload your file to any location that will require us to sign up or endure a wait list, slow downloads, etc. If your upload expires make sure you keep it active somehow (replace links if needed). Keep in mind that while we go over all tickets some may take a few days, and it's important we have the file available when we actually need it.
**Additional information**
{issue content here, replace this line with your issue content}
PS: Make sure you set an alert in GitHub so you get notifications about your ticket. We may need to ask questions and we do everything inside GitHub's system.

20
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,20 @@
Please prefix your pull request with one of the following: **[FEATURE]** **[FIX]** **[IMPROVEMENT]**.
**In raising this pull request, I confirm the following (please check boxes):**
- [ ] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md).
- [ ] I have checked that another pull request for this purpose does not exist.
- [ ] I have considered, and confirmed that this submission will be valuable to others.
- [ ] I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
- [ ] I give this submission freely, and claim no ownership to its content.
**My familiarity with the project is as follows (check one):**
- [ ] I have never used CCExtractor.
- [ ] I have used CCExtractor just a couple of times.
- [ ] I absolutely love CCExtractor, but have not contributed previously.
- [ ] I am an active contributor to CCExtractor.
---
{pull request content here}

85
.gitignore vendored
View File

@@ -1,3 +1,9 @@
####
# Ignore tests tmp files and results
tests/runtest
tests/**/*.gcda
tests/**/*.gcno
####
# Ignore CVS related files
@@ -7,16 +13,24 @@ CVS
####
# Linux Ignored binary and build folder
*.o
*.so
mac/ccextractor
linux/ccextractor
linux/depend
windows/Debug/**
windows/Release/**
windows/Release-OCR/**
windows/Debug-OCR/**
windows/Release/**
windows/Release-Full/**
windows/Release-OCR/**
windows/Debug-Full/**
windows/x64/**
windows/ccextractor.VC.db
build/
####
# Python
*.pyc
####
# Visual Studio project Ignored files
@@ -25,6 +39,7 @@ build/
*.opensdf
*.user
*.opendb
*.db
####
# Ignore the header file that is updated upon build
@@ -39,3 +54,69 @@ windows/libs/tesseract/**
# Vagrant
.vagrant/
# Eclipse stuff
.cproject
.project
.settings/
# Mac
.DS_Store
windows/enc_temp_folder/*
#CMake
src/cmake-build-debug/
src/.idea/
#Autotools
linux/config.h
linux/config.log
linux/config.status
linux/Makefile
linux/autom4te.cache
linux/aclocal.m4
linux/*.in
linux/configure
linux/build-conf/
mac/config.h
mac/config.log
mac/config.status
mac/Makefile
mac/autom4te.cache
mac/aclocal.m4
mac/*.in
mac/configure
mac/build-conf/
package_creators/*tar.gz
package_creators/build/*.deb
src/.deps/
src/.dirstamp
src/gpacmp4/.deps/
src/gpacmp4/.dirstamp
src/lib_ccx/.deps/
src/lib_ccx/.dirstamp
src/lib_hash/.deps/
src/lib_hash/.dirstamp
src/libpng/.deps/
src/libpng/.dirstamp
src/protobuf-c/.deps/
src/protobuf-c/.dirstamp
src/utf8proc/.deps/
src/utf8proc/.dirstamp
src/zlib/.deps/
src/zlib/.dirstamp
src/zvbi/.deps/
src/zvbi/.dirstamp
# Arch
package_creators/*.pkg.tar.xz
#RPMs
package_creators/*.rpm
src/lib_ccx/ccx.pc
windows/combase.pdb/
src/**/.deps
src/**/.dirstamp
mac/ccextractorGUI
linux/ccextractorGUI

26
.travis.yml Normal file
View File

@@ -0,0 +1,26 @@
language: c
os:
- osx
- linux
sudo:
- true
compiler:
- gcc
- clang
install:
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install pkg-config autoconf automake libtool tesseract leptonica; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get install -y libcurl4-gnutls-dev tesseract-ocr tesseract-ocr-dev libleptonica-dev autoconf-archive; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get install python-distutils-extra tesseract-ocr tesseract-ocr-eng libopencv-dev libtesseract-dev libleptonica-dev python-all-dev swig libcv-dev python-opencv python-numpy python-setuptools build-essential subversion; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then wget https://github.com/DanBloomberg/leptonica/releases/download/1.74.4/leptonica-1.74.4.tar.gz && tar xvf leptonica-1.74.4.tar.gz; cd leptonica-1.74.4; ./configure && make && sudo make install; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then git clone https://github.com/tesseract-ocr/tesseract.git; cd tesseract; ./autogen.sh; ./configure --enable-debug; LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make; sudo make install; sudo ldconfig; cd ..; fi
script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cd mac; ./build.command; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cd mac; ./autogen.sh; ./configure; make; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd linux; ./build; cd ..; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir build; cd build; cmake ../src/; make; cd ..; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd linux; ./autogen.sh; ./configure; make; fi

View File

@@ -1,637 +0,0 @@
A.R.G.U.S Tech
A.R.G.U.S. Agent
A.R.G.U.S. Guard
A.R.G.U.S. Tech
Adam Castwidth
Adam Donner
Adam Hoffman
Adam Hunt
Additional
Adrian Chase
Agent
Aglin
Aide
Akio Yamashiro
Al Ow-Al
Alan Chang
Alan Durand
Albie
Alderman Richard Ford
Alex Davis
Alex Salese
Alexi Leonov
Allison Lee
Alvarez
Amanda Waller
Ambushed Soldier
Anastasia
Anatoly Knyazev
Andy Diggle
Andy Jr.
Angry Crowd Riot
Angry Woman
Ankov
Anthony Venza
Anthony Walker
Armed Citizen
Armed Citizen #2
Armed Guard
Armored Truck Driver
Asian Driver
Assassin
Attendant
Attorney
Attractive Woman
Badass Inmate
Baker
Bank Guard
Bank Guard #1
Bank Guard #2
Bank Manager
Bar Guy
Barman
Baron Reiter
Barry Allen
Bartender
Barton Mathis
Bean Pole
Becky
Ben Turner
Benefit Patron
Benefit Security
Bertinelli's Thug
Bethany Snow
Big Donor
Biker
Biker Leader
Billy Malone
Black Hawk Guard
Blaine
Blake
Bo Travis
Bodyguard
Bodyguard #1
Bomb Squad Officer
Boss
Bouncer
Bouncer #1
Boy
Bratva Thug
Brick Thug #1
Brick Thug #2
Brie Larvan
Briefcase Man
Burly Guard
Business Suit
Businesswoman
Bystander
CSI Tech
CSU Tech Kelton
Caitlin Snow
Camille Declan
Captain
Captain Stein
Carl
Carl Roberto
Carly Diggle
Carrie Cutter
Carter Bowen
Carter Hall
Cass Derenick
Certo
Chase
Chauffeur
China White
Chinese Man
Chinese Pilot
Christopher Chance
Cisco Ramon
Claire Abbott
Clinton Hogue
Clock King
Cocktail Waitress
College Kid
Colonel Walker
Colton
Commissioner Brian Nudocerdo
Comptroller
Conklin
Constantine Drakon
Controller
Cooper Seldon
Cop
Cop #1
Cop's Wife
Coroner
Corrupt Cop #1
Costa
Councillor
Councilman Kullons
Count Vertigo
Counterfeiter
Courier
Court Clerk
Crewman
Cronan
Curtis Holt
Customs Agent
Cyrus Gold
Cyrus Vanch
D.B. Gavin Carnahan
D.O.C. Guard
DJ
Damian Darhk's Assistant
Damien Darhk
Dance Partner
Danny Brickwell
Danny De La Vega
Dark Archer
Dark Archer Stick
Daughter
Dead Girl
Dead Girl in Photograph
Deadshot
Dealer
Deathbolt
Deathstroke
Declan Lin
Delivery Clerk
Dennis
Dennis Fisk
Derek Reston
Derek Sampson
Desk Guard
Detective
Detective Lucas Hilton
Detective McKenna Hall
Deveau
Digger Harkness
Dignitary's Wife
Dina Salvati
Dinah Lance
District Attorney
Doctor
Dominic Alonzo
Donna Smoak
Double Down
Dr. Aldus Boardman
Dr. Anthony Ivo
Dr. Avery Pressnall
Dr. Douglas Miller
Dr. Lockhart
Dr. Neil Lamb
Dr. Schwartz
Dr. Vaca
Dr. Webb
Driver
Drug Dealer
Drug Dealer's Girlfriend
Drunk Guy
Drunk Partier
Dying Culebra Member
ESU Officer
ESU Sergeant
Eddie Walczak
Edward Fyers
Edward Rasmus
Elite Man
Emergency Services
Emily Nocenti
Engineer Antonov
Eric Dunn
Eric Moore
Erica Vendel
Erlich Kelso
Esrin Fortuna
Evan Wender
Evelyn Sharp
Ezra Barnes
FBI Agent
Federal Marshal
Felicity Smoak
Female Clubber
Female Hostage
Female Scientist
Fence
Field Reporter
Fire Chief Raynes
Firefly
Firestorm
First Mate
Fitzmartin
Frank Bertinelli
Frank Chen
Fred
Friendly Bratva
Galina
Gambler
Gang Leader
Gang Member
Gangbanger
Gangbanger #1
Gangbanger #2
Gardener
Gary
General Matthew Shrieve
General Vadimov
George Wolfman
German
Gerry Conway
Gholem Qadir
Gholem Security
Ghost
Ghost #2
Gideon
Girl
Glass Banger
Gora
Grandmother
Gravano
Greg Osborne
Grizzled Man
Guard
Guard #1
Guard #2
Guillermo Barrera
Gun Dealer
Gunman #2
Gus Sabatoni
Halcones Gang Member
Hardhat
Harley Quinn
Harold Backman
Hawkgirl
Heat Wave
Helena Bertinelli
Hendrick Von Arnim
Hive Scientist
Homeless Man
Hooded Man
Hoodie
Hoodlum
Hot Chick
Hot Girl
Housewife
Husband
Ian
Infected Man
Injured Chemist
Inmate
Intern
Isaac Stanzler
Isabel Rochev
Ishmael Gregor
Izzy Declan
Jackhammer
James Holder
Jana Washington
Janet Carroll
Janice Bowen
Jason Brodeur
Jean Loring
Jenn
Jenny Russo
Jermaine Fisher
Jessica Danforth
Jim Huffman
Joanna De La Vega
John Constantine
John Diggle
John Jr.
John Le
John Nickel
Jordan Kern
Jose Anton
Joseph Falk
Josiah Hudson
Judge
Judge Brackett
Judge Mandelbaum
Judge Moss
Judge Sakow
Junior Gangbanger
Junkie
Kandy Kane
Kara Danvers
Karla Groves
Kate Spencer
Katherine
Katsu Cheng
Keating
Kendrick Weller
Kirby Bates
Klaus Markos
Konstantin Kovar
Kyle Reston
LOA Soldier
Lady in Red
Landmine Soldier
Laura - Skull A
Laura Hoffman
Laura Washington
Laurel Lance
Lead Gangbanger
Lead Gunman
Lead Soldier
League Assassin
Leo Mueller
Li Khuan Hui
Lieutenant
Lieutenant Joyner
Liling
Linda Park
Little Boy
Liza Warner
Lonnie Machin
Lowlife
Lt. Conahan
Lt. Dave Ellet
Lt. Frank Pike
Lyla Michaels
M.I.T Student
MP #1
MP #2
MP #3
MP #4
Maddie
Madison Danforth
Maitre'd
Malcolm Merlyn
Malcolm's Friend
Male Scientist
Man
Man #2
Man in Suit
Man on Bus
Manny
Marcus Redmond
Margo
Mari McCabe
Mark Francis
Mark Scheffer
Mark Shaw
Markov
Martin Somers
Maseo Yamashiro
Matt Istook
Max Fuller
Maya Resik
Mayor Altman
Mayor Celia Castle
Mayor Queen's Assistant
Mercenary
Mercenary #3
Merlyn Security #1
Merlyn Security #2
Michael Amar
Michael Ancona
Middle Aged Woman
Milo Armitage
Mina Fayad
Minister
Mirakuru Soldier
Model
Moderator
Moira Queen
Morgan
Mother at Mall
Motorcycle Cop
Mouthpiece
Mr. Blank
Mr. Gardner
Mr. Russo
Mrs. Gardner
Mrs. Merlyn
Mrs. Reston
Mrs. Volodarsky
Myron Forest
Nancy Moore
Nate Heywood
Nathan Sierra
Ned Foster
Nelson Ravich
News Caster
News Reporter
Nick Salvati
Nico
Noah Kuttler
Nora Darhk
Nurse
Nyssa al Ghul
Obnoxious Clubber
Officer
Officer Benton
Officer Daily
Officer Jones
Officer Lopez
Officer Thompson
Officiant
Oliver Queen
Oliver's Security Detail
Ops Leader
Orderly
Orphan
Overlapping Personnel #1
Overlapping Personnel #2
Pablo Estevez
Palmer Tech Guard
Paparazzi
Parole Officer
Partner
Paul
Paul Copani
Paul Knox
Pedestrian
Peter
Peter Declan
Peter Kang
Petrov
Phaedra Nixon
Pharmacist
Phil
Pilot
Pino Bertinelli
Pirate
Pit Boss
Pretty Girl
Prison Guard
Prison Guard #1
Prison Guard #2
Prisoner
Prisoner #1
Prisoner #2
Private Collins
Protester
Pudgy Emcee
Pyotr Friedkin
QC Security Guard
Queen Family Lawyer
Quentin Lance
Ra's al Ghul
Ragman
Raisa
Rameses II
Raven
Ray Palmer
Real Estate Woman
Rebecca Merlyn
Recruit #1
Recruit #2
Redhead Girl
Refugee Woman
Rene Ramirez
Reporter
Reporter #1
Reporter #2
Reporter #3
Reporter #5
Richard
Rickie - Skull Man
Ripped
Rob Scott
Robert Joyce
Robert Queen
Rookie
Rosie
Roy Harper
Russian Cop #1
Russian Drugs Buyer
Russian Fight Arranger
Russian Policeman
Ruvé Adams
SCPD Clerk
SCPD Detective
SCPD Officer
SCPD Officer #1
SWAT #2
SWAT #3
SWAT #4
Samantha Clayton
Sara Lance
Scared Girl
Scientist
Screaming Woman
Sebastian Blood
Secretary
Security Guard
Security Guard #1
Security Guard #2
Senator Joseph Cray
Sentry
Sergei
Sergio
Servant
Sexy Hostess
Shado
Shadowspire Soldier
Shane Colvin
Shannon Groff
Sharp Gangster
Shimosawa
Shooter
Silhouetted Man
Simon
Simon Lacroix
Sin
Sin's Father
Skel
Skull B
Slade Wilson
Sleazy Businessman
Sleazy Clerk
Slim
Sobbing Man
Social Worker
Soldier
Soldier #2
Staffer #1
Staffer #2
Station Attendant
Steve Aoki
Street Kid
Street Tough
Striking Woman
Suited Bratva
Supporter #1
Supporter #2
Survivor
Susan Williams
Susie Lawton
Swat Team Leader
TV Host
Taiana
Talibah
Talking Head
Task Force Agent
Task Force Leader
Tatsu Yamashiro
Tattooed Inmate
Taylor Moore
Technician
Technician #2
Ted Gaynor
Ted Grant
Teddy Reston
Terrified Prisoner
The Butcher
The Captain
The Count
The Dodger
The Mayor
The Mechanic
The Priestess
Thea Queen
Thomas Flynn
Thomas Kemp
Thug
Thug #1
Tim Kaufman
Tim Sullivan
Tobias Church
Tom Weston
Tomas
Tommy Merlyn
Tony Daniel
Torque
Triad Accountant
Triad Thug
Turk
US Ambassador
Uniform
Uniform Cop
Untouchable #2
Untouchable #3
Vandal Savage
Vendor
Veronica Sparks
Victor Nocenti
Victor Swanstrom
Vigilante
Viktor
Viktor's Henchman
Vivian
Vixen
Vlad
Volkov
Volunteer
Waiter
Waitress
Walter Steele
Warehouse Worker
Wealthy Patron
Wheelman
Wife
William
Woman
Woman on Bus
Yao Fei
Young Boy
Young Girl with Glasses
Young Guard
Young Mother
Young Nyssa
Young Oliver
Young Thug
Young Tommy
Zhishan
Zoe Lawton

View File

@@ -1,370 +0,0 @@
ABQ Detective #1
ABQ Detective #2
APD Detective Tim Roberts
APD Officer
ASAC George Merkert
AUSA
Addict
Agent Buddy
Airport Traveler
Albuquerque Police Officer
Amber
Anchor #1
Anchor #2
Anchor #3
Anchor #4
Andrea Cantillo
Arms Dealer
Asst. US Attorney
Backhoe Operator
Bad Girl
Badger
Banger #1
Bank Customer
Bank Teller
Bar Fighter
Barfly
Barry
Bartender
Ben
Beneke Employee #1
Beneke Employee #2
Benicio Fuentes
Beto
Big Biker
Biker
Bingo Caller
Bingo Lady
Bob
Bogdan Wolynetz
Boy in Museum
Brock Cantillo
Burnout
Business Community Leader #1
Business Community Leader #2
Businessman
CID Special Agent
Cab Driver
Cancer Patient
Car Wash Attendant
Car Wash Customer
Car Wash Patron
CarWash Patron
Cara
Caregiver
Carmen Molina
Carol
Carpet Cleaner
Carpet Cleaner #2
Cartel Gunman #1
Cartel Gunman #2
Cartel Gunman #3
Cartel Gunman #4
Cartel Henchman
Carwash Customer
Chad
Chad's Girlfriend
Charlie Rose
Chemical Plant Guard
Chemistry Student
Chief Food Technician
Chris Mara
Chuck
Clovis
Colleen
Combo
Commercial Narrator
Commercial Voice Over
Concerned Parent
Conductor
Cop
Cop #1
Cop #2
Corpse
Customer
DEA
DEA Agent
DEA Agent #1
DEA Agent Artie
DEA Agent Scott
DEA Agent Tom
DEA Agent Vanco
DEA Point Man
Dan Wachsberger
Darla
Daughter
Dave
Declan
Declan's Crew Member
Declan's Driver
Delivery Man
Delores
Dennis Markowski
Deputy #1
Deputy Kee
Detective
Detective #1
Detective #2
Detective Kalanchoe
Detective Munn
Doctor
Dog Handler
Don Eladio
Donald Margolis
Dorothy Yobs
Dr. Barry Goodman
Dr. Belknap
Dr. Chavez
Dr. Delcavoli
Dr. Soper
Dr. Victor Bravenec
Drew Sharp
Duane Chow
Duty Officer
EMT
ER Doctor #1
ER Doctor #2
Ed
El Paso DEA Agent
Elliott Schwartz
Emilio Koyama
Emotional Woman
Engineer
Farley
Father
Federale
Female Employee
Female Homeowner
Fernando
Fireman
First Realtor
Fran
Francesca
Frankie
Friendly Agent
Friendly Guy
GYN
Gaff
Gale Boetticher
Garduño's Diner
Getz
Gonzo
Good Samaritan
Government Lawyer
Grandma
Gretchen Schwartz
Group Leader
Gunman #1
Gunman #2
Gus' Operative
Gustavo 'Gus' Fring
Hank Schrader
Henry Tyree
Herr Herzog
High School Student
Homeless Man
Homeless Man's Wife
Homeowner
Hospital Administrator
Hospital Patient
Hot Chick Cop
Huell
Hugo Archuleta
Ira
Irving
Jack's Henchman
Jake Pinkman
James Edward Kilkelly
Jane Margolis
Janice
Jeffrey
Jesse Pinkman
Jewelry Store Owner
Jock
Jock's Friend #1
Jock's Friend #2
Juan Bolsa
Kaylee Ehrmantraut
Ken Wins
Kenny
Kid
Kiira
Krazy-8
Kuby
Lady in Car
Laundry Woman 1
Laundry Woman 2
Laundry Woman 3
Laundry Worker
Lawson
Lawyer
Lead Doctor
Leonel Salamanca
Lester
Little Old Lady
Local Correspondant
Locksmith
Look out
Lookout
Los Pollos Hermanos Cook
Los Pollos Hermanos Patron
Louis
Lt. Adam Estiguez
Lucy
Lydia Rodarte-Quayle
Ma Kettle
Madrigal Suit
Magnet Guy #2
Mail Lady
Male Homeowner
Manager
Marco Salamanca
Mariano
Marie Schrader
Matt
Max Arsiniega
Medical Technician
Meth Cook
Meth Drug Dealer
Miguel
Mike Ehrmantraut
Mike's Security Team 1
Mike's Security Team 2
Min-Ye
Morning After Girl
Mortgage Broker
Mother
Mr. Gardiner
Mr. Pinkman
Mr. Wilson
Mrs. Ortega
Mrs. Pinkman
Mrs. Pope
Ms. Tromel
Music Producer
NA Sponsor
Narcocorridos Band #1
Narcocorridos Band #2
Native American Man
Neighbor
Neighborhood Boy
Neighborhood Kid
News Reporter
No-Doze
Nurse
O.M.I. Attendant
O.M.I. Officer
OPR Official #1
Ob-Gyn
Off Duty Cop
Office Manager
Office Worker
Old Crawler
Old Joe
Old Man
Orderly
Pa Kettle
Pamela
Parent
Party Girl
Partygoer
Paul Tyree
Pedestrian
Pediatric Nurse
Peng
Peter Schuler
Physical Therapist
Police Officer
Policeman
Pollos Manager
Preppy Shopper
Prison Guard
Prospective Buyer
Public Defender
Radio DJ #1
Radio DJ #2
Realtor
Receptionist
Rehab Group Girl
Rehab Patient
Restaurant Employee
Restaurant Patron
Rival Dealer #1
Rival Dealer #2
Ron Forenall
Rookie Officer
Rowdy Prisoner
SAC Ramey
Sad Faced Girl
Sales Girl
Salesman
Sara Tyree
Saul Goodman
Saul's Client
Scary Skell
Schlubby Guy #1
Schlubby Guy #2
School Office Worker
Scientist
Screaming Shopper
Secretary
Senior DEA Agent
Server
Sexy Cartel Girl
Sexy Neighbor
Skater
Skell
Sketchy
Skinny Pete
Skycap
Skyler White
Soren
Spooge
Spooge's Woman
Stephanie Doswell
Steven Gomez
Stew
Stripper #1
Stripper #2
Student
Supermarket Clerk
Support Group Leader
Support Group Member
TV Reporter
Tattooed Biker
Tattooed Woman
Teacher
Technician
Ted Beneke
The Assassin
Thug Buddy
Tio Salamanca
Tio's Nurse
Todd
Tomas
Tortuga
Trent
Truck Guard 1
Truck Guard 2
Tucker
Tuco Salamanca
Tweaker Thief
Tweaky Dude
Tyrus Kitt
Uncle Jack
Union Rep
Urinal Guy
Victor
Waiter
Waitress
Walter White
Walter White, Jr.
Warehouse Worker
Wendy
Wide Eyed Boy
Wino
Woman in Denny's
Young Boy
Young Leonel
Young Marco
Yuppie Woman

View File

@@ -1,614 +0,0 @@
'That's Right' Man
Addam Marbrand
Adrack Humble
Aeron Greyjoy
Aerys Targaryen
Aggo
Alliser Thorne
Alton Lannister
Amory Lorch
Anara
Anguy
Anya Waynwood
Areo Hotah
Armeca
Arthur
Arthur Dayne
Arya Stark
Ash
Axell Florent
Aya
Baby Sam
Balon Greyjoy
Baratheon Archer
Baratheon General
Baratheon Guard
Baratheon Officer
Baratheon Soldier
Baratheon Soldier #1
Baratheon Soldier #2
Barristan Selmy
Bathhouse Boy
Bathhouse Prostitute
Bear Island Maester
Beggar Woman
Belicho Paenymion
Benjen Stark
Beric Dondarrion
Bianca
Biter
Black Jack Bulwer
Black Lorren
Black Walder Rivers
Boat Commander
Bobono
Bolton General
Bolton Guard
Bolton Officer
Bolton Soldier
Bowen Marsh
Braavosi Captain
Braavosi Madam
Braavosi Theatre Server
Braavosi Theatre Sound Artist
Braavosi Woman #1
Braavosi Woman #2
Bran Stark
Brant
Brea
Brienne of Tarth
Bronn
Brothel Child #1
Brothel Child #2
Brothel Customer
Brothel Guard
Brother Ray
Brotherhood Member
Brusco
Brynden 'Blackfish' Tully
Camello
Captain of the Archers
Captain of the Bolton Archers
Captain's Daughter
Catelyn Stark
Catspaw Assassin
Cersei Body Double
Cersei Lannister
Chella
Child of the Forest
Citadel Maester
Clarenzo
Clea
Cley Cerwyn
Colen of Greenpools
Cooper
Craster
Craster's Wife
Craster's Wife #2
Craster's Wife #3
Craster's Younger Wife
Daario Naharis
Daenerys Targaryen
Dagmer Cleftjaw
Daisy
Davos Seaworth
Denys Mallister
Derek
Desmond Crakehall
Despondent Man
Dickon Tarly
Dim Dalba
Donnel Hill
Donnel Waynwood
Dontos Hollard
Doran Martell
Doreah
Dothraki
Dothraki Bloodrider #1
Dothraki Bloodrider #2
Dothraki Crone
Dothraki Man Having Sex
Dothraki Widow #1
Dothraki Widow #2
Dothraki Woman Having Sex
Dragonstone waiter
Drennan
Drowned Priest
Drummer
Drunk Patron
Dwarf Hunter #1
Dwarf Hunter #2
Dying Man
Eddard 'Ned' Stark
Eddison Tollett
Edmure Tully
Elder Meereen Slave
Ellaria Sand
Eon Hunter
Euron Greyjoy
Eyrie Guard
Faceless Man
Faith Militant
Faith Militant #1
Faith Militant #2
Farlen
Farmer Hamlet
Farmer's Daughter
Fennesz
Fighter
First Mate
Foreign Merchant
Frances
Frey Guard
Frey Guardsman
Frey Soldier #1
Frey Soldier #2
Frey Wedding Guest
Fruit Vendor
Gared
Gatins
Gendry
Genna
Gerald
Gerold Hightower
Ghita
Gilly
Glover General
Goatherd
Goatherd's Son
Goldcloak
Goldcloak #1
Goldcloak #2
Gordy
Grand Maester Pycelle
Great Master #1
Great Master #2
Great Master #3
Great Master #4
Great Master #5
Great Master #6
Great Master #7
Greatjon Umber
Gregor Clegane
Greizhen mo Ullhor
Grenn
Grey Worm
Guymon
Hallyne
Handmaid
Harald Karstark
Healtor Troop
High Priestess
High Septon
High Sparrow
Hizdahr zo Loraq
Hodor
Hog Farmer
Hoster Tully
Hot Pie
Howland Reed
Hugh of the Vale
Iggo
Illyrio Mopatis
Ilyn Payne
Imry Florent
Inn Waitress
Innkeeper
Innkeeper's Daughter
Ironborn #1
Ironborn #2
Ironborn #3
Ironborn Abusing a Volantene Whore
Ironborn at Brothel
Ironborn in Skiff
Irri
Izembaro
Jacks
Jaime Lannister
Janos Slynt
Jaqen H'ghar
Jaqen's Disguise
Jaremy Rykker
Jeor Mormont
Jhiqui
Joffrey Baratheon
Johnna
Jojen Reed
Jon Arryn
Jon Snow
Jon Snow Soldier
Jonos Bracken
Jorah Mormont
Jory Cassel
Joss
Joyeuse Erenford
Karl Tanner
Karsi
Karstark Lead Archer
Karstark Lookout
Karstark Soldier
Karstark Soldier #1
Karstark Soldier #2
Kayla
Kegs
Kesh
Kevan Lannister
Khal Brozho
Khal Drogo
Khal Forzho
Khal Moro
Khal Qorro
Khal Rhalko
Khaleesi Handmaiden #1
King Balon Greyjoy Dwarf
King Joffrey Baratheon Dwarf
King Renly Baratheon Dwarf
King Robb Stark Dwarf
King Stannis Baratheon Dwarf
King's Guard
King's Landing Baker
King's Landing Boaster
King's Landing Drunkard
King's Landing Flasher #1
King's Landing Flasher #2
King's Landing Handmaiden
King's Landing Rioter #1
King's Landing Rioter #2
King's Landing Rioter #3
King's Landing Tailor
King's Landing Urchin
King's Landing Whore
Kinvara
Knight of House Frey
Knight of House Lynderly
Kovarro
Kraznys mo Nakloz
Kurleket
Lady Crane
Lady Kitty Frey
Lancel Lannister
Lannister Archer
Lannister Army Member
Lannister Captain
Lannister Guard
Lannister Guard #1
Lannister Guard #2
Lannister Guard #3
Lannister Guardsman
Lannister Lord
Lannister Messenger
Lannister Scout
Lannister Soldier
Lannister Torturer
Lead Dornish Guard
Lead Kingsguard
Leaf
Lem Lemoncloak
Leo Lefford
Lhara
Little Bird
Little Bird #3
Little Bird #4
Little Bird #5
Little Bird #6
Little Bird #7
Loboda
Locke
Lollys Stokeworth
Lommy Greenhands
Loras Tyrell
Lord Blackmont
Lord Galbart Glover
Lord Portan
Lord Varys
Lord of Bones
Lordsport Dockhand
Lothar Frey
Loyal Night's Watchman #1
Loyal Night's Watchman #2
Lyanna Mormont
Lyanna Stark
Lysa Arryn
Mace Tyrell
Maester Aemon
Maester Caleotte
Maester Cressen
Maester Helliweg
Maester Luwin
Maester Wolkan
Mag the Mighty
Maggy
Mago
Male Prostitute
Malko
Mallister Supporter
Mance Rayder
Mandon Moore
Manservant
Marei
Margaery Tyrell
Margaery Tyrell Mummer
Margaery's Handmaiden
Marianne Frey
Marillion
Masha Heddle
Master Torturer
Matthos Seaworth
Meera Reed
Meereen Guard
Meereen Slave
Meereenese Homeless Mother
Melara Hetherspoon
Melessa Tarly
Melisandre
Merchant Captain
Merchant in Tavern
Mero
Merry Frey
Meryn Trant
Mhaegen
Mikken
Mirelle
Mirri Maz Duur
Missandei
Mole's Town Madam
Mole's Town Whore
Morag
Mord
Morgan
Morgan's Friend
Moro's Wife #1
Moro's Wife #2
Mossador
Mully
Mummer #2
Mummer #3
Mummer #4
Musician #1
Musician #2
Musician #3
Musician #4
Musician #5
Mycah
Myranda
Myrcella Baratheon
Night's Watch
Night's Watch Archer
Night's Watch Deserter
Night's Watch Messenger
Night's Watch Officer
Night's Watchman
Night's Watchman #1
Night's Watchman #2
Nobel Man
Noble Lady
Noble Man
Northern Lord
Northman Archer
Northman Rider
Northman Rioter
Nymeria Sand
Obara Sand
Oberyn Martell
Old Man
Old Nan
Old Woman
Old Woman Prisoner
Olenna Tyrell
Olly
Olly's Mother
Olyvar
Orell
Ornela
Orphan Kid
Osha
Othell Yarwyck
Oznak zo Pahl
Peasant
Pentoshi Servant
Petyr 'Littlefinger' Baelish
Pit Announcer
Pit Fighter
Podrick Payne
Polliver
Prendahl na Ghezn
Prisoner
Protestor
Pyat Pree
Pypar
Qartheen Woman
Qhono
Qhorin Halfhand
Qotho
Quaithe
Quent
Qyburn
Rakharo
Ralf Kenning
Ramsay Bolton
Randyll Tarly
Rast
Rattleshirt
Razdal mo Eraz
Red Keep Stableboy
Red Priestess
Reginald Lannister
Renly Baratheon
Rennick
Rhaego
Rickard Karstark
Rickard Stark
Rickon Stark
Riddell
Riverlands Traveller
Riverrun Nobleman
Robb Stark
Robert Baratheon
Robett Glover
Robin Arryn
Rodrik Cassel
Roose Bolton
Rorge
Ros
Roslin Frey
Royal Steward
Ryger Rivers
Sailor
Salladhor Saan
Samwell Tarly
Sandor 'The Hound' Clegane
Sansa Stark
Second Son
Sellsword #1
Sellsword #2
Selyse Baratheon
Septa Moelle
Septa Mordane
Septa Scolera
Septa Unella
Septon
Ser Endrew Tarth
Shae
Shagga
Shireen Baratheon
Silk King
Simpson
Singing Lannister Soldier
Sissy
Slaver
Smalljon Umber
Soldier
Son of the Harpy
Sorcerer
Sparring Boy
Spice King
Stannis Baratheon
Stark Guard
Stark Messenger
Stark Soldier
Steelshanks Walton
Steve
Stevron Frey
Stiv
Stone Man
Street Tough #1
Street Tough #2
Strong Fighter
Strong Sam Stone
Styr
Syrio Forel
Talisa Stark
Talla Tarly
Tansy
Ternesio Terys
The Bear
The Crone
The Maiden
The Mother
The Night King
The Tickler
The Waif
The Waif's Disguise
Thenn Warg
Theon Greyjoy
Theon's Master of Hounds
Thin Man
Thoros of Myr
Three-Eyed Raven
Timett
Tobho Mott
Todder
Tomard
Tommen Baratheon
Tommen's Attendant
Tommen's Manservant
Tommy
Tormund Giantsbane
Torrhen Karstark
Tortured Prisoner
Tortured Slave
Tourney Herald
Trystane Martell
Tully Bannerman
Tully Soldier
Tycho Nestoris
Tyene Sand
Tyrell Bannerman
Tyrell Guard
Tyrell Lady
Tyrell Servant
Tyrell Soldier
Tyrion Lannister
Tywin Lannister
Unsullied
Vala
Valyrian Slave
Vance Corbray
Vardis Egen
Varly
Vayon Poole
Violet
Viserys Targaryen
Volantene Whore
Volantene Whore #1
Volantene Whore #2
Volantene Whore #3
Volantene Whore #4
Volantene Whore #5
Waitress
Walda Bolton
Walder Frey
Warlock
Waymar Royce
Wedding Band
Wedding Guest
Wendel Manderly
Westerosi Trader
White Rat
White Walker
White Walker #2
Whore
Whore #1
Whore #2
Wight
Wight Wildling Girl
Wilding Gladiator
Wildling
Wildling Rioter
Will
Willa
Willem Lannister
Willis Wode
Wine Merchant
Winter Town Man
Winterfell Beekeeper
Winterfell Shepherd
Woodcutter
Wounded Lannister
Wun Wun
Wyllis
Wyman Manderly
Xaro Xhoan Daxos
Yara Greyjoy
Yezzan zo Qaggaz
Ygritte
Yohn Royce
Yoren
Young Benjen Stark
Young Braavosi
Young Cersei Lannister
Young Lyanna Stark
Young Nan
Young Ned
Young Ned Stark
Young Nobleman
Young Rodrik Cassel
Yunkai Citizen
Yunkai'i Slave #1
Yunkai'i Slave #2
Yunkai'i Slave #3
Yunkai'i Slave #4
Yunkai'i Slave #5
Yunkai'i Whore
Zanrush

File diff suppressed because it is too large Load Diff

View File

@@ -1,54 +0,0 @@
Ancient Psychic Tandem War Elephant
Banana Guard
Candy Kingdom
Candy People
Choose Goose
Cinnamon Bun
City of Thieves
Colonel Candycorn
Cosmic Owl
Crab Princess
Dr. Donut
Dr. Ice Cream
Duchess of Nuts
Earl of Lemongrab
Everything Burrito
Finn the Human
Fire Kingdom
Flame Princess
Flying Lettuce Bros.
Ghost Princess
Hotdog Knight
Ice King
Ice Kingdom
Jake the Dog
Lady Rainicorn
Lake Butterscotch
Land of Ooo
Lumpy Space Princess
Marauder Village
Marshmallow Kid
Mr. Cream Puff
Muscle Princess
Nice King
Nice Knights
Nightosphere
Nurse Poundcake
Old Lady Princess
Party Pat
Peppermint Butler
Pillow World
Princess Bubblegum
Raggedy Princess
Root Beer Guy
Sir Slicer
Skeleton Princess
Slime Princess
Snow Golem
The Enchiridion
The Lich
Toast Princess
Tree Fort
Tree Trunks
Wildberry Princess
Wizard Battle

View File

@@ -1,25 +0,0 @@
Adipose
Amy Pond
Clara Oswin Oswald
Cybermen
Dalek
Davros
Donna Noble
Jack Harkness
Judoon
K-9
Martha Jones
Master
Mickey Smith
Missy
Ood
River Song
Rory Williams
Rose Tyler
Sontarans
Tardis
Time Lord
The Doctor
The Silence
Weeping Angel
Zygon

View File

@@ -1,59 +0,0 @@
Greys Anatomy
Meredith Grey
Lexie Grey
Ellis Grey
Thatcher Grey
Derek Shepherd
Amelia Shepherd
Owen Hunt
Dr. Margaret Pierce
Dr. Teddy Altman
Alex Karev
Callie Torres
Izzie Stevens
Christina Yang
Mark Sloan
Jackson Avery
Leah Murphy
April Kepner
Arizona Robbins
George O'Malley
Preston Bruke
Miranda Bailey
Denny Duquette
Dr. Addison Montgomery
Richard Webber
Adele Webber
Jo Wilson
Andrew Deluca
Nathan Riggs
Erica Hahn
Sadie Harris
Stephanie Edwards
Jason Myers
Dr. Nicole Herman
Hannah Davies
Shane Ross
Seattle Grace Hospital
Mercy West Medical Center
Seattle Grace Mercy West Hospital
Denny Duquette Memorial Clinic
Grey Sloan Memorial Hospital
Mayo Clinic
Cleveland Clinic
Portland General Hospital
Seattle Presbyterian Hospital
Klausman Institute for Medical Research
Roseridge Home for Extended Care
Veterans Rehabilitation Center
Trauma Center
Emergency Room
Intensive Care Unit
Neonatal Intensive Care Unit
Operating Room
On-Call Room
Chasing Cars
Snow Patrol

View File

@@ -1,42 +0,0 @@
Annalise Keating
Anna Mae Harkness
Nate Lahey
Wes Gibbins
Connor Walsh
Michaela Pratt
Asher Millstone
Laurel Castillo
Frank Delfino
Bonnie Winterbottom
Oliver Hampton
Rebecca Sutter
Sam Keating
Caleb Hapstall
Catherine Hapstall
Emily Sinclair
Meggy Travers
Simon Drake
Soraya Hargrove
Phillip Jessup
Eve Rothlow
Lila Stangard
Bill Millstone
A.D.A. Rene Atwood
Kan
Griffin O'Reilly
Rose
Detective Mumford
A.D.A. Todd Denver
D.A. Wendy Parks
Levi Sutter
Wallace Mahoney
Charles Mahoney
Vince Levin
Christophe
Hannah Keating
Middleton University
Keating 5
Who's Under the Sheet
Keating House
HTGAWM
pro-bono law clinic

View File

@@ -1,11 +0,0 @@
Dev
Rachel
Go-Gurt
Arnold
Brian
Denise
The Sickening
Nina
Nashville
Paro
Benjamin

View File

@@ -1,36 +0,0 @@
Elliot Alderson
Mr. Robot
Darlene
Angela Moss
Tyrell Wellick
Joanna Wellick
Phillip Price
Federal Bureau of Investigation
Fun Society
Gideon Goddard
Lloyd Chung
Ollie Parker
E Corp
Evil Corp
Terry Colby
Scott Knowles
Sharon Knowles
Mr. Sutherland
Antara Nayar
Krista Gordon
Shayla Nico
Fernando Vera
Elliot's Mother
The Hackers
fsociety
Romero
Trenton
Mobley
The Dark Army
Whiterose
Cisco
New York
Evil Corp Headquarters
Allsafe Cybersecurity
Rons Coffee
Python

View File

@@ -1,11 +0,0 @@
Jess
Jessica Day
Nick Miller
Winston Bishop
Schmidt
Cece Parekh
Coach
Latvian Basketball League
Ferguson
True American
Los Angeles middle school

View File

@@ -1,59 +0,0 @@
Sense8
Abraham
Amanita
Amondi Kabaka
Angelica Turing
Anton Bogdanow
Bug
Capheus "Van Damme"
Daniela Velasquez
Daya Dandekar
Diego Morales
Dr. Metzger
Felix Berner
Githu
Grace
Gunnar
Hassan Bogdanow
Hernando
Jacks
Janet Marks
Jela
Joaquin Flores
Jonas Maliki
Joong-Ki Bak
Kala Dandekar
Kang-Dae Bak
Wolfgang Bogdanow
Lina
Lito Rodriguez
Lúna Magnúsdóttir
Magnús Þórsson
Manendra Rasal
Mi-Cha
Michael Gorski
Min-Jung
Mr. Whispers
Niles Bolger
Nomi Marks
Nyx
Prisoner 818
Priya Dandekar
Purab Kohli
Rajan Rasal
Riley Blue
Sahana Rasal
Sanyam Dandekar
Sanyam Dendekar
Sara Patrell
Sergei Bogdanow
Shiro
Silas Kabaka
Soo-Jin
Steiner Bogdanow
Sun Bak
Sven
Teagan Marks
Will Gorski
Yrsa
Sensates

View File

@@ -1,25 +0,0 @@
Anderson
Baker Street
Bill Wiggins
Charles Augustus Magnussen
Detective Inspector Lestrade
Greg Lestrade
Irene Adler
James Moriarty
Jim Moriarty
John Watson
John Hamish Watson
Lady Smallwood
Lestrade
Magnussen
Mary Morstan
Mary Watson
Mike Stamford
Molly Hooper
Moriarty
Mrs. Hudson
Mycroft Holmes
Philip Anderson
Sally Donovan
Sergeant Donovan
Sherlock Holmes

View File

@@ -1,41 +0,0 @@
Arachne
Arachnophobia
Asura
Azusa
Black Star
Blair
Crona
Death City
Death the Kid
Death Weapon Meister Academy
DWMA
Eibon
Eruka
Excalibur
Franken Stein
Free
Giriko
Joe Buttataki
Justin
Kilik
Kishin
Liz
Lord Death
Maka
Maka Albarn
Marie
Masamune
Medusa
Meister
Mifune
Mizune
Mosquito
Ox Ford
Patty
Professor Stein
Sid
Soul
Soul Eater
Spirit
Tsubaki
Weapon

View File

@@ -1,16 +0,0 @@
Amethyst
Beach City
Cookie Cat
Crying Breakfast Friends
Crystal Gems
Crystal Temple
Earthlings
Fryman
Garnet
Lion
Pearl
Peridot
Rose Quartz
Ruby
Sapphire
Steven Universe

View File

@@ -1,84 +0,0 @@
Stranger Things
Murray Bauman
Becky Ives
Benny Hammond
Bill
Billy
Martin Brenner
Jonathan Byers
Joyce Byers
Lonnie Byers
Will Byers
Callahan
Carol
Russell Coleman
Connie Frazier
Cynthia
Dark dimension creature
David O'Bannon
Diane
Donald Melvald
Earl
Eel-like creature
Elevator Scientist
Eleven
El
011
The Weirdo
Eleanor
Florence
Tommy H.
Steve Harrington
Dustin Henderson
Barbara Holland
Jim Hopper
Sarah Hopper
James
Jeffrey
Jen
Jennifer Hayes
Lead Agent
Marissa
Max
The Monster
Mrs. Holland
Bob Newby
Nicole
Dr. Owens
Pastor Charles
Patrick
Powell
Roman
Russian Agent
Sandra
Scott Clarke
Shepard
Lucas Sinclair
Slug-like creature
Terry Ives
Troy
Troy's mother
Holly Wheeler
Karen Wheeler
Mike Wheeler
Nancy Wheeler
Ted Wheeler
Demogorgon
Hawkins National Laboratory
Upside Down
Hawkins Middle School
Project MKUltra
Dungeons & Dragons
Operation Mirkwood
Heathkit ham shack
Castle Byers
Hawkins General Hospital
Hawkins Police Station
Hawkins High School
Quarry
Etowah
Benny's Burgers
Bradley's Big Buy
Byers house
Downtown Hawkins
Roane County Coroner

View File

@@ -1,30 +0,0 @@
The Big Bang Theory
Penny
Leonard Hofstadter
Sheldon Cooper
Raj Koothrappali
Bernadette Rostenkowski
Howard Wolowitz
Amy Farrah Fowler
Leslie Winkle
Stuart Bloom
Arthur Jeffries
Mrs. Wolowitz
Barry Kripke
Priya Koothrappali
Mrs. Koothrappali
Mr. Koothrappali
Lucy
Sheldons Spot
The Apartment Building
Apartment 4A/B
The Laundry Room
The Roof
Wolowitzs' House
Capitol Comics
The Cheesecake Factory
The Comic Center of Pasadena
California Institute of Technology
Massachusetts Institute of Technology
Jet Propulsion Laboratory
Pasadena

View File

@@ -1,23 +0,0 @@
Arsenal Football Club
Aunt Irma
Big Ben
Countdown
Dragon's Den
Emergency Services
Employee of the Month
Friendface
Gay: A Gay Musical
Information Technology
Jen Barber
Lonely Hearts
Maurice Moss
Random Access Memory
Sea Parks
Spaceology
The Banner
The Evening Informer
The Internet
The London Echo
Tnetennba
Windows Vista
Word

View File

@@ -1,54 +1,79 @@
![logo](https://avatars3.githubusercontent.com/u/7253637?v=3&s=100)
# CCExtractor
CCExtractor is a tool that produces subtitles from TV use. Global accessibility (all users, all content, all countries) is the goal. With so many different formats, this is a constantly moving target, but we intend to keep up with all sources and formats.
[![Build Status](https://travis-ci.org/CCExtractor/ccextractor.svg?branch=master)](https://travis-ci.org/CCExtractor/ccextractor)
Carlos' version (mainstream) is the most stable branch.
CCExtractor is a tool used to produce subtitles for TV recordings from almost anywhere in the world. We intend to keep up with all sources and formats.
Subtitles are important for many people. If you're learning a new language, subtitles are a great way to learn it from movies or TV shows. If you are hard of hearing, subtitles can help you better understand what's happening on the screen. We aim to make it easy to generate subtitles by using the command line tool or Windows GUI.
The official repository is ([CCExtractor/ccextractor](https://github.com/CCExtractor/ccextractor)) and master being the most stable branch.
### **Features**
- Extract subtitles in real-time
- Translate subtitles
- Extract closed captions from DVDs
- Convert closed captions to subtitles
### Programming Languages & Technologies
The core functionality is written in C. Other languages used include C++ and Python.
## Google Code-in 2017
CCExtractor is [participating in Google Code-in 2017!](https://ccextractor.org/public:codein:welcome_2017)
Google Code-In is a competition of encouraging young people to learn more about Open Source and contributing to it. Tasks range from coding, documentation, quality assurance, user interface, outreach and research.
This is our second year of challenging tasks for pre-university students aged 13-17.
If you are a student fitting the age criteria, interested to contribute to CCExtractor feel free to join us. You can read more at the [Google Code-in website](https://codein.withgoogle.com).
If you're interested in design tasks, you should read [this](https://www.ccextractor.org/public:codein:google_code-in_2017_code-in_for_designers) first.
## Installation and Usage
Downloads for precompiled binaries and source code can be found [on our website](http://www.ccextractor.org/doku.php?id=public:general:downloads).
Downloads for precompiled binaries and source code can be found [on our website](https://www.ccextractor.org?id=public:general:downloads).
Extracting subtitles is relatively simple. Just run the following command:
```ccextractor <input>```
`ccextractor <input>`
This will extract the subtitles.
This will extract the subtitles.
More usage information can be found on our website:
- [Using the command line tool](http://www.ccextractor.org/doku.php?id=public:general:command_line_usage)
- [Using the Windows GUI](http://www.ccextractor.org/doku.php?id=public:general:win_gui_usage)
- [Using the command line tool](https://www.ccextractor.org/doku.php?id=public:general:command_line_usage)
- [Using the Windows GUI](https://www.ccextractor.org/doku.php?id=public:general:win_gui_usage)
## Compiling
You can also find the list of parameters and their brief description by running `ccextractor` without any arguments.
Compilation instructions are coming soon.
## Compiling CCExtractor
To learn more about how to compile and build CCExtractor for your platform check the [compilation guide](https://github.com/CCExtractor/ccextractor/blob/master/docs/COMPILATION.MD).
## Support
By far the best way to get support is by opening a support ticket at our [issue tracker](https://github.com/CCExtractor/ccextractor/issues).
By far the best way to get support is by opening an issue at our [issue tracker](https://github.com/CCExtractor/ccextractor/issues).
When creating a ticket:
When you create a new issue, please fill in the needed details in the provided template. That makes it easier for us to help you more efficiently.
- Make sure you are using the latest CCExtractor version.
- If it's a new issue (for example a video file that a previous CCExtractor version processed fine but now causes a crash), mention the last version you know was working.
- If the issue is about a specific file, make that file available for us. Don't just send us the output from CCExtractor, as we can't do anything about a screenshot that shows a crash. We need the input that actually causes it. You can upload the file to Dropbox, Google Drive, etc, and make it public so you get a download link to add to your ticket.
- If you cannot make the file public for any (reasonable) reason you can send us a private invitation (both Dropbox and Google Drive allow that). In this case we will download the file and upload it to the private developer repository.
- Do not upload your file to any location that will require us to sign up or endure a wait list, slow downloads, etc.
- If your upload expires make sure you keep it active somehow (replace links if needed). Keep in mind that while we go over all tickets some may take a few days, and it's important we have the file available when we actually need it.
- Make sure you set an alert in GitHub so you get notifications about your ticket. We may need to ask questions and we do everything inside GitHub's system.
- Please use English.
- It goes without saying, we like polite people.
If you have a question or a problem you can also [contact us by email or chat with the team in Slack](https://www.ccextractor.org/doku.php?id=public:general:support).
If you want to contribute to CCExtractor but can't submit some code patches or issues or video samples, you can also [donate to us](https://www.ccextractor.org/public:general:http:sourceforge.net_donate_index.php?group_id=190832)
You can also [contact us by email or chat with the team in Slack](http://www.ccextractor.org/doku.php?id=public:general:support).
## Contributing
You can contribute to the project by forking it, modifying the code, and making a pull request to the repository.
You can contribute to the project by reporting issues, forking it, modifying the code and making a pull request to the repository. We have some rules, outlined in the [contributor's guide](.github/CONTRIBUTING.md).
## News & Other Information
News about releases and modifications to the code can be found in the `CHANGES.TXT` file.
News about releases and modifications to the code can be found in the [CHANGES.TXT](docs/CHANGES.TXT) file.
For more information visit the CCExtractor website: [http://www.ccextractor.org](http://www.ccextractor.org)
For more information visit the CCExtractor website: [https://www.ccextractor.org](https://www.ccextractor.org)
## License
GNU General Public License version 2.0 (GPL-2.0)

39
api/api_support.py Normal file
View File

@@ -0,0 +1,39 @@
import ccextractor as cc
import ccx_to_python_g608 as g608
import python_srt_generator as srt_generator
text,font,color = [],[],[]
filename = " "
srt_counter = " "
def generate_output_srt(line, encoding):
global text,font,color
global filename, srt_counter
if "filename:" in line:
filename = str(str(line.split(":")[1]).split("\n")[0])
with open(filename, 'w+') as fh:
pass
elif "srt_counter-" in line:
srt_counter = str(line.split("-")[1])
with open(filename, 'a+') as fh:
fh.write(srt_counter)
elif "start_time" in line:
with open(filename, 'a+') as fh:
data = line.split("-")
end_time = str(data[-1].split("\n")[0])
start_time = str(data[1].split("\t")[0])
fh.write(start_time)
fh.write(" --> ")
fh.write(end_time)
fh.write("\n")
fh.flush()
elif "***END OF FRAME***" in line:
d={}
d['text']=text
d['color']=color
d['font']=font
srt_generator.generate_output_srt(filename,d, encoding)
text,font,color = [],[],[]
else:
g608.g608_grid_former(line,text,color,font)

28
api/api_testing.py Normal file
View File

@@ -0,0 +1,28 @@
###
#MANDATORY UPDATES IN EVERY PYTHON SCRIPT
###
import ccextractor as cc
import api_support
from multiprocessing import Queue,Process,Event
import sys
import time
def templer():
s = cc.api_init_options()
cc.check_configuration_file(s)
for i in sys.argv[1:]:
cc.api_add_param(s,str(i))
#very mandatory for keeping a track of pythonapi call. Always must be set.
cc.my_pythonapi(s, callback)
compile_ret = cc.compile_params(s,len(sys.argv[1:]));
#very mandatory for keeping a track of pythonapi call. Always must be called so that the program knows that the call is from pythonapi.
cc.call_from_python_api(s)
start_ret = cc.api_start(s);
def callback(line, encoding):
api_support.generate_output_srt(line, str(encoding))
if __name__=="__main__":
templer()

48
api/build_api Executable file
View File

@@ -0,0 +1,48 @@
#!/bin/bash
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR"
BLD_INCLUDE="-I /usr/include/python2.7/ -I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc"
WRAPPER_FLAGS="-Wl,-wrap,write"
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
SRC_CCX="$(find ../src/lib_ccx/ -name '*.c')"
SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
SRC_UTF8PROC="../src/utf8proc/utf8proc.c"
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
BLD_SOURCES="../src/ccextractor.c ccextractor_wrap.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $API_EXTRACTORS"
../linux/pre-build.sh
out=$((LC_ALL=C gcc -fPIC -c -DPYTHONAPI $BLD_FLAGS $BLD_INCLUDE $BLD_SOURCES $BLD_LINKER) 2>&1)
#out=$((LC_ALL=C gcc -fPIC -c -Wl,-wrap,write $BLD_INCLUDE $BLD_SOURCES) 2>&1)
res=$?
if [[ $out == *"gcc: command not found"* ]]
then
echo "Error: please install gcc";
exit 1
fi
if [[ $out == *"curl.h: No such file or directory"* ]]
then
echo "Error: please install curl development library (libcurl4-gnutls-dev for Debian/Ubuntu)";
exit 2
fi
if [[ $out == *"capi.h: No such file or directory"* ]]
then
echo "Error: please install tesseract development library (tesseract-ocr-dev for Debian/Ubuntu)";
exit 3
fi
if [[ $out == *"allheaders.h: No such file or directory"* ]]
then
echo "Error: please install leptonica development library (libleptonica-dev for Debian/Ubuntu)";
exit 4
fi
if [[ $res -ne 0 ]] # Unknown error
then
echo "Compiled with errors"
>&2 echo "$out"
exit 5
fi
echo "Compilation successful";

44
api/build_api_exe Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/bash
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR"
BLD_INCLUDE="-I /usr/include/python2.7/ -I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc"
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
SRC_CCX="$(find ../src/lib_ccx/ -name '*.c')"
SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
SRC_UTF8PROC="../src/utf8proc/utf8proc.c"
BLD_SOURCES="../src/ccextractor.c ../src/ccextractorapi.c ccextractorapi_wrap.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC"
BLD_LINKER="-lm -pthread -zmuldefs -l tesseract -l lept -l python2.7"
./pre-build.sh
out=$((LC_ALL=C gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractorapi -g $BLD_SOURCES $BLD_LINKER) 2>&1)
res=$?
if [[ $out == *"gcc: command not found"* ]]
then
echo "Error: please install gcc";
exit 1
fi
if [[ $out == *"curl.h: No such file or directory"* ]]
then
echo "Error: please install curl development library (libcurl4-gnutls-dev for Debian/Ubuntu)";
exit 2
fi
if [[ $out == *"capi.h: No such file or directory"* ]]
then
echo "Error: please install tesseract development library (tesseract-ocr-dev for Debian/Ubuntu)";
exit 3
fi
if [[ $out == *"allheaders.h: No such file or directory"* ]]
then
echo "Error: please install leptonica development library (libleptonica-dev for Debian/Ubuntu)";
exit 4
fi
if [[ $res -ne 0 ]] # Unknown error
then
echo "Compiled with errors"
>&2 echo "$out"
exit 5
fi
echo "Compilation successful";

35
api/build_library Executable file
View File

@@ -0,0 +1,35 @@
#!/bin/bash
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept -l python2.7"
WRAPPER_FLAGS="-Wl,-wrap,write"
out=$((swig -python ccextractor.i && ./build_api && gcc -shared $(find -name '*.o') -o _ccextractor.so $BLD_LINKER) 2>&1)
#out=$((swig -python ccextractor.i && ./build_api && gcc -shared $WRAPPER_FLAGS $(find -name '*.o') -o _ccextractor.so ) 2>&1)
res=$?
if [[ $out == *"gcc: command not found"* ]]
then
echo "Error: please install gcc";
exit 1
fi
if [[ $out == *"curl.h: No such file or directory"* ]]
then
echo "Error: please install curl development library (libcurl4-gnutls-dev for Debian/Ubuntu)";
exit 2
fi
if [[ $out == *"capi.h: No such file or directory"* ]]
then
echo "Error: please install tesseract development library (tesseract-ocr-dev for Debian/Ubuntu)";
exit 3
fi
if [[ $out == *"allheaders.h: No such file or directory"* ]]
then
echo "Error: please install leptonica development library (libleptonica-dev for Debian/Ubuntu)";
exit 4
fi
if [[ $res -ne 0 ]] # Unknown error
then
echo "Compiled with errors"
>&2 echo "$out"
exit 5
fi
rm *.o
echo "Compilation successful";

78
api/ccextractor.i Normal file
View File

@@ -0,0 +1,78 @@
%module ccextractor
%{
#define SWIG_FILE_WITH_INIT
#include "../src/lib_ccx/lib_ccx.h"
#include "../src/lib_ccx/configuration.h"
#include "../src/lib_ccx/ccx_common_option.h"
#include "../src/lib_ccx/ccx_mp4.h"
#include "../src/lib_ccx/hardsubx.h"
#include "../src/lib_ccx/ccx_share.h"
#include "../src/ccextractor.h"
#include "../src/wrappers/wrapper.h"
%}
void my_pythonapi(struct ccx_s_options *api_options, PyObject* func);
%pythoncode %{
def g608_grid_former(line,text,color,font):
if "text[" in line:
line = str(line.split(":", 1)[1])
line = str(line.split("\n")[0])
text.append(line)
if "color[" in line:
line = str(line.split(":", 1)[1])
line = str(line.split("\n")[0])
color.append(line)
if "font[" in line:
line = str(line.split(":", 1)[1])
line = str(line.split("\n")[0])
font.append(line)
def print_g608_grid(case,text,color,font):
help_string = """
Case is the value that would give the desired output.
case = 0 --> print start_time,end_time,text,color,font
case = 1 --> print start_time,end_time,text
case = 2 --> print start_time,end_time,color
case = 3 --> print start_time,end_time,font
case = 4 --> print start_time,end_time,text,color
case = 5 --> print start_time,end_time,text,font
case = 6 --> print start_time,end_time,color,font
"""
if case==0:
if text:
print "\n".join(text)
if color:
print "\n".join(color)
if font:
print "\n".join(font)
elif case==1:
if text:
print "\n".join(text)
elif case==2:
if color:
print "\n".join(color)
elif case==3:
if font:
print "\n".join(font)
elif case==4:
if text:
print "\n".join(text)
if color:
print "\n".join(color)
elif case==5:
if text:
print "\n".join(text)
if font:
print "\n".join(font)
elif case==6:
if color:
print "\n".join(color)
if font:
print "\n".join(font)
else:
print help_string
%}
%include "../src/lib_ccx/ccx_common_common.h"
%include "../src/ccextractor.h"
%include "../src//wrappers/wrapper.h"

341
api/ccextractor.py Normal file
View File

@@ -0,0 +1,341 @@
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_import_helper():
import importlib
pkg = __name__.rpartition('.')[0]
mname = '.'.join((pkg, '_ccextractor')).lstrip('.')
try:
return importlib.import_module(mname)
except ImportError:
return importlib.import_module('_ccextractor')
_ccextractor = swig_import_helper()
del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_ccextractor', [dirname(__file__)])
except ImportError:
import _ccextractor
return _ccextractor
try:
_mod = imp.load_module('_ccextractor', fp, pathname, description)
finally:
if fp is not None:
fp.close()
return _mod
_ccextractor = swig_import_helper()
del swig_import_helper
else:
import _ccextractor
del _swig_python_version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
try:
import builtins as __builtin__
except ImportError:
import __builtin__
def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
if (name == "thisown"):
return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name, None)
if method:
return method(self, value)
if (not static):
if _newclass:
object.__setattr__(self, name, value)
else:
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self, class_type, name, value):
return _swig_setattr_nondynamic(self, class_type, name, value, 0)
def _swig_getattr(self, class_type, name):
if (name == "thisown"):
return self.this.own()
method = class_type.__swig_getmethods__.get(name, None)
if method:
return method(self)
raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
def _swig_repr(self):
try:
strthis = "proxy of " + self.this.__repr__()
except __builtin__.Exception:
strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except __builtin__.Exception:
class _object:
pass
_newclass = 0
def my_pythonapi(api_options, func):
return _ccextractor.my_pythonapi(api_options, func)
my_pythonapi = _ccextractor.my_pythonapi
def g608_grid_former(line,text,color,font):
if "text[" in line:
line = str(line.split(":", 1)[1])
line = str(line.split("\n")[0])
text.append(line)
if "color[" in line:
line = str(line.split(":", 1)[1])
line = str(line.split("\n")[0])
color.append(line)
if "font[" in line:
line = str(line.split(":", 1)[1])
line = str(line.split("\n")[0])
font.append(line)
def print_g608_grid(case,text,color,font):
help_string = """
Case is the value that would give the desired output.
case = 0 --> print start_time,end_time,text,color,font
case = 1 --> print start_time,end_time,text
case = 2 --> print start_time,end_time,color
case = 3 --> print start_time,end_time,font
case = 4 --> print start_time,end_time,text,color
case = 5 --> print start_time,end_time,text,font
case = 6 --> print start_time,end_time,color,font
"""
if case==0:
if text:
print "\n".join(text)
if color:
print "\n".join(color)
if font:
print "\n".join(font)
elif case==1:
if text:
print "\n".join(text)
elif case==2:
if color:
print "\n".join(color)
elif case==3:
if font:
print "\n".join(font)
elif case==4:
if text:
print "\n".join(text)
if color:
print "\n".join(color)
elif case==5:
if text:
print "\n".join(text)
if font:
print "\n".join(font)
elif case==6:
if color:
print "\n".join(color)
if font:
print "\n".join(font)
else:
print help_string
EXIT_OK = _ccextractor.EXIT_OK
EXIT_NO_INPUT_FILES = _ccextractor.EXIT_NO_INPUT_FILES
EXIT_TOO_MANY_INPUT_FILES = _ccextractor.EXIT_TOO_MANY_INPUT_FILES
EXIT_INCOMPATIBLE_PARAMETERS = _ccextractor.EXIT_INCOMPATIBLE_PARAMETERS
EXIT_UNABLE_TO_DETERMINE_FILE_SIZE = _ccextractor.EXIT_UNABLE_TO_DETERMINE_FILE_SIZE
EXIT_MALFORMED_PARAMETER = _ccextractor.EXIT_MALFORMED_PARAMETER
EXIT_READ_ERROR = _ccextractor.EXIT_READ_ERROR
EXIT_WITH_HELP = _ccextractor.EXIT_WITH_HELP
EXIT_NO_CAPTIONS = _ccextractor.EXIT_NO_CAPTIONS
EXIT_NOT_CLASSIFIED = _ccextractor.EXIT_NOT_CLASSIFIED
EXIT_ERROR_IN_CAPITALIZATION_FILE = _ccextractor.EXIT_ERROR_IN_CAPITALIZATION_FILE
EXIT_BUFFER_FULL = _ccextractor.EXIT_BUFFER_FULL
EXIT_MISSING_ASF_HEADER = _ccextractor.EXIT_MISSING_ASF_HEADER
EXIT_MISSING_RCWT_HEADER = _ccextractor.EXIT_MISSING_RCWT_HEADER
CCX_COMMON_EXIT_FILE_CREATION_FAILED = _ccextractor.CCX_COMMON_EXIT_FILE_CREATION_FAILED
CCX_COMMON_EXIT_UNSUPPORTED = _ccextractor.CCX_COMMON_EXIT_UNSUPPORTED
EXIT_NOT_ENOUGH_MEMORY = _ccextractor.EXIT_NOT_ENOUGH_MEMORY
CCX_COMMON_EXIT_BUG_BUG = _ccextractor.CCX_COMMON_EXIT_BUG_BUG
CCX_OK = _ccextractor.CCX_OK
CCX_FALSE = _ccextractor.CCX_FALSE
CCX_TRUE = _ccextractor.CCX_TRUE
CCX_EAGAIN = _ccextractor.CCX_EAGAIN
CCX_EOF = _ccextractor.CCX_EOF
CCX_EINVAL = _ccextractor.CCX_EINVAL
CCX_ENOSUPP = _ccextractor.CCX_ENOSUPP
CCX_ENOMEM = _ccextractor.CCX_ENOMEM
def fdprintf(fd, fmt):
return _ccextractor.fdprintf(fd, fmt)
fdprintf = _ccextractor.fdprintf
def millis_to_time(milli, hours, minutes, seconds, ms):
return _ccextractor.millis_to_time(milli, hours, minutes, seconds, ms)
millis_to_time = _ccextractor.millis_to_time
def freep(arg):
return _ccextractor.freep(arg)
freep = _ccextractor.freep
def dbg_print(mask, fmt):
return _ccextractor.dbg_print(mask, fmt)
dbg_print = _ccextractor.dbg_print
def debug_608_to_ASC(ccdata, channel):
return _ccextractor.debug_608_to_ASC(ccdata, channel)
debug_608_to_ASC = _ccextractor.debug_608_to_ASC
def add_cc_sub_text(sub, str, start_time, end_time, info, mode, arg7):
return _ccextractor.add_cc_sub_text(sub, str, start_time, end_time, info, mode, arg7)
add_cc_sub_text = _ccextractor.add_cc_sub_text
class python_subs_modified(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, python_subs_modified, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, python_subs_modified, name)
__repr__ = _swig_repr
__swig_setmethods__["start_time"] = _ccextractor.python_subs_modified_start_time_set
__swig_getmethods__["start_time"] = _ccextractor.python_subs_modified_start_time_get
if _newclass:
start_time = _swig_property(_ccextractor.python_subs_modified_start_time_get, _ccextractor.python_subs_modified_start_time_set)
__swig_setmethods__["end_time"] = _ccextractor.python_subs_modified_end_time_set
__swig_getmethods__["end_time"] = _ccextractor.python_subs_modified_end_time_get
if _newclass:
end_time = _swig_property(_ccextractor.python_subs_modified_end_time_get, _ccextractor.python_subs_modified_end_time_set)
def __init__(self):
this = _ccextractor.new_python_subs_modified()
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _ccextractor.delete_python_subs_modified
__del__ = lambda self: None
python_subs_modified_swigregister = _ccextractor.python_subs_modified_swigregister
python_subs_modified_swigregister(python_subs_modified)
cvar = _ccextractor.cvar
class python_subs_array(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, python_subs_array, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, python_subs_array, name)
__repr__ = _swig_repr
__swig_setmethods__["sub_count"] = _ccextractor.python_subs_array_sub_count_set
__swig_getmethods__["sub_count"] = _ccextractor.python_subs_array_sub_count_get
if _newclass:
sub_count = _swig_property(_ccextractor.python_subs_array_sub_count_get, _ccextractor.python_subs_array_sub_count_set)
__swig_setmethods__["subs"] = _ccextractor.python_subs_array_subs_set
__swig_getmethods__["subs"] = _ccextractor.python_subs_array_subs_get
if _newclass:
subs = _swig_property(_ccextractor.python_subs_array_subs_get, _ccextractor.python_subs_array_subs_set)
def __init__(self):
this = _ccextractor.new_python_subs_array()
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _ccextractor.delete_python_subs_array
__del__ = lambda self: None
python_subs_array_swigregister = _ccextractor.python_subs_array_swigregister
python_subs_array_swigregister(python_subs_array)
def api_init_options():
return _ccextractor.api_init_options()
api_init_options = _ccextractor.api_init_options
def check_configuration_file(api_options):
return _ccextractor.check_configuration_file(api_options)
check_configuration_file = _ccextractor.check_configuration_file
def compile_params(api_options, argc):
return _ccextractor.compile_params(api_options, argc)
compile_params = _ccextractor.compile_params
def api_add_param(api_options, arg):
return _ccextractor.api_add_param(api_options, arg)
api_add_param = _ccextractor.api_add_param
def api_start(api_options):
return _ccextractor.api_start(api_options)
api_start = _ccextractor.api_start
def api_param_count(api_options):
return _ccextractor.api_param_count(api_options)
api_param_count = _ccextractor.api_param_count
def api_param(api_options, count):
return _ccextractor.api_param(api_options, count)
api_param = _ccextractor.api_param
def sigterm_handler(sig):
return _ccextractor.sigterm_handler(sig)
sigterm_handler = _ccextractor.sigterm_handler
def sigint_handler(sig):
return _ccextractor.sigint_handler(sig)
sigint_handler = _ccextractor.sigint_handler
def print_end_msg():
return _ccextractor.print_end_msg()
print_end_msg = _ccextractor.print_end_msg
def main(argc, argv):
return _ccextractor.main(argc, argv)
main = _ccextractor.main
def call_from_python_api(api_options):
return _ccextractor.call_from_python_api(api_options)
call_from_python_api = _ccextractor.call_from_python_api
def free_python_global_vars():
return _ccextractor.free_python_global_vars()
free_python_global_vars = _ccextractor.free_python_global_vars
def set_pythonapi(api_options):
return _ccextractor.set_pythonapi(api_options)
set_pythonapi = _ccextractor.set_pythonapi
def setautoprogram(api_options):
return _ccextractor.setautoprogram(api_options)
setautoprogram = _ccextractor.setautoprogram
def setstdout(api_options):
return _ccextractor.setstdout(api_options)
setstdout = _ccextractor.setstdout
def setpesheader(api_options):
return _ccextractor.setpesheader(api_options)
setpesheader = _ccextractor.setpesheader
def setdebugdvbsub(api_options):
return _ccextractor.setdebugdvbsub(api_options)
setdebugdvbsub = _ccextractor.setdebugdvbsub
# This file is compatible with both classic and new-style classes.

5366
api/ccextractor_wrap.c Normal file

File diff suppressed because it is too large Load Diff

61
api/ccx_to_python_g608.py Normal file
View File

@@ -0,0 +1,61 @@
def g608_grid_former(line,text,color,font):
if "text[" in line:
line = str(line.split(":", 1)[1])
line = str(line.split("\n")[0])
text.append(line)
if "color[" in line:
line = str(line.split(":", 1)[1])
line = str(line.split("\n")[0])
color.append(line)
if "font[" in line:
line = str(line.split(":", 1)[1])
line = str(line.split("\n")[0])
font.append(line)
def return_g608_grid(case,text,color,font):
ret_val = {'text':" ",'color':" ",'font':" "}
help_string = """
Case is the value that would give the desired output.
case = 0 --> print start_time,end_time,text,color,font
case = 1 --> print start_time,end_time,text
case = 2 --> print start_time,end_time,color
case = 3 --> print start_time,end_time,font
case = 4 --> print start_time,end_time,text,color
case = 5 --> print start_time,end_time,text,font
case = 6 --> print start_time,end_time,color,font
"""
if case==0:
if text:
ret_val['text']=text
if color:
ret_val['color']=color
if font:
ret_val['font']=font
elif case==1:
if text:
ret_val['text']=text
elif case==2:
if color:
ret_val['color']=color
elif case==3:
if font:
ret_val['font']=font
elif case==4:
if text:
ret_val['text']=text
if color:
ret_val['color']=color
elif case==5:
if text:
ret_val['text']=text
if font:
ret_val['font']=font
elif case==6:
if color:
ret_val['color']=color
if font:
ret_val['font']=font
else:
print help_string
return ret_val

152
api/python_srt_generator.py Normal file
View File

@@ -0,0 +1,152 @@
import ccextractor as cc
import re
"""
#Handling underline
buff = ""
underline_flag = 0
for i,font_type in enumerate(font_line):
if font_type == 'U' and not underline_flag:
buff = buff + '<u> '
underline_flag = 1
underline=1
elif font_type =="R" and underline_flag:
buff = buff + '</u>'
underline_flag = 0
continue;
buff += letter[i]
#adding a new line after buff has seen underline
#need to cross check with CCExtractor output as to how they are doing
if underline:
buff+= "\n"
else:
buff=""
"""
encodings_map = {
'0':'unicode',
'1':'latin1',
'2':'utf-8',
'3':'ascii',
}
color_text_start={
"0":"",
"1":"<font color=\"#00ff00\">",
"2":"<font color=\"#0000ff\">",
"3":"<font color=\"#00ffff\">",
"4":"<font color=\"#ff0000\">",
"5":"<font color=\"#ffff00\">",
"6":"<font color=\"#ff00ff\">",
"7":"<font color=\"",
"8":"",
"9":""
};
color_text_end={
"0":"",
"1":"</font",
"2":"</font>",
"3":"</font>",
"4":"</font>",
"5":"</font>",
"6":"</font>",
"7":"</font>",
"8":"",
"9":""
};
no_color_tag = ['0','8','9']
def comparing_text_font_grids(text, font, color):
original_text = text
original_color = color
temp_color = []
for letter,color_line in zip(original_text,color):
color = 0
prev = color_line[0]
buff = color_text_start[str(prev)]
if prev not in no_color_tag:
color_flag = 1
else:
color_flag = 0
if letter.count(" ")<32:
for i,color_type in enumerate(color_line):
if color_type not in no_color_tag and prev!=color_type and not color_flag:
color = 1
buff = buff + color_text_start[str(color_type)]
color_flag = 1
elif prev!=color_type and color_flag:
color = 1
buff = buff + color_text_end[str(prev)]
color_flag = 0
buff += letter[i]
prev=color_type
if color_flag:
color_flag=0
buff+=color_text_end[str(prev)]
if color:
temp_color.append((buff,1))
else:
temp_color.append((letter,0))
temp_font_italics=[]
for letter,font_line in zip(original_text,font):
if letter.count(" ")<32:
buff=""
underline,italics = 0,0
#Handling italics
italics_flag = 0
for i,font_type in enumerate(font_line):
if font_type == 'I' and not italics_flag:
italics=1
buff = buff + '<i>'
italics_flag = 1
elif font_type =="R" and italics_flag:
italics=1
buff = buff + '</i>'
italics_flag = 0
buff += letter[i]
if italics_flag:
buff+='</i>'
if italics:
temp_font_italics.append((buff,1))
else:
temp_font_italics.append((letter,0))
else:
temp_font_italics.append((letter,0))
final = []
for i,j in zip(temp_color,temp_font_italics):
if i[1] and not j[1]:
final.append(i[0])
elif j[1] and not i[1]:
final.append(j[0])
else:
if not i[1]:
final.append(i[0])
else:
print "error"
return (final,font,color)
def generate_output_srt(filename,d, encoding):
if encoding in encodings_map.keys():
if encoding!='0':
encoding_format = encodings_map[encoding]
else:
encoding_format = ""
else:
print "encoding error in python"
return
if encoding_format:
d['text'] = [unicode(item,encoding_format) for item in d['text']]
else:
d['text'] = [unicode(item) for item in d['text']]
d['text'],d['font'],d['color']= comparing_text_font_grids(d['text'],d['font'],d['color'])
for item in d['text']:
if item.count(" ")<32:
o=item
with open(filename,'ab+') as fh:
if encoding_format:
fh.write(o.encode(encoding_format))
else:
fh.write(str(o))
fh.write("\n")
fh.flush()
with open(filename,'ab+') as fh:
fh.write("\n")
fh.flush()

25
api/recursive_tester.py Normal file
View File

@@ -0,0 +1,25 @@
import sys
import os
import subprocess
output_formats = ['.srt','.ass','.ssa','.webvtt','.sami','.txt','.original','.python','.py']
args_list = sys.argv[1:]
args_count = len(args_list)
if args_count>1:
print "wrong usage"
exit(0)
directory = args_list[0]
if not os.path.isdir(directory):
print "error: path given is not a directory"
exit(0)
files = []
for item in os.listdir(directory):
ext = os.path.splitext(item)[1]
if ext not in output_formats:
files.append(os.path.join(directory,item))
for sample in files:
print "Processing file: "+sample
#command=['../linux/ccextractor',sample]
command = ['python','api_testing.py',sample]
subprocess.call(command)
print "Finished processing file: "+sample

View File

@@ -1,3 +1,107 @@
0.86 (2017-01-09)
-----------------
- New: Preliminary MXF support
- New: Added a histogram in one-minute increments of the number of lines in a subtitle.
- New: Added Autoconf build scripts for CCExtractor to generate makefiles (mac).
- New: Added Autoconf build scripts for CCExtractor to generate makefiles (linux).
- New: Added .rpm package generation script.
- New: Added build/installation script for .pkg.tar.xz (Arch Linux).
- New: Added tarball generation script.
- New: Added --analyzevideo. If present the video stream will be processed even if the
subtitles are in a different stream. This is useful when we want video information
(resolution, frame type, etc). -vides now implies this option too.
[Note: Tentative - some possibly breaking changed were made for this, so if you
use it validate results]
- New: Added a GUI in the main CCExtractor binary (separate from the external GUIs
such as CCExtractorGUI).
- New: A Python binding extension so it's possible to use CCExtractor's tools from
Python.
- New: Added -nospupngocr (don't OCR bitmaps when generating spupng, faster)
- New: Add support for file split on keyframe (-segmentonkeyonly)
- New: Added WebVTT output from Matroska.
- New: Support for source-specific multicast.
- New: FreeType-based text renderer (-out=spupng with teletext/EIA608).
- New: Upgrade library UTF8proc
- New: Upgrade library win_iconv
- New: Upgrade library zlib
- New: Upgrade library LibPNG
- New: Support for Source-Specific Multicast
- New: Added Travis CI support
- New: Made error messages clearer, less ambiguous
- Fix: Prevent the OCR being initialized more than once (happened on multiprogram and
PAT changes)
- Fix: Makefiles, build scripts, etc... everything updated and corrected for all
platforms.
-Fix: Proper line ending for .srt files from bitmaps.
- Fix: OCR corrections using grayscale before extracting texts.
- Fix: End timestamps in transcripts from DVB.
- Fix: Forcing -noru to cause deduplication in ISDB
- Fix: TS: Skip NULL packets
- Fix: When NAL decoding fails, don't dump the whole decoded thing, limit to 160 bytes.
- Fix: Modify Autoconf scripts to generate tarball for mac from `/package_creators/tarball.sh`
and include GUI files in tarball
- Fix: Started work on libGPAC upgrade.
- Fix: DVB subtitle not extracted if there's no display segment
- Fix: Heap corruption in add_ocrtext2str
- Fix: bug that caused -out=spupng sometimes crashes
- Fix: Checks for text before newlines on DVB subtitles
- Fix: OCR issue caused by separated dvb subtitle regions
- Fix: DVB crash on specific condition (!rect->ocr_text)
- Fix: DVB bug (Multiple-line subtitle; Missing last line)
- Fix: --sentencecap for teletext samples
- Fix: Crash when image passed into OCR is empty
- Fix: Temporarily wrapped the Python API, not production ready yet
- Fix: -delay option in DVB
0.85b (2017-01-26)
------------------
- Fix: Base Windows binary (without OCR) compiled without DLL dependencies.
0.85 (2017-01-23)
-----------------
- New: Added FFMPEG 3.0 to Windows build - last one that is XP compatible.
- New: Major improvements in CEA-608 to WebVTT (styles, etc).
- New: Return a non-zero return code if no subtitles are found.
- New: Windows build files updated to Visual Studio 2015, new target platform is 140_xp.
- New: Added basic support of Tesseract 4.0.0.
- New: Added build script for .deb.
- New: Updated -debugdvbsub parameter to get the most relevant DVB traces for debugging.
- New: SMPTE-TT files are now compatible with Adobe Premiere.
- New: Updated libpng.
- New: Added 3rd party (Tracy from archive.org) static linux build script.
- New: Add chapter extraction for MP4 files.
- New: Return code 10 if no captions are found at all.
- Fix: Teletext duplicate lines in certain cases.
- Fix: Improved teletext timing.
- Fix: DVB timing is finally good.
- Fix: A few minor memory leaks.
- Fix: tesseract library file included in mac build command.
- Fix: Bad WTV timings in some cases.
- Fix: Mac build script.
- Fix: Memory optimization in HARDSUBX edit_distance.
- Fix: SubStation Alpha subtitles in bitmap.
- Fix: lept msg severity in linux.
- Fix: SSA, SPUPNG and VTT timing and skipping of subtitles for SAMI and TTML.
- Fix: SMPTE-TT : Added support for font color.
- Fix: SAMI unnecessary empty subtitle when extracting DVB subs.
- Fix: Skip the packet if the adaptation field length is broken.
- Fix: 708 - lots of work done in the decoder. Implementation of more commands. Better timing.
0.84 (2016-12-16)
-----------------
- New: In Windows, both with and without-OCR binaries are bundled, since the OCR one causes problems due to
dependencies in some system. So unless you need the OCR just use the non-OCR version.
- New: Added -sbs (sentence by sentence) for DVB output. Each frame in the output file contains a complete
sentence (experimental).
- New: Added -curlposturl. If used each output frame will be sent with libcurl by doing a POST to that URL.
- Fix: More code consistency checking in function names.
- Fix: linux build script now tries to verify dependencies.
- Fix: Mac build script was missing a directory.
0.83 (2016-12-13)
-----------------
- Fix: Duplicate lines in mp4 (specifically affects itunes).

204
docs/COMPILATION.MD Normal file
View File

@@ -0,0 +1,204 @@
# Compiling CCExtractor
You may compile CCExtractor across all major platforms using `CMakeLists.txt` stored under `ccextractor/src/` directory. Autoconf and custom build scripts are also available. See platform specific instructions in the below sections.
Downloads for precompiled binaries and source code can be found [on our website](https://www.ccextractor.org?id=public:general:downloads).
Clone the latest repository from Github
```
git clone https://github.com/CCExtractor/ccextractor.git
```
## Linux
1. Make sure all the dependencies are met.
```
sudo apt-get install -y gcc
sudo apt-get install -y libcurl4-gnutls-dev
sudo apt-get install -y tesseract-ocr
sudo apt-get install -y tesseract-ocr-dev
sudo apt-get install -y libleptonica-dev
```
**Note:** On Ubuntu Version 14.04 (Trusty) and earlier, you should build leptonica and tesseract from source
2. Compiling
**Using the build script**
```
#Navigate to linux directory and call the build script
cd ccextractor/linux
./build
# test your build
./ccextractor
```
**Standard linux compilation through Autoconf scripts**
```
sudo apt-get install autoconf #Dependency to generate configuration script
cd ccextractor/linux
./autogen.sh
./configure
make
# test your build
./ccextractor
```
**Using CMake**
```
#Create and navigate to directory where you want to store built files
cd ccextractor/
mkdir build
cd build
#Generate makefile using cmake and then compile
cmake ../src/
make
# test your build
./ccextractor
```
**Compiling with GUI:**
To build CCExtractor with a gui you will additionally need to install [GLEW](http://glew.sourceforge.net/build.html) and [GLFW](http://www.glfw.org/docs/latest/compile.html)
In order to compile it you'll need to configure it using autoconf by passing the `-with-gui` option.
```
./autogen.sh
./configure --with-gui
make
```
Once set up you can run the GUI interface from the terminal `./ccextractorGUI`
## macOS
1. Make sure all the dependencies are met. They can be installed via Homebrew as
```
brew install pkg-config
brew install autoconf automake libtool
brew install tesseract
brew install leptonica
```
To verify tesseract and leptonica are detected by pkg-config, e.g.
````
pkg-config --exists --print-errors tesseract
pkg-config --exists --print-errors lept
````
2. Compiling
**Using build.command script:**
```
cd ccextractor/mac
./build.command OCR
# test your build
./ccextractor
```
If you don't want the OCR capabilities, then you don't need to configure the tesseract and leptonica packages, and build it with just
```
cd ccextractor/mac
./build.command
# test your build
./ccextractor
```
**Using CMake**
```
#Create and navigate to directory where you want to store built files
cd ccextractor/
mkdir build
cd build
#Generate makefile using cmake and then compile
cmake ../src/
make
# test your build
./ccextractor
```
**Standard compilation through Autoconf scripts :**
```
cd ccextractor/mac
./autogen.sh
./configure
make
# test your build
./ccextractor
```
**Compiling with GUI:**
To use CCExtractor with a gui you will additionally need to install GLEW and GLFW. You can do that by installing it via homebrew using:
```
brew install glfw
brew install glew
```
In order to compile it you'll need to configure it using autoconf by passing the `-with-gui` option.
```
./autogen.sh
./configure --with-gui
make
```
Once set up you can run the GUI interface from the terminal `./ccextractorGUI`
## Windows
Open the windows/ccextractor.sln file with Visual Studio (2015 at least), and build it.
Configurations options are: `(Debug|Release)-Full`
Configurations options include dependent libraries which are used for OCR.
**Using CMake**
You may also generate `.sln` files for Visual Studio and build using build tools, or open `.sln` files using Visual Studio.
```
cmake ../src/ -G "Visual Studio 14 2015"
cmake --build . --config Release --ccextractor
```
## Building Installation Packages
### Arch Linux
Go to the package_creators folder using `cd` and run the `./arch.sh`
### Redhat Package Manager (rpm) based Linux Distributions
Go to the package_creators folder using `cd` and run the `./rpm.sh`

View File

@@ -11,6 +11,10 @@ Dependency
Tesseract (OCR library by Google)
Leptonica (Image processing library)
Ubuntu install Dependency using package manager
===============================================
sudo apt-get install libleptonica-dev libtesseract-dev tesseract-ocr-eng
How to compile CCExtractor on Linux with OCR
=============================================

252
docs/Python extension module.txt Executable file
View File

@@ -0,0 +1,252 @@
This is the main documentation of Python extension module for CCExtractor:
====
CCExtractor Library
----
Refactoring the codebase into a library
Earlier version of CCExtractor was compiled as a binary and could not be used as a library. The entire codebase was executed via a single main function defined in ccextractor.c and this architecture was not suitable for extending ccextractor source code to a library. Hence, many modifications were made to ccextractor.c so that conversion to a library could be done. Major modifications were:
Segmenting the larger functions into smaller functions so that they could be called from one main function. Earlier the entire processing was carried out from one main function itself. This was not a good idea considering the possibility for library. This would allow the user to set the parameters to be passed to CCExtractor from Python with one parameter at a time and not the entire list of all parameters together.
The refactoring of the code base and architectural judgements as to how the code should be segmented so that the entire working remains the same and also the library structure could be established.
Apart from these changes, the header file ccextractor.h was also included into the codebase to define many global variables as well as the function declarations of definitions made in ccextractor.c. The major changes could be seen at this PR (merged). However, following the next stages of development after the changes made in the above mentioned PR, the final structure could be found at ccextractor.c and ccextractor.h.
----
Definitions made in ccextractor.h
In ccextractor.h, the major changes included declaring global variables which would be accessible throughout the codebase for calling the respective callbacks (discussed later in the documentation) from C to Python for processing the caption frames in Python as they are extracted in CCExtractor. The global variable was also used to keep a track of the start time and end time of caption frames so that the CE-608 grids belonging to the same frame could be clubbed together. The global variable array has been defined and the respective structure definition has also been done in ccextractor.h.
The global variable array is an instance of this structure. The elements of the structure are PyObject* reporter, int sub_count and struct python_subs_modified* subs. The subs has been defined with start_time and end_time as its elements. More detailed description about why start_time and end_time have been used is given in the section describing about extractors. The main motivation for defining a global variable to catch hold of start time and end time of the caption frames as they are processed in CCExtractor is to identify the text, font and color grids (for CE-608 captions) that belong to the same caption frame.
The major point to note is that the compilation of Python extension module includes setting a macro PYTHONAPI which acts as an indication that the compilation is made for Python extension module and this helps in declaring as well as defining the functions which are only needed for Python extension module. As defined here, the PYTHONAPI macro is used to define the functions/variables which are needed only by the extension module.
Another major advantage of defining the macro PYTHONAPI is that the definitions made for Python extension module only need python-dev package as a prerequisite for compilation. However, if the user wants to compile only CCExtractor and not the Python extension module, then the code should not have python-dev package as a dependency. This has been attained by using macro PYTHONAPI and C pre-processors.
====
CCExtractor Python Extension Module
----
Extension module dependencies
1. SWIG
For generation of the wrappers of the C code base, which would then be used to compile the extension module, I have used SWIG (swig-3.0.12). The entire compilation has been included in a build script (discussed later) and the user need not have prior knowledge of SWIG to get started.
For compiling the Python extension module, the second dependency in addition to the dependencies of CCExtractor is SWIG. The user can follow these installation steps for getting SWIG installed.
For generating the wrappers of the C/C++ code in a user required language, the user needs to have a basic understanding of the interface file which is used by SWIG. However, in case of generating the extension module for CCExtractor, the interface file has been written and is available here. SWIG uses this interface file to generate the wrappers for CCExtractor which are then compiled to form the extension module.
2. Python-dev package
----
Overall architecture
The entire Python Extension module related work is done in the api/ directory with modifications to the CCExtractor codebase to integrate the divergent path, CCExtractor would take if the processing is done via Python module.
----
Generating the Python extension module:
For this project, I have mainly used two build scripts, viz., build_api and build_library which are both present in the api/ directory. For generating the Python bindings, user need to just run the build_library script as ./build_library. This would internally generate the SWIG wrappers from the SWIG interface file (ccextractor.i) present in the same directory. The user should note that if the user has not installed SWIG, the the compilation would stop at this step itself. Once the wrappers are generated, then the build_library script would execute the build_api script which would compile the entire code base of CCExtractor along with the wrappers generated by SWIG. In addition to this, build_api would also compile the extractors and wrappers defined in the extractors/ and wrappers/ directories respectively. Once the compilation is successful, then build_library would generate a shared library called _ccextractor.so from the entire code which would be shared object for the module.
In addition to generating the wrapper codes generated by SWIG, it also outputs the ccextractor.py which would be later used as Python extension module for accessing CCExtractor functionality via Python.
As mentioned in earlier section, the build_api compiles the entire code base with an option -DPYTHONAPI which is used by GCC to define a macro PYTHONAPI. This macro then acts as a signal telling that the extension module is being generated and the bindings dependency need a check as well as the bindings dependent functions need to be defined.
----
Workflow of Python extension module
The following section encompasses on the detailed description of the entire workflow of Python extension modules and the importance of each function in the codeflow. An example usage has been done in api_testing.py.
****
api_init_options
Function declaration- struct ccx_s_options* api_init_options()
This function returns an initialized instance of struct ccx_s_options which is modified in CCExtractor according to the values of the parameters provided by the user while executing CCExtractor.
****
check_configuration_file
Function declaration- void check_configuration_file(struct ccx_s_options api_options)
This function is used to check the configuration file and it takes the struct ccx_s_options instance as returned by api_init_options().
****
api_add_param
Function declaration- void api_add_param(struct ccx_s_options* api_options,char* arg)
The api_add_param function is used to add user passed parameters to the struct ccx_s_options instance which would be used to compile the parameters and make the necessary modifications in the working of CCExtractor.
This function takes the instance of struct ccx_s_options passed to check_configuration_file function and also, the string denoting the parameter passed by the user.
The parameters are added to the python_params element of struct ccx_s_options and the count of the parameters is kept in python_param_count.
****
my_pythonapi
Function declaration- (depends on whether the compilation is done as CCExtractor binary or as extension modules)
The my_pythonapi is defined on the basis of how the compilation has been done by the user. If the user wants to use CCExtractor binary rather than the Python extension module, then this function is defined as #define my_pythonapi(args, func) set_pythonapi(args) with the set_pythonapi being defined in wrapper.c.
However, if the user wants to build the extension module, then the definition of my_pythonapi is done as #define my_pythonapi(args, func) set_pythonapi_via_python(args, func) with the set_pythonapi_via_python function being defined in wrapper.c.
Thus, it can been observed that my_pythonapi takes two arguments when the compilation is done as extension module. In both the case, the first argument is struct ccx_s_options instance as used by api_add_param. But in case of compiling the extension module, the my_pythonapi function takes a second parameter which is the python callback function that CCExtractor would call when passing values from C to Python (a detailed discussion about this has been done later).
This function is not a mandatory function to call when using the CCExtractor binary.
****
compile_params
Function declaration- int compile_params(struct ccx_s_options *api_options,int argc)
The compile_params function mainly compiles all the parameters supplied by the user and modifies the elements of the api_options on the basis of the parameters supplied by the user.
In this function, we add a dummy parameter ./ccextractor so that the parse_params function which is called from compile_params function properly compiles all the parameter except the first parameter as done in here.
This function then returns the return value as obtained by the parse_params function.
****
call_from_python_api
Function declaration- void call_from_python_api(struct ccx_s_options *api_options)
The call_from_python_api function checks if the parameter -pythonapi was provided by the user. If the parameter was passed by the user then the global varable signal_python_api is set to 1 showing that the execution is done via Python modules; otherwise the value of signal_python_api is 0.
In case of clarifications, the user does not explicitly need to pass the parameter -pythonapi. It is passed by the my_pythonapi function and thus used by call_from_python_api to set the signal_python_api to 1.
****
api_start
Function declaration- int api_start(struct ccx_s_options api_options)
This is the most important function of entire processing done by CCExtractor. After the entire compiling of parameters have been completed, then comes the stage when the actual processing is done.
The api_start is the function which is majorly responsible for extracting the caption frames and passing them back to Python for processing.
The user should note that the codeflow discussed above till this point is generic to both CCExtractor binary as well as CCExtractors Python extension module. From this point onwards, the codeflow that has been described is mainly how the Python extension module accepts the caption frames via callback function and then processings done on the caption frames to generate the output subtitle file (.srt) via Python.
The api_start function in case of CE-608 captions calls a function general_loop for processing of the sample(video) that needs to be processed which in turn makes a call to encode_sub which encodes the subtitle buffer obtained from the sample.
In encode_sub function, the sub_type is checked to be CE-608. If the sub_type is 608, then another check is made to check the value of signal_python_api. If the signal_python_api is set to 1, then a call to pass_cc_buffer_to_python is made. Otherwise, the processing continues as if the call for processing was made from CCExtractor binary.
From the pass_cc_buffer_to_python function, the call is made to the extractor function, then the extractor function in turns calls the callback function provided earlier via my_pythonapi function. The arguments given to the callback function are the ones corresponding to the information content of the caption frame which has been processed by CCExtractor. This information is accessed via the Python SRT generator scripts which would process the caption frames and write the processed information in the output subtitle files.
The following sections would be sequential in-detail descriptions about how each process functions:
----
Python Encoder for CCExtractor
Following the architecture of CCExtractors codebase, a new file named ccx_encoders_python.c was added. The main reason of adding this file was to define the functions which would be called when the extraction process or CCExtractor extraction functionality is being performed via Python extension module. At this moment, since the extension module extends support only for CE-608 samples, only pass_cc_buffer_to_python function has been defined. Later on, when the bindings support is extended to support other formats then in that case other functions like pass_cc_bitmap_to_python and others would be included in this file following the architecture of other encoders.
****
pass_cc_buffer_to_python
Function declaration- int pass_cc_buffer_to_python(struct eia608_screen *data, struct encoder_ctx *context)
This is the function where the actual work of passing the extracted caption buffer to Python extension modules for processing the caption frames is done.
The pass_cc_buffer_to_python function is called when the sample from which the caption frames are to be extracted is a CE-608 sample and the call for extraction is made from Python extension module.
In this function, whenever a caption frame element is extracted, be it the srt_counter, caption timing information or any information related to the text, font or color grid of the CE-608 captions, then that information is passed to extractor function defined in extractors/ directory. A detailed description about how exactly the extractors function would be included in the next section.
----
Extractors for bindings
As documented in the previous section, when the extraction of CE-608 caption frames in done via Python, then the call is made to pass_cc_buffer_to_python function defined in ccx_encoders_python.c. In this function, after extracting lines in a caption frame (lines may belong to any of the text, font or color grid for CE-608), those lines are passed to python_extract_g608_grid function defined in extractors.c.
****
python_extract_g608_grid
Function declaration- void python_extract_g608_grid(unsigned h1, unsigned m1, unsigned s1, unsigned ms1, unsigned h2, unsigned m2, unsigned s2, unsigned ms2, char* buffer, int identifier, int srt_counter, int encoding)
The main aim of using python_extract_g608_grid function is to able to identify the lines belonging to a particular frame and then passing these lines to the Python callback function with added identifiers for identification as to which CE-608 grid those lines belong to in a particular caption frame. More documentation about the identifiers and the nomenclature used for the bindings has been documented in the Support for only CE-608 captions section and the user is advised to read that section to get a better understanding of the nomenclature.
The arguments passed to python_extract_g608_grid include encoding which is the encoding that CCExtractor would have used to write the output subtitle file. Thus, the encoding is passed from CCExtractor to Python via the callback function so that the output subtitle file generated by Python would have the same encoding as the output generated by CCExtractor would have had.
Out of all the arguments that are passed to the python_extract_g608_grid function, the one interesting argument is the identifier argument which has different values depending on the type of caption frame line it is called with. For example, if the line passed to python_extract_g608_grid function is a line belonging to its color grid, then the value of the identifier would be 2. Similarly, we have:
identifier = 0 -> adding start and end time
identifier = 1 -> subtitle
identifier = 2 -> color
identifier = 3 -> font
This is how the python_extract_g608_grid function is able to generate the entire caption frame for a CE-608 sample along with timings.
----
Callback Function architecture
When using the extension module, when a particular C function is called from Python, the control is transferred to C and returned to Python only after the execution of the function. However, according to the adopted architecture, a single function would process the entire sample and extract all the caption frames until the control is passed back to Python for processing the captions in Python. Thereupon, for further processing in Python the user would have had to wait until the end of the extraction of all the caption frames from the sample. This would violate the basic ideology that the module should be able to process the caption frames in Python as they are extracted in CCExtractor rather than waiting till the end of extraction from the entire sample.
As a result of this, the callback function architecture was adopted. The main advantage of this architecture is that the moment a line from the caption frame is extracted the line is passed via a callback function to Python and the processing of the extracted line could be done in Python.
In the present architecture, the user has a flexibility to tell CCExtractor which Python function would act as a callback function and a mechanism has been designed to convey this function to CCExtractor. This has been done with the use of my_pythonapi function as discussed in the previous sections.
NOTE: In the api_testing.py, I have defined the callback function to be named callback. However, the user has complete freedom to define any name for the callback function. The user needs to note that the callback function would be getting nothing but a line from the caption frame that is extracted by CCExtractor. Further processing of the extracted line is the responsibility of the user.
After defining the callback function, the user needs to make sure that this function is passed via Python to CCExtractor so that it can be used for callback. For doing so, the user needs to set the second argument of the function my_pythonapi as the callback function. This has been done in the api_testing.py script and the user can refer to it for example.
A detailed description about why a single line of the caption frame is passed via the callback function and not the entire frame is described in detail in later sections.
Also, when the user passes the callback function via Python to CCExtractor so the my_pythonapi function saves a pointer to this function as an element to a global structure, array, defined and declared in ccextractor.h. The element reporter holds the callback function passed by user via Python.
Whenever the user wants to pass a line to the callback function then the user needs to call the function run which has been defined in ccextractor.c.
****
run
Function declaration- void run(PyObject * reporter, char * line, int encoding)
The run function takes two arguments and their description is as follows:
The first argument is the callback function which the user passes via Python. According to present architecture, this callback function is contained by the element reporter contained in the global structure named array. So the first argument is array.reporter.
The second argument to the run function is the line which needs to be passed to Python.
This is how the callback mechanism works for passing the lines from C to Python in real time.
----
Processing output in Python
As described in the previous sections, the extension modules just return a single line from the caption frames. The processing of the caption frames to generate the output subtitle file is done in Python.
A script to generate an output subtitle file from the extracted captions frames in Python has been written. The api_testing.py has a function named callback which acts as a callback function returning the extracted caption lines in Python. These lines then are passed to generated_output_srt in api_support.py described in the api/ directory. Thereupon, the function searches if the line has specific identifier which are used to decide how the output would be generated. A detailed section has been included in this documentation regarding the nomenclature used for processing different lines in CE-608 format caption fields (Support for only CE-608 captions section). The main reason for doing so is to avoid any buffering in C to hold the caption lines until the entire caption frames are extracted. This facilitates real time processing of the extracted caption frames.
For getting the output filename from CCExtractor which would then be used to write the output srt file from Python, whenever the code is run from the extension module the first line that is passed via the callback function is the output filename generated by CCExtractor. This is incorporated by calling the callback function from init_write function defined in the src/lib_ccx/output.c file. The line passed to the callback function is of the format filename-<name of the output file to be generated> and this is then used to generate the output file. This line is then captured in the generate_output_srt function defined in the api_support.py.
However, if the user wants the flexibility of defining the filename in a different manner, then for such outputs, the user must make changes in the generate_output_srt function to set the filename and ignoring the first line that appears in Python via the callback function.
----
Support for only CE-608 captions:
For understanding the CE-608 caption format, the user is advised to refer to this documentation on CE-608.
The Python extension module is so far able to extract the captions frames from CE-608 samples. In samples with CE-608, the caption frames that are extracted by CCExtractor are in the form a 15x32 grid which depicts the screen. Thus, the information regarding the font of the captions, the colour they would be having on the screen as well as their alignment on the screen is captured in font,color and text grids respectively.
Using Python modules each of such grids can be accessed in Python. However, as described in the previous section the callback function gets a single line and not the entire grid from CCExtractor, some processing needs to be done in Python for getting the user required grids per caption frames.
The functions which would be acting as the processing and buffering functions for grid generations are present in the ccx_to_python_g608.py. The two major functions are return_g608_grid and g608_grid_former. The g608_grid_former is mainly used to form the grid from lines obtained at the callback function.
The main advantage of the return_g608_grid function is that the user can generate whatever pattern the user desires to process in Python. For accessing various different combinations of the font, color and text grids in CE-608, a help_string has been defined in the return_g608_grid function in the ccx_to_python_g608.py file which describes on the value of mode to be passed to this function to get proper combination of the grids.
In the earlier sections it has been stated that the callback function in Python is not passed with the entire caption frame but just one single line from the frame, a particular nomenclature has been devised to make sure that the lines belonging to the same caption frames are identified in the Python interface. The nomenclature is as follows:
For every frame, the first line that is passed to the callback function is the srt_counter which indicates the identifier value of the caption frame that would be extracted next.
Following the srt_counter, the next line would contain a conjunction of the start time and end time of the caption frame with respect to the timings when the captions would be visible on the screen. The start_time and end_time would be conjuncted as start_time-<start time>\t end_time-<end time>\n and the user needs to process this line to get the timings. This processing in case of getting a srt file as an output has been done in the generate_output_srt function.
After the timings have been sent via the callback function, until the next srt_counter is extracted, the lines containing information about the color, font or text grids of CE-608 samples are passed via the callback function to Python.
For processing the grids separately, the color grid could be identified by identifying the presence of color[<srt_counter value>]:<color grid line> in the line obtained from the callback function. Similarly, for the font and text grids, the nomenclatures are font[<srt_counter value>]:<font grid line> and text[<srt_counter value>]:<text grid line> respectively. Processing a grid on the basis of such a nomenclature has been done in the g608_grid_former in the ccx_to_python_g608.py file.
After the entire caption frame has been sent via the callback function to Python for further processing, when the extraction of present caption frames finishes and CCExtractor shifts to a new frame, then a line containing ***END OF FRAME*** is passed via the callback function from C to Python. The user needs to catch this line in order to get the signal that from the next line onwards a new caption frame would begin. Similar approach has been implemented in the function generate_output_srt in the api_support.py file.
This is how the entire CE-608 is transmitted to Python and the user needs to follow the nomenclature in order to get the caption frames in Python.
However, if the user thinks to modify the nomenclature in accordance with some other nomenclature that suits their use case, then the user can do so by editing the python_extract_g608_grid function in the extractor.c file. In this file, the user needs to find the lines where the function run is called with its first parameter being the callback function that is passed from Python and the second parameter being the line which is to be passed to Python.
----
Wrappers for the extension module
In case of using an API, it is highly desired to set the parameters desired by the user not via command line but as call to built-in functions. This gave rise to the necessity of wrapper functions which can be called to set certain parameters for directing the functioning of the bindings.
The wrappers have been defined in the wrapper.c file in api/wrappers/ directory. The user can use just call the wrappers to set some parameters. More wrappers can be defined according to the architecture followed in wrapper.c.
The user needs to note that the wrappers can be called anytime in between adding parameters to CCExtractor instance (as done in api_testing.py) and before calling the compile_params function from the CCExtractor module.
Another thing to note about the wrapper is that, the my_pythonapi wrapper function is a very important wrapper function. It tells CCExtractor that the call has been made using the Python module and thus the functioning of CCExtractor is altered. Hence, if the user intends to use the Python module the user is always advised to call this wrapper function with its first argument to be the object returned by api_init function from CCExtractor module and second argument being the callback function which would be called by the CCExtractor to pass the extracted caption lines back to Python.
----
Test Script
Once the Python module are generated then the user can use them by importing ccextractor module in Python.
For testing the output of the bindings a test script, api_testing.py. But to mention, the module at this stage only supports generating a subtitle file from the CE-608 standard samples only.
Another testing feature, that has been added is that the user can use recursive_tester.py to generate the subtitle files for all the samples from a directory. The only parameter needed to run this script is the location of all the samples.
----
Silent API
The Python bindings have been designed in such a way that the API is silent in itself as well as in the form of output generation. Silent in itself means that the API doesnt write out any output to the STDOUT and the entire output of CCExtractor is silenced when the module is used for extraction of caption frames. This feature has been made possible by passing a parameter -pythonapi internally in api_testing.py using the function my_pythonapi() from the ccextractor module. The -pythonapi internally makes CCExtractor to silence all the outputs that could have been generated otherwise.
If the user wants to add some print functionality from the CCExtractor, then may be defining the prints using printf C function could be an option. Note that the user cannot use the mprint function to get prints from the extension module from inside the CCExtractor C code part as used in CCExtractor to get the desired STDOUT prints as these are silenced via -pythonapi.
====
Work status
The proposal made by me for this project had a major component of multi-threading to let CCExtractors Python bindings run the CCExtractors extraction process in multi-threads.
However, the end goal was modified while the GSOC 2017 coding period and after Second Phase Evaluation, the main aim was to create a Python extension module for CCExtractor which could process CE-608 video samples, extract the caption information present in them and pass this information to Python for further processing. The module was expected to be silent and the output generation from the caption information present in the video sample has to be done via Python.
The present status of the extension module is that the module can extract caption information from CE-608 standard video samples and pass the caption information to Python. Further work has also been done to process this caption information to generate an output subtitle(srt) file (the user is advised to check completion of comparing_text_font_grids function sub-section under the future work section).
====
Future Work
----
Identifying the input format and raising errors if unsupported
CCExtractor does not process any non-video files. Similarly, the processing of non-video files is not supported by extension module. However, since the API has been designed to be silent, the module doesnt output any error log stating that the input file is a non-video file and it cannot be processed.
This is a much desired feature and the present version of CCExtractor extension module lacks this feature. I would be working on this feature post GSOC 2017 but if any user finds that this feature has not been added until they start contribution to CCExtractors extension module, then their work on this feature would be highly appreciated.
For adding this feature to extension module, the extension module must be extended to process the return value from CCExtractor as done in the api_start function. When the sample (non-video) is processed via CCExtractors binary, then the processing is stopped by raising an Invalid option to CCExtractor Library error. However, since the extension module has been designed to be silent, this error message is suppressed. Hence, the user should extend the test scripts to process the return value of api_start function in python extension module according to the constants defined in ccx_common_common.h
----
Callback class mechanism
The present architecture uses a callback mechanism to pass the extracted caption lines from the caption frames of CE-608 captions to Python for further processing. In the callback mechanism, a callback function is supplied to CCExtractor in C via the my_pythonapi function which stores the callback function as a PyObject* in the global variable array. However, according to Python documentation on C-API, everything in Python is a PyObject; be it a function, a tuple or a class.
So, the ideology is to replace the present callback function by a class which can have many methods that the user can use for different use cases.
An example of such an implementation has been done here. The user needs to note that for accessing the Python class in C, some modifications need to be done to the run function defined in ccextractor.c and a sample example for calling a class method named callback could be found here.
Also, an important point to be noted in this case is that the user needs to pass the callback functions name to run function in C so that the corresponding callback method of the class passed via my_pythonapi could be called via C. As an example, the callback methods name has been provided here.
For understanding the exact implementation of this approach, I would recommend the user to understand C-API for Python as the documentation is quite extensive to every use case.
----
Completion of comparing_text_font_grids function
The Python extension module for CCExtractor is able to pass lines of the caption frames for different grids of CE-608 captions. However, for generating the subtitle file from the caption grids, the text grid needs to be modified according to the color grid as well as font grid. In CCExtractor, this job is done at the function, get_decoder_line_encoded.
For generation of subtitle files (.srt files) from Python, an equivalent version of get_decoder_line_encoded has been implemented in Python and has been defined as comparing_text_font_grids in python_srt_generator.py
However, as the user can note that this function is not a complete implementation of get_decoder_line_encoded function, completion of this functions definition is a matter of future work.
----
Adding more wrapper functions
As described in the Wrappers for the extension module section, more wrapper functions are needed to be declared in the wrapper.c file. For example, few wrappers have been defined. More wrapper functions can be defined in a similar manner.
Extending the module to support other caption formats
In this version, CCExtractors extension module supports processing of video samples having CE-608 standard captions in them and writing these captions to output subtitle (.srt) files.
However, CCExtractor in itself has support for other caption standards like DVB, 708 etc. So, extension of module to extract of caption information from samples containing the caption information in these formats is a future task.
The user should note that the information passed from CE-608 to Python is in raw form as lines which are then used to form the 608 grids. Similarly, the extension to other formats must consider passing the raw information of caption in respective format and then processing the information extracted by CCExtractor in Python.
While extending, the architecture to be followed for ccx_encoders_python should be consistent to other encoders in the codebase to maintain uniformity. Thus for DVB samples, a function name pass_cc_bitmap_to_python and for 708 samples pass_cc_subtitle_to_python need to be declared in ccx_encoders_python.c.
====
PyPI module
(This section is for contributors who want to upload the package to PyPI)
The PyPI module that has been uploaded has many things added to the CCExtractor code tree and all of this can be found here (branch - manifest_file).
The contributor is advised to use the documentation at An Introduction to Distutils and its subsequent parts to understand this section.
The overall strategy or steps that have been followed to generate the distribution for being uploaded to PyPI is as follows:
----
Adding files to distribution and generating the distribution
All the files that are needed to be included in the package distribution are to be added the MANIFEST file as done here. For understanding the syntax used in MANIFEST file the user can check this documentation.
After the MANIFEST file has been written properly, the user can generate the distribution package by the command
python setup.py sdist
This command would generate the distribution on the basis of MANIFEST file and place in the dist/ directory as a .tar.gz file until specified otherwise by the user.
One thing to mention about the MANIFEST file is that it can only include files/folders from the folder it is defined within. It cannot include directories/files from parent directory or any other child directory. However, in the MANIFEST file I used, I have added the symlink to src main src directory so that the source code can be added to the package distribution via the MANIFEST file.
----
An analysis of the setup.py file used
The setup.py has been used to install the Python module on the user system. To understand what all the parameters mean in setup the user must refer to this documentation.
The cmdclass defined at line is a very important part of the script as it internally makes call to the scripts included in package_build_scripts. A point to note is that this directory is used to include the scripts into the package distribution via the MANIFEST file.
The scripts in package_build_scripts are the scripts which do the actual compilation of the source code to required python module and shared object. The user is advised to refer to build_library_package and build_api_package to understand how to compilation process takes place. The user may also refer to this documentation for understanding how the build scripts work.
For any modifications made to the build scripts, viz, build_library and build_api corresponding modifications are to be made to the scripts included in package_build_scripts so that the compilation does not fail while installing the Python extension module.
The ccextractor.i used in the package_build_scripts is an interface file used by SWIG to generate the wrapper codes. This is an essential part and should always be present with the distribution.

View File

@@ -1,8 +1,11 @@
ccextractor, 0.83
ccextractor, 0.86
-----------------
Authors: Carlos Fernández (cfsmp3), Volker Quetschke.
Original authors: Carlos Fernández (cfsmp3), Volker Quetschke.
Maintainer: cfsmp3
Currently lots of developers work on CCExtractor, particularly during
Google Summer of Code and Google Code-in.
Lots of credit goes to other people, though:
McPoodle (author of the original SCC_RIP), Neuron2, and others (see source
code).
@@ -30,9 +33,17 @@ Google Summer of Code 2016 students
- Rishabh Garg
Google Code-in 2016 students
(to be listed)
- Evgeny Shulgin
- Manveer Basra
- Alexandru Bratosin
- Matej Plavevski
- Danila Fedorin
(more, but they forgot to add themselves...)
Google Summer of Code 2017 students
- Diptanshu Jamgade
- Mayank Gupta
License
-------
@@ -45,9 +56,10 @@ but painfully slow Perl script SCC_RIP. It lets you rip the raw closed
captions (read: subtitles) data from a number of sources, such as DVD or
ATSC (digital TV) streams.
Since the original port, lots of changes have been made, such as HDTV
support, analog captures support (via bttv cards), direct .srt/.smi
generation, time adjusting, and more.
Since the original port, the whole code has been rewritten (more than once,
one might add) and support for most subtitle formats around the world has
been added (teletext, DVB, CEA-708, ISDB...)
Basic Usage
-----------

340
docs/freetype.TXT Normal file
View File

@@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
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
convey 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 2 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, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision 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, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This 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 Library General
Public License instead of this License.

821
docs/guidoc.md Normal file
View File

@@ -0,0 +1,821 @@
# Documentation
## CCExtractor Graphical User Interface
### Code Structure:
```
src/GUI
├── activity.c -Activity window definitions
├── activity.h -Activity window declarations
├── ccextractorGUI.c -Contains main() and GUI code for 'Main' Tab + 'Menu'
├── ccextractorGUI.h -Function and structure declarations
├── ccx_cli_thread.c -All the functions (definitions) passed in threads
├── ccx_cli_thread.h -Function, variables & structs declaration used in thread
├── command_builder.c -Builds command to pass to CLI CCExtractor
├── command_builder.h -Function, variables & structs declaration used
├── file_browser.c -Function definition for File Browser
├── file_browser.h -Function, struct & variable declaration
├── nuklear_lib -Diretory contains Library Files
│ ├── nuklear_glfw_gl2.h -GLFW backend source header to interact with Nuklear
│ └── nuklear.h -Nuklear library source code
├── popups.c -Function definitions for all Popups used
├── popups.h -Function & network struct declaration for all Popups
├── preview.c -Preview window definitions
├── preview.h -Preview window definitions
├── save_load_data.c -Function definition to save last run state
├── save_load_data.h -Function declaration to save last run state
├── stb_image.h -Code to load images
├── tabs.c -Function definitions for all tabs except 'Main' tab
├── tabs.h -Function, variable and structure declarations
├── terminal.c -Code for terminal Window
└── win_dirent.h -Dirent API for Windows
```
### File by File functions:
activity.c
[nk_begin](#nk-begin)(ctx, "Activity", nk_rect(x, y, width, height), NK_WINDOW_TITLE|NK_WINDOW_BACKGROUND);
[nk_end](#nk-end)(ctx);
[nk_layout_row_dynamic](#nk-layout-row-dynamic)(ctx, 40, 1);
[nk_label_wrap](#nk-label-wrap)(ctx, [main_settings](#struct-main-tab)->activity_string[i]);
[nk_window_is_closed](#nk-window-is-closed)(ctx, "Activity");
activity.h
int [activity](#func-activity)(struct [nk_context](#nk-context) &ast;ctx, int x, int y, int width, int height, struct [main_tab](#struct-main-tab) &ast;main_settings);
ccextractorGUI.c
[nk_menubar_begin](#nk-menubar-begin)(ctx);
[nk_layout_row_begin](#nk-layout-row-begin)(ctx, NK_STATIC, 30, 3);
[nk_layout_row_push](#nk-layout-row-push)(ctx, 80);
[nk_menu_begin_label](#nk-menu-begin-label)(ctx, "Preferences", NK_TEXT_LEFT, [nk_vec2](#nk-vec2)(120, 200));
[nk_menu_end](#nk-menu-end)(ctx);
[nk_menubar_end](#nk-menubar-end)(ctx);
[nk_layout_space_begin](#nk-layout-space-begin)(ctx, NK_STATIC, 15, 1);
[nk_layout_space_end](#nk-layout-space-end)(ctx);
[nk_style_push_vec2](#nk-style-push-vec2)(ctx, &ctx->style.window.spacing, [nk_vec2(](#nk-vec2)0, 0));
[nk_style_push_float](#nk-style-push-float)(ctx, &ctx->style.button.rounding, 0);
[nk_button_label](#nk-label-button)(ctx, names[i]);
[nk_style_pop_float](#nk-style-pop-float)(ctx);
[nk_group_begin](#nk-group-begin)(ctx, "Advanced Tabs", NK_WINDOW_NO_SCROLLBAR);
[nk_group_end](#nk-group-end)(ctx);
[nk_layout_row](#nk-layout-row)(ctx, NK_DYNAMIC, 20, 3, ratio_adv_mode);
[nk_spacing](#nk-spacing)(ctx, 1);
[nk_checkbox_label](#nk-checkbox-label)(ctx, "Advanced Mode", &advanced_mode_check);
[nk_option_label](#nk-option-label)(ctx, "Extract from files below:", [main_settings](#struct-main-tab).port_or_files == FILES));
[nk_selectable_label](#nk-selectable-label)(ctx, [truncate_path_string](#func-truncate-path-string)([main_settings](#struct-main-tab).filenames[i]), NK_TEXT_LEFT, &[main_settings](#struct-main-tab).is_file_selected[i]);
[nk_combo](#nk-combo)(ctx, [main_settings](#struct-main-tab).port_type, 2, [main_settings](#struct-main-tab).port_select, 20, [nk_vec2](#nk-vec2)_(85,100));
[nk_label](#nk-label)(ctx, "Drag and Drop files for extraction.", NK_TEXT_CENTERED
[nk_progress](#nk-progress)(ctx, &[main_settings](#struct-main-tab).progress_cursor, 101, nk_true);
ccextractorGUI.h
void [setup_main_settings](#func-setup-main-settings)(struct main_tab &ast;main_settings);
char&ast; [truncate_path_string](#func-truncate-path-string)(char &ast;filePath);
void [remove_path_entry](#func-remove-path-entry)(struct [main_tab](#struct-main-tab) &ast;main_settings, int indexToRemove);
ccx_cli_thread.c || ccx_cli_thread.h
void&ast; [read_activity_data](#func-read-activity-data)(void &ast;read_args);
void&ast; [read_data_from_thread](#func-read-data-from-thread)(void&ast; read_args);
void&ast; [extract_thread](#func-extract-thread)(void&ast; extract_args);
void&ast; [feed_files_for_extraction](#func-feed-files-for-extraction)(void&ast; file_args);
void [setup_and_create_thread](#fun-setup-and-create-thread)(struct [main_tab](#struct-main-tab) &ast;main_settings, struct [built_string](#struct-built-string) &ast;command);
void&asst; [find_hd_homerun_devices](#func-hd-homerun-devices)(void &ast;args);
void&ast; [setup_hd_homerun_device](#func-setup-hd-homerun-device)(void &ast;args);
command_builder.c || command_builder.h
void [command_builder](#func-command-builder)(struct [built_string](#struct-built-string) &ast;command,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [main_tab](#struct-main-tab) &ast;main_settings,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [network_popup](#struct-network-popup) &ast;network_settings,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [input_tab](#struct-input-tab) &ast;input,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [advanced_input_tab](#struct-advanced-input-tab) &ast;advanced_input,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [output_tab](#struct-output-tab) &ast;output,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [decoders_tab](#struct-output-tab) &ast;decoders,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [credits_tab](#struct-output-tab) &ast;credits,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [debug_tab](#struct-debug-tab) &ast;debug,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [burned_subs_tab](#struct-debug-tab) &ast;burned_subs);
file_browser.c || file_browser.h
void [die](#func-die)(const char &ast;fmt, ...);
char&ast; [file_load](#func-file-load)(const char&ast; path, size_t&ast; siz);
char&ast; [str_duplicate](#func-str-duplicate)(const char &ast;src);
void [dir_free_list](#func-dir-free-list)(char &ast;&ast;list, size_t size);
char&ast;&ast; [dir_list](#func-dir-list)(const char &ast;dir, int return_subdirs, size_t &ast;count);
struct file_group [FILE_GROUP](#func-file-group)(enum file_groups group, const char &ast;name, struct nk_image &ast;icon);
struct file [FILE_DEF](#func-file-def)(enum file_types type, const char &ast;suffix, enum file_groups group);
struct nk_image&ast; [media_icon_for_file](#func-media-icon-for-file)(struct media &ast;media, const char &ast;file);
void [media_init](#func-media-init)(struct media &ast;media);
void [file_browser_reload_directory_content](#func-file-browser-reload-directory-content)(struct file_browser &ast;browser, const char &ast;path);
void [get_drives](#func-get-drives)(struct file_browser &ast;browser);
void [file_browser_init](#func-file-browser-init)(struct file_browser &ast;browser, struct media &ast;media);
void [file_browser_free](#func-file-browser-free)(struct file_browser &ast;browser);
int [file_browser_run](#func-file-browser-run)(struct file_browser &ast;browser, struct [nk_context](#nk-context) &ast;ctx, struct [main_tab](#struct-main-tab) &ast;main_settings, struct [output_tab](#struct-output-tab) &ast;output, struct [debug_tab](#struct-debug-tab) &ast;debug, struct [hd_homerun_tab](#struct-hd-homerun-tab) &ast;hd_homerun);
popups.c || popups.h
void [draw_network_popup](#func-draw-network-popup)(struct [nk_context](#nk-context) &ast;ctx, int &ast;show_preferences_network, struct [network_popup](#struct-network-popup) &ast;network_settings);
void [draw_getting_started_popup](#func-draw-getting-started-popup)(struct [nk_context](#nk-context) &ast;ctx, int &ast;show_getting_started);
void [draw_about_ccx_popup](#func-draw-about-ccx-popup)(struct [nk_context](#nk-context) &ast;ctx, int &ast;show_about_ccx, struct nk_user_font &ast;droid_big, struct nk_user_font &ast;droid_head);
void [draw_progress_details_popup](#func-draw-progress-details-popup)(struct [nk_context](#nk-context) &ast;ctx, int &ast;show_progress_details, struct [main_tab](#struct-main-tab) &ast;main_settings);
void [draw_color_popup](#func-draw-color-popup)(struct [nk_context](#nk-context) &ast;ctx, struct [output_tab](#struct-output-tab) &ast;output);
void [draw_thread_popup](#fun-draw-thread-popup)(struct [nk_context](#nk-context) &ast;ctx, int &ast;show_thread_popup);
void [setup_network_settings](#func-setup-network-settings)(struct [network_popup](#struct-network-popup) &ast;network_settings);
preview.c || preview.h
int [preview](#func-preview)(struct [nk_context](#nk-context) &ast;ctx, int x, int y, int width, int height, struct [main_tab](#struct-main-tab) &ast;main_settings);
save_load_data.c || save_load_data.h
void [load_data](#func-load-data)(FILE *file,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [main_tab](#struct-main-tab) &ast;main_settings,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [input_tab](#struct-input-tab) &ast;input,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [advanced_input_tab](#struct-advanced-input-tab) &ast;advanced_input,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [output_tab](#struct-output-tab) &ast;output,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [decoders_tab](#struct-decoders-tab) &ast;decoders,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [credits_tab](#struct-credits-tab) &ast;credits,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [debug_tab](#struct-debug-tab) &ast;debug,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [hd_homerun_tab](#struct-hd-homerun-tab) &ast;hd_homerun,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [burned_subs_tab](#struct-burned-subs-tab) &ast;burned_subs);
void [save_data](#func-save-data)(FILE *file,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [main_tab](#struct-main-tab) &ast;main_settings,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [input_tab](#struct-input-tab) &ast;input,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [advanced_input_tab](#struct-advanced-input-tab) &ast;advanced_input,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [output_tab](#struct-output-tab) &ast;output,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [decoders_tab](#struct-decoders-tab) &ast;decoders,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [credits_tab](#struct-credits-tab) &ast;credits,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [debug_tab](#struct-debug-tab) &ast;debug,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [hd_homerun_tab](#struct-hd-homerun-tab) &ast;hd_homerun,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct [burned_subs_tab](#struct-burned-subs-tab) &ast;burned_subs);
void [write_credits](#func-write-credits)(FILE* file, struct [credits_tab](#struct-credits-tab) &ast;credits);
void [read_credits](#func-read-credits)(FILE* file, struct [credits_tab](#struct-credits-tab) &ast;credits);
terminal.c
int [terminal](#func-terminal)(struct [nk_context](#nk-context) &ast;ctx, int x, int y, int width, int height, char &ast;command);
### About CCExtractor specific functions
#### int <a id="func-activity">activity</a>(struct nk_context &ast;ctx, int x, int y, int width, int height, struct [main_tab](#struct-main-tab) &ast;main_settings);
##### Info:
--Contains the procedure to be carried out when Activity Window is toggled.
##### Parameters:
* &ast;ctx - pointer to `nk_context` structure.
* x - X co-ordinate to draw Activity Window
* y - Y co-ordinate to draw Activty Window.
* width - width of window to draw.
* height - height of window to draw.
* &ast;main_settings - pointer to [`main_tab`](#struct-main-tab) structure.
##### Return Type: int
* Returns non-zero value if window is not closed.
* Returns zero if window is closed.
#### void <a id="func-setup-main-settings">setup_main_settings</a>(struct [main_tab](#struct-main-tab) &ast;main_settings);
##### Info:
Setups the required defaults of variables in [`main_tab`](#struct-main-tab) structure.
##### Parameters:
* &ast;main_settings - pointer to [`main_tab`](#struct-main-tab) structure.
##### Return Type: void
#### char* <a id="func-truncate-path-string">truncate_path_string</a>(char &ast;filePath);
##### Info:
Truncated the Path String of file to visible area using `...`
##### Parameters:
* &ast;filePath - Pointer to string to be truncated.
##### Return Type: *char
* Returns pointer to truncated string.
#### void <a id="func-remove-path-entry">remove_path_entry</a>(struct [main_tab](#struct-main-tab) &ast;main_settings, int indexToRemove);
##### Info:
Removes the selected path in the extraction queue (Selected entry's index is passed).
##### Parameters:
* &ast;main_settings - pointer to [`main_tab`](#struct-main-tab) structure.
* indexToRemove - index of the string to be removed from dynamic array of many strings.
##### Return Type: void
#### void&ast; <a id="func-read-activity-data">read_activity_data</a>(void &ast;read_args);
##### Info:
Reads activity data related to CCExtractor on `stdout`. And outputs to activity window (Updates variables that code of activity window uses).
##### Parameters:
* &ast;read_args - Pointer to void, because thread functions don't allow any datatype as argument or return type. Therefore they are passed as void then typecasted later in the function.
##### Return type: void&ast;
#### void&ast; <a id="func-read-data-from-thread>read_data_from_thread</a>(void&ast; read_args);
##### Info:
Reads data from`--gui_mode_reports` redirected from `stderr` to a file. Reads the subtitles extracted in realtime and updates the variables for the same, updates the state of progress bar. Also, lanches [read_activity_data](#func-read-activity-data) in a new thread.
##### Parameters:
* &ast;read_args - Pointer to void, because thread functions don't allow any datatype as argument or return type. Therefore they are passed as void then typecasted later in the function.
##### Return type: void&ast;
#### void&ast; <a id="func-extract-thread">extract_thread</a>(void&ast; extract_args);
##### Info:
Passes command with all options from GUI to CLI CCExtractor.
##### Parameters:
* &ast;extract_args - Pointer to void, because thread functions don't allow any datatype as argument or return type. Therefore they are passed as void then typecasted later in the function.
##### Return type: void&ast;
#### void&ast; <a id="func-feed-files-for-extraction">feed_files_for_extraction</a>(void&ast; file_args);
##### Info:
Feeds file by file to a new thread and waits until its extraction is done. This is done until all the files in extraction queue are extracted.
##### Parameters:
* &ast;file_args - Pointer to void, because thread functions don't allow any datatype as argument or return type. Therefore they are passed as void then typecasted later in the function.
##### Return type: void&ast;
#### void <a id="func-setup-and-create-thread">setup_and_create_thread</a>(struct [main_tab](#struct-main-tab) &ast;main_settings, struct [built_string](#struct-built-string) &ast;command);
##### Info:
Initialises some values for the structure used in thread arguments and creates [feed_files_for_extraction](#feed-files-for-extraction).
##### Parameters:
* &ast;main_settings - Pointer to `main_tab` struct.
* &ast;command - Pointer to `built_string` struct.
##### Return type: void&ast;
#### void&ast; <a id="func-hind-hd-homerun-devices">find_hd_homerun_devices</a>(void &ast;args);
Finds devices connected to HD HomeRun Network.
#### Parameters:
* &ast;args - Pointer to void, because thread functions don't allow any datatype as argument or return type. Therefore they are passed as void then typecasted later in the function.
#### Return type: void&ast;
#### void&ast; <a id="func-setup-hd-homerun-device">setup_hd_homerun_device</a>(void &ast;args);
##### Info:
Sets up various parameters required to extract subtitle from incoming stream from a HD HomeRun Device.
##### Parameters:
* &ast;args - Pointer to void, because thread functions don't allow any datatype as argument or return type. Therefore they are passed as void then typecasted later in the function.
##### Return type: void&ast;
#### void [command_builder](#func-command-builder)(struct [built_string](#struct-built-string) &ast;command, struct [main_tab](#struct-main-tab) &ast;main_settings, struct [network_popup](#struct-network-popup) &ast;network_settings, struct [input_tab](#struct-input-tab) &ast;input, struct [advanced_input_tab](#struct-advanced-input-tab) &ast;advanced_input, struct [output_tab](#struct-output-tab) &ast;output, struct [decoders_tab](#struct-output-tab) &ast;decoders, struct [credits_tab](#struct-output-tab) &ast;credits, struct [debug_tab](#struct-debug-tab) &ast;debug, struct [burned_subs_tab](#struct-debug-tab) &ast;burned_subs);
##### Info:
Fetches the options from the whole GUI and adds the respective CLI commands to the `term_string` in `built_string` struct.
##### Parameters:
* &ast;command - Pointer to `built_string` command.
* &ast;main_settings - Pointer to `main_tab` struct.
* &ast;network_settings - Pointer to `network_popup` struct.
* &ast;input - Pointer to `input_tab` struct.
* &ast;advance_input - Pointer to `advanced_input` struct.
* &ast;output - Pointer to `output_tab` struct.
* &ast;decoders - Pointer to `decoders_tab` struct.
* &ast;credits - Pointer to `credits_tab` struct.
* &ast;debug - Pointer to `debug_tab` struct.
* &ast;burned_subs - Pointer to `burned_subs_tab` struct.
##### Return type: void
#### void <a id="func-die">die</a>(const char &ast;fmt, ...);
##### Info:
Custom function to generate error if something in File Browser goes wrong.
##### Parameters:
* &ast;fmt - Format of char string along with place holder for variables.
* ... - Variables in order of their specified place holder.
##### Return type: void
#### char&ast; <a id="func-file-load">file_load</a>(const char&ast; path, size_t&ast; siz);
##### Info:
Custom function to load file and read data from loaded file.
##### Parameters:
* &ast;path - Pointer to string literal (Path of the file).
* &ast;siz - Size of string literal provided (To allocate memory accordingly).
##### Return type: void
#### char&ast; <a id="func-str-duplicate">str_duplicate</a>(const char &ast;src);
##### Info:
Dynamically copies specified string to memory.
##### Parameters:
* &ast;src - The String to be copied.
##### Return type: char&ast;
* Pointer to the string in the memory.
#### void <a id="func-dir-free-list">dir_free_list</a>(char &ast;&ast;list, size_t size);
##### Info:
Frees the memory allocated to Files' and Directories' name and path.
##### Parameters:
* &ast;&ast;char - Pointer to list (array of strings) to be freed
##### Return type: void
#### char&ast;&ast; <a id="func-dir-list">dir_list</a>(const char &ast;dir, int return_subdirs, size_t &ast;count);
##### Info:
Opens the selected directory and adds its path to list and returns the same list.
#####Parameters:
* &ast;dir - Pointer to string (name of directory to be opened).
* return_subdirs - `nk_true` if subdirectories are to be returned then.
* &ast;count - Number of directories in opened directories.
#### Retrun type: char&ast;&ast;
* Pointer to List (Array of strings, name of directories and files) is returned.
#### struct file_group <a id="func-file-group">FILE_GROUP</a>(enum file_groups group, const char &ast;name, struct nk_image &ast;icon);
##### Info:
Initialises variables for `file_group` struct.
##### Parameters:
* group - specifies to which group does the file belong to. Selected from `file_groups` enum, like `FILE_GROUP_MUSIC`.
* &ast;name - Pointer to a string literal (to set `name` member in `file_group`.
* &ast;icon - Pointer to `nk_image` struct (Holds attributes for loaded image file) to set to `icon`member of `file_group`.
##### Returnt type: struct `file_group`
* Returns a `file_group` instance with set variables.
#### struct file <a id="func-file-def">FILE_DEF</a>(enum file_types type, const char &ast;suffix, enum file_groups group);
##### Info:
Initialises variables for `file` struct.
##### Parameters:
* type - specifies which type does the file belong to. Selected from `file_types` enum, like `FILE_TEXT`.
* &ast;suffix - Pointer to string( to set `suffix` member in `file`).
* group - specifies to which group does the file belong to. Selected from `file_groups` enum, like `FILE_GROUP_MUSIC`.
##### Return type: struct `file`
* Returns a `file` instance with set variables.
#### struct nk_image&ast; <a id="func-media-icon-for-file">media_icon_for_file</a>(struct media &ast;media, const char &ast;file);
##### Info:
Analyses the files and checks to which `file` or `file_group` they belong and assign appropriate icon to the file and returns the same.
##### Parameters:
* &ast;media - pointer to `media` struct.
* &ast;file - pointer to string literal (name of file with extension)
##### Return type: struct `nk_image`&ast;
* Returns appropriate `nk_image` corresponding to the file.
#### void <a id="func-media-init">media_init</a>(struct media &ast;media);
##### Info:
Assigns icons to `file` and `file_group` members from.
##### Parameters:
* &ast;media - pointer to `media` struct.
#### Return type: void
#### void <a is="func-file-browser-reload-directory-content">file_browser_reload_directory_content</a>(struct file_browser &ast;browser, const char &ast;path);
##### Info:
Updates various variables related to Files/Directories path and names when screen of File Browser reloads. (Due to clicking on a directory or any other button leading to different directory).
##### Parameters:
* &ast;browser - Pointer to `file_browser` struct.
* &ast;path - Path of the new directory whose contents are to be reloaded and showed on file browser.
##### Return type: void
#### void <a id="func-get-drives">get_drives</a>(struct file_browser &ast;browser);
##### Info:
NOTE: Windows Specific Function.
Detects the number of drives and their respective Drive Letters to show the same in File Browser.
#####Parameters:
* &ast;browser - pointer to `file_browser` struct.
##### Return type: void
#### void <a id="func-file-browser-init">file_browser_init</a>(struct file_browser &ast;browser, struct media &ast;media);
##### Info:
Initialised various variables/attributes required whenever the File Browser is run.
##### Parameters:
* &ast;browser - Pointer to `file_browser` struct.
* &ast;media - pointer to `media` struct.
##### Return type: void
#### void <a id="func-file-browser-free">file_browser_free</a>(struct file_browser &ast;browser);
##### Info:
Frees the memory allocated to various variables in [file_browser_init](#func-file-browser-init).
##### Parameters:
* &ast;browser - pointer to `file_browser` struct.
##### Return type: void
#### int <a id="func-file-browser-run">file_browser_run</a>(struct file_browser &ast;browser, struct [nk_context](#nk-context) &ast;ctx, struct [main_tab](#struct-main-tab) &ast;main_settings, struct [output_tab](#struct-output-tab) &ast;output, struct [debug_tab](#struct-debug-tab) &ast;debug, struct [hd_homerun_tab](#struct-hd-homerun-tab) &ast;hd_homerun);
##### Info:
Provides runtime of File Browser on GUI.
##### Parameters:
* &ast;browser - pointer to `file_browser` struct.
* &ast;ctx - pointer to `nk_context` struct.
* &ast;main_settings - pointer to `main_tab` struct.
* &ast;output - poiter to `output_tab` struct.
* &ast;debug - pointer to `debug_tab` struct.
* &ast;hd_homerun - pointer to `hd_homerun_tab` struct.
##### Return type: int
* Returns `1` if any File name/path is copied to current variable.
* Returns `0` otherwise.
#### void <a -d="func-draw-network-popup">draw_network_popup</a>(struct [nk_context](#nk-context) &ast;ctx, int &ast;show_preferences_network, struct [network_popup](#struct-network-popup) &ast;network_settings);
##### Info:
Draws popup with Network Settings on GUI.
##### Parameters:
* &ast;ctx - pointer to `nk_context` struct.
* &ast;show_preferences_network - pointer to variable status if which triggers the popup.
* &ast;network_settings - pointer to `network_popup` struct.
##### Return type: void
#### void <a id="func-draw-getting-started-popup">draw_getting_started_popup</a>(struct [nk_context](#nk-context) &ast;ctx, int &ast;show_getting_started);
##### Info:
Draws popup on screen which shows Getting Started Info.
##### Parameters:
* &ast;ctx - pointer to `nk_context` struct.
* &ast;show_getting_started - pointer to variable status if which triggers the popup.
##### Return type: void
#### void <a id="func-draw-about-ccx-popup">draw_about_ccx_popup</a>(struct [nk_context](#nk-context) &ast;ctx, int &ast;show_about_ccx, struct nk_user_font &ast;droid_big, struct nk_user_font &ast;droid_head);
##### Info:
Draws popup on screen containing information about CCExtractor.
##### Parameters:
* &ast;ctx - pointer to `nk_context` struct.
* &ast;show_about_ccx - pointer to variable status if which triggers the popup.
* &ast;droid_big - pointer to `nk_user_font` struct.
* &ast;droid_head - pointer to `nk_user_font` struct.
##### Return type: void
#### void <a id="func-draw-progress-details-popup">draw_progress_details_popup</a>(struct [nk_context](#nk-context) &ast;ctx, int &ast;show_progress_details, struct [main_tab](#struct-main-tab) &ast;main_settings);
##### Info:
Draws popup on screen which shows progress details.
##### Parameters:
* &ast;ctx - pointer to `nk_context` struct.
* &ast;show_pogress_details - pointer to variable status if which triggers the popup.
* &ast;main_settings - pointer to `main_tab` struct.
##### Return type: void
#### void <a id="func-draw-color-popup">draw_color_popup</a>(struct [nk_context](#nk-context) &ast;ctx, struct [output_tab](#struct-output-tab) &ast;output);
##### Info:
Draws popup on screen which shows color-picker.
##### Parameters:
* &ast;ctx - pointer to `nk_context` struct.
* &ast;output - pointer to `output_tab` struct.
##### Return type: void
#### void <a id="func-draw-thread-popup">draw_thread_popup</a>(struct [nk_context](#nk-context) &ast;ctx, int &ast;show_thread_popup);
##### Info:
This popup is shown if anyhow the GUI is unable to read file.
##### Parameters:
* &ast;ctx - pointer to `nk_context` struct.
* &ast;show_thread_popup - pointer to variable status if which triggers the popup.
##### Return type: void
#### void <a id="func-setup-network-settings">setup_network_settings</a>(struct [network_popup](#struct-network-popup) &ast;network_settings);
##### Info:
Sets up defaults for Network Settings.
##### Parameters:
* &ast;network_settings - pointer to `network_popup` struct.
##### Return type: void
#### int <a id="func-preview">preview</a>(struct [nk_context](#nk-context) &ast;ctx, int x, int y, int width, int height, struct [main_tab](#struct-main-tab) &ast;main_settings);
##### Info:
Draws `Preview` Nuklear window and shows preview strings (lines of subtitles extracted in realtime).
##### Parameters:
* &ast;ctx - pointer to `nk_context` struct.
* x - X co-ordinate from where to draw window.
* y - Y co-ordinate from where to draw window.
* width - width of window.
* height - height of window.
* &ast;main_settings - pointer to `main_tab ` struct.
##### Return type:
* Returns non-zero value if window is not closed.
* Returns zero if window is closed.
#### void <a id="func-load-data">load_data</a>(FILE *file, struct [main_tab](#struct-main-tab) &ast;main_settings, struct [input_tab](#struct-input-tab) &ast;input, struct [advanced_input_tab](#struct-advanced-input-tab) &ast;advanced_input, struct [output_tab](#struct-output-tab) &ast;output, struct [decoders_tab](#struct-decoders-tab) &ast;decoders, struct [credits_tab](#struct-credits-tab) &ast;credits, struct [debug_tab](#struct-debug-tab) &ast;debug, struct [hd_homerun_tab](#struct-hd-homerun-tab) &ast;hd_homerun, struct [burned_subs_tab](#struct-burned-subs-tab) &ast;burned_subs);
##### Info:
Loads values of all the variables stored in a file at last exit of GUI.
##### Parameters:
* &ast;file - pointer to `FILE`.
* &ast;main_settings - pointer to `main_tab` struct.
* &ast;intput - pointer to `input_tab` struct.
* &ast;advanced_input - pointer to `advanced_input_tab` struct.
* &ast;output - pointer to `output_tab` struct.
* &ast;decoders - pointer to `decoders_tab` struct.
* &ast;credits - poitner to `credits_tab` struct.
* &ast;debug - pointer to `debug_tab` struct.
* &ast;hd_homerun - pointer to `hd_homerun_tab` struct.
* &ast;burned_subs - pointer to `burned_subs_tab` struct.
##### Return type: void
#### void <a id="func-save-data">save_data</a>(FILE *file, struct [main_tab](#struct-main-tab) &ast;main_settings, struct [input_tab](#struct-input-tab) &ast;input, struct [advanced_input_tab](#struct-advanced-input-tab) &ast;advanced_input, struct [output_tab](#struct-output-tab) &ast;output, struct [decoders_tab](#struct-decoders-tab) &ast;decoders, struct [credits_tab](#struct-credits-tab) &ast;credits, struct [debug_tab](#struct-debug-tab) &ast;debug, struct [hd_homerun_tab](#struct-hd-homerun-tab) &ast;hd_homerun, struct [burned_subs_tab](#struct-burned-subs-tab) &ast;burned_subs);
##### info:
Saves values of all the variables as a "Current State" in a file on exit.
##### Parameters:
* &ast;file - pointer to `FILE`.
* &ast;main_settings - pointer to `main_tab` struct.
* &ast;intput - pointer to `input_tab` struct.
* &ast;advanced_input - pointer to `advanced_input_tab` struct.
* &ast;output - pointer to `output_tab` struct.
* &ast;decoders - pointer to `decoders_tab` struct.
* &ast;credits - poitner to `credits_tab` struct.
* &ast;debug - pointer to `debug_tab` struct.
* &ast;hd_homerun - pointer to `hd_homerun_tab` struct.
* &ast;burned_subs - pointer to `burned_subs_tab` struct.
##### Return type: void
#### void <a id="func-write-credits">write_credits</a>(FILE &ast;file, struct [credits_tab](#struct-credits-tab) &ast;credits);
##### Info:
Writes Credits to files after some operations, since extra`\n` character gives problems while reading file.
##### Parameters:
* &ast;file - pointer to `FILE`.
* &ast;credits - pointer to `credits_tab` struct.
##### Return type: void
#### void <a id="func-read-credits">read_credits</a>(FILE* file, struct [credits_tab](#struct-credits-tab) &ast;credits);
##### Info:
Reads credits from file in a specific format (as written by [write_credits](#func-write-credits)) from file.
##### Parameters:
* &ast;file - pointer to `FILE`.
* &ast;credits - pointer to `credits_tab` struct.
##### Return type: void
#### int <a id="func-terminal">terminal</a>(struct [nk_context](#nk-context) &ast;ctx, int x, int y, int width, int height, char &ast;command);
##### Info:
Writes the command string (that would be passed to CLI CCExtractor) in "Terminal" Nuklear Window.
##### Parameters:
* &ast;ctx - pointer to `nk_context` struct.
* x - X co-ordinate from where to draw the window.
* y - Y co-ordinate from where to draw the window.
* width - Width of the window.
* height - height of the window.
* &ast;command - String to write on window (the command to be passed).
##### Return type: int
* Returns non-zero value if window is not closed.
* Returns zero if window is closed.
### About CCExtractor specific Structures/Variables
#### <a id="struct-main-tab">main_tab</a>
##### Info:
Contains all the variables for `Main` tab.
##### Variables worth noting:
* `int is_file_browser_active`
* `nk_true` if File Browser is triggered by any event.
* `nk_false` otherwise.
* `int scaleWindowForFileBrowser`
* Sets to `nk_true` if `is_file_browser_active` is `nk_true` to scale the `glfwWindow` to required size to accommodate File Browser.
* Sets to `nk_false` otherwise.
#### <a id="struct-input-tab">input_tab</a>
##### Info:
Contains all variables to hold data of options selected/changed and view dynamically generated data to GUI in `Input` tab.
#### <a id="struct-advanced-input">advanced_input_tab</a>
Info:
Contains all variables to hold data of options selected/changed and view dynamically generated data to GUI in `Advanced Input` tab.
#### <a id="struct-output-tab">output_tab</a>
#####Info:
Contains all variables to hold data of options selected/changed and view dynamically generated data to GUI in `Advanced Input` tab.
#### <a id="struct-decoders-tab">decoders_tab</a>
##### Info:
Contains all variables to hold data of options selected/changed and view dynamically generated data to GUI in `Decoders` tab.
#### <a id="struct-credits-tab">credits_tab</a>
##### Info:
Contains all variables to hold data of options selected/changed and view dynamically generated data to GUI in `Credits` tab.
#### <a id="struct-debug-tab">debug_tab</a>
##### Info:
Contains all variables to hold data of options selected/changed and view dynamically generated data to GUI in `Debug` tab.
#### <a id="struct-hd-homerun-tab">hd_homerun_tab</a>
##### Info:
Contains all variables to hold data of options selected/changed and view dynamically generated data to GUI in `HDHomeRun` tab.
#### <a id="struct-burned-subs-tab">burned_subs</a>
##### Info:
Contains all variables to hold data of options selected/changed and view dynamically generated data to GUI in `HDHomeRun` tab.
#### <a id="struct-network-popup">networ_popup</a>
##### Info:
Contains all the variables to store all the Network related options or showing them in GUI dynamically.
### About Nuklear Specific functions
#### int <a id="nk-begin">nk_begin</a>(struct nk_context&ast;, const char &ast;title, struct nk_rect bounds, nk_flags flags);
##### Info:
Draws a basic(and blank) window(Nuklear Window inside main GLFW window) to hold other Nuklear widgets.
##### Parameters:
* nk_context&ast; - Pointer to `nk_context` structure.
* &ast;title - Title for the so drawn Nuklear Window.
* bounds - instance of `nk_rect` structure to hold co-ordinates, width and height of the Nuklear Window.
* flags - Which flags to pass( from those contained in `enum flags`) to change behaviour of the Nuklear Window.
##### Return Type: int
* Returns true if window creation is successful.
* Returns false if window creation fails.
#### void <a id="nk-end">nk_end</a>(struct nk_context *ctx)
##### Info:
Marks the end of the Nuklear Window.
##### Parameter:
* &ast;ctx - Pointer to `nk_context` structure.
##### Return type: void
#### void <a id="nk-layout-row-dynamic">nk_layout_row_dynamic</a>(struct nk_context&ast;, float height, int cols);
##### Info:
Used to define a dynamic row layout(to hold widgets), dynamic in the sense that the width is dynamically allocated to widgets.
##### Parameters:
* &ast;nk_context - Pointer to `nk_context` structure.
* height - height to set for widgets of that row.
* cols - Columns to set for layout (generally the number of widgets to place).
##### Return Type: void
#### void <a id="nk-label-wrap">nk_label_wrap</a>(struct nk_context&ast;, const char&ast;);
##### Info:
Writes a label ( A plain String) and wraps it to the next line if the border of Nuklear Window, Group or Popup is reached.
*Note*: If the text wraps to next line, height for a new line must be considered while defining a layout, else the wrapped text won't be visible (but it will be there).
##### Parameters:
* nk_context&ast; - Pointer to `nk_context` structure.
* char&ast; - Pointer to string literal (to view).
#### int <a id="nk-window-is-closed">nk_window_is_closed</a>(struct nk_context &ast;ctx, const char &ast;name);
##### Info:
Checks if the active Nuklear Window is closed (by any trigger).
##### Parameters:
* &ast;ctx - Pointer to `nk_context` structure.
* &ast;name - Pointer to String literal(Name of window to check).
##### Return type: int
* Returns true if window is closed (by any trigger).
* Returns false of window is not closed.
#### void <a id="nk-menubar-begin">nk_menubar_begin</a>(struct nk_context &ast;ctx);
##### Info:
Marks the end of Menu Bar definition(Menubar code).
##### Parameters:
* &ast;ctx - Pointer to `nk_context` structure.
##### Return type: void
#### void <a id="nk-layout-row-begin">nk_layout_row_begin</a>(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols);
##### Info:
Marks the beginning of custom layout. Which means, marking that layout has begun, now the widgets will be pushed row by row as per requirement using [nk_layout_row_push](#nk-layout-row-push).
##### Parameters:
* &ast;ctx - Pointer to `nk_context` structure.
* fmt - Layout format from provided formats (`enum nk_layout_format`), example - `NK_STATIC`, `NK_DYNAMIC`.
* row_height - height of row pushed.
* cols - Number of columns pushed in row.
##### Return type: void
#### void <a id="nk-layout-row-push">nk_layout_row_push</a>(struct nk_context&ast;, float value);
##### Info:
Pushes a row to hold widgets after defining the beginning of custom layout by [nk_layout_row_begin](#nk-layout-row-begin).
##### Parameters:
* nk_context&ast; - Pointer to `nk_context` structure.
* value - ratio or width of the widget to be pushed next.
##### Return Type: void
#### int <a id="nk-menu-begin-label">nk_menu_begin_label</a>(struct nk_context &ast;ctx, const char &ast;text, nk_flags align, struct [nk_vec2](#nk-vec2) size);
##### Info:
The label of the Menu Item to be pushed, for example - "Preferences" is marked by this function.
##### Parameters:
* &ast;ctx - pointer to `nk_context` structure.
* &ast;text - pointer to string literal (Title of the Menu, example - "Settings").
* align - alignment enumeration in `nk_flags`, example `NK_TEXT_LEFT`.
* size - Size of label (as `nk_vec2` struct)
##### Return type: int
* Returns true if label creation successful.
* Returns false if label creation fails.
#### void <a id="nk-menubar-end">nk_menubar_end</a>(struct nk_context&ast;);
##### Info:
Marks the end of the MenuBar definition.
##### Parameters:
* nk_context&ast; - Pointer to `nk_context` structure.
##### Return type: void
#### void <a id="nk-layout-space-begin">nk_layout_space_begin</a>(struct nk_context &ast;ctx, enum nk_layout_format fmt, float height, int widget_count);
##### Info:
Marks the beginning of an empty space (Custom space for proper placement of widgets).
##### Parameters:
* &ast;ctx - pointer to `nk_context` structure.
* fmt - Layout format as in `enu nk_layout_format`, example - `NK_STATIC`, `NK_DYNAMIC`.
* height = height of space to be added.
* widget_count - Number of spaces to add.
##### Return type: void
#### void <a id="nk-layout-space-end">nk_layout_space_end</a>(struct nk_context &ast;ctx);
##### Info:
Marks the end of custom space (empty) definition.
##### Parameters:
* &ast;ctx - pointer to `nk_context` structure.
##### Return type: void
#### int <a id="nk-style-push-vec2">nk_style_push_vec2</a>(struct nk_context&ast; struct nk_vec2&ast;, struct nk_vec2);
##### Info:
Comes under `Style Stack`. Used to temporarily modify length, width, spacing related attributes of Styles of Nuklear Context.
##### Parameters:
* nk_context&ast; - Pointer to `nk_context` structure.
* nk_vec2&ast; - Pointer to attribute to be modified.
* nk_vec2&ast; - New value in the form `nk_vec2(x, y)` as an instance of nk_vec2 structure.
##### Return type: int
* Returns true if successful.
* Returns false if unsuccessful.
#### int <a id="nk-style-push-float">nk_style_push_float</a>(struct nk_context&ast;, float&ast;, float);
##### Info:
Comes under `Style Stack`. Used to temporarily modify attributes requiring precision with floating point such as rounding value for buttons.
##### Parameters:
* nk_context&ast; - Pointer to `nk_context` structure.
* float&ast; - Pointer to variable whose value is to be changed.
* float - new value to set.
#### int <a id="nk-button-label">nk_button_label</a>(struct nk_context&ast;, const char &ast;title);
##### Info:
Draws a Button with provided label.
##### Parameters:
* nk_context&ast; - Pointer to `nk_context` struct.
* &ast;title - Pointer to string literal (Label to put on button).
##### Return type: int
* Returns true of Button is clicked.
* Returns false of Button is in 'unclicked' state.
#### int <a id="nk-style-pop-float">nk_style_pop_float</a>(struct nk_context&ast;);
##### Info:
Pops the float values modified off the `Style Stack`. Which means, returns them to original state as they were before being modified by [nk_style_push_float](#nk-style-push-float).
##### Paramaters:
* nk_context&ast; - Pointer to `nk_context` struct.
##### Return type: int
* Returns true if successful.
* Returns false if unsuccessful.
#### int <a id="nk-group-begin">nk_group_begin</a>(struct nk_context &ast;ctx, const char &ast;title, nk_flags flags);
##### Info:
Makes a group with given flags. Looks just like a window created by [nk_begin](#nk-begin) but can be created inside a window.
##### Parameters:
* &ast;ctx - pointer to `nk_context` struct.
* &ast;title - string literal (Title of the group).
* flags - All the required flags among available flags in `nk_flags`.
##### Return Type: int
* Returns false if creation unsuccessful.
* Returns true if creation successful.
#### void <a id="nk-group-end">nk_group_end</a>(struct nk_context &ast;ctx);
##### Info:
Marks the end of the group created by [nk_group_begin](#nk-group-begin).
##### Parameters:
* &ast;ctx - pointer to `nk_context` struct.
##### Return type: void
#### void <a id="nk-layout-row">nk_layout_row</a>(struct nk_context&ast;, enum nk_layout_format, float height, int cols, const float &ast;ratio);
##### Info:
Used to create custom row layout in which widget placement (including spacing) is done using ratios in floating point. Maximum ratio allowed is one. So, if there are two widgets (say buttons) need to placed in 50% available area each. Then `ratio` will be {0.5f, 0.5f}.
##### Parameters:
* nk_context&ast; - pointer to `nk_context` struct.
* nk_layout_format - format from available formats in `enum nk_layout_format` like `NK_STATIC` , `NK_DYNAMIC`.
* height - height of the layout.
* cols - Number of widgets(including spaces) to be used.
* &ast;ratio - Ratio for widget placement.
##### Return type: void
#### void <a id="nk-spacing">nk_spacing</a>(struct nk_context&ast;, int cols);
##### Info:
Used to create spacing (blank) of specified columns.
##### Parameters:
* nk_context&ast; - pointer to `nk_context` struct.
* cols - Number of columns for which spacing has to be true.
##### Return type: void
#### int <a id="nk-checkbox-label">nk_checkbox_label</a>(struct nk_context &ast;ctx, const char &ast;label, int &ast;active);
##### Info:
Creates a checkbox with specified label.
##### Parameters:
* &ast;ctx - Pointer to `nk_context` struct.
* &ast; - Pointer to string literal(Label of checkbox).
* &ast; - Pointer to variable to store the active value. `nk_false` if unchecked, `nk_true` if checked.
##### Return type: int
* Returns false if unable to draw widget or old value of `*active` = new value of `*active`.
* Returns true of old value of `*active` != new value of `*active`.
#### int <a id="nk-option-label">nk_option_label</a>(struct nk_context &ast;ctx, const char &ast;label, int active);
##### Info:
Draws radio button (among radio group) with specified label.
##### Parameters:
* &ast;ctx - pointer to `nk_context` struct.
* &ast;label - Pointer to string literal (label of radio button).
* active - Any check to specify if the radio button is active.
##### Return type: int
* Returns true if radio button is active.
* Returns false if radio button is inactive.
#### int <a id="nk-selectable-label">nk_selectable_label</a>(struct nk_context&ast;, const char&ast;, nk_flags align, int &ast;value);
##### Info:
Draws a selectable label. (Just like a regular [nk_label](#nk-label) but with a difference that it can be selected)
##### Parameters:
* nk_context&ast; - pointer to `nk_context` struct.
* char&ast; - Pointer to string literal (Label to display on GUI).
* align - required alignment flags from `nk_flags` like `NK_TEXT_LEFT`.
* &ast;value - Pointer to integer variable to store the value if the label is triggered or not.
* Sets to `nk_true` if label selected.
* Sets to `nk_false` if label is in unselected state.
##### Return type: int
* Returns false if unable to draw widget or old value of `*value` = new value of `*value`.
* Returns true of old value of `*value` != new value of `*value`.
#### int <a id="nk-combo">nk_combo</a>(struct nk_context&ast;, const char &ast;&ast;items, int count, int selected, int item_height, struct nk_vec2 size);
##### Info:
Draws combobox with given items as array of strings.
##### Parameters:
* nk_context&ast; - Pointer to `nk_context` structure.
* &ast;&ast;items - Array of strings of items to populate the list of combobox.
* count - Number of items in the combobox.
* selected - variable to store the index of selected item.
* item_height - Height to allocate to each item in combobox.
* size - size of combobox after expansion(when dropdown arrow is clicked). Given as [nk_vec2](#nk-vec2)(x, y).
##### Return type: int
* Returns the index of selected item.
#### void <a id="nk-label">nk_label</a>(struct nk_context &ast;ctx, const char &ast;str, nk_flags alignment);
##### Info:
Draws a plain text on Nuklear Window, Popup or group.
##### Parameters:
* &ast;ctx - pointer to `nk_context` structure.
* &ast;str - Pointer to string literal (Text to draw).
* alignment - required flags for text alignment from `nk_flags`, like `NK_TEXT_LEFT`.
##### Return type: void
#### int <a id="nk-progress">nk_progress</a>(struct nk_context &ast;ctx, nk_size &ast;cur, nk_size max, int is_modifyable);
##### Info:
Draws a progress bar.
##### Parameters:
* &ast;ctx - Poitner to `nk_context` struct.
* &ast;cur - Realtime value to update in progress bar.
* max - Maximum value `*cur` can achieve (usually 100, for 100% progress).
* is_modifyable -
* `nk_true` if progress bar can be modified with other events like mouse click and drag.
* `nk_false` if progress bar needs to be modified only by value of `*cur`
##### Return type: int
* Returns false if unable to draw widget or old value of `*cur` = new value of `*cur`.
* Returns true of old value of `*cur` != new value of `*cur`.
### About Nuklear Specific Structures/Variables
#### <a id="nk-context">nk_context</a>
##### Info:
Contains various Variables/attributes related to current Window.
#### <a id="nk-vec2">nk_vec2</a>
##### Info:
A simple structure containing 2 variables `x` and `y`. Used for various purposes where 2 variables are required for example.. using offset for position or size of any widget/window.

BIN
fonts/Cousine-Regular.ttf Normal file

Binary file not shown.

BIN
fonts/DroidSans.ttf Normal file

Binary file not shown.

BIN
fonts/Karla-Regular.ttf Normal file

Binary file not shown.

BIN
fonts/ProggyClean.ttf Normal file

Binary file not shown.

BIN
fonts/ProggyTiny.ttf Normal file

Binary file not shown.

BIN
fonts/Raleway-Bold.ttf Normal file

Binary file not shown.

BIN
fonts/Roboto-Bold.ttf Normal file

Binary file not shown.

BIN
fonts/Roboto-Light.ttf Normal file

Binary file not shown.

BIN
fonts/Roboto-Regular.ttf Normal file

Binary file not shown.

BIN
fonts/kenvector_future.ttf Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,6 @@
#!/bin/bash
find /vagrant/Second\ phase\ evaluation/ -name '*.ts' -exec sh -c '
for file do
python ../../api/api_testing.py $file -quiet
done
' sh {} +

BIN
icon/computer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

BIN
icon/default.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
icon/desktop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

BIN
icon/directory.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
icon/drive.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
icon/font.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
icon/home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

BIN
icon/img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
icon/movie.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
icon/music.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
icon/text.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@@ -1,167 +0,0 @@
SHELL = /bin/sh
CC = gcc
SYS := $(shell gcc -dumpmachine)
CFLAGS = -O3 -std=gnu99 -s
INCLUDE = -I../src/gpacmp4/ -I../src/libpng -I../src/lib_hash -I../src/protobuf-c -I../src/zlib -I../src/lib_ccx -I../src/.
INCLUDE += -I../src/zvbi -I../src/utf8proc
ALL_FLAGS = -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT
LDFLAGS = -lm
ifneq (, $(findstring linux, $(SYS)))
CFLAGS +=-DGPAC_CONFIG_LINUX
endif
TARGET = ccextractor
OBJS_DIR = objs
VPATH = ../src:../src/gpacmp4:../src/libpng:../src/zlib:../src/lib_ccx:../src/zvbi:../src/lib_hash:../src/utf8proc:../src/protobuf-c
SRCS_DIR = ../src
SRCS_C = $(wildcard $(SRCS_DIR)/*.c)
OBJS = $(SRCS_C:$(SRCS_DIR)/%.c=$(OBJS_DIR)/%.o)
SRCS_CCX_DIR = $(SRCS_DIR)/lib_ccx
SRCS_CCX = $(wildcard $(SRCS_CCX_DIR)/*.c)
OBJS_CCX = $(SRCS_CCX:$(SRCS_CCX_DIR)/%.c=$(OBJS_DIR)/%.o)
SRCS_PNG_DIR = $(SRCS_DIR)/libpng
SRCS_PNG = $(wildcard $(SRCS_PNG_DIR)/*.c)
OBJS_PNG = $(SRCS_PNG:$(SRCS_PNG_DIR)/%.c=$(OBJS_DIR)/%.o)
SRCS_ZVBI_DIR = $(SRCS_DIR)/zvbi
SRCS_ZVBI = $(wildcard $(SRCS_ZVBI_DIR)/*.c)
OBJS_ZVBI = $(SRCS_ZVBI:$(SRCS_ZVBI_DIR)/%.c=$(OBJS_DIR)/%.o)
SRCS_GPACMP4_DIR = $(SRCS_DIR)/gpacmp4
SRCS_GPACMP4_C = $(wildcard $(SRCS_GPACMP4_DIR)/*.c)
SRCS_GPACMP4_CPP = $(wildcard $(SRCS_GPACMP4_DIR)/*.cpp)
OBJS_GPACMP4 = $(SRCS_GPACMP4_C:$(SRCS_GPACMP4_DIR)/%.c=$(OBJS_DIR)/%.o) \
$(SRCS_GPACMP4_CPP:$(SRCS_GPACMP4_DIR)/%.cpp=$(OBJS_DIR)/%.o)
SRCS_ZLIB_DIR = $(SRCS_DIR)/zlib
SRCS_ZLIB = $(wildcard $(SRCS_ZLIB_DIR)/*.c)
OBJS_ZLIB = $(SRCS_ZLIB:$(SRCS_ZLIB_DIR)/%.c=$(OBJS_DIR)/%.o)
SRCS_HASH_DIR = $(SRCS_DIR)/lib_hash
SRCS_HASH = $(wildcard $(SRCS_HASH_DIR)/*.c)
OBJS_HASH = $(SRCS_HASH:$(SRCS_HASH_DIR)/%.c=$(OBJS_DIR)/%.o)
SRCS_UTF8_DIR = $(SRCS_DIR)/utf8proc
SRCS_UTF8 = $(SRCS_UTF8_DIR)/utf8proc.c
OBJS_UTF8 = $(SRCS_UTF8:$(SRCS_UTF8_DIR)/%.c=$(OBJS_DIR)/%.o)
INSTLALL = cp -f -p
INSTLALL_PROGRAM = $(INSTLALL)
DESTDIR = /usr/bin
ifeq ($(ENABLE_HARDSUBX),yes)
ENABLE_OCR=yes
CFLAGS+=-DENABLE_HARDSUBX
CFLAGS+= $(shell pkg-config --cflags libavcodec)
CFLAGS+= $(shell pkg-config --cflags libavformat)
CFLAGS+= $(shell pkg-config --cflags libavutil)
CFLAGS+= $(shell pkg-config --cflags libswscale)
AV_LDFLAGS+= $(shell pkg-config --libs libavcodec )
AV_LDFLAGS+= $(shell pkg-config --libs libavformat )
AV_LDFLAGS+= $(shell pkg-config --libs libavutil )
AV_LDFLAGS+= $(shell pkg-config --libs libswscale )
ifeq ($(AV_LDFLAGS),$(EMPTY))
$(error **ERROR** "libav not found")
else
$(info "libav found")
endif
LDFLAGS+= $(AV_LDFLAGS)
endif
ifeq ($(ENABLE_OCR),yes)
CFLAGS+=-DENABLE_OCR -DPNG_NO_CONFIG_H
LEPT_LDFLAGS+= $(shell pkg-config --libs lept)
ifneq ($(shell pkg-config --exists tesseract), $(EMPTY))
TESS_LDFLAGS+= $(shell pkg-config --libs tesseract)
TESS_CFLAGS+= $(shell pkg-config --cflags tesseract)
else
#fix for raspberry pi not having a pkgconfig file for tesseract
ifneq ($(wildcard /usr/include/tesseract/*),$(EMPTY))
TESS_LDFLAGS+= -ltesseract
TESS_CFLAGS+= -I/usr/include/tesseract
endif
endif
#error checking of library are there or not
ifeq ($(TESS_LDFLAGS),$(EMPTY))
$(error **ERROR** "tesseract not found")
else
#TODO print the version of library found
$(info "tesseract found")
endif
ifeq ($(LEPT_LDFLAGS),$(EMPTY))
$(error **ERROR** "leptonica not found")
else
#TODO print the version of library found
$(info "Leptonica found")
endif
CFLAGS += $(TESS_CFLAGS)
CFLAGS += $(shell pkg-config --cflags lept)
LDFLAGS += $(TESS_LDFLAGS)
LDFLAGS += $(LEPT_LDFLAGS)
endif
ifeq ($(ENABLE_FFMPEG),yes)
CFLAGS+=-DENABLE_FFMPEG
CFLAGS+= $(shell pkg-config --cflags libavcodec)
CFLAGS+= $(shell pkg-config --cflags libavformat)
CFLAGS+= $(shell pkg-config --cflags libavutil)
LDFLAGS+= $(shell pkg-config --libs libavcodec )
LDFLAGS+= $(shell pkg-config --libs libavformat )
LDFLAGS+= $(shell pkg-config --libs libavutil )
endif
.PHONY: all
all: pre-build objs_dir $(TARGET)
.PHONY: objs_dir
objs_dir:
mkdir -p $(OBJS_DIR)
$(TARGET): $(OBJS) $(OBJS_PNG) $(OBJS_GPACMP4) $(OBJS_ZVBI) $(OBJS_ZLIB) $(OBJS_HASH) $(OBJS_CCX) $(OBJS_UTF8)
$(CC) $(ALL_FLAGS) $(CFLAGS) $(OBJS) $(OBJS_CCX) $(OBJS_PNG) $(OBJS_ZVBI) $(OBJS_GPACMP4) $(OBJS_ZLIB) $(OBJS_HASH) $(OBJS_UTF8) $(LDFLAGS) -o $@
$(OBJS_DIR)/%.o: %.c
$(CC) -c $(ALL_FLAGS) $(INCLUDE) $(CFLAGS) $< -o $@
$(OBJS_DIR)/%.o: %.cpp
$(CC) -c $(ALL_FLAGS) $(INCLUDE) $(CFLAGS) $< -o $@ -I../src/gpacmp4
$(OBJS_DIR)/ccextractor.o: ccextractor.c
$(CC) -c $(ALL_FLAGS) $(INCLUDE) $(CFLAGS) -O0 $< -o $@
.PHONY: clean
clean:
rm -rf $(TARGET) 2>/dev/null || true
rm -rf $(OBJS_CCX) $(OBJS_PNG) $(OBJS_ZLIB) $(OBJS_GPACMP4) $(OBJS_HASH) $(OBJS_UTF8) $(OBJS) 2>/dev/null || true
rm -rdf $(OBJS_DIR) 2>/dev/null || true
rm -rf .depend 2>/dev/null || true
.PHONY: install
install: $(TARGET)
$(INSTLALL_PROGRAM) $(TARGET) $(DESTDIR)
.PHONY: uninstall
uninstall:
rm -iv $(DESTDIR)/$(TARGET)
.PHONY: depend dep
depend dep:
$(CC) $(CFLAGS) $(INCLUDE) -E -MM $(SRCS_C) $(SRCS_PNG) $(SRCS_ZVBI) $(SRCS_ZLIB) $(SRCS_HASH) $(SRCS_UTF8) $(SRCS_CCX) \
$(SRCS_GPACMP4_C) $(SRCS_GPACMP4_CPP) |\
sed 's/^[a-zA-Z_0-9]*.o/$(OBJS_DIR)\/&/' > .depend
.PHONY: pre-build
pre-build:
./pre-build.sh
-include .depend

424
linux/Makefile.am Normal file
View File

@@ -0,0 +1,424 @@
AUTOMAKE_OPTIONS = foreign
bin_PROGRAMS = ccextractor
ccextractor_SOURCES = \
../src/ccextractor.c \
../src/ccextractor.h \
../src/gpacmp4/avc_ext.c \
../src/gpacmp4/avilib.c \
../src/gpacmp4/av_parsers.c \
../src/gpacmp4/base_encoding.c \
../src/gpacmp4/bitstream.c \
../src/gpacmp4/box_code_3gpp.c \
../src/gpacmp4/box_code_adobe.c \
../src/gpacmp4/box_code_apple.c \
../src/gpacmp4/box_code_base.c \
../src/gpacmp4/box_code_drm.c \
../src/gpacmp4/box_code_meta.c \
../src/gpacmp4/box_funcs.c \
../src/gpacmp4/configfile.c \
../src/gpacmp4/data_map.c \
../src/gpacmp4/desc_private.c \
../src/gpacmp4/descriptors.c \
../src/gpacmp4/drm_sample.c \
../src/gpacmp4/error.c \
../src/gpacmp4/gpac_ogg.c \
../src/gpacmp4/hinting.c \
../src/gpacmp4/ipmpx_code.c \
../src/gpacmp4/ipmpx_parse.c \
../src/gpacmp4/isom_intern.c \
../src/gpacmp4/isom_read.c \
../src/gpacmp4/isom_store.c \
../src/gpacmp4/isom_write.c \
../src/gpacmp4/list.c \
../src/gpacmp4/math.c \
../src/gpacmp4/media.c \
../src/gpacmp4/media_odf.c \
../src/gpacmp4/meta.c \
../src/gpacmp4/movie_fragments.c \
../src/gpacmp4/mp4.c \
../src/gpacmp4/odf_code.c \
../src/gpacmp4/odf_codec.c \
../src/gpacmp4/odf_command.c \
../src/gpacmp4/os_config_init.c \
../src/gpacmp4/os_divers.c \
../src/gpacmp4/os_file.c \
../src/gpacmp4/qos.c \
../src/gpacmp4/sample_descs.c \
../src/gpacmp4/slc.c \
../src/gpacmp4/stbl_read.c \
../src/gpacmp4/stbl_write.c \
../src/gpacmp4/track.c \
../src/gpacmp4/tx3g.c \
../src/gpacmp4/url.c \
../src/gpacmp4/utf.c \
../src/gpacmp4/gpac/avparse.h \
../src/gpacmp4/gpac/base_coding.h \
../src/gpacmp4/gpac/bitstream.h \
../src/gpacmp4/gpac/config_file.h \
../src/gpacmp4/gpac/configuration.h \
../src/gpacmp4/gpac/constants.h \
../src/gpacmp4/gpac/events_constants.h \
../src/gpacmp4/gpac/ietf.h \
../src/gpacmp4/gpac/isomedia.h \
../src/gpacmp4/gpac/list.h \
../src/gpacmp4/gpac/math.h \
../src/gpacmp4/gpac/media_tools.h \
../src/gpacmp4/gpac/mpeg4_odf.h \
../src/gpacmp4/gpac/network.h \
../src/gpacmp4/gpac/revision.h \
../src/gpacmp4/gpac/setup.h \
../src/gpacmp4/gpac/tools.h \
../src/gpacmp4/gpac/utf.h \
../src/gpacmp4/gpac/version.h \
../src/gpacmp4/gpac/internal/avilib.h \
../src/gpacmp4/gpac/internal/isomedia_dev.h \
../src/gpacmp4/gpac/internal/media_dev.h \
../src/gpacmp4/gpac/internal/odf_dev.h \
../src/gpacmp4/gpac/internal/odf_parse_common.h \
../src/gpacmp4/gpac/internal/ogg.h \
../src/libpng/pngstruct.h \
../src/libpng/pngpriv.h \
../src/libpng/pnginfo.h \
../src/libpng/pnglibconf.h \
../src/libpng/pngconf.h \
../src/libpng/pngdebug.h \
../src/libpng/png.h \
../src/libpng/png.c \
../src/libpng/pngerror.c \
../src/libpng/pngget.c \
../src/libpng/pngmem.c \
../src/libpng/pngpread.c \
../src/libpng/pngread.c \
../src/libpng/pngrio.c \
../src/libpng/pngrtran.c \
../src/libpng/pngrutil.c \
../src/libpng/pngset.c \
../src/libpng/pngtrans.c \
../src/libpng/pngwio.c \
../src/libpng/pngwrite.c \
../src/libpng/pngwtran.c \
../src/libpng/pngwutil.c \
../src/lib_ccx/ccx_common_common.h \
../src/lib_ccx/ccx_common_option.h \
../src/lib_ccx/utility.h \
../src/lib_ccx/activity.h \
../src/lib_ccx/asf_constants.h \
../src/lib_ccx/avc_functions.h \
../src/lib_ccx/bitstream.h \
../src/lib_ccx/ccx_common_option.c \
../src/lib_ccx/ccx_common_common.c \
../src/lib_ccx/utility.c \
../src/lib_ccx/activity.c \
../src/lib_ccx/asf_functions.c \
../src/lib_ccx/avc_functions.c \
../src/lib_ccx/cc_bitstream.c \
../src/lib_ccx/ccx_common_char_encoding.c \
../src/lib_ccx/ccx_common_char_encoding.h \
../src/lib_ccx/ccx_common_constants.c \
../src/lib_ccx/ccx_common_constants.h \
../src/lib_ccx/ccx_common_platform.h \
../src/lib_ccx/ccx_common_structs.h \
../src/lib_ccx/ccx_common_timing.c \
../src/lib_ccx/ccx_common_timing.h \
../src/lib_ccx/ccx_decoders_608.c \
../src/lib_ccx/ccx_decoders_608.h \
../src/lib_ccx/ccx_decoders_708.c \
../src/lib_ccx/ccx_decoders_708_encoding.c \
../src/lib_ccx/ccx_decoders_708_encoding.h \
../src/lib_ccx/ccx_decoders_708.h \
../src/lib_ccx/ccx_decoders_708_output.c \
../src/lib_ccx/ccx_decoders_708_output.h \
../src/lib_ccx/ccx_decoders_common.c \
../src/lib_ccx/ccx_decoders_common.h \
../src/lib_ccx/ccx_decoders_isdb.c \
../src/lib_ccx/ccx_decoders_isdb.h \
../src/lib_ccx/ccx_decoders_structs.h \
../src/lib_ccx/ccx_decoders_vbi.c \
../src/lib_ccx/ccx_decoders_vbi.h \
../src/lib_ccx/ccx_decoders_xds.c \
../src/lib_ccx/ccx_decoders_xds.h \
../src/lib_ccx/ccx_demuxer.c \
../src/lib_ccx/ccx_demuxer.h \
../src/lib_ccx/ccx_demuxer_mxf.c \
../src/lib_ccx/ccx_demuxer_mxf.h \
../src/lib_ccx/ccx_dtvcc.c \
../src/lib_ccx/ccx_dtvcc.h \
../src/lib_ccx/ccx_encoders_common.c \
../src/lib_ccx/ccx_encoders_common.h \
../src/lib_ccx/ccx_encoders_curl.c \
../src/lib_ccx/ccx_encoders_g608.c \
../src/lib_ccx/ccx_encoders_helpers.c \
../src/lib_ccx/ccx_encoders_helpers.h \
../src/lib_ccx/ccx_encoders_python.c \
../src/lib_ccx/ccx_encoders_sami.c \
../src/lib_ccx/ccx_encoders_smptett.c \
../src/lib_ccx/ccx_encoders_splitbysentence.c \
../src/lib_ccx/ccx_encoders_spupng.c \
../src/lib_ccx/ccx_encoders_srt.c \
../src/lib_ccx/ccx_encoders_ssa.c \
../src/lib_ccx/ccx_encoders_structs.h \
../src/lib_ccx/ccx_encoders_transcript.c \
../src/lib_ccx/ccx_encoders_webvtt.c \
../src/lib_ccx/ccx_encoders_xds.c \
../src/lib_ccx/ccx_encoders_xds.h \
../src/lib_ccx/ccx_gxf.c \
../src/lib_ccx/ccx_gxf.h \
../src/lib_ccx/ccx_mp4.h \
../src/lib_ccx/ccx_share.c \
../src/lib_ccx/ccx_share.h \
../src/lib_ccx/ccx_sub_entry_message.pb-c.c \
../src/lib_ccx/ccx_sub_entry_message.pb-c.h \
../src/lib_ccx/compile_info.h \
../src/lib_ccx/compile_info_real.h \
../src/lib_ccx/configuration.c \
../src/lib_ccx/configuration.h \
../src/lib_ccx/disable_warnings.h \
../src/lib_ccx/dvb_subtitle_decoder.c \
../src/lib_ccx/dvb_subtitle_decoder.h \
../src/lib_ccx/dvd_subtitle_decoder.c \
../src/lib_ccx/dvd_subtitle_decoder.h \
../src/lib_ccx/es_functions.c \
../src/lib_ccx/es_userdata.c \
../src/lib_ccx/ffmpeg_intgr.c \
../src/lib_ccx/ffmpeg_intgr.h \
../src/lib_ccx/file_buffer.h \
../src/lib_ccx/file_functions.c \
../src/lib_ccx/general_loop.c \
../src/lib_ccx/hamming.h \
../src/lib_ccx/hardsubx.c \
../src/lib_ccx/hardsubx_classifier.c \
../src/lib_ccx/hardsubx_decoder.c \
../src/lib_ccx/hardsubx.h \
../src/lib_ccx/hardsubx_imgops.c \
../src/lib_ccx/hardsubx_utility.c \
../src/lib_ccx/lib_ccx.c \
../src/lib_ccx/lib_ccx.h \
../src/lib_ccx/list.h \
../src/lib_ccx/matroska.c \
../src/lib_ccx/matroska.h \
../src/lib_ccx/myth.c \
../src/lib_ccx/networking.c \
../src/lib_ccx/networking.h \
../src/lib_ccx/ocr.c \
../src/lib_ccx/ocr.h \
../src/lib_ccx/output.c \
../src/lib_ccx/params.c \
../src/lib_ccx/params_dump.c \
../src/lib_ccx/sequencing.c \
../src/lib_ccx/stdintmsc.h \
../src/lib_ccx/stream_functions.c \
../src/lib_ccx/teletext.h \
../src/lib_ccx/telxcc.c \
../src/lib_ccx/ts_functions.c \
../src/lib_ccx/ts_functions.h \
../src/lib_ccx/ts_info.c \
../src/lib_ccx/ts_tables.c \
../src/lib_ccx/ts_tables_epg.c \
../src/lib_ccx/wtv_constants.h \
../src/lib_ccx/wtv_functions.c \
../src/zlib/adler32.c \
../src/zlib/compress.c \
../src/zlib/crc32.c \
../src/zlib/crc32.h \
../src/zlib/deflate.c \
../src/zlib/deflate.h \
../src/zlib/gzclose.c \
../src/zlib/gzguts.h \
../src/zlib/gzlib.c \
../src/zlib/gzread.c \
../src/zlib/gzwrite.c \
../src/zlib/infback.c \
../src/zlib/inffast.c \
../src/zlib/inffast.h \
../src/zlib/inffixed.h \
../src/zlib/inflate.c \
../src/zlib/inflate.h \
../src/zlib/inftrees.c \
../src/zlib/inftrees.h \
../src/zlib/trees.c \
../src/zlib/trees.h \
../src/zlib/uncompr.c \
../src/zlib/zconf.h \
../src/zlib/zlib.h \
../src/zlib/zutil.c \
../src/zlib/zutil.h \
../src/utf8proc/utf8proc.c \
../src/utf8proc/utf8proc.h \
../src/lib_hash/sha2.c \
../src/lib_hash/sha2.h \
../src/protobuf-c/protobuf-c.c \
../src/protobuf-c/protobuf-c.h \
../src/zvbi/bcd.h \
../src/zvbi/bit_slicer.c \
../src/zvbi/bit_slicer.h \
../src/zvbi/decoder.c \
../src/zvbi/macros.h \
../src/zvbi/misc.h \
../src/zvbi/raw_decoder.c \
../src/zvbi/raw_decoder.h \
../src/zvbi/sampling_par.c \
../src/zvbi/sampling_par.h \
../src/zvbi/sliced.h \
../src/zvbi/zvbi_decoder.h \
../src/extractors/extractor.c \
../src/extractors/extractor.h \
../src/wrappers/wrapper.c \
../src/wrappers/wrapper.h \
../src/freetype/autofit/autofit.c \
../src/freetype/base/ftbase.c \
../src/freetype/base/ftbbox.c \
../src/freetype/base/ftbdf.c \
../src/freetype/base/ftbitmap.c \
../src/freetype/base/ftcid.c \
../src/freetype/base/ftfntfmt.c \
../src/freetype/base/ftfstype.c \
../src/freetype/base/ftgasp.c \
../src/freetype/base/ftglyph.c \
../src/freetype/base/ftgxval.c \
../src/freetype/base/ftinit.c \
../src/freetype/base/ftlcdfil.c \
../src/freetype/base/ftmm.c \
../src/freetype/base/ftotval.c \
../src/freetype/base/ftpatent.c \
../src/freetype/base/ftpfr.c \
../src/freetype/base/ftstroke.c \
../src/freetype/base/ftsynth.c \
../src/freetype/base/ftsystem.c \
../src/freetype/base/fttype1.c \
../src/freetype/base/ftwinfnt.c \
../src/freetype/bdf/bdf.c \
../src/freetype/bzip2/ftbzip2.c \
../src/freetype/cache/ftcache.c \
../src/freetype/cff/cff.c \
../src/freetype/cid/type1cid.c \
../src/freetype/gzip/ftgzip.c \
../src/freetype/lzw/ftlzw.c \
../src/freetype/pcf/pcf.c \
../src/freetype/pfr/pfr.c \
../src/freetype/psaux/psaux.c \
../src/freetype/pshinter/pshinter.c \
../src/freetype/psnames/psnames.c \
../src/freetype/raster/raster.c \
../src/freetype/sfnt/sfnt.c \
../src/freetype/smooth/smooth.c \
../src/freetype/truetype/truetype.c \
../src/freetype/type1/type1.c \
../src/freetype/type42/type42.c \
../src/freetype/winfonts/winfnt.c
ccextractor_CFLAGS = -std=gnu99 -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY
ccextractor_CPPFLAGS =-I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi/ -I../src/lib_hash/ -I../src/protobuf-c/ -I../src/utf8proc/ -I../src/ -I../src/freetype/include/
ccextractor_LDADD=-lm
if SYS_IS_LINUX
ccextractor_CFLAGS += -O3 -s -DGPAC_CONFIG_LINUX
endif
if SYS_IS_MAC
ccextractor_CFLAGS += -DPAC_CONFIG_DARWIN -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek
ccextractor_LDADD += -liconv -lz
endif
if HARDSUBX_IS_ENABLED
ccextractor_CFLAGS += -DENABLE_HARDSUBX
ccextractor_CPPFLAGS+= ${libavcodec_CFLAGS}
ccextractor_CPPFLAGS+= ${libavformat_CFLAGS}
ccextractor_CPPFLAGS+= ${libavutil_CFALGS}
ccextractor_CPPFLAGS+= ${libswscale_CFLAGS}
AV_LIB = ${libavcodec_LIBS}
AV_LIB += ${libavformat_LIBS}
AV_LIB += ${libavutil_LIBS}
AV_LIB += ${libswscale_LIBS}
ccextractor_LDADD += $(AV_LIB)
endif
if OCR_IS_ENABLED
ccextractor_CFLAGS += -DENABLE_OCR -DPN3G_NO_CONFIG_H
LEPT_LIB = ${lept_LIBS}
LEPT_CPPFLAG = ${lept_CFLAGS}
if TESSERACT_PRESENT
TESS_LIB = ${tesseract_LIBS}
TESS_CPPFLAG = ${tesseract_CFLAGS}
else
#fix for raspberry pi not having a pkgconfig file for tesseract
if TESSERACT_PRESENT_RPI
TESS_LIB = -ltesseract
TESS_CPPFLAG = -I/usr/include/tesseract
endif
endif
ccextractor_CPPFLAGS += $(TESS_CPPFLAG)
ccextractor_CPPFLAGS += $(LEPT_CPPFLAG)
ccextractor_LDADD += $(TESS_LIB)
ccextractor_LDADD += $(LEPT_LIB)
endif
EXTRA_DIST = ../src/gpacmp4/gpac/sync_layer.h ../src/lib_ccx/ccfont2.xbm ../src/utf8proc/utf8proc_data.c fonts/ icon/
#For GUI
if BUILD_WITH_GUI
bin_PROGRAMS += ccextractorGUI
ccextractorGUI_SOURCES = \
../src/GUI/ccextractorGUI.c \
../src/GUI/ccextractorGUI.h \
../src/GUI/activity.c \
../src/GUI/activity.h \
../src/GUI/terminal.c \
../src/GUI/preview.c \
../src/GUI/preview.h \
../src/GUI/ccx_cli_thread.c \
../src/GUI/ccx_cli_thread.h \
../src/GUI/command_builder.c \
../src/GUI/command_builder.h \
../src/GUI/save_load_data.c \
../src/GUI/save_load_data.h \
../src/GUI/file_browser.c \
../src/GUI/file_browser.h \
../src/GUI/popups.c \
../src/GUI/popups.h \
../src/GUI/tabs.c \
../src/GUI/tabs.h \
../src/GUI/stb_image.h \
../src/GUI/nuklear_lib/nuklear.h \
../src/GUI/nuklear_lib/nuklear_glfw_gl2.h
ccextractorGUI_CFLAGS = -std=gnu99
ccextractorGUI_LDADD = ${glfw3_LIBS}
if SYS_IS_LINUX
ccextractorGUI_CFLAGS += -s -O3 -DUNIX
ccextractorGUI_CFLAGS += ${glew_CFLAGS}
ccextractorGUI_LDADD += ${glew_LIBS}
ccextractorGUI_LDADD += -lX11 -lXinerama -lXcursor -lXi -lXrandr -lXxf86vm -lm -ldl -lpthread
endif
if SYS_IS_MAC
ccextractorGUI_CFLAGS += -O3 -DUNIX
ccextractorGUI_CFLAGS += ${glew_CFLAGS}
ccextractorGUI_LDADD += ${glew_LIBS}
ccextractorGUI_LDFLAGS = -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
ccextractorGUI_LDADD += -lglfw -lm -L/usr/local/lib -lpthread
endif
if HARDSUBX_IS_ENABLED
if OCR_IS_ENABLED
ccextractorGUI_CFLAGS += -DENABLE_OCR
endif
endif
EXTRA_DIST += ../icon/ ../fonts/
endif

4
linux/autogen.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
./pre-build.sh
autoreconf -i

View File

@@ -1,6 +1,6 @@
#!/bin/bash
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR"
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc"
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DFT2_BUILD_LIBRARY"
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc -I../src/freetype/include"
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
@@ -9,8 +9,80 @@ SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
SRC_UTF8PROC="../src/utf8proc/utf8proc.c"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC"
SRC_FREETYPE="../src/freetype/autofit/autofit.c
../src/freetype/base/ftbase.c
../src/freetype/base/ftbbox.c
../src/freetype/base/ftbdf.c
../src/freetype/base/ftbitmap.c
../src/freetype/base/ftcid.c
../src/freetype/base/ftfntfmt.c
../src/freetype/base/ftfstype.c
../src/freetype/base/ftgasp.c
../src/freetype/base/ftglyph.c
../src/freetype/base/ftgxval.c
../src/freetype/base/ftinit.c
../src/freetype/base/ftlcdfil.c
../src/freetype/base/ftmm.c
../src/freetype/base/ftotval.c
../src/freetype/base/ftpatent.c
../src/freetype/base/ftpfr.c
../src/freetype/base/ftstroke.c
../src/freetype/base/ftsynth.c
../src/freetype/base/ftsystem.c
../src/freetype/base/fttype1.c
../src/freetype/base/ftwinfnt.c
../src/freetype/bdf/bdf.c
../src/freetype/bzip2/ftbzip2.c
../src/freetype/cache/ftcache.c
../src/freetype/cff/cff.c
../src/freetype/cid/type1cid.c
../src/freetype/gzip/ftgzip.c
../src/freetype/lzw/ftlzw.c
../src/freetype/pcf/pcf.c
../src/freetype/pfr/pfr.c
../src/freetype/psaux/psaux.c
../src/freetype/pshinter/pshinter.c
../src/freetype/psnames/psnames.c
../src/freetype/raster/raster.c
../src/freetype/sfnt/sfnt.c
../src/freetype/smooth/smooth.c
../src/freetype/truetype/truetype.c
../src/freetype/type1/type1.c
../src/freetype/type42/type42.c
../src/freetype/winfonts/winfnt.c"
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $API_EXTRACTORS $SRC_FREETYPE"
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept"
./pre-build.sh
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER
out=$((LC_ALL=C gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER)2>&1)
res=$?
if [[ $out == *"gcc: command not found"* ]]
then
echo "Error: please install gcc";
exit 1
fi
if [[ $out == *"curl.h: No such file or directory"* ]]
then
echo "Error: please install curl development library (libcurl4-gnutls-dev for Debian/Ubuntu)";
exit 2
fi
if [[ $out == *"capi.h: No such file or directory"* ]]
then
echo "Error: please install tesseract development library (tesseract-ocr-dev for Debian/Ubuntu)";
exit 3
fi
if [[ $out == *"allheaders.h: No such file or directory"* ]]
then
echo "Error: please install leptonica development library (libleptonica-dev for Debian/Ubuntu)";
exit 4
fi
if [[ $res -ne 0 ]] # Unknown error
then
echo "Compiled with errors"
>&2 echo "$out"
exit 5
fi
echo "Compilation successful";

112
linux/build-static.sh Executable file
View File

@@ -0,0 +1,112 @@
#!/bin/sh -ex
####################################################################
# setup by tracey apr 2012
# updated version dec 2016
# see: http://www.ccextractor.org/doku.php
####################################################################
# build it static!
# simplest way is with linux alpine
# hop onto box with docker on it and cd to dir of the file you are staring at
# You will get a static-compiled binary and english language library file in the end.
if [ ! -e /tmp/cc/ccextractor-README.txt ]; then
rm -rf /tmp/cc;
mkdir -p -m777 /tmp/cc;
mkdir -p -m777 ../lib/tessdata/;
cp ccextractor-README.txt /tmp/cc/;
sudo docker run -v /tmp/cc:/tmp/cc --rm -it alpine:latest /tmp/cc/ccextractor-README.txt;
# NOTE: _AFTER_ testing/validating, you can promote it from "ccextractor.next" to "ccextractor"... ;-)
cp /tmp/cc/*traineddata ../lib/tessdata/;
chmod go-w ../lib/tessdata/;
exit 0;
fi
# NOW we are inside docker container...
cd /tmp/cc;
# we want tesseract (for OCR)
echo '
http://dl-cdn.alpinelinux.org/alpine/v3.5/main
http://dl-cdn.alpinelinux.org/alpine/v3.5/community
' >| /etc/apk/repositories;
apk update; apk upgrade;
apk add --update bash zsh alpine-sdk perl;
# (needed by various static builds below)
# Even though we're going to (re)builid tesseract from source statically, get its dependencies setup by
# installing it now, too.
apk add autoconf automake libtool tesseract-ocr-dev;
# Now comes the not-so-fun parts... Many packages _only_ provide .so files in their distros -- not the .a
# needed files for building something with it statically. Step through them now...
# libgif
wget https://sourceforge.net/projects/giflib/files/giflib-5.1.4.tar.gz;
zcat giflib*tar.gz | tar xf -;
cd giflib*/;
./configure --disable-shared --enable-static; make; make install;
hash -r;
cd -;
# libwebp
git clone https://github.com/webmproject/libwebp;
cd libwebp;
./autogen.sh;
./configure --disable-shared --enable-static; make; make install;
cd -;
# leptonica
wget http://www.leptonica.org/source/leptonica-1.73.tar.gz;
zcat leptonica*tar.gz | tar xf -;
cd leptonica*/;
./configure --disable-shared --enable-static; make; make install;
hash -r;
cd -;
# tesseract
git clone https://github.com/tesseract-ocr/tesseract;
cd tesseract;
./autogen.sh;
./configure --disable-shared --enable-static; make; make install;
cd -;
# ccextractor -- build static
git clone https://github.com/CCExtractor/ccextractor;
cd ccextractor/linux/;
# wget https://sourceforge.net/projects/ccextractor/files/ccextractor/0.82/ccextractor.src.0.82.zip;
# unzip ccextractor*.zip;
# cd ccextractor.*/linux/;
perl -i -pe 's/O3 /O3 -static /' Makefile;
# quick patch:
perl -i -pe 's/(strchr|strstr)\(/$1((char *)/' ../src/gpacmp4/url.c ../src/gpacmp4/error.c;
set +e; # this _will_ FAIL at the end..
make ENABLE_OCR=yes;
set -e;
# I confess hand-compiling (cherrypicking which .a to use when there are 2, etc.) is fragile...
# But it was the _only_ way I could get a fully static build after hours of thrashing...
gcc -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -O3 -std=gnu99 -s -DGPAC_CONFIG_LINUX -DENABLE_OCR -DPNG_NO_CONFIG_H -I/usr/local/include/tesseract -I/usr/local/include/leptonica objs/*.o -o ccextractor \
--static -lm \
/usr/local/lib/libtesseract.a \
/usr/local/lib/liblept.a \
/usr/local/lib/libgif.a \
/usr/local/lib/libwebp.a \
/usr/lib/libjpeg.a \
/usr/lib/libtiff.a \
/usr/lib/libgomp.a \
-lstdc++;
cp ccextractor /tmp/cc/ccextractor.next;
cd -;
# get english lang trained data
wget https://github.com/tesseract-ocr/tessdata/raw/master/eng.traineddata;

View File

@@ -1,6 +1,6 @@
#!/bin/bash
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DENABLE_HARDSUBX"
BLD_INCLUDE="-I../src -I /usr/local/include -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c"
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DENABLE_HARDSUBX -DFT2_BUILD_LIBRARY"
BLD_INCLUDE="-I../src -I /usr/local/include -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/freetype/include"
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
@@ -8,9 +8,52 @@ SRC_CCX="$(find ../src/lib_ccx/ -name '*.c')"
SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
SRC_UTF8="../src/utf8proc/utf8proc.c"
SRC_FREETYPE="../src/freetype/autofit/autofit.c
../src/freetype/base/ftbase.c
../src/freetype/base/ftbbox.c
../src/freetype/base/ftbdf.c
../src/freetype/base/ftbitmap.c
../src/freetype/base/ftcid.c
../src/freetype/base/ftfntfmt.c
../src/freetype/base/ftfstype.c
../src/freetype/base/ftgasp.c
../src/freetype/base/ftglyph.c
../src/freetype/base/ftgxval.c
../src/freetype/base/ftinit.c
../src/freetype/base/ftlcdfil.c
../src/freetype/base/ftmm.c
../src/freetype/base/ftotval.c
../src/freetype/base/ftpatent.c
../src/freetype/base/ftpfr.c
../src/freetype/base/ftstroke.c
../src/freetype/base/ftsynth.c
../src/freetype/base/ftsystem.c
../src/freetype/base/fttype1.c
../src/freetype/base/ftwinfnt.c
../src/freetype/bdf/bdf.c
../src/freetype/bzip2/ftbzip2.c
../src/freetype/cache/ftcache.c
../src/freetype/cff/cff.c
../src/freetype/cid/type1cid.c
../src/freetype/gzip/ftgzip.c
../src/freetype/lzw/ftlzw.c
../src/freetype/pcf/pcf.c
../src/freetype/pfr/pfr.c
../src/freetype/psaux/psaux.c
../src/freetype/pshinter/pshinter.c
../src/freetype/psnames/psnames.c
../src/freetype/raster/raster.c
../src/freetype/sfnt/sfnt.c
../src/freetype/smooth/smooth.c
../src/freetype/truetype/truetype.c
../src/freetype/type1/type1.c
../src/freetype/type42/type42.c
../src/freetype/winfonts/winfnt.c"
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
protobuf-c
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_UTF8 $SRC_PROTOBUF"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_UTF8 $SRC_PROTOBUF $API_WRAPPERS $API_EXTRACTORS $SRC_FREETYPE"
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept -L/usr/local/lib -lswscale -lavutil -pthread -lavformat -lavcodec -lxcb-shm -lxcb -lX11 -llzma -lz -lswresample"
./pre-build.sh

View File

@@ -1,6 +1,6 @@
#!/bin/bash
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR"
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc"
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DFT2_BUILD_LIBRARY"
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc -I../src/freetype/include"
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
@@ -9,8 +9,51 @@ SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
SRC_UTF8PROC="../src/utf8proc/utf8proc.c"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC"
SRC_FREETYPE="../src/freetype/autofit/autofit.c
../src/freetype/base/ftbase.c
../src/freetype/base/ftbbox.c
../src/freetype/base/ftbdf.c
../src/freetype/base/ftbitmap.c
../src/freetype/base/ftcid.c
../src/freetype/base/ftfntfmt.c
../src/freetype/base/ftfstype.c
../src/freetype/base/ftgasp.c
../src/freetype/base/ftglyph.c
../src/freetype/base/ftgxval.c
../src/freetype/base/ftinit.c
../src/freetype/base/ftlcdfil.c
../src/freetype/base/ftmm.c
../src/freetype/base/ftotval.c
../src/freetype/base/ftpatent.c
../src/freetype/base/ftpfr.c
../src/freetype/base/ftstroke.c
../src/freetype/base/ftsynth.c
../src/freetype/base/ftsystem.c
../src/freetype/base/fttype1.c
../src/freetype/base/ftwinfnt.c
../src/freetype/bdf/bdf.c
../src/freetype/bzip2/ftbzip2.c
../src/freetype/cache/ftcache.c
../src/freetype/cff/cff.c
../src/freetype/cid/type1cid.c
../src/freetype/gzip/ftgzip.c
../src/freetype/lzw/ftlzw.c
../src/freetype/pcf/pcf.c
../src/freetype/pfr/pfr.c
../src/freetype/psaux/psaux.c
../src/freetype/pshinter/pshinter.c
../src/freetype/psnames/psnames.c
../src/freetype/raster/raster.c
../src/freetype/sfnt/sfnt.c
../src/freetype/smooth/smooth.c
../src/freetype/truetype/truetype.c
../src/freetype/type1/type1.c
../src/freetype/type42/type42.c
../src/freetype/winfonts/winfnt.c"
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $API_EXTRACTORS $SRC_FREETYPE"
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept"
./pre-build.sh
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER
gcc -g $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER

4
linux/cleanup Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
make distclean > /dev/null 2>&1 || true
rm -rf Makefile configure *.in config.status config.log aclocal.m4 build-conf autom4te.cache

120
linux/configure.ac Normal file
View File

@@ -0,0 +1,120 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([CCExtractor], [0.86], [carlos@ccextractor.org])
AC_CONFIG_AUX_DIR([build-conf])
AC_CONFIG_SRCDIR([../src/ccextractor.c])
AM_INIT_AUTOMAKE([foreign subdir-objects])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
#Checks for "pkg-config" utility
AC_MSG_CHECKING([pkg-config m4 macros])
if test m4_ifdef([PKG_CHECK_MODULES], [yes], [no]) == yes; then
AC_MSG_RESULT([yes]);
else
AC_MSG_RESULT([no]);
AC_MSG_ERROR([
pkg-config is required.])
fi
# Checks for libraries.
AC_CHECK_LIB([m], [sin], [], [AC_MSG_ERROR(Math library not installed. Install it before proceeding.)])
AC_CHECK_LIB([lept], [getLeptonicaVersion], [HAS_LEPT=1 && PKG_CHECK_MODULES([lept], [lept])], [HAS_LEPT=0])
AC_CHECK_LIB([tesseract], [TessVersion], [HAS_TESSERACT=1 && PKG_CHECK_MODULES([tesseract], [tesseract])], [HAS_TESSERACT=0])
AC_CHECK_LIB([avcodec], [avcodec_version], [HAS_AVCODEC=1 && PKG_CHECK_MODULES([libavcodec], [libavcodec])], [HAS_AVCODEC=0])
AC_CHECK_LIB([avformat], [avformat_version], [HAS_AVFORMAT=1 && PKG_CHECK_MODULES([libavformat], [libavformat])], [HAS_AVFORMAT=0])
AC_CHECK_LIB([avutil], [avutil_version], [HAS_AVUTIL=1 && PKG_CHECK_MODULES([libavutil], [libavutil])], [HAS_AVUTIL=0])
AC_CHECK_LIB([swscale], [swscale_version], [HAS_SWSCALE=1 && PKG_CHECK_MODULES([libswscale], [libswscale])], [HAS_SWSCALE=0])
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h inttypes.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h termios.h unistd.h wchar.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_CHECK_TYPES([ptrdiff_t])
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FSEEKO
AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_FUNC_REALLOC
AC_FUNC_STRERROR_R
AC_CHECK_FUNCS([floor ftruncate gethostbyname gettimeofday inet_ntoa mblen memchr memmove memset mkdir modf pow realpath rmdir select setlocale socket sqrt strcasecmp strchr strdup strerror strndup strrchr strstr strtol])
# Checks for arguments with configure
AC_ARG_ENABLE([hardsubx],
AC_HELP_STRING([--enable-hardsubx], [Enables extraction of burnt subtitles (hard subtitles)]),
[case "${enableval}" in
yes) hardsubx=true ;;
no) hardsubx=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-hardsubx]) ;;
esac],[hardsubx=false])
AC_ARG_ENABLE([ocr],
AC_HELP_STRING([--enable-ocr], [Enables Optical Character Recognition]),
[case "${enableval}" in
yes) ocr=true ;;
no) ocr=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-ocr]) ;;
esac],[ocr=false])
AC_ARG_ENABLE([ffmpeg],
AC_HELP_STRING([--enable-ffmpeg], [Enable FFmpeg integration]),
[case "${enableval}" in
yes) ffmpeg=true ;;
no) ffmpeg=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-ffmpeg]) ;;
esac],[ffmpeg=false])
AC_ARG_WITH([gui],
AC_HELP_STRING([--with-gui], [Builds CCExtractor with GUI (requires GLFW and GLEW)]),
[PKG_CHECK_MODULES([glfw3], [glfw3]) && PKG_CHECK_MODULES([glew], [glew])],
[with_gui=no])
#Checks and prompts if libraries found/not found to avoild failure while building
AS_IF([ test x$hardsubx = xtrue && test $HAS_AVCODEC -gt 0 ], [AC_MSG_NOTICE(avcodec library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_AVCODEC -gt 0 ], [AC_MSG_ERROR(avcodec library not found. Please install the avcodec library before proceeding)])
AS_IF([ test x$hardsubx = xtrue && test $HAS_AVFORMAT -gt 0 ], [AC_MSG_NOTICE(avformat library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_AVFORMAT -gt 0 ], [AC_MSG_ERROR(avformat library not found. Please install the avformat library before proceeding)])
AS_IF([ test x$hardsubx = xtrue && test $HAS_AVUTIL -gt 0 ], [AC_MSG_NOTICE(avutil library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_AVUTIL -gt 0 ], [AC_MSG_ERROR(avutil library not found. Please install the avutil library before proceeding)])
AS_IF([ test x$hardsubx = xtrue && test $HAS_SWSCALE -gt 0 ], [AC_MSG_NOTICE(swscale library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_SWSCALE -gt 0 ], [AC_MSG_ERROR(swscale library not found. Please install the swscale library before proceeding)])
AS_IF([ (test x$ocr = xtrue || test x$hardsubx = xtrue) && test $HAS_TESSERACT -gt 0 ], [TESS_VERSION=`tesseract --version 2>&1 | grep tesseract` && AC_MSG_NOTICE(tesseract library found... $TESS_VERSION)])
AS_IF([ (test x$ocr = xtrue || test x$hardsubx = xtrue) && test ! $HAS_TESSERACT -gt 0 ], [AC_MSG_ERROR(tesserect library not found. Please install the tesseract library before proceeding)])
AS_IF([ (test x$ocr = xtrue || test x$hardsubx = xtrue) && test $HAS_LEPT -gt 0 ], [LEPT_VERSION=`tesseract --version 2>&1 | grep leptonica` && AC_MSG_NOTICE(leptonica library found... $LEPT_VERSION)])
AS_IF([ (test x$ocr = xtrue || test x$hardsubx = xtrue) && test ! $HAS_LEPT -gt 0 ], [AC_MSG_ERROR(leptonica library not found. Please install the leptonica library before proceeding)])
#AM_CONDITIONAL(s) for setting values to enable/disable flags in Makefile.am
AM_CONDITIONAL(HARDSUBX_IS_ENABLED, [ test x$hardsubx = xtrue ])
AM_CONDITIONAL(OCR_IS_ENABLED, [ test x$ocr = xtrue || test x$hardsubx = xtrue ])
AM_CONDITIONAL(FFMPEG_IS_ENABLED, [ test x$ffmpeg = xtrue ])
AM_CONDITIONAL(TESSERACT_PRESENT, [ test ! -z `pkg-config --libs-only-l --silence-errors tesseract` ])
AM_CONDITIONAL(TESSERACT_PRESENT_RPI, [ test -d "/usr/include/tesseract" && test `ls -A /usr/include/tesseract | wc -l` -gt 0 ])
AM_CONDITIONAL(SYS_IS_LINUX, [ test `uname -s` = "Linux"])
AM_CONDITIONAL(SYS_IS_MAC, [ test `uname -s` = "Darwin"])
AM_CONDITIONAL(BUILD_WITH_GUI, [test "x$with_gui" = "xyes"])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

1
linux/description-pak Normal file
View File

@@ -0,0 +1 @@
Best open source tool for a subtitled world

14
linux/module_generator Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
SRC_CCX="$(find ../src/lib_ccx/ -name '*.c')"
SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
SRC_UTF8PROC="../src/utf8proc/utf8proc.c"
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
BLD_SOURCES="../src/ccextractor.c ../src/ccextractorapi_wrap.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $API_EXTRACTORS"
python setup.py $BLD_SOURCES

View File

@@ -30,5 +30,5 @@ echo "#define CCX_CCEXTRACTOR_COMPILE_REAL_H" >> ../src/lib_ccx/compile_info_rea
echo "#define GIT_COMMIT \"$commit\"" >> ../src/lib_ccx/compile_info_real.h
echo "#define COMPILE_DATE \"$builddate\"" >> ../src/lib_ccx/compile_info_real.h
echo "#endif" >> ../src/lib_ccx/compile_info_real.h
echo "Stored all in compile.h"
echo "Stored all in compile_info_real.h"
echo "Done."

425
mac/Makefile.am Normal file
View File

@@ -0,0 +1,425 @@
AUTOMAKE_OPTIONS = foreign
bin_PROGRAMS = ccextractor
ccextractor_SOURCES = \
../src/ccextractor.c \
../src/ccextractor.h \
../src/gpacmp4/avc_ext.c \
../src/gpacmp4/avilib.c \
../src/gpacmp4/av_parsers.c \
../src/gpacmp4/base_encoding.c \
../src/gpacmp4/bitstream.c \
../src/gpacmp4/box_code_3gpp.c \
../src/gpacmp4/box_code_adobe.c \
../src/gpacmp4/box_code_apple.c \
../src/gpacmp4/box_code_base.c \
../src/gpacmp4/box_code_drm.c \
../src/gpacmp4/box_code_meta.c \
../src/gpacmp4/box_funcs.c \
../src/gpacmp4/configfile.c \
../src/gpacmp4/data_map.c \
../src/gpacmp4/desc_private.c \
../src/gpacmp4/descriptors.c \
../src/gpacmp4/drm_sample.c \
../src/gpacmp4/error.c \
../src/gpacmp4/gpac_ogg.c \
../src/gpacmp4/hinting.c \
../src/gpacmp4/ipmpx_code.c \
../src/gpacmp4/ipmpx_parse.c \
../src/gpacmp4/isom_intern.c \
../src/gpacmp4/isom_read.c \
../src/gpacmp4/isom_store.c \
../src/gpacmp4/isom_write.c \
../src/gpacmp4/list.c \
../src/gpacmp4/math.c \
../src/gpacmp4/media.c \
../src/gpacmp4/media_odf.c \
../src/gpacmp4/meta.c \
../src/gpacmp4/movie_fragments.c \
../src/gpacmp4/mp4.c \
../src/gpacmp4/odf_code.c \
../src/gpacmp4/odf_codec.c \
../src/gpacmp4/odf_command.c \
../src/gpacmp4/os_config_init.c \
../src/gpacmp4/os_divers.c \
../src/gpacmp4/os_file.c \
../src/gpacmp4/qos.c \
../src/gpacmp4/sample_descs.c \
../src/gpacmp4/slc.c \
../src/gpacmp4/stbl_read.c \
../src/gpacmp4/stbl_write.c \
../src/gpacmp4/track.c \
../src/gpacmp4/tx3g.c \
../src/gpacmp4/url.c \
../src/gpacmp4/utf.c \
../src/gpacmp4/gpac/avparse.h \
../src/gpacmp4/gpac/base_coding.h \
../src/gpacmp4/gpac/bitstream.h \
../src/gpacmp4/gpac/config_file.h \
../src/gpacmp4/gpac/configuration.h \
../src/gpacmp4/gpac/constants.h \
../src/gpacmp4/gpac/events_constants.h \
../src/gpacmp4/gpac/ietf.h \
../src/gpacmp4/gpac/isomedia.h \
../src/gpacmp4/gpac/list.h \
../src/gpacmp4/gpac/math.h \
../src/gpacmp4/gpac/media_tools.h \
../src/gpacmp4/gpac/mpeg4_odf.h \
../src/gpacmp4/gpac/network.h \
../src/gpacmp4/gpac/revision.h \
../src/gpacmp4/gpac/setup.h \
../src/gpacmp4/gpac/tools.h \
../src/gpacmp4/gpac/utf.h \
../src/gpacmp4/gpac/version.h \
../src/gpacmp4/gpac/internal/avilib.h \
../src/gpacmp4/gpac/internal/isomedia_dev.h \
../src/gpacmp4/gpac/internal/media_dev.h \
../src/gpacmp4/gpac/internal/odf_dev.h \
../src/gpacmp4/gpac/internal/odf_parse_common.h \
../src/gpacmp4/gpac/internal/ogg.h \
../src/libpng/pngstruct.h \
../src/libpng/pngpriv.h \
../src/libpng/pnginfo.h \
../src/libpng/pnglibconf.h \
../src/libpng/pngconf.h \
../src/libpng/pngdebug.h \
../src/libpng/png.h \
../src/libpng/png.c \
../src/libpng/pngerror.c \
../src/libpng/pngget.c \
../src/libpng/pngmem.c \
../src/libpng/pngpread.c \
../src/libpng/pngread.c \
../src/libpng/pngrio.c \
../src/libpng/pngrtran.c \
../src/libpng/pngrutil.c \
../src/libpng/pngset.c \
../src/libpng/pngtrans.c \
../src/libpng/pngwio.c \
../src/libpng/pngwrite.c \
../src/libpng/pngwtran.c \
../src/libpng/pngwutil.c \
../src/lib_ccx/ccx_common_common.h \
../src/lib_ccx/ccx_common_option.h \
../src/lib_ccx/utility.h \
../src/lib_ccx/activity.h \
../src/lib_ccx/asf_constants.h \
../src/lib_ccx/avc_functions.h \
../src/lib_ccx/bitstream.h \
../src/lib_ccx/ccx_common_option.c \
../src/lib_ccx/ccx_common_common.c \
../src/lib_ccx/utility.c \
../src/lib_ccx/activity.c \
../src/lib_ccx/asf_functions.c \
../src/lib_ccx/avc_functions.c \
../src/lib_ccx/cc_bitstream.c \
../src/lib_ccx/ccx_common_char_encoding.c \
../src/lib_ccx/ccx_common_char_encoding.h \
../src/lib_ccx/ccx_common_constants.c \
../src/lib_ccx/ccx_common_constants.h \
../src/lib_ccx/ccx_common_platform.h \
../src/lib_ccx/ccx_common_structs.h \
../src/lib_ccx/ccx_common_timing.c \
../src/lib_ccx/ccx_common_timing.h \
../src/lib_ccx/ccx_decoders_608.c \
../src/lib_ccx/ccx_decoders_608.h \
../src/lib_ccx/ccx_decoders_708.c \
../src/lib_ccx/ccx_decoders_708_encoding.c \
../src/lib_ccx/ccx_decoders_708_encoding.h \
../src/lib_ccx/ccx_decoders_708.h \
../src/lib_ccx/ccx_decoders_708_output.c \
../src/lib_ccx/ccx_decoders_708_output.h \
../src/lib_ccx/ccx_decoders_common.c \
../src/lib_ccx/ccx_decoders_common.h \
../src/lib_ccx/ccx_decoders_isdb.c \
../src/lib_ccx/ccx_decoders_isdb.h \
../src/lib_ccx/ccx_decoders_structs.h \
../src/lib_ccx/ccx_decoders_vbi.c \
../src/lib_ccx/ccx_decoders_vbi.h \
../src/lib_ccx/ccx_decoders_xds.c \
../src/lib_ccx/ccx_decoders_xds.h \
../src/lib_ccx/ccx_demuxer.c \
../src/lib_ccx/ccx_demuxer.h \
../src/lib_ccx/ccx_demuxer_mxf.c \
../src/lib_ccx/ccx_demuxer_mxf.h \
../src/lib_ccx/ccx_dtvcc.c \
../src/lib_ccx/ccx_dtvcc.h \
../src/lib_ccx/ccx_encoders_common.c \
../src/lib_ccx/ccx_encoders_common.h \
../src/lib_ccx/ccx_encoders_curl.c \
../src/lib_ccx/ccx_encoders_g608.c \
../src/lib_ccx/ccx_encoders_helpers.c \
../src/lib_ccx/ccx_encoders_helpers.h \
../src/lib_ccx/ccx_encoders_python.c \
../src/lib_ccx/ccx_encoders_sami.c \
../src/lib_ccx/ccx_encoders_smptett.c \
../src/lib_ccx/ccx_encoders_splitbysentence.c \
../src/lib_ccx/ccx_encoders_spupng.c \
../src/lib_ccx/ccx_encoders_srt.c \
../src/lib_ccx/ccx_encoders_ssa.c \
../src/lib_ccx/ccx_encoders_structs.h \
../src/lib_ccx/ccx_encoders_transcript.c \
../src/lib_ccx/ccx_encoders_webvtt.c \
../src/lib_ccx/ccx_encoders_xds.c \
../src/lib_ccx/ccx_encoders_xds.h \
../src/lib_ccx/ccx_gxf.c \
../src/lib_ccx/ccx_gxf.h \
../src/lib_ccx/ccx_mp4.h \
../src/lib_ccx/ccx_share.c \
../src/lib_ccx/ccx_share.h \
../src/lib_ccx/ccx_sub_entry_message.pb-c.c \
../src/lib_ccx/ccx_sub_entry_message.pb-c.h \
../src/lib_ccx/compile_info.h \
../src/lib_ccx/compile_info_real.h \
../src/lib_ccx/configuration.c \
../src/lib_ccx/configuration.h \
../src/lib_ccx/disable_warnings.h \
../src/lib_ccx/dvb_subtitle_decoder.c \
../src/lib_ccx/dvb_subtitle_decoder.h \
../src/lib_ccx/dvd_subtitle_decoder.c \
../src/lib_ccx/dvd_subtitle_decoder.h \
../src/lib_ccx/es_functions.c \
../src/lib_ccx/es_userdata.c \
../src/lib_ccx/ffmpeg_intgr.c \
../src/lib_ccx/ffmpeg_intgr.h \
../src/lib_ccx/file_buffer.h \
../src/lib_ccx/file_functions.c \
../src/lib_ccx/general_loop.c \
../src/lib_ccx/hamming.h \
../src/lib_ccx/hardsubx.c \
../src/lib_ccx/hardsubx_classifier.c \
../src/lib_ccx/hardsubx_decoder.c \
../src/lib_ccx/hardsubx.h \
../src/lib_ccx/hardsubx_imgops.c \
../src/lib_ccx/hardsubx_utility.c \
../src/lib_ccx/lib_ccx.c \
../src/lib_ccx/lib_ccx.h \
../src/lib_ccx/list.h \
../src/lib_ccx/matroska.c \
../src/lib_ccx/matroska.h \
../src/lib_ccx/myth.c \
../src/lib_ccx/networking.c \
../src/lib_ccx/networking.h \
../src/lib_ccx/ocr.c \
../src/lib_ccx/ocr.h \
../src/lib_ccx/output.c \
../src/lib_ccx/params.c \
../src/lib_ccx/params_dump.c \
../src/lib_ccx/sequencing.c \
../src/lib_ccx/stdintmsc.h \
../src/lib_ccx/stream_functions.c \
../src/lib_ccx/teletext.h \
../src/lib_ccx/telxcc.c \
../src/lib_ccx/ts_functions.c \
../src/lib_ccx/ts_functions.h \
../src/lib_ccx/ts_info.c \
../src/lib_ccx/ts_tables.c \
../src/lib_ccx/ts_tables_epg.c \
../src/lib_ccx/wtv_constants.h \
../src/lib_ccx/wtv_functions.c \
../src/zlib/adler32.c \
../src/zlib/compress.c \
../src/zlib/crc32.c \
../src/zlib/crc32.h \
../src/zlib/deflate.c \
../src/zlib/deflate.h \
../src/zlib/gzclose.c \
../src/zlib/gzguts.h \
../src/zlib/gzlib.c \
../src/zlib/gzread.c \
../src/zlib/gzwrite.c \
../src/zlib/infback.c \
../src/zlib/inffast.c \
../src/zlib/inffast.h \
../src/zlib/inffixed.h \
../src/zlib/inflate.c \
../src/zlib/inflate.h \
../src/zlib/inftrees.c \
../src/zlib/inftrees.h \
../src/zlib/trees.c \
../src/zlib/trees.h \
../src/zlib/uncompr.c \
../src/zlib/zconf.h \
../src/zlib/zlib.h \
../src/zlib/zutil.c \
../src/zlib/zutil.h \
../src/utf8proc/utf8proc.c \
../src/utf8proc/utf8proc.h \
../src/lib_hash/sha2.c \
../src/lib_hash/sha2.h \
../src/protobuf-c/protobuf-c.c \
../src/protobuf-c/protobuf-c.h \
../src/zvbi/bcd.h \
../src/zvbi/bit_slicer.c \
../src/zvbi/bit_slicer.h \
../src/zvbi/decoder.c \
../src/zvbi/macros.h \
../src/zvbi/misc.h \
../src/zvbi/raw_decoder.c \
../src/zvbi/raw_decoder.h \
../src/zvbi/sampling_par.c \
../src/zvbi/sampling_par.h \
../src/zvbi/sliced.h \
../src/zvbi/zvbi_decoder.h \
../src/extractors/extractor.c \
../src/extractors/extractor.h \
../src/wrappers/wrapper.c \
../src/wrappers/wrapper.h \
../src/freetype/autofit/autofit.c \
../src/freetype/base/ftbase.c \
../src/freetype/base/ftbbox.c \
../src/freetype/base/ftbdf.c \
../src/freetype/base/ftbitmap.c \
../src/freetype/base/ftcid.c \
../src/freetype/base/ftfntfmt.c \
../src/freetype/base/ftfstype.c \
../src/freetype/base/ftgasp.c \
../src/freetype/base/ftglyph.c \
../src/freetype/base/ftgxval.c \
../src/freetype/base/ftinit.c \
../src/freetype/base/ftlcdfil.c \
../src/freetype/base/ftmm.c \
../src/freetype/base/ftotval.c \
../src/freetype/base/ftpatent.c \
../src/freetype/base/ftpfr.c \
../src/freetype/base/ftstroke.c \
../src/freetype/base/ftsynth.c \
../src/freetype/base/ftsystem.c \
../src/freetype/base/fttype1.c \
../src/freetype/base/ftwinfnt.c \
../src/freetype/bdf/bdf.c \
../src/freetype/bzip2/ftbzip2.c \
../src/freetype/cache/ftcache.c \
../src/freetype/cff/cff.c \
../src/freetype/cid/type1cid.c \
../src/freetype/gzip/ftgzip.c \
../src/freetype/lzw/ftlzw.c \
../src/freetype/pcf/pcf.c \
../src/freetype/pfr/pfr.c \
../src/freetype/psaux/psaux.c \
../src/freetype/pshinter/pshinter.c \
../src/freetype/psnames/psnames.c \
../src/freetype/raster/raster.c \
../src/freetype/sfnt/sfnt.c \
../src/freetype/smooth/smooth.c \
../src/freetype/truetype/truetype.c \
../src/freetype/type1/type1.c \
../src/freetype/type42/type42.c \
../src/freetype/winfonts/winfnt.c
ccextractor_CFLAGS = -std=gnu99 -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY
ccextractor_CPPFLAGS =-I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi/ -I../src/lib_hash/ -I../src/protobuf-c/ -I../src/utf8proc/ -I../src/ -I../src/freetype/include/
ccextractor_LDADD=-lm
if SYS_IS_LINUX
ccextractor_CFLAGS += -O3 -s -DGPAC_CONFIG_LINUX
endif
if SYS_IS_MAC
ccextractor_CFLAGS += -DPAC_CONFIG_DARWIN -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek
ccextractor_LDADD += -liconv -lz
endif
if HARDSUBX_IS_ENABLED
ccextractor_CFLAGS += -DENABLE_HARDSUBX
ccextractor_CPPFLAGS+= ${libavcodec_CFLAGS}
ccextractor_CPPFLAGS+= ${libavformat_CFLAGS}
ccextractor_CPPFLAGS+= ${libavutil_CFALGS}
ccextractor_CPPFLAGS+= ${libswscale_CFLAGS}
AV_LIB = ${libavcodec_LIBS}
AV_LIB += ${libavformat_LIBS}
AV_LIB += ${libavutil_LIBS}
AV_LIB += ${libswscale_LIBS}
ccextractor_LDADD += $(AV_LIB)
endif
if OCR_IS_ENABLED
ccextractor_CFLAGS += -DENABLE_OCR -DPN3G_NO_CONFIG_H
LEPT_LIB = ${lept_LIBS}
LEPT_CPPFLAG = ${lept_CFLAGS}
if TESSERACT_PRESENT
TESS_LIB = ${tesseract_LIBS}
TESS_CPPFLAG = ${tesseract_CFLAGS}
else
#fix for raspberry pi not having a pkgconfig file for tesseract
if TESSERACT_PRESENT_RPI
TESS_LIB = -ltesseract
TESS_CPPFLAG = -I/usr/include/tesseract
endif
endif
ccextractor_CPPFLAGS += $(TESS_CPPFLAG)
ccextractor_CPPFLAGS += $(LEPT_CPPFLAG)
ccextractor_LDADD += $(TESS_LIB)
ccextractor_LDADD += $(LEPT_LIB)
endif
EXTRA_DIST = ../src/gpacmp4/gpac/sync_layer.h ../src/lib_ccx/ccfont2.xbm ../src/utf8proc/utf8proc_data.c fonts/ icon/
#For GUI
if BUILD_WITH_GUI
bin_PROGRAMS += ccextractorGUI
ccextractorGUI_SOURCES = \
../src/GUI/ccextractorGUI.c \
../src/GUI/ccextractorGUI.h \
../src/GUI/activity.c \
../src/GUI/activity.h \
../src/GUI/terminal.c \
../src/GUI/preview.c \
../src/GUI/preview.h \
../src/GUI/ccx_cli_thread.c \
../src/GUI/ccx_cli_thread.h \
../src/GUI/command_builder.c \
../src/GUI/command_builder.h \
../src/GUI/save_load_data.c \
../src/GUI/save_load_data.h \
../src/GUI/file_browser.c \
../src/GUI/file_browser.h \
../src/GUI/popups.c \
../src/GUI/popups.h \
../src/GUI/tabs.c \
../src/GUI/tabs.h \
../src/GUI/stb_image.h \
../src/GUI/nuklear_lib/nuklear.h \
../src/GUI/nuklear_lib/nuklear_glfw_gl2.h
ccextractorGUI_CFLAGS = -std=gnu99
ccextractorGUI_LDADD = ${glfw3_LIBS}
if SYS_IS_LINUX
ccextractorGUI_CFLAGS += -s -O3 -DUNIX
ccextractorGUI_CFLAGS += ${glew_CFLAGS}
ccextractorGUI_LDADD += ${glew_LIBS}
ccextractorGUI_LDADD += -lX11 -lXinerama -lXcursor -lXi -lXrandr -lXxf86vm -lm -ldl -lpthread
endif
if SYS_IS_MAC
ccextractorGUI_CFLAGS += -O3 -DUNIX
ccextractorGUI_CFLAGS += ${glew_CFLAGS}
ccextractorGUI_LDADD += ${glew_LIBS}
ccextractorGUI_LDFLAGS = -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
ccextractorGUI_LDADD += -lm -L/usr/local/lib -lpthread
endif
if HARDSUBX_IS_ENABLED
if OCR_IS_ENABLED
ccextractorGUI_CFLAGS += -DENABLE_OCR
endif
endif
EXTRA_DIST += ../icon/ ../fonts/
endif

View File

@@ -1,8 +0,0 @@
Note: I don't currently have a Mac to test Mac builds. An effort is done to ensure that CCExtractor is portable,
which is why it compiles and works in Mac without any effort. But the build script (any of its 2 lines) is not
maintained. If it doesn't compile for this version please fix and send me the new file so I can add it to the
official version.
I know this sucks but I can't really do much more.
Carlos

4
mac/autogen.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
./pre-build.sh
autoreconf -i

View File

@@ -1,17 +1,63 @@
#!/bin/bash
cd `dirname $0`
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_DARWIN -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek"
BLD_INCLUDE="-I../src/ -I../src/lib_ccx -I../src/gpacmp4 -I../src/lib_hash -I../src/libpng -I../src/utf8proc -I../src/protobuf-c -I../src/zlib -I../src/zvbi"
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_DARWIN -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek -DFT2_BUILD_LIBRARY"
[[ $1 = "OCR" ]] && BLD_FLAGS="$BLD_FLAGS -DENABLE_OCR"
BLD_INCLUDE="-I../src/ -I../src/lib_ccx -I../src/gpacmp4 -I../src/lib_hash -I../src/libpng -I../src/utf8proc -I../src/protobuf-c -I../src/zlib -I../src/zvbi -I../src/freetype/include"
[[ $1 = "OCR" ]] && BLD_INCLUDE="$BLD_INCLUDE `pkg-config --cflags --silence-errors tesseract`"
SRC_CCX="$(find ../src/lib_ccx -name '*.c')"
SRC_GPAC="$(find ../src/gpacmp4 -name '*.c')"
SRC_LIB_HASH="$(find ../src/lib_hash -name '*.c')"
SRC_LIBPNG="$(find ../src/libpng -name '*.c')"
SRC_PROTOBUF="$(find ../src/protobuf-c -name '*.c')"
SRC_UTF8="$(find ../src/utf8proc-c -name '*.c')"
SRC_UTF8="../src/utf8proc/utf8proc.c"
SRC_ZLIB="$(find ../src/zlib -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi -name '*.c')"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_LIB_HASH $SRC_LIBPNG $SRC_PROTOBUF $SRC_UTF8 $SRC_ZLIB $SRC_ZVBI"
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
SRC_FREETYPE="../src/freetype/autofit/autofit.c \
../src/freetype/base/ftbase.c \
../src/freetype/base/ftbbox.c \
../src/freetype/base/ftbdf.c \
../src/freetype/base/ftbitmap.c \
../src/freetype/base/ftcid.c \
../src/freetype/base/ftfntfmt.c \
../src/freetype/base/ftfstype.c \
../src/freetype/base/ftgasp.c \
../src/freetype/base/ftglyph.c \
../src/freetype/base/ftgxval.c \
../src/freetype/base/ftinit.c \
../src/freetype/base/ftlcdfil.c \
../src/freetype/base/ftmm.c \
../src/freetype/base/ftotval.c \
../src/freetype/base/ftpatent.c \
../src/freetype/base/ftpfr.c \
../src/freetype/base/ftstroke.c \
../src/freetype/base/ftsynth.c \
../src/freetype/base/ftsystem.c \
../src/freetype/base/fttype1.c \
../src/freetype/base/ftwinfnt.c \
../src/freetype/bdf/bdf.c \
../src/freetype/bzip2/ftbzip2.c \
../src/freetype/cache/ftcache.c \
../src/freetype/cff/cff.c \
../src/freetype/cid/type1cid.c \
../src/freetype/gzip/ftgzip.c \
../src/freetype/lzw/ftlzw.c \
../src/freetype/pcf/pcf.c \
../src/freetype/pfr/pfr.c \
../src/freetype/psaux/psaux.c \
../src/freetype/pshinter/pshinter.c \
../src/freetype/psnames/psnames.c \
../src/freetype/raster/raster.c \
../src/freetype/sfnt/sfnt.c \
../src/freetype/smooth/smooth.c \
../src/freetype/truetype/truetype.c \
../src/freetype/type1/type1.c \
../src/freetype/type42/type42.c \
../src/freetype/winfonts/winfnt.c"
BLD_SOURCES="../src/ccextractor.c $SRC_API $SRC_CCX $SRC_GPAC $SRC_LIB_HASH $SRC_LIBPNG $SRC_PROTOBUF $SRC_UTF8 $SRC_ZLIB $SRC_ZVBI $SRC_FREETYPE $API_WRAPPERS $API_EXTRACTORS"
BLD_LINKER="-lm -liconv"
[[ $1 = "OCR" ]] && BLD_LINKER="$BLD_LINKER `pkg-config --libs --silence-errors tesseract` `pkg-config --libs --silence-errors lept`"
./pre-build.sh
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER

4
mac/cleanup Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
make distclean > /dev/null 2>&1 || true
rm -rf Makefile configure *.in config.status config.log aclocal.m4 build-conf autom4te.cache

120
mac/configure.ac Normal file
View File

@@ -0,0 +1,120 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([CCExtractor], [0.86], [carlos@ccextractor.org])
AC_CONFIG_AUX_DIR([build-conf])
AC_CONFIG_SRCDIR([../src/ccextractor.c])
AM_INIT_AUTOMAKE([foreign subdir-objects])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
#Checks for "pkg-config" utility
AC_MSG_CHECKING([pkg-config m4 macros])
if test m4_ifdef([PKG_CHECK_MODULES], [yes], [no]) == yes; then
AC_MSG_RESULT([yes]);
else
AC_MSG_RESULT([no]);
AC_MSG_ERROR([
pkg-config is required.])
fi
# Checks for libraries.
AC_CHECK_LIB([m], [sin], [], [AC_MSG_ERROR(Math library not installed. Install it before proceeding.)])
AC_CHECK_LIB([lept], [getLeptonicaVersion], [HAS_LEPT=1 && PKG_CHECK_MODULES([lept], [lept])], [HAS_LEPT=0])
AC_CHECK_LIB([tesseract], [TessVersion], [HAS_TESSERACT=1 && PKG_CHECK_MODULES([tesseract], [tesseract])], [HAS_TESSERACT=0])
AC_CHECK_LIB([avcodec], [avcodec_version], [HAS_AVCODEC=1 && PKG_CHECK_MODULES([libavcodec], [libavcodec])], [HAS_AVCODEC=0])
AC_CHECK_LIB([avformat], [avformat_version], [HAS_AVFORMAT=1 && PKG_CHECK_MODULES([libavformat], [libavformat])], [HAS_AVFORMAT=0])
AC_CHECK_LIB([avutil], [avutil_version], [HAS_AVUTIL=1 && PKG_CHECK_MODULES([libavutil], [libavutil])], [HAS_AVUTIL=0])
AC_CHECK_LIB([swscale], [swscale_version], [HAS_SWSCALE=1 && PKG_CHECK_MODULES([libswscale], [libswscale])], [HAS_SWSCALE=0])
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h inttypes.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h termios.h unistd.h wchar.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_CHECK_TYPES([ptrdiff_t])
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FSEEKO
AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_FUNC_REALLOC
AC_FUNC_STRERROR_R
AC_CHECK_FUNCS([floor ftruncate gethostbyname gettimeofday inet_ntoa mblen memchr memmove memset mkdir modf pow realpath rmdir select setlocale socket sqrt strcasecmp strchr strdup strerror strndup strrchr strstr strtol])
# Checks for arguments with configure
AC_ARG_ENABLE([hardsubx],
AC_HELP_STRING([--enable-hardsubx], [Enables extraction of burnt subtitles (hard subtitles)]),
[case "${enableval}" in
yes) hardsubx=true ;;
no) hardsubx=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-hardsubx]) ;;
esac],[hardsubx=false])
AC_ARG_ENABLE([ocr],
AC_HELP_STRING([--enable-ocr], [Enables Optical Character Recognition]),
[case "${enableval}" in
yes) ocr=true ;;
no) ocr=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-ocr]) ;;
esac],[ocr=false])
AC_ARG_ENABLE([ffmpeg],
AC_HELP_STRING([--enable-ffmpeg], [Enable FFmpeg integration]),
[case "${enableval}" in
yes) ffmpeg=true ;;
no) ffmpeg=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-ffmpeg]) ;;
esac],[ffmpeg=false])
AC_ARG_WITH([gui],
AC_HELP_STRING([--with-gui], [Builds CCExtractor with GUI (requires GLFW and GLEW)]),
[PKG_CHECK_MODULES([glfw3], [glfw3]) && PKG_CHECK_MODULES([glew], [glew])],
[with_gui=no])
#Checks and prompts if libraries found/not found to avoild failure while building
AS_IF([ test x$hardsubx = xtrue && test $HAS_AVCODEC -gt 0 ], [AC_MSG_NOTICE(avcodec library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_AVCODEC -gt 0 ], [AC_MSG_ERROR(avcodec library not found. Please install the avcodec library before proceeding)])
AS_IF([ test x$hardsubx = xtrue && test $HAS_AVFORMAT -gt 0 ], [AC_MSG_NOTICE(avformat library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_AVFORMAT -gt 0 ], [AC_MSG_ERROR(avformat library not found. Please install the avformat library before proceeding)])
AS_IF([ test x$hardsubx = xtrue && test $HAS_AVUTIL -gt 0 ], [AC_MSG_NOTICE(avutil library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_AVUTIL -gt 0 ], [AC_MSG_ERROR(avutil library not found. Please install the avutil library before proceeding)])
AS_IF([ test x$hardsubx = xtrue && test $HAS_SWSCALE -gt 0 ], [AC_MSG_NOTICE(swscale library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_SWSCALE -gt 0 ], [AC_MSG_ERROR(swscale library not found. Please install the swscale library before proceeding)])
AS_IF([ (test x$ocr = xtrue || test x$hardsubx = xtrue) && test $HAS_TESSERACT -gt 0 ], [TESS_VERSION=`tesseract --version 2>&1 | grep tesseract` && AC_MSG_NOTICE(tesseract library found... $TESS_VERSION)])
AS_IF([ (test x$ocr = xtrue || test x$hardsubx = xtrue) && test ! $HAS_TESSERACT -gt 0 ], [AC_MSG_ERROR(tesserect library not found. Please install the tesseract library before proceeding)])
AS_IF([ (test x$ocr = xtrue || test x$hardsubx = xtrue) && test $HAS_LEPT -gt 0 ], [LEPT_VERSION=`tesseract --version 2>&1 | grep leptonica` && AC_MSG_NOTICE(leptonica library found... $LEPT_VERSION)])
AS_IF([ (test x$ocr = xtrue || test x$hardsubx = xtrue) && test ! $HAS_LEPT -gt 0 ], [AC_MSG_ERROR(leptonica library not found. Please install the leptonica library before proceeding)])
#AM_CONDITIONAL(s) for setting values to enable/disable flags in Makefile.am
AM_CONDITIONAL(HARDSUBX_IS_ENABLED, [ test x$hardsubx = xtrue ])
AM_CONDITIONAL(OCR_IS_ENABLED, [ test x$ocr = xtrue || test x$hardsubx = xtrue ])
AM_CONDITIONAL(FFMPEG_IS_ENABLED, [ test x$ffmpeg = xtrue ])
AM_CONDITIONAL(TESSERACT_PRESENT, [ test ! -z `pkg-config --libs-only-l --silence-errors tesseract`])
AM_CONDITIONAL(TESSERACT_PRESENT_RPI, [ test -d "/usr/include/tesseract" && test `ls -A /usr/include/tesseract | wc -l` -gt 0 ])
AM_CONDITIONAL(SYS_IS_LINUX, [ test `uname -s` = "Linux"])
AM_CONDITIONAL(SYS_IS_MAC, [ test `uname -s` = "Darwin"])
AM_CONDITIONAL(BUILD_WITH_GUI, [test "x$with_gui" = "xyes"])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

View File

@@ -30,5 +30,5 @@ echo "#define CCX_CCEXTRACTOR_COMPILE_REAL_H" >> ../src/lib_ccx/compile_info_rea
echo "#define GIT_COMMIT \"$commit\"" >> ../src/lib_ccx/compile_info_real.h
echo "#define COMPILE_DATE \"$builddate\"" >> ../src/lib_ccx/compile_info_real.h
echo "#endif" >> ../src/lib_ccx/compile_info_real.h
echo "Stored all in compile.h"
echo "Stored all in compile_info_real.h"
echo "Done."

22
package_creators/PKGBUILD Normal file
View File

@@ -0,0 +1,22 @@
pkgname=ccextractor
pkgver=0.85
pkgrel=1
pkgdesc="A closed captions and teletext subtitles extractor for video streams."
arch=('i686' 'x86_64')
url="http://www.ccextractor.org"
license=('GPL')
depends=('gcc-libs' 'tesseract')
source=(
$pkgname-$pkgver.tar.gz
)
build() {
cd "$srcdir/$pkgname-$pkgver"
CC=gcc ./configure --enable-ocr --prefix="$pkgdir/usr/local"
make -j4
}
package() {
cd "$srcdir/$pkgname-$pkgver"
make install
}

30
package_creators/arch.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
./tarball.sh
retval=$?
if [ $retval -ne 0 ]; then
echo "Sorry, the package could not be created as the tarball building process failed with return code $retval"
rm -f ./*.tar.gz
exit $retval
fi
makepkg -g >> PKGBUILD
makepkg -sc
retval=$?
if [ $retval -ne 0 ]; then
echo "Sorry, the package could not be created as makepkg failed with return code $retval"
rm -rf ./*.tar.gz src
sed -i '$ d' PKGBUILD
exit $retval
fi
rm -f ./*.tar.gz
sed -i '$ d' PKGBUILD
read -p "Do you wish to install ccextractor? [y/N] " yn
case $yn in
[Yy]* ) if [ -x "$(command -v sudo)" ]; then
sudo pacman -U ./*.pkg.tar.xz;
else
su -c "pacman -U ./*.pkg.tar.xz";
fi
rm -f ./*.pkg.tar.xz;;
* ) exit;;
esac

View File

@@ -0,0 +1,39 @@
Name: ccextractor
Version: 0.85
Release: 1
Summary: A closed captions and teletext subtitles extractor for video streams.
Group: Applications/Internet
License: GPL
URL: http://ccextractor.org/
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
CCExtractor is a software that extracts closed captions from videos of various formats, even live video streams. Available as a multi-platform desktop application.
%global debug_package %{nil}
%prep
%setup -q
%build
./configure --enable-ocr --prefix="$pkgdir/usr"
make
%install
mkdir -p $RPM_BUILD_ROOT/usr/bin
install ccextractor $RPM_BUILD_ROOT/usr/bin/ccextractor
%files
%defattr(-,root,root)
/usr/bin/ccextractor
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Thu Oct 5 2017 Jason Hancock <jason@jasonhancock.com>
- Install to /usr/bin instead of /usr/local/bin
* Fri Apr 14 2017 Carlos Fernandez <carlos@ccextractor.org>
- Initial build

View File

@@ -0,0 +1,44 @@
#!/bin/bash
TYPE="debian" # can be one of 'slackware', 'debian', 'rpm'
PROGRAM_NAME="ccextractor"
VERSION="0.85"
RELEASE="1"
LICENSE="GPL-2.0"
MAINTAINER="carlos@ccextractor.org"
REQUIRES="gcc,libcurl4-gnutls-dev,tesseract-ocr,tesseract-ocr-dev,libleptonica-dev"
../linux/pre-build.sh
out=$((LC_ALL=C dpkg -s checkinstall) 2>&1)
if [[ $out == *"is not installed"* ]]
then
read -r -p "You have not installed the package 'checkinstall'. Would you like to install it? [Y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
apt-get install -y checkinstall
else
exit 0
fi
fi
(cd ../linux; ./autogen.sh; ./configure; make; sudo checkinstall \
-y \
--pkgrelease=$RELEASE \
--pkggroup="CCExtractor" \
--backup=no \
--install=no \
--type $TYPE \
--pkgname=$PROGRAM_NAME \
--pkgversion=$VERSION \
--pkglicense=$LICENSE \
--pakdir="../package_creators/build" \
--maintainer=$MAINTAINER \
--nodoc \
--requires=$REQUIRES;)
cd ../linux
make distclean
./cleanup
cd ../package_creators

31
package_creators/rpm.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
if [[ $(rpmbuild 2>&1) == *"not found"* ]]
then
echo "ERROR: 'rpmbuild' package not found. Please install it and try again."
exit 0
fi
workdir=`pwd`
echo "%_topdir $workdir/RPMBUILD" >> $HOME/.rpmmacros
./tarball.sh
retval=$?
if [ $retval -ne 0 ]; then
echo "Sorry, the package could not be created as the tarball building process failed with return code $retval"
rm -f ./*.tar.gz
exit $retval
fi
mkdir -p RPMBUILD/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
mv *.tar.gz RPMBUILD/SOURCES/
cp ccextractor.spec RPMBUILD/SPECS
cd RPMBUILD/SPECS
rpmbuild -ba ccextractor.spec
retval=$?
if [ $retval -ne 0 ]; then
echo "Sorry, the package could not be created as rpmbuild failed with return code $retval"
exit $retval
fi
cd ../..
cp RPMBUILD/RPMS/x86_64/*.rpm .
cp RPMBUILD/SRPMS/*.rpm .
rm -rf RPMBUILD

30
package_creators/tarball.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
cd ..
cp linux/autogen.sh .
cp linux/pre-build.sh .
cp linux/configure.ac .
cp linux/Makefile.am .
sed -i -e 's:../src:src:g' Makefile.am
sed -i -e 's:../src:src:g' configure.ac
sed -i -e 's:../.git:.git:g' pre-build.sh
sed -i -e 's:../src:src:g' pre-build.sh
./autogen.sh
./configure
make dist
mv *.gz package_creators
rm -rf Makefile
rm -rf Makefile.am
rm -rf configure.ac
rm -rf autogen.sh
rm -rf pre-build.sh
rm -rf configure
rm -rf Makefile.in
rm -rf config.status
rm -rf config.log
rm -rf aclocal.m4
rm -rf build-conf
rm -rf autom4te.cache
cd package_creators

View File

@@ -1,6 +1,12 @@
/**
/*
* the configured options and settings for CCExtractor
*/
#define CCExtractor_VERSION_MAJOR @CCEXTRACTOR_VERSION_MAJOR@
#define CCExtractor_VERSION_MINOR @CCEXTRACTOR_VERSION_MINOR@
#ifndef CCX_CCEXTRACTOR_COMPILE_REAL_H
#define CCX_CCEXTRACTOR_COMPILE_REAL_H
#define GIT_COMMIT "@GIT_COMMIT_HASH@"
#define COMPILE_DATE "@COMPILATION_DATE@"
#endif
#define CCExtractor_VERSION_MAJOR "@CCEXTRACTOR_VERSION_MAJOR@"
#define CCExtractor_VERSION_MINOR "@CCEXTRACTOR_VERSION_MINOR@"

View File

@@ -8,59 +8,135 @@ option (WITH_SHARING "Build with sharing and translation support" OFF)
# Version number
set (CCEXTRACTOR_VERSION_MAJOR 0)
set (CCEXTRACTOR_VERSION_MINOR 77)
set (CCEXTRACTOR_VERSION_MINOR 85b)
# Get project directory
get_filename_component(BASE_PROJ_DIR ../ ABSOLUTE)
# Get the latest commit hash of the working branch
IF(EXISTS "${BASE_PROJ_DIR}/.git")
execute_process(
COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
ELSE(EXISTS "${BASE_PROJ_DIR}/.git")
set(GIT_BRANCH "Unknown")
set(GIT_COMMIT_HASH "Unknown")
ENDIF(EXISTS "${BASE_PROJ_DIR}/.git")
#Get the date
string(TIMESTAMP COMPILATION_DATE %Y-%m-%d)
message(STATUS "Commit : ${GIT_COMMIT_HASH}")
message(STATUS "Compilation Date: ${COMPILATION_DATE}")
# configure a header file to pass some of the CMake settings
# to the source code
configure_file (
"${PROJECT_SOURCE_DIR}/CCExtractorConfig.h.in"
"${PROJECT_BINARY_DIR}/CCExtractorConfig.h"
"${PROJECT_SOURCE_DIR}/lib_ccx/compile_info_real.h"
)
add_definitions(-DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY)
include_directories ("${PROJECT_SOURCE_DIR}")
include_directories ("${PROJECT_SOURCE_DIR}/lib_ccx")
include_directories ("${PROJECT_SOURCE_DIR}/utf8proc")
include_directories ("${PROJECT_SOURCE_DIR}/lib_ccx/")
include_directories ("${PROJECT_SOURCE_DIR}/utf8proc/")
include_directories ("${PROJECT_SOURCE_DIR}/gpacmp4/")
include_directories ("${PROJECT_SOURCE_DIR}/protobuf-c/")
include_directories ("${PROJECT_SOURCE_DIR}/zvbi")
aux_source_directory ("${PROJECT_SOURCE_DIR}/zvbi" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/zlib" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/lib_hash" SOURCEFILE)
include_directories ("${PROJECT_SOURCE_DIR}/zvbi/")
include_directories ("${PROJECT_SOURCE_DIR}/lib_hash/")
include_directories ("${PROJECT_SOURCE_DIR}/extractors/")
include_directories ("${PROJECT_SOURCE_DIR}/wrappers/")
include_directories ("${PROJECT_SOURCE_DIR}/libpng/")
include_directories ("${PROJECT_SOURCE_DIR}/zlib/")
include_directories ("${PROJECT_SOURCE_DIR}/freetype/include/")
aux_source_directory ("${PROJECT_SOURCE_DIR}/protobuf-c/" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/zvbi/" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/lib_hash/" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/extractors/" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/wrappers/" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/libpng/" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/zlib/" SOURCEFILE)
# Adding some platform specific library path
link_directories (/opt/local/lib)
link_directories (/usr/local/lib)
set(FREETYPE_SOURCE
${PROJECT_SOURCE_DIR}/freetype/autofit/autofit.c
${PROJECT_SOURCE_DIR}/freetype/base/ftbase.c
${PROJECT_SOURCE_DIR}/freetype/base/ftbbox.c
${PROJECT_SOURCE_DIR}/freetype/base/ftbdf.c
${PROJECT_SOURCE_DIR}/freetype/base/ftbitmap.c
${PROJECT_SOURCE_DIR}/freetype/base/ftcid.c
${PROJECT_SOURCE_DIR}/freetype/base/ftfntfmt.c
${PROJECT_SOURCE_DIR}/freetype/base/ftfstype.c
${PROJECT_SOURCE_DIR}/freetype/base/ftgasp.c
${PROJECT_SOURCE_DIR}/freetype/base/ftglyph.c
${PROJECT_SOURCE_DIR}/freetype/base/ftgxval.c
${PROJECT_SOURCE_DIR}/freetype/base/ftinit.c
${PROJECT_SOURCE_DIR}/freetype/base/ftlcdfil.c
${PROJECT_SOURCE_DIR}/freetype/base/ftmm.c
${PROJECT_SOURCE_DIR}/freetype/base/ftotval.c
${PROJECT_SOURCE_DIR}/freetype/base/ftpatent.c
${PROJECT_SOURCE_DIR}/freetype/base/ftpfr.c
${PROJECT_SOURCE_DIR}/freetype/base/ftstroke.c
${PROJECT_SOURCE_DIR}/freetype/base/ftsynth.c
${PROJECT_SOURCE_DIR}/freetype/base/ftsystem.c
${PROJECT_SOURCE_DIR}/freetype/base/fttype1.c
${PROJECT_SOURCE_DIR}/freetype/base/ftwinfnt.c
${PROJECT_SOURCE_DIR}/freetype/bdf/bdf.c
${PROJECT_SOURCE_DIR}/freetype/bzip2/ftbzip2.c
${PROJECT_SOURCE_DIR}/freetype/cache/ftcache.c
${PROJECT_SOURCE_DIR}/freetype/cff/cff.c
${PROJECT_SOURCE_DIR}/freetype/cid/type1cid.c
${PROJECT_SOURCE_DIR}/freetype/gzip/ftgzip.c
${PROJECT_SOURCE_DIR}/freetype/lzw/ftlzw.c
${PROJECT_SOURCE_DIR}/freetype/pcf/pcf.c
${PROJECT_SOURCE_DIR}/freetype/pfr/pfr.c
${PROJECT_SOURCE_DIR}/freetype/psaux/psaux.c
${PROJECT_SOURCE_DIR}/freetype/pshinter/pshinter.c
${PROJECT_SOURCE_DIR}/freetype/psnames/psnames.c
${PROJECT_SOURCE_DIR}/freetype/raster/raster.c
${PROJECT_SOURCE_DIR}/freetype/sfnt/sfnt.c
${PROJECT_SOURCE_DIR}/freetype/smooth/smooth.c
${PROJECT_SOURCE_DIR}/freetype/truetype/truetype.c
${PROJECT_SOURCE_DIR}/freetype/type1/type1.c
${PROJECT_SOURCE_DIR}/freetype/type42/type42.c
${PROJECT_SOURCE_DIR}/freetype/winfonts/winfnt.c
)
#Windows specific libraries and linker flags
if(WIN32)
include_directories ("${PROJECT_SOURCE_DIR}/win_spec_incld/")
include_directories ("${PROJECT_SOURCE_DIR}/win_iconv/")
aux_source_directory ("${PROJECT_SOURCE_DIR}/win_iconv/" SOURCEFILE)
set (EXTRA_LIBS ${EXTRA_LIBS} ws2_32 winmm)
else (WIN32)
# Adding some platform specific library path
link_directories (/opt/local/lib)
link_directories (/usr/local/lib)
endif(WIN32)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -Wall -g -std=gnu99 -Wno-write-strings -D_FILE_OFFSET_BITS=64")
if(MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W3 /wd4005 /wd4996")
else (MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-write-strings -g -std=gnu99")
endif(MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FILE_OFFSET_BITS=64")
add_subdirectory (lib_ccx)
aux_source_directory (${PROJECT_SOURCE_DIR} SOURCEFILE)
set (EXTRA_LIBS ${EXTRA_LIBS} ccx)
set (EXTRA_LIBS ${EXTRA_LIBS} m)
# set (EXTRA_LIBS ${EXTRA_LIBS} m)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (EXTRA_LIBS ${EXTRA_LIBS} iconv)
set (EXTRA_LIBS ${EXTRA_LIBS} iconv)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (EXTRA_LIBS ${EXTRA_LIBS} -lz -lm)
find_package (PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PNG libpng )
if(PNG_FOUND)
set (EXTRA_LIBS ${EXTRA_LIBS} png)
else (PNG_FOUND)
include_directories ("${PROJECT_SOURCE_DIR}/libpng/")
include_directories ("${PROJEXT_SOURCE_DIR}/zlib/")
aux_source_directory ("${PROJECT_SOURCE_DIR}/libpng/" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/zlib/" SOURCEFILE)
endif(PNG_FOUND)
else(PKG_CONFIG_FOUND)
include_directories ("${PROJECT_SOURCE_DIR}/libpng/")
include_directories ("${PROJEXT_SOURCE_DIR}/zlib/")
aux_source_directory ("${PROJECT_SOURCE_DIR}/libpng/" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/zlib/" SOURCEFILE)
endif (PKG_CONFIG_FOUND)
########################################################
# Build using FFmpeg libraries
@@ -71,36 +147,42 @@ if (PKG_CONFIG_FOUND AND WITH_FFMPEG)
pkg_check_modules (AVFORMAT REQUIRED libavformat)
pkg_check_modules (AVUTIL REQUIRED libavutil)
pkg_check_modules (AVCODEC REQUIRED libavcodec)
pkg_check_modules (SWSCALE REQUIRED libswscale)
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVFORMAT_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVUTIL_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVCODEC_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVFORMAT_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVUTIL_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVCODEC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${SWSCALE_LIBRARIES})
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVFORMAT_INCLUDE_DIRS})
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVUTIL_INCLUDE_DIRS})
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVCODEC_INCLUDE_DIRS})
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${SWSCALE_INCLUDE_DIRS})
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_FFMPEG")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_HARDSUBX")
endif (PKG_CONFIG_FOUND AND WITH_FFMPEG)
########################################################
# Build with OCR using leptonica and tesseract libraries
########################################################
if (WITH_OCR)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND AND WITH_OCR)
pkg_check_modules (TESSERACT REQUIRED tesseract)
pkg_check_modules (LEPTONICA REQUIRED lept)
set (EXTRA_LIBS ${EXTRA_LIBS} ${TESSERACT_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${LEPTONICA_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${TESSERACT_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${LEPTONICA_LIBRARIES})
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_OCR ${TESSERACT_CFLAGS} ${LEPTONICA_CFLAGS}")
endif (WITH_OCR)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_OCR")
endif (PKG_CONFIG_FOUND AND WITH_OCR)
########################################################
# Build with CC sharing and translation support
########################################################
if (WITH_SHARING)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND AND WITH_SHARING)
pkg_check_modules (NANOMSG REQUIRED libnanomsg)
set (EXTRA_LIBS ${EXTRA_LIBS} ${NANOMSG_STATIC_LIBRARIES})
@@ -109,10 +191,10 @@ if (WITH_SHARING)
aux_source_directory ("${PROJECT_SOURCE_DIR}/protobuf-c/" SOURCEFILE)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_SHARING")
endif (WITH_SHARING)
endif (PKG_CONFIG_FOUND AND WITH_SHARING)
add_executable (ccextractor ${SOURCEFILE})
add_executable (ccextractor ${SOURCEFILE} ${FREETYPE_SOURCE})
target_link_libraries (ccextractor ${EXTRA_LIBS})
target_include_directories (ccextractor PUBLIC ${EXTRA_INCLUDES})
install (TARGETS ccextractor DESTINATION bin)

18
src/GUI/activity.c Normal file
View File

@@ -0,0 +1,18 @@
#ifndef NK_IMPLEMENTATION
#include "nuklear_lib/nuklear.h"
#endif // !NK_IMPLEMENTATION
#include "activity.h"
int activity(struct nk_context *ctx, int x, int y, int width, int height, struct main_tab *main_settings)
{
static int i;
if (nk_begin(ctx, "Activity", nk_rect(x, y, width, height), NK_WINDOW_TITLE|NK_WINDOW_BACKGROUND))
{
nk_layout_row_dynamic(ctx, 40, 1);
for(i = 0; i < main_settings->activity_string_count; i++)
nk_label_wrap(ctx, main_settings->activity_string[i]);
}
nk_end(ctx);
return !nk_window_is_closed(ctx, "Activity");
}

8
src/GUI/activity.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef ACTIVITY_H
#define ACTIVITY_H
#include "ccextractorGUI.h"
int activity(struct nk_context *ctx, int x, int y, int width, int height, struct main_tab *main_settings);
#endif

929
src/GUI/ccextractorGUI.c Normal file
View File

@@ -0,0 +1,929 @@
/* nuklear - v1.32.0 - public domain */
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include <assert.h>
#include <math.h>
#include <limits.h>
#include <time.h>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#define PATH_LENGTH 66
#define NAME_LENGTH 56
#define PREFIX_LENGTH_TRUNCATED 10
#define NK_INCLUDE_FIXED_TYPES
#define NK_INCLUDE_STANDARD_IO
#define NK_INCLUDE_STANDARD_VARARGS
#define NK_INCLUDE_DEFAULT_ALLOCATOR
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
#define NK_INCLUDE_FONT_BAKING
#define NK_INCLUDE_DEFAULT_FONT
#define NK_IMPLEMENTATION
#define NK_GLFW_GL2_IMPLEMENTATION
#include "nuklear_lib/nuklear.h"
#include "nuklear_lib/nuklear_glfw_gl2.h"
//#define WINDOW_WIDTH 1200
//#define WINDOW_HEIGHT 800
//#define true 1
//#define false 0
//#define UNUSED(a) (void)a
//#define MIN(a,b) ((a) < (b) ? (a) : (b))
//#define MAX(a,b) ((a) < (b) ? (b) : (a))
//#define LEN(a) (sizeof(a)/sizeof(a)[0])
#include "ccextractorGUI.h"
#include "tabs.h"
#include "activity.h"
#include "terminal.c"
#include "preview.h"
#include "popups.h"
#include "command_builder.h"
#include "ccx_cli_thread.h"
#include "file_browser.h"
#include "save_load_data.h"
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
static struct main_tab main_settings;
/*Trigger command for CLI*/
char command[20];
/*Global Variables for Drag and Drop files*/
/* Width and Height of all frames*/
const GLint WIDTH_mainPanelAndWindow = 530, HEIGHT_mainPanelandWindow = 550;
const GLint WIDTH_termORPreviewPanel = 530, HEIGHT_termORPreviewPanel = 100;
const GLint WIDTH_termANDPreviewPanel = 400, HEIGHT_termANDPreviewPanel = 650;
const GLint WIDTH_activityPanel = 400, HEIGHT_activityPanelSolo = 550, HEIGHT_activityPanelDuo = 650;
const GLint WIDTH_mainTermORPreviewWindow = 530, HEIGHT_mainORPreviewTermWindow = 650;
const GLint WIDTH_mainTermANDPreviewWindow = 930, HEIGHT_mainTermAndPreviewWindow = 650;
const GLint WIDTH_mainActivityWindow = 930, HEIGHT_mainActivityWindowSolo = 550, HEIGHT_mainActivityWindowDuo = 650;
/*Tab constants*/
static int tab_screen_height;
/*Parameter Constants*/
static int modifiedParams = 0;
static void error_callback(int e, const char *d)
{
printf("Error %d: %s\n", e, d);
}
void drop_callback(GLFWwindow* window, int count, const char **paths)
{
int i,j,k,z,copycount, prefix_length, slash_length, fileNameTruncated_index;
printf("Number of selected paths:%d\n", count);
if(main_settings.filename_count == 0 && main_settings.filenames == NULL)
main_settings.filenames = (char**)calloc(count + 1, sizeof(char*));
else
main_settings.filenames = (char**)realloc(main_settings.filenames, (main_settings.filename_count + count + 1) * sizeof(char*));
for (i = 0; i < count; i++)
{
printf("\n%d", main_settings.filename_count);
main_settings.filenames[main_settings.filename_count] = (char*)calloc((strlen(paths[i])+5), sizeof(char));
main_settings.filenames[main_settings.filename_count][0] = '\"';
strcat(main_settings.filenames[main_settings.filename_count], paths[i]);
strcat(main_settings.filenames[main_settings.filename_count], "\"");
puts(main_settings.filenames[main_settings.filename_count]);
main_settings.filename_count++;
}
main_settings.filenames[main_settings.filename_count] = NULL;
}
/*Rectangle to hold file names*/
//void draw_file_rectangle_widget(struct nk_context *ctx, struct nk_font *font)
//{
// struct nk_command_buffer *canvas;
// struct nk_input *input = &ctx->input;
// canvas = nk_window_get_canvas(ctx);
//
// struct nk_rect space;
// enum nk_widget_layout_states state;
// state = nk_widget(&space, ctx);
// if (!state) return;
//
// /*if (state != NK_WIDGET_ROM)
// update_your_widget_by_user_input(...);*/
// nk_fill_rect(canvas, space, 5, nk_rgb(88, 81, 96));
// if (!strcmp(filePath[0], "\0")) {
// space.y = space.y + (space.h / 2) -10;
// space.x = space.x + 90;
// nk_draw_text(canvas, space, "Drag and Drop files here for Extraction.", 40, &font->handle, nk_rgb(88, 81, 96), nk_rgb(0, 0, 0));
// }
// else {
// for (int i = 0; i < fileCount; i++)
// {
// nk_draw_text(canvas, space, filePath[i], strlen(filePath[i]), &font->handle, nk_rgb(88, 81, 96), nk_rgb(0, 0, 0));
// space.y = space.y + 20;
// }
// }
//
//}
/*Rectangle to hold extraction info*/
//void draw_info_rectangle_widget(struct nk_context *ctx, struct nk_font *font)
//{
// struct nk_command_buffer *canvas;
// struct nk_input *input = &ctx->input;
// canvas = nk_window_get_canvas(ctx);
//
// struct nk_rect space;
// enum nk_widget_layout_states state;
// state = nk_widget(&space, ctx);
// if (!state) return;
//
// /*if (state != NK_WIDGET_ROM)
// update_your_widget_by_user_input(...);*/
// nk_fill_rect(canvas, space, 5, nk_rgb(88, 81, 96));
// space.x = space.x + 3;
// nk_draw_text(canvas, space, "Input Type: Auto", 16, &font->handle, nk_rgb(88, 81, 96), nk_rgb(0, 0, 0));
// space.y = space.y + 20;
// nk_draw_text(canvas, space, "Output Type: Default(.srt)", 26, &font->handle, nk_rgb(88, 81, 96), nk_rgb(0, 0, 0));
// space.y = space.y + 20;
// nk_draw_text(canvas, space, "Output Path: Default", 20, &font->handle, nk_rgb(88, 81, 96), nk_rgb(0, 0, 0));
// space.y = space.y + 20;
// nk_draw_text(canvas, space, "Hardsubs Extraction: Yes", 24, &font->handle, nk_rgb(88, 81, 96), nk_rgb(0, 0, 0));
//}
int main(void)
{
//Platform
static GLFWwindow *win;
struct nk_context *ctx;
int screenWidth, screenHeight;
//int winWidth, winHeight;
//GLFW
glfwSetErrorCallback(error_callback);
if (!glfwInit())
{
fprintf(stdout, "GLFW failed to initialise.\n");
}
win = glfwCreateWindow(WIDTH_mainPanelAndWindow, HEIGHT_mainPanelandWindow, "CCExtractor", NULL, NULL);
if (win == NULL)
printf("Window Could not be created!\n");
glfwMakeContextCurrent(win);
glfwSetWindowSizeLimits(win, WIDTH_mainPanelAndWindow, HEIGHT_mainPanelandWindow, WIDTH_mainPanelAndWindow, HEIGHT_mainPanelandWindow);
glfwSetWindowUserPointer(win, &ctx);
glfwSetDropCallback(win, drop_callback);
if (glewInit() != GLEW_OK) {
fprintf(stderr, "Failed to setup GLEW\n");
exit(1);
}
//GUI
struct file_browser browser;
static const struct file_browser reset_browser;
struct media media;
ctx = nk_glfw3_init(win, NK_GLFW3_INSTALL_CALLBACKS);
struct nk_font_atlas *font_atlas;
nk_glfw3_font_stash_begin(&font_atlas);
#ifdef _WIN32
struct nk_font *droid = nk_font_atlas_add_from_file(font_atlas, "../../fonts/Roboto-Regular.ttf", 16, 0);
struct nk_font *droid_big = nk_font_atlas_add_from_file(font_atlas, "../../fonts/Roboto-Regular.ttf", 25, 0);
struct nk_font *droid_head = nk_font_atlas_add_from_file(font_atlas, "../../fonts/Roboto-Regular.ttf", 20, 0);
#else
struct nk_font *droid = nk_font_atlas_add_from_file(font_atlas, "../fonts/Roboto-Regular.ttf", 16, 0);
struct nk_font *droid_big = nk_font_atlas_add_from_file(font_atlas, "../fonts/Roboto-Regular.ttf", 25, 0);
struct nk_font *droid_head = nk_font_atlas_add_from_file(font_atlas, "../fonts/Roboto-Regular.ttf", 20, 0);
#endif
nk_glfw3_font_stash_end();
nk_style_set_font(ctx, &droid->handle);
//CHECKBOX VALUES
static int show_terminal_check = nk_false;
static int show_preview_check = nk_false;
static int show_activity_check = nk_false;
static int advanced_mode_check = nk_false;
static int file_extension_check = nk_true;
/*Settigs and tab options*/
setup_main_settings(&main_settings);
static struct network_popup network_settings;
setup_network_settings(&network_settings);
static struct output_tab output;
setup_output_tab(&output);
static struct decoders_tab decoders;
setup_decoders_tab(&decoders);
static struct credits_tab credits;
setup_credits_tab(&credits);
static struct input_tab input;
setup_input_tab(&input);
static struct advanced_input_tab advanced_input;
setup_advanced_input_tab(&advanced_input);
static struct debug_tab debug;
setup_debug_tab(&debug);
static struct hd_homerun_tab hd_homerun;
setup_hd_homerun_tab(&hd_homerun);
static struct burned_subs_tab burned_subs;
setup_burned_subs_tab(&burned_subs);
static struct built_string command;
/* icons */
#ifdef _WIN32
media.icons.home = icon_load("../../icon/home.png");
media.icons.directory = icon_load("../../icon/directory.png");
media.icons.computer = icon_load("../../icon/computer.png");
media.icons.drives = icon_load("../../icon/drive.png");
media.icons.desktop = icon_load("../../icon/desktop.png");
media.icons.default_file = icon_load("../../icon/default.png");
media.icons.text_file = icon_load("../../icon/text.png");
media.icons.music_file = icon_load("../../icon/music.png");
media.icons.font_file = icon_load("../../icon/font.png");
media.icons.img_file = icon_load("../../icon/img.png");
media.icons.movie_file = icon_load("../../icon/movie.png");
#else
media.icons.home = icon_load("../icon/home.png");
media.icons.directory = icon_load("../icon/directory.png");
media.icons.computer = icon_load("../icon/computer.png");
media.icons.desktop = icon_load("../icon/desktop.png");
media.icons.default_file = icon_load("../icon/default.png");
media.icons.text_file = icon_load("../icon/text.png");
media.icons.music_file = icon_load("../icon/music.png");
media.icons.font_file = icon_load("../icon/font.png");
media.icons.img_file = icon_load("../icon/img.png");
media.icons.movie_file = icon_load("../icon/movie.png");
#endif
media_init(&media);
file_browser_init(&browser, &media);
/*Read Last run state*/
FILE *loadFile;
loadFile = fopen("ccxGUI.ini", "r");
if(loadFile != NULL)
{
printf("File found and reading it!\n");
load_data(loadFile, &main_settings, &input, &advanced_input, &output, &decoders, &credits, &debug, &hd_homerun, &burned_subs, &network_settings);
fclose(loadFile);
}
/*Main GUI loop*/
while (nk_true)
{
if(glfwWindowShouldClose(win))
{
FILE *saveFile;
saveFile = fopen("ccxGUI.ini", "w");
save_data(saveFile, &main_settings, &input, &advanced_input, &output, &decoders, &credits, &debug, &hd_homerun, &burned_subs, &network_settings);
fclose(saveFile);
break;
}
//Input
glfwPollEvents();
nk_glfw3_new_frame();
//Popups
static int show_progress_details = nk_false;
static int show_about_ccx = nk_false;
static int show_getting_started = nk_false;
//GUI
if (nk_begin(ctx, "CCExtractor", nk_rect(0, 0, WIDTH_mainPanelAndWindow, HEIGHT_mainPanelandWindow),
NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BACKGROUND))
{
//MENUBAR
nk_menubar_begin(ctx);
nk_layout_row_begin(ctx, NK_STATIC, 30, 3);
nk_layout_row_push(ctx, 80);
if (nk_menu_begin_label(ctx, "Preferences", NK_TEXT_LEFT, nk_vec2(120, 200))) {
nk_layout_row_dynamic(ctx, 30, 1);
if(nk_menu_item_label(ctx, "Reset Defaults", NK_TEXT_LEFT))
{
remove("ccxGUI.ini");
setup_main_settings(&main_settings);
setup_network_settings(&network_settings);
setup_output_tab(&output);
setup_decoders_tab(&decoders);
setup_credits_tab(&credits);
setup_input_tab(&input);
setup_advanced_input_tab(&advanced_input);
setup_debug_tab(&debug);
setup_hd_homerun_tab(&hd_homerun);
setup_burned_subs_tab(&burned_subs);
}
if (nk_menu_item_label(ctx, "Network Settings", NK_TEXT_LEFT))
network_settings.show_network_settings = nk_true;
nk_menu_end(ctx);
}
nk_layout_row_push(ctx, 70);
if (nk_menu_begin_label(ctx, "Windows", NK_TEXT_LEFT, nk_vec2(120, 200))) {
nk_layout_row_dynamic(ctx, 30, 1);
nk_checkbox_label(ctx, "Activity", &show_activity_check);
nk_checkbox_label(ctx, "Terminal", &show_terminal_check);
nk_checkbox_label(ctx, "Preview", &show_preview_check);
nk_menu_end(ctx);
}
nk_layout_row_push(ctx, 45);
if (nk_menu_begin_label(ctx, "Help", NK_TEXT_LEFT, nk_vec2(120, 200)))
{
nk_layout_row_dynamic(ctx, 30, 1);
if (nk_menu_item_label(ctx, "Getting Started", NK_TEXT_LEFT))
show_getting_started = nk_true;
if (nk_menu_item_label(ctx, "About CCExtractor", NK_TEXT_LEFT))
show_about_ccx = nk_true;
nk_menu_end(ctx);
}
//Network Settings
if (network_settings.show_network_settings)
draw_network_popup(ctx, &network_settings);
//About CCExtractor Popup
if (show_about_ccx)
draw_about_ccx_popup(ctx, &show_about_ccx, &droid_big->handle, &droid_head->handle);
//Getting Started
if (show_getting_started)
draw_getting_started_popup(ctx, &show_getting_started);
//Color Popup
if (output.color_popup)
draw_color_popup(ctx, &output);
//File Browser as Popup
if(main_settings.scaleWindowForFileBrowser){
int width = 0, height = 0;
glfwGetWindowSize(win, &width, &height);
glfwSetWindowSize(win, 930, 650);
glfwSetWindowSizeLimits(win,930, 650, 930, 650 );
file_browser_run(&browser, ctx, &main_settings, &output, &debug, &hd_homerun);
}
//Thread popop when file can't be read
if(main_settings.threadPopup)
draw_thread_popup(ctx, &main_settings.threadPopup);
//Thread popup for hd_homerun thread
if(hd_homerun.threadPopup)
draw_thread_popup(ctx, &hd_homerun.threadPopup);
nk_layout_row_end(ctx);
nk_menubar_end(ctx);
nk_layout_space_begin(ctx, NK_STATIC, 15, 1);
nk_layout_space_end(ctx);
/*TABS TRIGGERED IN ADVANCED MODE FLAG*/
if (advanced_mode_check)
{
static int current_tab = 0;
enum tab_name { MAIN, INPUT, ADV_INPUT, OUTPUT, DECODERS, CREDITS, DEBUG, HDHOMERUN, BURNEDSUBS };
const char *names[] = { "Main", "Input", "Advanced Input", "Output", "Decoders", "Credits", "Debug", "HDHomeRun", "BurnedSubs" };
float id = 0;
int i;
nk_style_push_vec2(ctx, &ctx->style.window.spacing, nk_vec2(0, 0));
nk_style_push_float(ctx, &ctx->style.button.rounding, 0);
nk_layout_row_begin(ctx, NK_STATIC, 20, 9);
for (i = 0; i < 9; ++i) {
/*Make sure button perfectly fits text*/
const struct nk_user_font *f = ctx->style.font;
float text_width = f->width(f->userdata, f->height, names[i], nk_strlen(names[i]));
float widget_width = text_width + 3 * ctx->style.button.padding.x;
nk_layout_row_push(ctx, widget_width);
if (current_tab == i) {
/*Active tab gets highlighted*/
struct nk_style_item button_color = ctx->style.button.normal;
ctx->style.button.normal = ctx->style.button.active;
current_tab = nk_button_label(ctx, names[i]) ? i : current_tab;
ctx->style.button.normal = button_color;
}
else
current_tab = nk_button_label(ctx, names[i]) ? i : current_tab;
}
nk_style_pop_float(ctx);
/*Body*/
nk_layout_row_dynamic(ctx, tab_screen_height, 1);
if (nk_group_begin(ctx, "Advanced Tabs", NK_WINDOW_NO_SCROLLBAR))
{
nk_style_pop_vec2(ctx);
switch (current_tab) {
case MAIN:
tab_screen_height = 0;
break;
case INPUT:
draw_input_tab(ctx, &tab_screen_height, &input, &decoders);
break;
case ADV_INPUT:
draw_advanced_input_tab(ctx, &tab_screen_height, &advanced_input);
break;
case OUTPUT:
draw_output_tab(ctx, &tab_screen_height, &output, &main_settings);
break;
case DECODERS:
draw_decoders_tab(ctx, &tab_screen_height, &decoders);
break;
case CREDITS:
draw_credits_tab(ctx, &tab_screen_height, &credits);
break;
case DEBUG:
draw_debug_tab(ctx, &tab_screen_height, &main_settings, &output, &debug);
break;
case HDHOMERUN:
draw_hd_homerun_tab(ctx, &tab_screen_height, &hd_homerun, &main_settings);
break;
case BURNEDSUBS:
draw_burned_subs_tab(ctx, &tab_screen_height, &burned_subs);
break;
}
nk_group_end(ctx);
}
else nk_style_pop_vec2(ctx);
}
//ADVANCED MODE FLAG
static const float ratio_adv_mode[] = { 0.75f, 0.22f, .03f };
nk_layout_row(ctx, NK_DYNAMIC, 20, 3, ratio_adv_mode);
nk_spacing(ctx, 1);
nk_checkbox_label(ctx, "Advanced Mode", &advanced_mode_check);
//RADIO BUTTON 1
static const float ratio_button[] = { .10f, .90f };
static const float check_extension_ratio[] = { .10f, .53f, .12f, .15f, .10f };
//static int op = FILES;
nk_layout_row(ctx, NK_DYNAMIC, 20, 2, ratio_button);
nk_spacing(ctx, 1);
if (nk_option_label(ctx, "Extract from files below:", main_settings.port_or_files == FILES)) {
//op = FILES;
main_settings.port_or_files = FILES;
}
//CHECKBOX FOR FILE TYPES
static int add_remove_button = nk_false;
nk_layout_row(ctx, NK_DYNAMIC, 20, 5, check_extension_ratio);
nk_spacing(ctx, 1);
nk_checkbox_label(ctx, "Check for common video file extensions", &file_extension_check);
if (main_settings.filename_count > 0)
{
if(nk_button_label(ctx, "Add"))
{
main_settings.is_file_browser_active = nk_true;
main_settings.scaleWindowForFileBrowser = nk_true;
}
for (int i = 0; i < main_settings.filename_count; i++)
{
if (main_settings.is_file_selected[i]) {
add_remove_button = nk_true;
break;
}
else
add_remove_button = nk_false;
}
if (add_remove_button)
{
if (nk_button_label(ctx, "Remove")) {
for (int i = main_settings.filename_count-1; i != -1; i--)
if (main_settings.is_file_selected[i]) {
remove_path_entry(&main_settings, i );
main_settings.is_file_selected[i] = nk_false;
}
}
}
else
if (nk_button_label(ctx, "Clear"))
{
free(main_settings.filenames);
main_settings.filename_count = 0;
}
}
//RECTANGLE-FILES
static const float ratio_rect_files[] = { 0.10f,0.80f };
nk_layout_row(ctx, NK_DYNAMIC, 180, 2, ratio_rect_files);
nk_spacing(ctx, 1);
if (nk_group_begin(ctx, "Files in extraction queue:", NK_WINDOW_BORDER | NK_WINDOW_TITLE ))
{
if (main_settings.filename_count != 0)
{
int i = 0;
nk_layout_row_static(ctx, 18, 380, 1);
for (i = 0; i < main_settings.filename_count; ++i)
nk_selectable_label(ctx, truncate_path_string(main_settings.filenames[i]), NK_TEXT_LEFT, &main_settings.is_file_selected[i]);
}
else {
nk_layout_row_dynamic(ctx, 1, 1);
nk_spacing(ctx, 1);
nk_layout_row_dynamic(ctx, 25, 1);
nk_label(ctx, "Drag and Drop files for extraction.", NK_TEXT_CENTERED);
nk_layout_row_dynamic(ctx, 25, 1);
nk_label(ctx, "OR", NK_TEXT_CENTERED);
nk_layout_row_dynamic(ctx, 25, 3);
nk_spacing(ctx, 1);
if (nk_button_label(ctx, "Browse Files"))
{
main_settings.is_file_browser_active = nk_true;
main_settings.scaleWindowForFileBrowser = nk_true;
}
nk_spacing(ctx, 1);
}
nk_group_end(ctx);
}
//RadioButton 2 along with combobox
static const float ratio_port[] = { 0.10f,0.20f,0.20f,0.20f,0.20f,0.10f };
nk_layout_row(ctx, NK_DYNAMIC, 20, 6, ratio_port);
nk_spacing(ctx, 1);
if (nk_option_label(ctx, "Extract from", main_settings.port_or_files == PORT)) {
//op = PORT;
main_settings.port_or_files = PORT;
}
main_settings.port_select = nk_combo(ctx, main_settings.port_type, 2, main_settings.port_select, 20, nk_vec2(85,100));
nk_label(ctx, " stream, on port:", NK_TEXT_LEFT);
//RADDIO BUTTON 2, TEXTEDIT FOR ENTERING PORT NUMBER
static int len;
static char buffer[10];
nk_edit_string(ctx, NK_EDIT_SIMPLE, main_settings.port_num, &main_settings.port_num_len, 8, nk_filter_decimal);
nk_layout_space_begin(ctx, NK_STATIC, 10, 1);
nk_layout_space_end(ctx);
//Extraction Info`rmation
nk_layout_row_dynamic(ctx, 10, 1);
nk_text(ctx, "Extraction Info:", 16, NK_TEXT_CENTERED);
//RECTANGLE-INFO
static const float ratio_rect_info[] = { 0.10f,0.80f,0.10f };
nk_layout_row(ctx, NK_DYNAMIC, 75, 2, ratio_rect_info);
nk_spacing(ctx, 1);
if (nk_group_begin(ctx, "Extraction Info:", NK_WINDOW_BORDER))
{
if (main_settings.filename_count != 0)
{
nk_layout_row_static(ctx, 18, 380, 1);
nk_label(ctx, concat("Input type: ", input.type[input.type_select]), NK_TEXT_LEFT);
nk_label(ctx, concat("Output type: ", output.type[output.type_select]), NK_TEXT_LEFT);
if(output.is_filename)
nk_label(ctx, concat("Output path: ", output.filename), NK_TEXT_LEFT);
else
nk_label(ctx, "Output path: Default", NK_TEXT_LEFT);
if(burned_subs.is_burned_subs)
nk_label(ctx, "Hardsubtitles extraction: Yes", NK_TEXT_LEFT);
else
nk_label(ctx, "Hardsubtitles extraction: No", NK_TEXT_LEFT);
}
nk_group_end(ctx);
}
nk_layout_space_begin(ctx, NK_STATIC, 10, 1);
nk_layout_space_end(ctx);
//PROGRESSBAR
static const float ratio_progress[] = { 0.10f,0.03f,0.57f,0.03f,0.17f,0.10f };
nk_layout_row(ctx, NK_DYNAMIC, 20, 6, ratio_progress);
nk_spacing(ctx, 1);
nk_spacing(ctx, 1);
nk_progress(ctx, &main_settings.progress_cursor, 101, nk_false);
//Extract Button
nk_spacing(ctx, 1);
if (nk_button_label(ctx, "Extract"))
{
setup_and_create_thread(&main_settings, &command);
}
nk_layout_space_begin(ctx, NK_STATIC, 10, 1);
nk_layout_space_end(ctx);
//PROGRESS_DETAILS_BUTTON
if(!show_activity_check)
{
nk_layout_row_dynamic(ctx, 20, 3);
nk_spacing(ctx, 1);
if (nk_button_label(ctx, "Progress Details"))
{
show_progress_details = nk_true;
}
nk_spacing(ctx, 1);
}
//PROGRESS_DETAILS_POPUP
if (show_progress_details)
draw_progress_details_popup(ctx, &show_progress_details, &main_settings);
//build command string
command_builder(&command, &main_settings, &network_settings, &input, &advanced_input, &output, &decoders, &credits, &debug, &burned_subs);
}
nk_end(ctx);
glfwGetWindowSize(win, &screenWidth, &screenHeight);
if (!main_settings.scaleWindowForFileBrowser)
{
if (show_activity_check && show_preview_check && show_terminal_check)
{
if (screenWidth != 930 || screenHeight != 650)
{
glfwSetWindowSize(win, 930, 550);
glfwSetWindowSizeLimits(win, 930, 650, 930, 650);
}
preview(ctx, 530, 0, 400, 550, &main_settings);
terminal(ctx, 0, 550, 530, 100, &command.term_string);
activity(ctx, 530, 550, 400, 100, &main_settings);
}
if (show_activity_check && show_preview_check && !show_terminal_check)
{
if (screenWidth != 930 || screenHeight != 650)
{
glfwSetWindowSize(win, 930, 650);
glfwSetWindowSizeLimits(win, 930, 650, 930, 650);
}
preview(ctx, 530, 0, 400, 650, &main_settings);
activity(ctx, 0, 550, 530, 100, &main_settings);
}
if (show_activity_check && !show_preview_check && show_terminal_check)
{
if (screenWidth != 930 || screenHeight != 650)
{
glfwSetWindowSize(win, 930, 650);
glfwSetWindowSizeLimits(win, 930, 650, 930, 650);
}
activity(ctx, 530, 0, 400, 650, &main_settings);
terminal(ctx, 0, 550, 530, 100, &command.term_string);
}
if (show_terminal_check && show_preview_check && !show_activity_check)
{
if (screenWidth != 930 || screenHeight != 650)
{
glfwSetWindowSize(win, 930, 650);
glfwSetWindowSizeLimits(win, 930, 650, 930, 650);
}
terminal(ctx, 0, 550, 530, 100, &command.term_string);
preview(ctx, 530, 0, 400, 650, &main_settings);
}
if (show_activity_check && !show_preview_check && !show_terminal_check)
{
if (screenWidth != 930 || screenHeight == 650)
{
glfwSetWindowSize(win, 930, 550);
glfwSetWindowSizeLimits(win, 930, 550, 930, 550);
}
activity(ctx, 530, 0, 400, 550, &main_settings);
}
if (show_terminal_check && !show_activity_check && !show_preview_check)
{
if (screenHeight != 650 || screenWidth == 930)
{
glfwSetWindowSize(win, 530, 650);
glfwSetWindowSizeLimits(win, 530, 650, 530, 650);
}
terminal(ctx, 0, 550, 530, 100, &command.term_string);
}
if (show_preview_check && !show_terminal_check && !show_activity_check)
{
if (screenHeight != 650 || screenWidth == 930)
{
glfwSetWindowSize(win, 930, 550);
glfwSetWindowSizeLimits(win, 930, 550, 930, 550);
}
preview(ctx, 530, 0, 400, 550, &main_settings);
}
if (!show_preview_check && !show_terminal_check && !show_activity_check)
{
glfwSetWindowSize(win, WIDTH_mainPanelAndWindow, HEIGHT_mainPanelandWindow);
glfwSetWindowSizeLimits(win, WIDTH_mainPanelAndWindow, HEIGHT_mainPanelandWindow,
WIDTH_mainPanelAndWindow, HEIGHT_mainPanelandWindow);
}
}
else
{
glfwSetWindowSize(win, 930, 650);
glfwSetWindowSizeLimits(win, 930, 650, 930, 650);
}
glViewport(0, 0, screenWidth, screenHeight);
glClear(GL_COLOR_BUFFER_BIT);
/* IMPORTANT: `nk_glfw_render` modifies some global OpenGL state
* with blending, scissor, face culling and depth test and defaults everything
* back into a default state. Make sure to either save and restore or
* reset your own state after drawing rendering the UI. */
nk_glfw3_render(NK_ANTI_ALIASING_ON);
glfwSwapBuffers(win);
}
glDeleteTextures(1,(const GLuint*)&media.icons.home.handle.id);
glDeleteTextures(1,(const GLuint*)&media.icons.directory.handle.id);
glDeleteTextures(1,(const GLuint*)&media.icons.computer.handle.id);
#ifdef _WIN32
glDeleteTextures(1, (const GLuint*)&media.icons.drives.handle.id);
#endif
glDeleteTextures(1,(const GLuint*)&media.icons.desktop.handle.id);
glDeleteTextures(1,(const GLuint*)&media.icons.default_file.handle.id);
glDeleteTextures(1,(const GLuint*)&media.icons.text_file.handle.id);
glDeleteTextures(1,(const GLuint*)&media.icons.music_file.handle.id);
glDeleteTextures(1,(const GLuint*)&media.icons.font_file.handle.id);
glDeleteTextures(1,(const GLuint*)&media.icons.img_file.handle.id);
glDeleteTextures(1,(const GLuint*)&media.icons.movie_file.handle.id);
file_browser_free(&browser);
//free(main_settings.filenames);
nk_glfw3_shutdown();
glfwTerminate();
return 0;
}
void setup_main_settings(struct main_tab *main_settings)
{
main_settings->is_check_common_extension = nk_false;
main_settings->port_num_len = 0;
main_settings->port_or_files = FILES;
main_settings->port_type = (char**)malloc(2 * sizeof(char*));
main_settings->port_type[0] = "UDP";
main_settings->port_type[1] = "TCP";
main_settings->port_select = 0;
main_settings->is_file_browser_active = nk_false;
main_settings->scaleWindowForFileBrowser = nk_false;
main_settings->preview_string_count = 0;
main_settings->activity_string_count = 0;
main_settings->threadPopup = nk_false;
}
char* truncate_path_string(char *filePath)
{
char* file_path = strdup(filePath);
int i,j,z,slash_length, fileNameTruncated_index,copycount, prefix_length;
char file_name[PATH_LENGTH], *ptr_slash, fileNameTruncated[NAME_LENGTH];
//strcpy(filePath[i], paths[i]);
if (strlen(filePath) >= PATH_LENGTH - 1)
{
#ifdef _WIN32
ptr_slash = strrchr(file_path, '\\');
#else
ptr_slash = strrchr(file_path, '/');
#endif
slash_length = strlen(ptr_slash);
if (slash_length >= NAME_LENGTH)
{
fileNameTruncated_index = NAME_LENGTH - 1;
for (z = 0; z < 6; z++)
{
fileNameTruncated[fileNameTruncated_index] = ptr_slash[slash_length];
fileNameTruncated_index--;
slash_length--;
}
for (z = 0; z < 4; z++)
{
fileNameTruncated[fileNameTruncated_index] = '.';
fileNameTruncated_index--;
}
strncpy(fileNameTruncated, ptr_slash, 47);
strncpy(file_name, file_path , 7);
file_name[7] = '.';
file_name[8] = '.';
file_name[9] = '.';
file_name[10] = '\0';
file_name[11] = '\0';
file_name[12] = '\0';
strcat(file_name, fileNameTruncated);
strcpy(file_path, file_name);
}
else {
copycount = PATH_LENGTH - 1;
prefix_length = copycount - slash_length - 3;
strncpy(file_name, file_path, prefix_length);
while (slash_length >= 0)
{
file_name[copycount] = ptr_slash[slash_length];
copycount--;
slash_length--;
}
for (j = 0; j < 3; j++, copycount--)
file_name[copycount] = '.';
file_name[65] = '\0';
strcpy(file_path, file_name);
}
return file_path;
}
else
return filePath;
}
void remove_path_entry(struct main_tab *main_settings, int indexToRemove)
{
//printf("Beginning processing. Array is currently: ");
//for (int i = 0; i < arraySize; ++i)
// printf("%d ", (*array)[i]);
//printf("\n");
char** temp = (char**)calloc(main_settings->filename_count, sizeof(char *)); // allocate an array with a size 1 less than the current one
memmove(
temp,
main_settings->filenames,
(indexToRemove + 1) * sizeof(char *)); // copy everything BEFORE the index
memmove(
temp + indexToRemove,
(main_settings->filenames) + (indexToRemove + 1),
(main_settings->filename_count - indexToRemove) * sizeof(char *)); // copy everything AFTER the index
free(main_settings->filenames);
main_settings->filenames = temp;
main_settings->filename_count--;
main_settings->filenames[main_settings->filename_count] = NULL;
}
struct nk_image
icon_load(const char *filename)
{
int x,y,n;
GLuint tex;
unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
if (!data) die("[SDL]: failed to load image: %s", filename);
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, x, y, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
glGenerateMipmap(GL_TEXTURE_2D);
stbi_image_free(data);
return nk_image_id((int)tex);
}
char* concat(char* string1, char *string2)
{
static char prefix[300], suffix[300];
strcpy(prefix, string1);
strcpy(suffix, string2);
return strcat(prefix, suffix);
}

35
src/GUI/ccextractorGUI.h Normal file
View File

@@ -0,0 +1,35 @@
#ifndef CCEXTRACTORGUI_H
#define CCEXTRACTORGUI_H
#ifndef NK_IMPLEMENTATION
#include "nuklear_lib/nuklear.h"
#endif // !NK_IMPLEMENTATION
struct main_tab
{
enum {PORT, FILES} port_or_files;
char port_num[8];
int port_num_len;
int is_check_common_extension;
char **port_type;
int port_select;
char **filenames;
int filename_count;
int is_file_selected[1000];
int is_file_browser_active;
int scaleWindowForFileBrowser;
nk_size progress_cursor;
char** activity_string;
int activity_string_count;
char** preview_string;
int preview_string_count;
int threadPopup;
};
void setup_main_settings(struct main_tab *main_settings);
char* truncate_path_string(char *filePath);
void remove_path_entry(struct main_tab *main_settings, int indexToRemove);
char* concat(char* string1, char *string2);
#endif //!CCEXTRACTORGUI_H

376
src/GUI/ccx_cli_thread.c Normal file
View File

@@ -0,0 +1,376 @@
#include "ccx_cli_thread.h"
#include "ccextractorGUI.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define MAX_WAIT 10
#define PROGRESS_COMPLETE 100
void* extract_thread(void* extract_args)
{
struct args_extract *params = (struct args_extract*)extract_args;
static char term_string[500];
strcpy(term_string, params->command_string);
strcat(term_string, " ");
strcat(term_string, params->file_string);
strcat(term_string, " 1>>ccx.log 2>>gui_report.log");
printf("%s", term_string);
system(term_string);
pthread_exit(0);
}
void* read_activity_data(void *read_args)
{
puts("Inside activity thread!");
char line[500];
char buffer[500];
#if UNIX
struct timespec time;
time.tv_sec = 0;
time.tv_nsec = 10000000L;
#endif
int wait = 0;
struct args_extract *read_params = (struct args_extract*)read_args;
FILE *file;
char current_input[500];
int concat_index = 0;
file = fopen("ccx.log", "r");
while(file == NULL)
{
printf("Cannot open ccx.log, trying again.\n");
file = fopen("ccx.log", "r");
#if UNIX
nanosleep(&time, NULL);
#else
_sleep(10);
#endif
wait++;
if(wait == MAX_WAIT)
{
read_params->main_threadsettings->threadPopup = nk_true;
return 0;
}
}
while(!feof(file))
{
if (fgets(current_input, sizeof(current_input), file) == NULL)
continue;
if (concat_index == 0) {
strcpy(line, current_input);
} else {
strcat(line, current_input);
}
concat_index++;
if (current_input[strlen(current_input) - 1] != '\n')
continue;
sscanf(line, "%[^\n]", buffer);
if(read_params->main_threadsettings->activity_string_count == 0)
read_params->main_threadsettings->activity_string =
malloc(sizeof(*read_params->main_threadsettings->activity_string));
else
read_params->main_threadsettings->activity_string =
realloc(read_params->main_threadsettings->activity_string,
(read_params->main_threadsettings->activity_string_count + 1)*sizeof(char*));
read_params->main_threadsettings->activity_string[read_params->main_threadsettings->activity_string_count] = strdup(buffer);
read_params->main_threadsettings->activity_string_count++;
memset(line, 0, sizeof(line));
memset(buffer, 0, sizeof(buffer));
concat_index = 0;
}
}
void* read_data_from_thread(void* read_args)
{
pthread_t tid_activity;
pthread_attr_t attr_activity;
static char buffer[500];
char t_start[6], t_end[6], subtitle1[100], subtitle2[100];
#if UNIX
struct timespec time;
time.tv_sec = 0;
time.tv_nsec = 10000000L;
#endif
int wait = 0;
struct args_extract *read_params = (struct args_extract*)read_args;
int unknown1 = 0, unknown2 = 0,progress_count = 0;
FILE *file;
char prev_line[500];
char line[500];
char current_input[500];
int concat_index = 0;
char sub_line[500];
char prog_line[500];
int subs_success1, subs_success2, progress_success;
/*Setup activity thread*/
pthread_attr_init(&attr_activity);
int err = pthread_create(&tid_activity, &attr_activity, read_activity_data, read_params);
if(!err)
puts("Activity Thread created");
file = fopen("gui_report.log", "r");
while (file == NULL) {
printf("Cannot open gui_report.log, trying again.\n");
file = fopen("gui_report.log", "r");
#if UNIX
nanosleep(&time, NULL);
#else
_sleep(10);
#endif
wait++;
if (wait >= MAX_WAIT) {
read_params->main_threadsettings->threadPopup = nk_true;
return 0;
}
}
while(1)
{
if (fgets(current_input, sizeof(current_input), file) == NULL)
continue;
if (concat_index == 0) {
strcpy(line, current_input);
} else {
strcat(line, current_input);
}
concat_index++;
if (current_input[strlen(current_input) - 1] != '\n')
continue;
progress_success = sscanf(line, "###PROGRESS#%d#%d#%d", &progress_count, &unknown1, &unknown2);
if(progress_success == 3)
read_params->main_threadsettings->progress_cursor = progress_count;
subs_success1 = sscanf(line, "###SUBTITLE#%[^#]#%[^#]#%[^\n]", t_start, t_end, subtitle1);
subs_success2 = sscanf(line, "###SUBTITLE###%[^\n]", subtitle2);
if(subs_success1 == 3)
{
sprintf(buffer, "%s-%s: %s", t_start, t_end, subtitle1);
if(read_params->main_threadsettings->preview_string_count == 0)
read_params->main_threadsettings->preview_string =
malloc(sizeof(*read_params->main_threadsettings->preview_string));
else
read_params->main_threadsettings->preview_string =
realloc(read_params->main_threadsettings->preview_string,
(read_params->main_threadsettings->preview_string_count + 1)*sizeof(char*));
read_params->main_threadsettings->preview_string[read_params->main_threadsettings->preview_string_count] = strdup(buffer);
read_params->main_threadsettings->preview_string_count++;
}
if(subs_success2 == 1)
{
sprintf(buffer, " %s", subtitle2);
if(read_params->main_threadsettings->preview_string_count == 0)
read_params->main_threadsettings->preview_string =
malloc(sizeof(*read_params->main_threadsettings->preview_string));
else
read_params->main_threadsettings->preview_string =
realloc(read_params->main_threadsettings->preview_string,
(read_params->main_threadsettings->preview_string_count + 1)*sizeof(char*));
read_params->main_threadsettings->preview_string[read_params->main_threadsettings->preview_string_count] = strdup(buffer);
read_params->main_threadsettings->preview_string_count++;
}
if(progress_count == PROGRESS_COMPLETE)
break;
memset(line, 0, sizeof(line));
concat_index = 0;
}
printf("progress count:%d\n", progress_count);
fclose(file);
printf("File closed\n");
for(int i = 0; i<read_params->main_threadsettings->preview_string_count; i++)
printf("%s\n",read_params->main_threadsettings->preview_string[i]);
pthread_exit(0);
}
void* feed_files_for_extraction(void* file_args)
{
printf("Inside feeder\n");
struct args_extract *extract_params = (struct args_extract *)file_args;
printf("count:%d\n", extract_params->main_threadsettings->filename_count);
extract_params->command_string = extract_params->threadcommand->term_string;
int count = extract_params->main_threadsettings->filename_count;
pthread_t tid_extract, tid_read;
pthread_attr_t attr_extract, attr_read;
for(int i = 0; count != 0; i++, count--)
{
pthread_t tid_extract, tid_read;
pthread_attr_t attr_extract, attr_read;
pthread_attr_init(&attr_extract);
pthread_attr_init(&attr_read);
extract_params->main_threadsettings->is_file_selected[i] = nk_true;
extract_args.file_string = extract_params->main_threadsettings->filenames[i];
int err1 = pthread_create(&tid_extract, &attr_extract, extract_thread, extract_params);
int err2 = pthread_create(&tid_read, &attr_read, read_data_from_thread, extract_params);
if (!err1)
printf("Extraction Thread Complete:%d\n", i);
if (!err2)
printf("Read Thread Complete:%d\n", i);
pthread_join(tid_extract, NULL);
printf("Extract thread joined\n");
pthread_join(tid_read, NULL);
printf("Read thread joined\n");
extract_params->main_threadsettings->is_file_selected[i] = nk_false;
remove("gui_report.log");
remove("ccx.log");
}
printf("File feeding over\n");
}
void setup_and_create_thread(struct main_tab *main_settings, struct built_string *command)
{
extract_args.main_threadsettings = (struct main_tab*)main_settings;
extract_args.threadcommand = (struct built_string*)command;
pthread_attr_init(&attr_launch);
int err = pthread_create(&tid_launch, &attr_launch, feed_files_for_extraction, &extract_args);
if (!err)
printf("Feeder created!\n");
}
/*THREAD FUNCTIONS FOR HD_HOMERUN*/
void* find_hd_homerun_devices(void *args)
{
char command[300];
extract_args.homerun_thread = (struct hd_homerun_tab*)args;
int wait = 0;
FILE *file;
char line[200];
int device_success;
char device[200];
#if UNIX
struct timespec time;
time.tv_sec = 0;
time.tv_nsec = 10000000L;
#endif
#if HD_HOMERUN
strcpy(command, "hdhomerun_config");
#else
strncpy(command, extract_args.homerun_thread->location, extract_args.homerun_thread->location_len);
#endif
strcpy(command, " discover >> homerun.log");
system(command);
file = fopen("homerun.log", "r");
while (file == NULL) {
printf("Cannot open file! Trying again.\n");
file = fopen("homerun.log", "r");
#if UNIX
nanosleep(&time, NULL);
#else
_sleep(10);
#endif
wait++;
if (wait >= MAX_WAIT) {
extract_args.homerun_thread->threadPopup = nk_true;
return 0;
}
}
while(1)
{
fgets(line, sizeof(line), file);
device_success = sscanf(line, "hdhomerun device %[^\n]", device);
if(feof(file))
break;
if(device_success == 1)
{
if(extract_args.homerun_thread->device_num == 0)
{
extract_args.homerun_thread->devices = malloc(sizeof(char*));
extract_args.homerun_thread->devices[extract_args.homerun_thread->device_num] = strdup(device);
extract_args.homerun_thread->device_num++;
}
else
{
extract_args.homerun_thread->devices = realloc(extract_args.homerun_thread->devices,
(extract_args.homerun_thread->device_num + 1)*sizeof(char*));
extract_args.homerun_thread->devices[extract_args.homerun_thread->device_num] = strdup(device);
extract_args.homerun_thread->device_num++;
}
}
}
printf("Find device thread finished\n");
}
void* setup_hd_homerun_device(void *args)
{
char device[20];
extract_args.homerun_thread = (struct hd_homerun_tab*)args;
char channel_command[300];
char program_command[300];
char target_command[300];
sscanf(extract_args.homerun_thread->devices[extract_args.homerun_thread->selected], "%s", device);
#if HD_HOMERUN
strcpy(channel_command, "hdhomerun_config");
strcpy(program_command, "hdhomerun_config");
strcpy(target_command, "hdhomerun_config");
#else
strncpy(channel_command, extract_args.homerun_thread->location, extract_args.homerun_thread->location_len);
strncpy(program_command, extract_args.homerun_thread->location, extract_args.homerun_thread->location_len);
strncpy(target_command, extract_args.homerun_thread->location, extract_args.homerun_thread->location_len);
#endif
strcat(channel_command, " ");
strcat(program_command, " ");
strcat(target_command, " ");
strcat(channel_command, device);
strcat(program_command, device);
strcat(target_command, device);
strcat(channel_command, " set /tuner");
strcat(program_command, " set /tuner");
strcat(target_command, " set /tuner");
strncat(channel_command, extract_args.homerun_thread->tuner, extract_args.homerun_thread->tuner_len);
strncat(program_command, extract_args.homerun_thread->tuner, extract_args.homerun_thread->tuner_len);
strncat(target_command, extract_args.homerun_thread->tuner, extract_args.homerun_thread->tuner_len);
strcat(channel_command, "/channel ");
strcat(program_command, "/program ");
strcat(target_command, "/target ");
strncat(channel_command, extract_args.homerun_thread->channel, extract_args.homerun_thread->channel_len);
strncat(program_command, extract_args.homerun_thread->program, extract_args.homerun_thread->program_len);
strncat(target_command, extract_args.homerun_thread->ipv4_address, extract_args.homerun_thread->ipv4_address_len);
system(channel_command);
system(program_command);
system(target_command);
pthread_exit(0);
}

40
src/GUI/ccx_cli_thread.h Normal file
View File

@@ -0,0 +1,40 @@
#ifndef CCX_CLI_THREAD_H
#define CCX_CLI_THREAD_H
#define HAVE_STRUCT_TIMESPEC
#include "ccextractorGUI.h"
#include "popups.h"
#include "tabs.h"
#include "command_builder.h"
#include "pthread.h"
struct args_extract {
struct main_tab *main_threadsettings;
struct built_string *threadcommand;
struct hd_homerun_tab *homerun_thread;
char *file_string;
char *command_string;
};
static struct args_extract extract_args;
//FOR EXTRACT BUTTON TRIGGER ---- MAIN_TAB
pthread_t tid_launch;
pthread_attr_t attr_launch;
//FOR FIND DEVICES BUTTON TRIGGER ----- HD_HOMERUN_TAB
pthread_t tid_find;
pthread_attr_t attr_find;
//FOR SETUP DEVICE BUTTON TRIGGER ------ HD_HOMERUN_TAB
pthread_t tid_setup;
pthread_attr_t attr_setup;
void* read_activity_data(void *read_args);
void* read_data_from_thread(void* read_args);
void* extract_thread(void* extract_args);
void* feed_files_for_extraction(void* file_args);
void setup_and_create_thread(struct main_tab *main_settings, struct built_string *command);
void* find_hd_homerun_devices(void *args);
void* setup_hd_homerun_device(void *args);
#endif //!CCX_CLI_THREAD_H

482
src/GUI/command_builder.c Normal file
View File

@@ -0,0 +1,482 @@
#ifndef NK_IMPLEMENTATION
#include "nuklear_lib/nuklear.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#endif //!NK_IMPLEMENTATION
#include "ccextractorGUI.h"
#include "tabs.h"
#include "command_builder.h"
void command_builder(struct built_string *command,
struct main_tab *main_settings,
struct network_popup *network_settings,struct input_tab *input,
struct advanced_input_tab *advanced_input,
struct output_tab *output,
struct decoders_tab *decoders,
struct credits_tab *credits,
struct debug_tab *debug,
struct burned_subs_tab *burned_subs)
{
static char buffer[1000];
#ifdef _WIN32
strcpy(buffer, "ccextractorwin --gui_mode_reports");
#else
strcpy(buffer, "./ccextractor --gui_mode_reports");
#endif
/*INPUT COMMANDS*/
if (main_settings->port_or_files == FILES)
{
if (input->type_select != 0)
{
strcat(buffer, " -in=");
strcat(buffer, input->type[input->type_select]);
}
if (input->is_split)
strcat(buffer, " --videoedited");
if (input->is_process_from) {
strcat(buffer, " -startat ");
strcat(buffer, input->from_time_buffer);
}
if (input->is_process_until) {
strcat(buffer, " -endat ");
strcat(buffer, input->until_time_buffer);
}
switch (input->elementary_stream) {
case AUTO_DETECT:
break;
case STREAM_TYPE:
strcat(buffer, " -datastreamtype ");
strncat(buffer, input->stream_type, input->stream_type_len);
break;
case STREAM_PID:
strcat(buffer, " -datapid ");
strncat(buffer, input->stream_pid, input->stream_pid_len);
}
if (input->is_assume_mpeg) {
strcat(buffer, " -streamtype ");
strncat(buffer, input->mpeg_type, input->mpeg_type_len);
}
if(decoders->teletext_dvb == TELETEXT)
{
switch (input->teletext_decoder) {
case AUTO_DECODE:
break;
case FORCE:
strcat(buffer, " -teletext");
break;
case DISABLE:
strcat(buffer, " -noteletext");
}
if (input->is_process_teletext_page) {
strcat(buffer, " -tpage ");
strncat(buffer, input->teletext_page_number, input->teletext_page_numer_len);
}
}
switch (input->is_limit) {
case NO_LIMIT:
break;
case LIMITED:
strcat(buffer, " --screenfuls ");
strcat(buffer, input->screenful_limit_buffer);
}
switch (input->clock_input) {
case AUTO:
break;
case GOP:
strcat(buffer, " --goptime");
break;
case PTS:
strcat(buffer, " --nogoptime");
break;
}
}
/*Main tab and network settings*/
if (main_settings->port_or_files == PORT)
{
switch (main_settings->port_select)
{
case 0:
strcat(buffer, " -udp ");
if (!strstr(network_settings->udp_ipv4, "None")) {
strncat(buffer, network_settings->udp_ipv4, network_settings->udp_ipv4_len);
strcat(buffer, ":");
}
strncat(buffer, main_settings->port_num, main_settings->port_num_len);
break;
case 1:
strcat(buffer, " -tcp ");
strncat(buffer, main_settings->port_num, main_settings->port_num_len);
if (!strstr(network_settings->tcp_pass, "None")) {
strcat(buffer, " -tcppassword ");
strncat(buffer, network_settings->tcp_pass, network_settings->tcp_pass_len);
}
if (!strstr(network_settings->tcp_desc, "None")) {
strcat(buffer, " -tcpdesc ");
strncat(buffer, network_settings->tcp_desc, network_settings->tcp_desc_len);
}
break;
default:
break;
}
if (input->is_live_stream) {
strcat(buffer, " -s ");
strncat(buffer, input->wait_data_sec, input->wait_data_sec_len);
}
if (input->is_process_from) {
strcat(buffer, " -startat ");
strcat(buffer, input->from_time_buffer);
}
if (input->is_process_until) {
strcat(buffer, " -endat ");
strcat(buffer, input->until_time_buffer);
}
switch (input->elementary_stream) {
case AUTO_DETECT:
break;
case STREAM_TYPE:
strcat(buffer, " -datastreamtype ");
strncat(buffer, input->stream_type, input->stream_type_len);
break;
case STREAM_PID:
strcat(buffer, " -datapid ");
strncat(buffer, input->stream_pid, input->stream_pid_len);
}
if (input->is_assume_mpeg) {
strcat(buffer, " -streamtype ");
strncat(buffer, input->mpeg_type, input->mpeg_type_len);
}
switch (input->teletext_decoder) {
case AUTO_DECODE:
break;
case FORCE:
strcat(buffer, " -teletext");
break;
case DISABLE:
strcat(buffer, " -noteletext");
}
if (input->is_process_teletext_page) {
strcat(buffer, " -tpage ");
strncat(buffer, input->teletext_page_number, input->teletext_page_numer_len);
}
switch (input->is_limit) {
case NO_LIMIT:
break;
case LIMITED:
strcat(buffer, " --screenfuls ");
strcat(buffer, input->screenful_limit_buffer);
}
switch (input->clock_input) {
case AUTO:
break;
case GOP:
strcat(buffer, " --goptime");
break;
case PTS:
strcat(buffer, " --nogoptime");
break;
}
}
/*ADVANCED INPUT SETTINGS*/
if(advanced_input->is_multiple_program)
{
switch(advanced_input->multiple_program)
{
case FIRST_PROG:
strcat(buffer, " -autoprogram");
break;
case PROG_NUM:
strcat(buffer, " -pn ");
strcat(buffer, advanced_input->prog_number);
break;
}
}
switch(advanced_input->set_myth)
{
case AUTO_MYTH:
break;
case FORCE_MYTH:
strcat(buffer, " -myth");
break;
case DISABLE_MYTH:
strcat(buffer, " -nomyth");
break;
}
if(advanced_input->is_mpeg_90090)
strcat(buffer, " -90090");
if(advanced_input->is_padding_0000)
strcat(buffer, " -fp");
if(advanced_input->is_order_ccinfo)
strcat(buffer, " -poc");
if(advanced_input->is_win_bug)
strcat(buffer, " -wtvconvertfix");
if(advanced_input->is_hauppage_file)
strcat(buffer, " -haup");
if(advanced_input->is_process_mp4)
strcat(buffer, " -mp4vidtrack");
if(advanced_input->is_ignore_broadcast)
strcat(buffer, " -noautotimeref");
/*DECODERS TAB*/
if(decoders->is_field2)
strcat(buffer, " -12");
switch(decoders->channel)
{
case CHANNEL_1:
break;
case CHANNEL_2:
strcat(buffer, " -cc2");
break;
}
if(decoders->is_708)
{
strcat(buffer, " -svc ");
strncat(buffer, decoders->services, decoders->services_len);
}
switch(decoders->teletext_dvb)
{
case TELETEXT:
if(strcmp(decoders->min_distance, "2"))
{
strcat(buffer, " -levdistmincnt ");
strncat(buffer, decoders->min_distance, decoders->min_distance_len);
}
if(strcmp(decoders->max_distance, "10"))
{
strcat(buffer, " -levdistmaxpct ");
strncat(buffer, decoders->max_distance, decoders->max_distance_len);
}
break;
case DVB:
strcat(buffer, " -codec dvdsub");
break;
}
/*CREDITS TAB*/
if(credits->is_start_text)
{
strcat(buffer, " --startcreditstext \"");
strncat(buffer, credits->start_text, credits->start_text_len);
strcat(buffer,"\" --startcreditsforatleast ");
strncat(buffer, credits->start_atleast_sec, credits->start_atleast_sec_len);
strcat(buffer, " --startcreditsforatmost ");
strncat(buffer, credits->start_atmost_sec, credits->start_atmost_sec_len);
if(credits->is_before)
{
strcat(buffer, " --startcreditsnotbefore ");
strcat(buffer, credits->before_time_buffer);
}
if(credits->is_after)
{
strcat(buffer, " --startcreditsnotafter ");
strcat(buffer, credits->after_time_buffer);
}
}
if(credits->is_end_text)
{
strcat(buffer, " --endcreditstext \"");
strncat(buffer, credits->end_text, credits->end_text_len);
strcat(buffer, "\" --endcreditsforatleast ");
strncat(buffer, credits->end_atleast_sec, credits->end_atleast_sec_len);
strcat(buffer, " --endcreditsforatmost ");
strncat(buffer, credits->end_atmost_sec, credits->end_atmost_sec_len);
}
/*DEBUG TAB*/
if(debug->is_elementary_stream)
{
strcat(buffer, " -cf ");
strncat(buffer, debug->elementary_stream, debug->elementary_stream_len);
}
if(debug->is_dump_packets)
strcat(buffer, " -debug");
if(debug->is_debug_608)
strcat(buffer, " -608");
if(debug->is_debug_708)
strcat(buffer, " -708");
if(debug->is_stamp_output)
strcat(buffer, " -goppts");
if(debug->is_debug_analysed_vid)
strcat(buffer, " -vides");
if(debug->is_raw_608_708)
strcat(buffer, " -cbraw");
if(debug->is_debug_parsed)
strcat(buffer, " -parsedebug");
if(!strcmp(output->type[output->type_select], "bin"))
{
if(debug->is_disable_sync)
strcat(buffer, " -nosync");
if(debug->is_no_padding)
strcat(buffer, " -fullbin");
}
if(debug->is_debug_xds)
strcat(buffer, " -xdsdebug");
if(debug->is_output_pat)
strcat(buffer, " -parsePAT");
if(debug->is_output_pmt)
strcat(buffer, " -parsePMT");
if(debug->is_scan_ccdata)
strcat(buffer, " -investigate_packets");
if(debug->is_output_levenshtein)
strcat(buffer, " -deblev");
/*HARD_BURNED SUBS SETTINGS*/
if(burned_subs->is_burned_subs)
{
strcat(buffer, " -hardsubx -ocr_mode");
switch(burned_subs->ocr_mode)
{
case FRAME_WISE:
strcat(buffer, " frame");
break;
case WORD_WISE:
strcat(buffer, " word");
break;
case LETTER_WISE:
strcat(buffer, " letter");
break;
}
strcat(buffer, " -min_sub_duration ");
strcat(buffer, burned_subs->min_duration);
if(!burned_subs->subs_color_select && burned_subs->color_type == PRESET)
sprintf(buffer, "%s -whiteness_thresh %d", buffer, burned_subs->luminance_threshold);
sprintf(buffer, "%s -conf_thresh %d", buffer, burned_subs->confidence_threshold);
if(burned_subs->is_italic)
strcat(buffer, " -detect_italics");
}
//Output
{
strcat(buffer, " -out=");
strcat(buffer, output->type[output->type_select]);
if (output->is_filename) {
strcat(buffer, " -o \"");
strncat(buffer, output->filename, output->filename_len);
strcat(buffer, "\"");
}
if (output->is_delay) {
strcat(buffer, " -delay ");
strcat(buffer, output->delay_sec_buffer);
}
if (output->is_export_xds)
strcat(buffer, " -xds");
switch (output->encoding) {
case LATIN:
strcat(buffer, " -latin1");
break;
case UNIC:
strcat(buffer, " -unicode");
break;
case UTF:
strcat(buffer, " -utf8");
break;
}
if (output->is_bom)
strcat(buffer, " -bom");
else
strcat(buffer, " -nobom");
if (output->is_cap_standard)
strcat(buffer, " --sentencecap");
if (output->is_cap_file) {
strcat(buffer, " --capfile \"");
strncat(buffer, output->cap_dictionary, output->cap_dictionary_len);
strcat(buffer, "\"");
}
switch (output->line_ending)
{
case CRLF:
break;
case LF:
strcat(buffer, " -lf");
break;
}
if (output->is_center)
strcat(buffer, " -trim");
if (output->is_dash)
strcat(buffer, " -autodash");
if (output->no_typesetting)
strcat(buffer, " --notypesetting");
switch (output->font_color) {
case NO_COLOR:
strcat(buffer, " --nofontcolor");
break;
case DEFAULT_COLOR:
strcat(buffer, " --defaultcolor #");
strcat(buffer, output->color_hex);
break;
}
switch (output->onetime_or_realtime)
{
case ONETIME:
strcat(buffer, " --norollup");
break;
case REALTIME:
strcat(buffer, " -dru");
switch (output->roll_limit_select)
{
case 1:
strcat(buffer, " -ru1");
break;
case 2:
strcat(buffer, " -ru2");
break;
case 3:
strcat(buffer, " -ru3");
break;
default:
break;
}
}
}
memset(command->term_string, 0, sizeof(command->term_string));
strncpy(command->term_string, buffer, strlen(buffer));
}

Some files were not shown because too many files have changed in this diff Show More