mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-06 21:26:10 +00:00
Compare commits
1044 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
270c89b7f8 | ||
|
|
032cd1c6b1 | ||
|
|
42e4e9a657 | ||
|
|
821e307333 | ||
|
|
ae81f3ba3d | ||
|
|
b190751b2c | ||
|
|
f1bb0f4dce | ||
|
|
f147ac27f8 | ||
|
|
2dfb44d7d4 | ||
|
|
580e721dfe | ||
|
|
d0a82447ff | ||
|
|
5c19c7b932 | ||
|
|
fd7271bae2 | ||
|
|
05c68349d5 | ||
|
|
09f21f64e4 | ||
|
|
c65fb0874e | ||
|
|
9db727d593 | ||
|
|
fe6dad83b7 | ||
|
|
d494286082 | ||
|
|
259e881483 | ||
|
|
197069d3b8 | ||
|
|
7a810d736d | ||
|
|
1413c948c4 | ||
|
|
bb5385913b | ||
|
|
f8981e8e1e | ||
|
|
a1871abf04 | ||
|
|
20b3773bb9 | ||
|
|
8786b4cf75 | ||
|
|
8632ecda5b | ||
|
|
475153a9dd | ||
|
|
df90009f73 | ||
|
|
2352ea21e3 | ||
|
|
dc041a35e8 | ||
|
|
e99ba1d177 | ||
|
|
298665faa4 | ||
|
|
735a01bf04 | ||
|
|
3618c23b5a | ||
|
|
b7c9da75dd | ||
|
|
449d55d5e5 | ||
|
|
60aa370899 | ||
|
|
3d18b38c32 | ||
|
|
2a6d27f9ff | ||
|
|
91d3512bcc | ||
|
|
74e64c0421 | ||
|
|
c175750ebe | ||
|
|
e7dc4d19f7 | ||
|
|
1fbb51056d | ||
|
|
5d9a8cc6f2 | ||
|
|
17abad79f2 | ||
|
|
707e1f01fe | ||
|
|
efc8b791e7 | ||
|
|
a856bbde10 | ||
|
|
9390b876fa | ||
|
|
ead0a4beed | ||
|
|
b2e9cb74c1 | ||
|
|
20b194aac4 | ||
|
|
2d9b480972 | ||
|
|
1447b021cb | ||
|
|
e0ac126cff | ||
|
|
b8019bdb35 | ||
|
|
9d921dec43 | ||
|
|
3ada2b5002 | ||
|
|
50ec9866db | ||
|
|
ce87d01fbd | ||
|
|
fecd24d08e | ||
|
|
482544c5bf | ||
|
|
84a7a1fb41 | ||
|
|
f198bcd2ec | ||
|
|
4b6016ca1c | ||
|
|
9c2ea47eda | ||
|
|
170b466a20 | ||
|
|
2bdcd20115 | ||
|
|
ab18d234d2 | ||
|
|
3ff02617b0 | ||
|
|
c7fad95e24 | ||
|
|
c018f1f43c | ||
|
|
98b50b2a35 | ||
|
|
46cee0893a | ||
|
|
42ad48ca7f | ||
|
|
ed26a595bd | ||
|
|
b1c2aabb22 | ||
|
|
bb2ae1e70f | ||
|
|
6464fa486e | ||
|
|
5aa747ab33 | ||
|
|
39adfa59b0 | ||
|
|
20287548cb | ||
|
|
b7b10419ec | ||
|
|
8fbfd68426 | ||
|
|
7159d0b6d0 | ||
|
|
c515578e37 | ||
|
|
e55b8eb764 | ||
|
|
0228fbcbfa | ||
|
|
0e190e0962 | ||
|
|
13f1b5ab53 | ||
|
|
b39f923c46 | ||
|
|
7e32d6a553 | ||
|
|
3bde3dceec | ||
|
|
d5201b1129 | ||
|
|
a199f4f8af | ||
|
|
eea049923d | ||
|
|
d999c3e0e0 | ||
|
|
aac90d5a5f | ||
|
|
618df184c6 | ||
|
|
5e6aab8972 | ||
|
|
a77c21c06c | ||
|
|
4252703431 | ||
|
|
1af2a29a3c | ||
|
|
8ab474c593 | ||
|
|
1c781c2a38 | ||
|
|
4d718378d5 | ||
|
|
1bd4cd5c0a | ||
|
|
067045ce92 | ||
|
|
2f2904041c | ||
|
|
d837c369e5 | ||
|
|
686ff69fdc | ||
|
|
126835d998 | ||
|
|
6e170cd812 | ||
|
|
fe921626e1 | ||
|
|
6578f0ff34 | ||
|
|
1911068e92 | ||
|
|
493495361d | ||
|
|
643857e98f | ||
|
|
05adb5f47e | ||
|
|
504877b928 | ||
|
|
64ee63a560 | ||
|
|
270c603bd2 | ||
|
|
6d356b4458 | ||
|
|
cfb10d4b91 | ||
|
|
ca2b708023 | ||
|
|
10ac5ca6ce | ||
|
|
333cfb3726 | ||
|
|
c609f66c02 | ||
|
|
91f254017b | ||
|
|
1f5d3df0ae | ||
|
|
e36d81c237 | ||
|
|
8d338dc362 | ||
|
|
c78e01d186 | ||
|
|
401ff6c105 | ||
|
|
83eb51ed6f | ||
|
|
bce0c92fdd | ||
|
|
ea4859fd54 | ||
|
|
8d7890c743 | ||
|
|
477307e438 | ||
|
|
4a4911bcec | ||
|
|
dc946168e7 | ||
|
|
3a60b1268b | ||
|
|
e3d1c56ad0 | ||
|
|
b5bc0e2616 | ||
|
|
600a9a0e75 | ||
|
|
694b61f862 | ||
|
|
86925727e0 | ||
|
|
1c7515681e | ||
|
|
2bcac83761 | ||
|
|
efc28d87d5 | ||
|
|
b4d8e0ffaf | ||
|
|
0b7b7fd031 | ||
|
|
90041554a3 | ||
|
|
6950a7661e | ||
|
|
41fb966f6f | ||
|
|
04ed95f8b5 | ||
|
|
ddf29672fd | ||
|
|
0890e06d84 | ||
|
|
8c33412888 | ||
|
|
f40294cc5c | ||
|
|
22d5d35158 | ||
|
|
51cae1c2f0 | ||
|
|
dfaebd5db8 | ||
|
|
cfa7d912ca | ||
|
|
ad971f0e72 | ||
|
|
8aadbfb5f2 | ||
|
|
44eb665cd8 | ||
|
|
1255b318ae | ||
|
|
1b0e66bc67 | ||
|
|
f5dc1cf467 | ||
|
|
aaf937a135 | ||
|
|
317c66f14e | ||
|
|
946c5859d4 | ||
|
|
7166e48698 | ||
|
|
d31ea87c03 | ||
|
|
028ce9d0b5 | ||
|
|
cc7a43b5e2 | ||
|
|
3e1424cda8 | ||
|
|
82109e6cd9 | ||
|
|
5dc8292dd2 | ||
|
|
a5b8bc8bf6 | ||
|
|
29158b2c38 | ||
|
|
ad2ee70743 | ||
|
|
562de8893b | ||
|
|
12adb5e92b | ||
|
|
203eb23030 | ||
|
|
774c3a0d3a | ||
|
|
07f1ddc3fe | ||
|
|
303bec8d5d | ||
|
|
e43a6b5ced | ||
|
|
64484af49e | ||
|
|
7526da884c | ||
|
|
3529bb29b4 | ||
|
|
925560f773 | ||
|
|
200eb1750a | ||
|
|
6dcdb4b2d8 | ||
|
|
a2d2c4f063 | ||
|
|
4ab6c83c27 | ||
|
|
e66a0183c3 | ||
|
|
a8ec28630a | ||
|
|
432d4237ec | ||
|
|
e9519c4a67 | ||
|
|
fef005ddaf | ||
|
|
546c776e57 | ||
|
|
daeed5df71 | ||
|
|
b56ab005a8 | ||
|
|
f1681ee929 | ||
|
|
031f463b5c | ||
|
|
b23866f5a8 | ||
|
|
2ec93c3d3d | ||
|
|
5564aa8a54 | ||
|
|
868fac5423 | ||
|
|
9ca26171d6 | ||
|
|
ead4cbb278 | ||
|
|
dfd7101f54 | ||
|
|
9659d3cf4c | ||
|
|
34c7cd6d2e | ||
|
|
7448a260c7 | ||
|
|
54236f840c | ||
|
|
f2aeef167b | ||
|
|
6a4a1c97ec | ||
|
|
f369959096 | ||
|
|
1c2bcb5088 | ||
|
|
da79ee44d9 | ||
|
|
26434a7f89 | ||
|
|
718eb1a37f | ||
|
|
ace6361bfb | ||
|
|
7041441d39 | ||
|
|
1589c31774 | ||
|
|
c96d3ff3f1 | ||
|
|
598a48e260 | ||
|
|
0cc3626261 | ||
|
|
e0e66bd0ba | ||
|
|
2642ca8805 | ||
|
|
a108302dc0 | ||
|
|
ce90b61923 | ||
|
|
18566f2213 | ||
|
|
125c5e8821 | ||
|
|
64ce4ac84f | ||
|
|
674b859284 | ||
|
|
9a761331f8 | ||
|
|
046ee71eda | ||
|
|
b5fc3e63c4 | ||
|
|
5eaf805d27 | ||
|
|
0ba941e8c0 | ||
|
|
a9413a2312 | ||
|
|
a2eb03cb73 | ||
|
|
06063f26a4 | ||
|
|
82daa7fb2b | ||
|
|
a71687e19f | ||
|
|
25162fe40a | ||
|
|
3365a715a6 | ||
|
|
26e0f64720 | ||
|
|
a1ed940c8b | ||
|
|
f5f4768503 | ||
|
|
e4374204bd | ||
|
|
7f55ae5c1d | ||
|
|
8bf1bc16de | ||
|
|
5352a8b877 | ||
|
|
fd155285d2 | ||
|
|
a6fd8d468a | ||
|
|
5b05ce5073 | ||
|
|
d28bc4e114 | ||
|
|
285e81f9a7 | ||
|
|
730156f33b | ||
|
|
152bbd308c | ||
|
|
8c586bccbd | ||
|
|
434cd3959a | ||
|
|
3cb0f61b0c | ||
|
|
a18eaa2c96 | ||
|
|
69b7f9f4c3 | ||
|
|
63dde6f3b2 | ||
|
|
8f64eeb54f | ||
|
|
02d91c4a03 | ||
|
|
463a4a85a1 | ||
|
|
ba2833b819 | ||
|
|
635a305c37 | ||
|
|
6fe612db3e | ||
|
|
2930c61420 | ||
|
|
173db88dcf | ||
|
|
29c3f4e684 | ||
|
|
d4a7b1d6ed | ||
|
|
9d14766b0d | ||
|
|
6f2a73d706 | ||
|
|
1fccb783f2 | ||
|
|
ec30a79be9 | ||
|
|
5beb4389f6 | ||
|
|
a6ccf29630 | ||
|
|
b6d7c7e778 | ||
|
|
117c2fce69 | ||
|
|
ffd6a34c30 | ||
|
|
70af627078 | ||
|
|
b0a5c069ed | ||
|
|
53ee63894c | ||
|
|
50ece42e0a | ||
|
|
3d00e718f6 | ||
|
|
021b788461 | ||
|
|
86e5d47141 | ||
|
|
5b36356456 | ||
|
|
ba04aedae1 | ||
|
|
5001df0d6c | ||
|
|
28506fee7b | ||
|
|
47d8aaddb9 | ||
|
|
1b2254f911 | ||
|
|
dc34b26afb | ||
|
|
c06102678e | ||
|
|
b0800a112c | ||
|
|
2b0d9ed427 | ||
|
|
fd4db0e7bf | ||
|
|
00d8c9cb0a | ||
|
|
7829c14c60 | ||
|
|
d3602ec938 | ||
|
|
f9b5e081a7 | ||
|
|
bdc3eaa81b | ||
|
|
2820042c1d | ||
|
|
d4d228125a | ||
|
|
43d5ba2f34 | ||
|
|
557774b202 | ||
|
|
4e0472bddf | ||
|
|
9a2fe6221e | ||
|
|
182b23a283 | ||
|
|
77f3fd35f4 | ||
|
|
14e6919f2e | ||
|
|
353a37010d | ||
|
|
921cbe0c57 | ||
|
|
f0523ceaa3 | ||
|
|
7284430fc6 | ||
|
|
68d0d4094e | ||
|
|
7075f6291d | ||
|
|
170d769476 | ||
|
|
1ff3457744 | ||
|
|
dc352a2202 | ||
|
|
c8750e42d1 | ||
|
|
20448bfeb2 | ||
|
|
807df0339e | ||
|
|
6642973c63 | ||
|
|
f08fd658e6 | ||
|
|
5ae3116a6c | ||
|
|
826afcd991 | ||
|
|
46af5ce9bb | ||
|
|
123b35ae69 | ||
|
|
f6e9d55838 | ||
|
|
6f7d3f6169 | ||
|
|
07cc78c2f1 | ||
|
|
affa34848c | ||
|
|
45ee03aecc | ||
|
|
c6e27ca809 | ||
|
|
a8f25ce25e | ||
|
|
2781a7f7d6 | ||
|
|
903ccc1442 | ||
|
|
857a3bc9c6 | ||
|
|
c2c589d6f6 | ||
|
|
941604b33c | ||
|
|
1950f096b6 | ||
|
|
1fc5ec00d4 | ||
|
|
c0deae4b0c | ||
|
|
84692b5658 | ||
|
|
4a51ad114e | ||
|
|
6789376b92 | ||
|
|
ea5125f030 | ||
|
|
000b39775c | ||
|
|
23fe02f0d2 | ||
|
|
394fb39a9c | ||
|
|
294bf5bc18 | ||
|
|
4e52e61c91 | ||
|
|
faaaabf63c | ||
|
|
f5a9018ef0 | ||
|
|
e01720c05e | ||
|
|
f80b1f26ca | ||
|
|
e42bc2b9f9 | ||
|
|
f9ebfd2a32 | ||
|
|
bf9841a255 | ||
|
|
9f670de8ed | ||
|
|
fc4a14e7d6 | ||
|
|
4f13b861cd | ||
|
|
df692f296d | ||
|
|
419fc4694d | ||
|
|
fc230fc217 | ||
|
|
825e160e72 | ||
|
|
8e24c17c1e | ||
|
|
4e21fae053 | ||
|
|
be239a5c46 | ||
|
|
1d9f32239e | ||
|
|
cbb5f0b0a8 | ||
|
|
fd063931ea | ||
|
|
7a9acb7bd2 | ||
|
|
cbf180eb39 | ||
|
|
614e6c42b5 | ||
|
|
38bcb7ed85 | ||
|
|
d57354830e | ||
|
|
7b43201ce1 | ||
|
|
ea1c82ac17 | ||
|
|
b3f1e27f5c | ||
|
|
82c92d3910 | ||
|
|
5bf8e7de0d | ||
|
|
5b8a9709df | ||
|
|
063786c4b7 | ||
|
|
6ed09ea397 | ||
|
|
44363c0acd | ||
|
|
701271ec82 | ||
|
|
7c74ea4112 | ||
|
|
ed42525f44 | ||
|
|
b88d1ebab2 | ||
|
|
ec11b00f9f | ||
|
|
8c0fe08781 | ||
|
|
3304c1b094 | ||
|
|
5bad3732c3 | ||
|
|
e3b0defb49 | ||
|
|
2065c5509d | ||
|
|
5458370346 | ||
|
|
9e19c58edf | ||
|
|
0bb56d508a | ||
|
|
2c67381d2b | ||
|
|
2b708c4a31 | ||
|
|
94a43928ad | ||
|
|
25d68b75bd | ||
|
|
73cd19f5d0 | ||
|
|
d0caf23a82 | ||
|
|
da3dc52b45 | ||
|
|
0fdfb751ba | ||
|
|
0b5f13e2c4 | ||
|
|
60cec9e6de | ||
|
|
d758f3156a | ||
|
|
da802a0a39 | ||
|
|
8f78a8bbb2 | ||
|
|
e87807ec27 | ||
|
|
d097ec881c | ||
|
|
87c898497a | ||
|
|
49b698259d | ||
|
|
5715d6d315 | ||
|
|
9fddaab3b0 | ||
|
|
6fdfde0838 | ||
|
|
8db7fc7a6d | ||
|
|
d8504f80bd | ||
|
|
70404c29ca | ||
|
|
feb2a61c1d | ||
|
|
6503502624 | ||
|
|
bf271de52c | ||
|
|
67e560d288 | ||
|
|
54bc97a3f8 | ||
|
|
3d7c534824 | ||
|
|
eda489265d | ||
|
|
0ac093e4b2 | ||
|
|
6838666b79 | ||
|
|
08d59ecb5f | ||
|
|
2ce3e0c0de | ||
|
|
3f45a4e136 | ||
|
|
d0d46fc176 | ||
|
|
3e9ed3043b | ||
|
|
1bdd9abd35 | ||
|
|
9e970fd788 | ||
|
|
87bc1d9613 | ||
|
|
440cd5527f | ||
|
|
0fbbc06bcf | ||
|
|
5f0c6728bf | ||
|
|
b9aabcd60d | ||
|
|
d0243237db | ||
|
|
a86a4ca7ce | ||
|
|
77624ec678 | ||
|
|
73db3a2c39 | ||
|
|
dd3dab7d52 | ||
|
|
ebfa31c333 | ||
|
|
d52d26baf8 | ||
|
|
3a852b7915 | ||
|
|
c3f637a10e | ||
|
|
f3768625c6 | ||
|
|
c733902473 | ||
|
|
6c44100f97 | ||
|
|
a0593c60e3 | ||
|
|
300f8ca65a | ||
|
|
8988152fa5 | ||
|
|
78642bcf02 | ||
|
|
609a53f373 | ||
|
|
0c0e44472d | ||
|
|
2060db99c8 | ||
|
|
a299d06d97 | ||
|
|
50b51e4234 | ||
|
|
0b74c9226a | ||
|
|
80957d645b | ||
|
|
80a117e643 | ||
|
|
63999369b7 | ||
|
|
0e815c6e2d | ||
|
|
0ef7227d7e | ||
|
|
2fa023b9fe | ||
|
|
2f0770d45f | ||
|
|
ee36ac1d4d | ||
|
|
e160a533b0 | ||
|
|
083c12698f | ||
|
|
88fbe9190a | ||
|
|
ac49bb5978 | ||
|
|
138ccd01c2 | ||
|
|
9fe2dab6d4 | ||
|
|
a28561ad0d | ||
|
|
c8f6b565fd | ||
|
|
442ce1015d | ||
|
|
e2dfdaa6a8 | ||
|
|
a0809caa94 | ||
|
|
859741a22c | ||
|
|
4429067965 | ||
|
|
d72646ac85 | ||
|
|
4a304346c9 | ||
|
|
627e0855ce | ||
|
|
7b1a169b8f | ||
|
|
3d5d8e2a0a | ||
|
|
683468e233 | ||
|
|
89849d321f | ||
|
|
588ad5260a | ||
|
|
ebd8148cad | ||
|
|
ba33f7572d | ||
|
|
9cf96b1899 | ||
|
|
0b3ad40377 | ||
|
|
ac72625030 | ||
|
|
f6cb862dcb | ||
|
|
53c0f56b6f | ||
|
|
62272e7be6 | ||
|
|
a7e05c265c | ||
|
|
9ce13cf45f | ||
|
|
e0ac99a241 | ||
|
|
6ebf98ea4a | ||
|
|
9372e15024 | ||
|
|
7e1a01447a | ||
|
|
b728ddadfa | ||
|
|
300541b873 | ||
|
|
2f1c1bf227 | ||
|
|
0bcb532428 | ||
|
|
d8698dc9cb | ||
|
|
4cc9231fc8 | ||
|
|
d202a66fd0 | ||
|
|
d8048bc95a | ||
|
|
af3ab5acd4 | ||
|
|
90519e2296 | ||
|
|
494b14b651 | ||
|
|
5b286c5b8d | ||
|
|
ea4f884b9d | ||
|
|
3b0a63d9c6 | ||
|
|
390c96f00d | ||
|
|
95f6f09659 | ||
|
|
42885caedd | ||
|
|
8d95ad0e7b | ||
|
|
1f0980185f | ||
|
|
6c764aa56c | ||
|
|
a0129df16c | ||
|
|
d2ab31fe38 | ||
|
|
3f6656176e | ||
|
|
f2f63ed65f | ||
|
|
3738540804 | ||
|
|
31c6e94e25 | ||
|
|
33f41f6045 | ||
|
|
137719ebea | ||
|
|
ecb0780af5 | ||
|
|
abce0864a5 | ||
|
|
9ff46656be | ||
|
|
446923c79d | ||
|
|
cde9e1f842 | ||
|
|
6c75b26484 | ||
|
|
9c4d5a8a58 | ||
|
|
a49ebf4230 | ||
|
|
7b8533a2dc | ||
|
|
134cd75d3b | ||
|
|
80e21171b1 | ||
|
|
0b262d0e17 | ||
|
|
f579cbe45d | ||
|
|
1a83913540 | ||
|
|
075ae04f1d | ||
|
|
d4949ccfa3 | ||
|
|
588c981184 | ||
|
|
941b88f3f9 | ||
|
|
071d017b27 | ||
|
|
65d9a7ed1a | ||
|
|
54df50f4fe | ||
|
|
bc5d605543 | ||
|
|
a1a0094167 | ||
|
|
5b8d8a72d8 | ||
|
|
621871eb7c | ||
|
|
ffcb5fe149 | ||
|
|
1b0808b4f3 | ||
|
|
68da0a044d | ||
|
|
87b0d22057 | ||
|
|
af5e36cdab | ||
|
|
8329257b99 | ||
|
|
1869c4c713 | ||
|
|
b3c3bdcdac | ||
|
|
6e295ac374 | ||
|
|
468bd2c156 | ||
|
|
bcf7eb2a50 | ||
|
|
54c7dfa45f | ||
|
|
984123521d | ||
|
|
a2cb65f181 | ||
|
|
fe7a4b3f45 | ||
|
|
d4ec0fe49b | ||
|
|
4a98bf5290 | ||
|
|
249cac359f | ||
|
|
69e521b320 | ||
|
|
8af19df556 | ||
|
|
bff08bec9e | ||
|
|
a66fb8c661 | ||
|
|
042716adde | ||
|
|
1342e4edee | ||
|
|
4d1d874243 | ||
|
|
155f56ede7 | ||
|
|
fb49d9460d | ||
|
|
37fed5e5b5 | ||
|
|
7113036719 | ||
|
|
d93d6731ba | ||
|
|
77e1dff779 | ||
|
|
58dedba93f | ||
|
|
9eb266914a | ||
|
|
1510396aa0 | ||
|
|
a7dfaea559 | ||
|
|
e8383c84ee | ||
|
|
810c869bc5 | ||
|
|
b32c120e89 | ||
|
|
3d7553349f | ||
|
|
d524a0247f | ||
|
|
f30f276456 | ||
|
|
17a8e1ec7b | ||
|
|
ebe25af476 | ||
|
|
1f7120f32f | ||
|
|
9e9023c258 | ||
|
|
b2930178be | ||
|
|
759c3f5d41 | ||
|
|
3c51fb6536 | ||
|
|
494df3edae | ||
|
|
810e02f7fa | ||
|
|
2720448e87 | ||
|
|
5fceac5e90 | ||
|
|
60ae6fb760 | ||
|
|
c9d80e12b8 | ||
|
|
a0aa9e4616 | ||
|
|
1515f5c1be | ||
|
|
42d750950a | ||
|
|
5338c15f8d | ||
|
|
ee232b5ded | ||
|
|
654d00a54e | ||
|
|
d86ee721df | ||
|
|
da03c1ec9d | ||
|
|
ebd8252b88 | ||
|
|
1c7e2a0995 | ||
|
|
fb6a8301f6 | ||
|
|
f2168b4c79 | ||
|
|
24f718427f | ||
|
|
c2a1f0d91f | ||
|
|
12a27f34a0 | ||
|
|
ba59eb0887 | ||
|
|
3f441150b4 | ||
|
|
f09b6ff446 | ||
|
|
8c23447d35 | ||
|
|
4b5f68a6a4 | ||
|
|
25a447d42e | ||
|
|
7eba462b67 | ||
|
|
a34ba0f6b7 | ||
|
|
1ac3f05765 | ||
|
|
39e051b731 | ||
|
|
7d95b0574d | ||
|
|
6300bb7bca | ||
|
|
afde4d601f | ||
|
|
5a016d09b1 | ||
|
|
b63a29cd2e | ||
|
|
81fdecd5af | ||
|
|
099fa059c7 | ||
|
|
e663eca763 | ||
|
|
77b93e5ced | ||
|
|
2260165682 | ||
|
|
715597e325 | ||
|
|
407d0f4e93 | ||
|
|
9d1718f85f | ||
|
|
5b327c78fa | ||
|
|
17247daf8b | ||
|
|
888ffa4ee0 | ||
|
|
3851d24315 | ||
|
|
e597f01994 | ||
|
|
b62027a0ae | ||
|
|
9685ad6149 | ||
|
|
d7231d4567 | ||
|
|
a84256da01 | ||
|
|
9e2a594bca | ||
|
|
fc01fa05bd | ||
|
|
9ea3c9fd41 | ||
|
|
d276fb17f7 | ||
|
|
8c90bda9a2 | ||
|
|
27e1a3c849 | ||
|
|
0912ac8de0 | ||
|
|
65a0348b4f | ||
|
|
564795cdd3 | ||
|
|
ffe075b1f3 | ||
|
|
b08c5faa74 | ||
|
|
cbd8e27fe3 | ||
|
|
349020ece9 | ||
|
|
1a13bbb071 | ||
|
|
90f9f0a183 | ||
|
|
98a85e1be3 | ||
|
|
92f2ce0fa0 | ||
|
|
b92ca87835 | ||
|
|
8d4fdd7f3e | ||
|
|
b679215752 | ||
|
|
25e8b3642d | ||
|
|
f8001ae295 | ||
|
|
5f9b395bc6 | ||
|
|
9340cc7df6 | ||
|
|
90204d4cc6 | ||
|
|
34bb9dd20d | ||
|
|
8d9bf42be2 | ||
|
|
8e4c07ed97 | ||
|
|
cf9c9dde53 | ||
|
|
f5da158935 | ||
|
|
f12f12b916 | ||
|
|
d6ccf1bfcb | ||
|
|
8e3b145477 | ||
|
|
5748042f6d | ||
|
|
3f504412f5 | ||
|
|
312d10c001 | ||
|
|
f08febfd61 | ||
|
|
89a12a7dd0 | ||
|
|
2ada36d50e | ||
|
|
2d2a210c54 | ||
|
|
deaa4a68e0 | ||
|
|
f449d06cd1 | ||
|
|
c550726778 | ||
|
|
bce63b88dc | ||
|
|
63a259a313 | ||
|
|
eef2591c25 | ||
|
|
870e8bb6ac | ||
|
|
d2f17deb2c | ||
|
|
376ff83161 | ||
|
|
79aaf86593 | ||
|
|
280939df75 | ||
|
|
af6308b167 | ||
|
|
aa4a76a941 | ||
|
|
35e73c1c90 | ||
|
|
5b7666965f | ||
|
|
3efb2b1a68 | ||
|
|
6bcc53ecf9 | ||
|
|
7b873e1902 | ||
|
|
005ef5a731 | ||
|
|
72e769b145 | ||
|
|
cf2d207ba1 | ||
|
|
d768474e50 | ||
|
|
4a7dd139ec | ||
|
|
fa85a5270d | ||
|
|
7994096669 | ||
|
|
d379d72685 | ||
|
|
9b2215d9c2 | ||
|
|
29562759d2 | ||
|
|
0b6a8987ca | ||
|
|
a679aadd3a | ||
|
|
77b9696a37 | ||
|
|
f21d9e8737 | ||
|
|
fb3da4cd3a | ||
|
|
b983de6a54 | ||
|
|
260052b68c | ||
|
|
8105bc0b73 | ||
|
|
ea4998f635 | ||
|
|
cb496a7119 | ||
|
|
79958f7393 | ||
|
|
0264e7da2b | ||
|
|
257388bad3 | ||
|
|
1604572995 | ||
|
|
9125165231 | ||
|
|
b1cbfcea9b | ||
|
|
8bb52fa6d5 | ||
|
|
7bd3f7e788 | ||
|
|
f4bf40b05d | ||
|
|
b488126d09 | ||
|
|
1c6160f548 | ||
|
|
40145abccf | ||
|
|
492f0d5197 | ||
|
|
4b0928ad9b | ||
|
|
0e3dfdc73b | ||
|
|
4cb474c5a3 | ||
|
|
19f6ef43ef | ||
|
|
4dbcbe083e | ||
|
|
2a9a922d1a | ||
|
|
0d3e1d003d | ||
|
|
170066f046 | ||
|
|
0bd213e789 | ||
|
|
4712d85190 | ||
|
|
d95a3b3354 | ||
|
|
39724fe6a7 | ||
|
|
0f90afaa1b | ||
|
|
689d92ab59 | ||
|
|
ca303d6942 | ||
|
|
6a9a16e611 | ||
|
|
30bc27aa0c | ||
|
|
c3fc323150 | ||
|
|
b5fe0609fc | ||
|
|
0a4049c97c | ||
|
|
6e4ac56e9c | ||
|
|
e6503d5c81 | ||
|
|
1717cbb44d | ||
|
|
caa960e657 | ||
|
|
290e2f10f9 | ||
|
|
325464f793 | ||
|
|
f533a53902 | ||
|
|
97b381a2b0 | ||
|
|
03b0749e91 | ||
|
|
7bcdd6729f | ||
|
|
3dd3d5f6aa | ||
|
|
ba37cc41c8 | ||
|
|
6efa41a7e6 | ||
|
|
9b90c91f07 | ||
|
|
35936618e3 | ||
|
|
e98a584e98 | ||
|
|
1a8c8a86f3 | ||
|
|
57663b8cf1 | ||
|
|
2b3d759e20 | ||
|
|
ed1b5dddce | ||
|
|
86fede6af8 | ||
|
|
68e6390c76 | ||
|
|
0ebeec4183 | ||
|
|
8c10ded107 | ||
|
|
3a1851f904 | ||
|
|
50aceb45fb | ||
|
|
cad6b0495c | ||
|
|
c7ebd45d9f | ||
|
|
77abe01885 | ||
|
|
98cec31516 | ||
|
|
46b145a396 | ||
|
|
ccf2a031e9 | ||
|
|
9784cd5bd1 | ||
|
|
5d8dc3b9eb | ||
|
|
a42e847bcb | ||
|
|
b7a1dd1030 | ||
|
|
b18e696c85 | ||
|
|
d58f078c38 | ||
|
|
0bbdfc13ee | ||
|
|
5127da50d1 | ||
|
|
352f035214 | ||
|
|
f04ba8d0c4 | ||
|
|
1ea94d0b14 | ||
|
|
7f99603859 | ||
|
|
3713283dfc | ||
|
|
09129f1e63 | ||
|
|
c56840ff2c | ||
|
|
2a34bd99e6 | ||
|
|
c7886ed615 | ||
|
|
948531a4be | ||
|
|
022987c804 | ||
|
|
db6c852fae | ||
|
|
b793f16343 | ||
|
|
ceaaa65a26 | ||
|
|
1d7589e653 | ||
|
|
e09abe7a83 | ||
|
|
e86e8692a8 | ||
|
|
961bfda727 | ||
|
|
8218d5ff73 | ||
|
|
5850ef073d | ||
|
|
7347440277 | ||
|
|
4007198342 | ||
|
|
c09524d043 | ||
|
|
d81c692bbb | ||
|
|
6d366bfdc6 | ||
|
|
ceb0110378 | ||
|
|
f06436c1fe | ||
|
|
67e15aaf80 | ||
|
|
5b29ef281a | ||
|
|
24b90970c7 | ||
|
|
84e6891922 | ||
|
|
0dcdf72042 | ||
|
|
e3b939baad | ||
|
|
0e5910ebee | ||
|
|
8a81a57a24 | ||
|
|
02d84d27d0 | ||
|
|
a2af0d7044 | ||
|
|
4f5bd7bf37 | ||
|
|
91ef488dff | ||
|
|
1af107aef8 | ||
|
|
9a60796674 | ||
|
|
7f4acae74b | ||
|
|
fa8b0a3023 | ||
|
|
acb55470f6 | ||
|
|
97da554da6 | ||
|
|
a121823adc | ||
|
|
cb85740690 | ||
|
|
e91a13bb60 | ||
|
|
a063be996b | ||
|
|
19da837232 | ||
|
|
22a494d834 | ||
|
|
2e68e9f600 | ||
|
|
b1c22e5034 | ||
|
|
e3c54327e8 | ||
|
|
9e62f8c557 | ||
|
|
6216247ecb | ||
|
|
082100a0d4 | ||
|
|
cf828471d6 | ||
|
|
cf84757e02 | ||
|
|
f486efbb57 | ||
|
|
0db5b0c838 | ||
|
|
e411a75dcd | ||
|
|
33ecccedce | ||
|
|
28dd35b040 | ||
|
|
e82a492c94 | ||
|
|
4509b9daf5 | ||
|
|
d330b78f37 | ||
|
|
ab89f88aea | ||
|
|
0227c2787a | ||
|
|
84dec36845 | ||
|
|
b4f692807a | ||
|
|
1f5ec6cd8d | ||
|
|
6f375cd9b3 | ||
|
|
e959654c6f | ||
|
|
18484d555f | ||
|
|
1534d81ae7 | ||
|
|
84b5df2713 | ||
|
|
8e729cc62c | ||
|
|
0f1f4d889f | ||
|
|
487b521c9b | ||
|
|
1aed90e42c | ||
|
|
e2d387bfa9 | ||
|
|
b974a7ed81 | ||
|
|
522ebae65e | ||
|
|
1b17a04b25 | ||
|
|
588c4a8187 | ||
|
|
88830e6c58 | ||
|
|
db646f50ac | ||
|
|
b1c9540085 | ||
|
|
e98137e059 | ||
|
|
3c37d49764 | ||
|
|
a8d6b81baf | ||
|
|
b8321cac0f | ||
|
|
6697ed3496 | ||
|
|
722d52420c | ||
|
|
af6d8282cb | ||
|
|
732b20aefa | ||
|
|
54318d0402 | ||
|
|
5f61fae0c7 | ||
|
|
0afba56a26 | ||
|
|
0873953d9f | ||
|
|
75af5f2e8c | ||
|
|
8d8dc9ccc2 | ||
|
|
e37a21aace | ||
|
|
40a603d366 | ||
|
|
c5bed1e3b2 | ||
|
|
8db3398eb7 | ||
|
|
7b038ab649 | ||
|
|
7d0c2ede26 | ||
|
|
60773bb859 | ||
|
|
a919ef4410 | ||
|
|
424e67f5f4 | ||
|
|
4097831b9b | ||
|
|
1764aa1f92 | ||
|
|
19de49763a | ||
|
|
a0b4e389f9 | ||
|
|
2281051d3d | ||
|
|
fc21280857 | ||
|
|
746806dcef | ||
|
|
812734fd2a | ||
|
|
66d59e498b | ||
|
|
5599ce9eaf | ||
|
|
2e2075ca52 | ||
|
|
c69d2db52b | ||
|
|
54ecce8b86 | ||
|
|
82b60988bb | ||
|
|
ab1af7c678 | ||
|
|
84ba7c5238 | ||
|
|
676be1f193 | ||
|
|
e8cb55e739 | ||
|
|
30613b224a | ||
|
|
19241744d7 | ||
|
|
27288ccf89 | ||
|
|
34282c17b8 | ||
|
|
227f149670 | ||
|
|
27477e9f7c | ||
|
|
b3018e083e | ||
|
|
96de55429d | ||
|
|
863eacc440 | ||
|
|
78249045f8 | ||
|
|
dad108b7e1 | ||
|
|
79f18b996b | ||
|
|
987c5cd301 | ||
|
|
34d0df1d96 | ||
|
|
1db731a7a8 | ||
|
|
af67596e66 | ||
|
|
86f98ddf5f | ||
|
|
bba6c4fcfd | ||
|
|
af64fa8a3d | ||
|
|
e1d3060232 | ||
|
|
3a1815163f | ||
|
|
0954b47a24 | ||
|
|
594a83cc4e | ||
|
|
ecec3ea22b | ||
|
|
f9cfc7219d | ||
|
|
c854d25963 | ||
|
|
4fe32b1482 | ||
|
|
5fcb31d279 | ||
|
|
b2d3a2fefc | ||
|
|
70ac7f9a40 | ||
|
|
f739d54cbc | ||
|
|
fc78fc3192 | ||
|
|
b0e5eb03e1 | ||
|
|
84cff4d6d8 | ||
|
|
e5575a0f50 | ||
|
|
f4961a0bd8 | ||
|
|
e3e810f34e | ||
|
|
57eb1795aa | ||
|
|
37e4d4163f | ||
|
|
59a8c7a049 | ||
|
|
8ef89f6bf1 | ||
|
|
2739602575 | ||
|
|
a7d2264cc1 | ||
|
|
7d8499a7fb | ||
|
|
99a12b8737 | ||
|
|
5b29db341f | ||
|
|
777ce98aa5 | ||
|
|
fe9c94d50c | ||
|
|
6d074928b6 | ||
|
|
1e32bee8e5 | ||
|
|
6281e128aa | ||
|
|
c1c0627dab | ||
|
|
9cfc345041 | ||
|
|
f3a72bff3d | ||
|
|
e906585287 | ||
|
|
b27c6fe415 | ||
|
|
5e888ee895 | ||
|
|
c9f55f5a39 | ||
|
|
1e9939bc8a | ||
|
|
df66746e89 | ||
|
|
5dac23f156 | ||
|
|
a3148f07ac | ||
|
|
75e21feee3 | ||
|
|
334a87aed1 | ||
|
|
ee3418cd60 | ||
|
|
b9ca8a1291 | ||
|
|
280b4308f7 | ||
|
|
45eec1c919 | ||
|
|
7ad5859629 | ||
|
|
bdfe4ca25b | ||
|
|
3020fd24e7 | ||
|
|
0f2a5b3b96 | ||
|
|
8fec59e753 | ||
|
|
7598225ee1 | ||
|
|
8a9d924fc1 | ||
|
|
2bcd993c0f | ||
|
|
e461c14b48 | ||
|
|
c9a6707fdc | ||
|
|
6cb70be4a4 | ||
|
|
403581462e | ||
|
|
9e212fa104 | ||
|
|
b6978f2fd8 | ||
|
|
513372978c | ||
|
|
de9b198496 |
7
.clang-format
Normal file
7
.clang-format
Normal file
@@ -0,0 +1,7 @@
|
||||
BreakBeforeBraces: Allman
|
||||
ColumnLimit: 0
|
||||
IndentCaseLabels: true
|
||||
IndentWidth: 8
|
||||
TabWidth: 8
|
||||
UseTab: Always
|
||||
SortIncludes: false
|
||||
37
.dockerignore
Normal file
37
.dockerignore
Normal file
@@ -0,0 +1,37 @@
|
||||
# Build artifacts
|
||||
linux/ccextractor
|
||||
linux/rust/
|
||||
linux/*.o
|
||||
linux/*.a
|
||||
mac/ccextractor
|
||||
mac/rust/
|
||||
build/
|
||||
build_*/
|
||||
|
||||
# Git
|
||||
.git/
|
||||
.github/
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# Docker
|
||||
docker/
|
||||
|
||||
# Documentation (not needed for build)
|
||||
docs/
|
||||
*.md
|
||||
!README.md
|
||||
|
||||
# Test files
|
||||
*.ts
|
||||
*.mp4
|
||||
*.mkv
|
||||
*.srt
|
||||
*.vtt
|
||||
|
||||
# Plans
|
||||
plans/
|
||||
49
.github/ISSUE_TEMPLATE.md
vendored
49
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,8 +1,28 @@
|
||||
Please prefix your issue with one of the following: [BUG], [PROPOSAL], [QUESTION].
|
||||
|
||||
CCExtractor version (using the --version parameter preferably) : **X.X**
|
||||
To get the version of CCExtractor, you can use `--version`.
|
||||
|
||||
**In raising this issue, I confirm the following (please check boxes, eg [X] - and delete unchecked ones):**
|
||||
If this issue is related to the flutter GUI, please make the issue on the GUI repo [here](https://github.com/CCExtractor/ccextractorfluttergui/issues/new)
|
||||
|
||||
Please check all that apply and **remove the ones that do not**.
|
||||
|
||||
In the necessary information section, if this is a regression (something that used to work does not work anymore), make sure to specify the last known working version.
|
||||
|
||||
Only specify the minimum number of arguments needed to reproduce the issue.
|
||||
|
||||
In the additional information section, describe your problem.
|
||||
|
||||
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. Methods to send the private invitation to us can be found [here](https://ccextractor.org/public:general:support#email).
|
||||
|
||||
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 to enable notifications in GitHub so you get notifications about your ticket. We may need to ask questions and we do everything inside GitHub's system.
|
||||
|
||||
Once you have read all of the instructions **delete all the text from here to the top**.
|
||||
|
||||
CCExtractor version: {replace with the version}
|
||||
|
||||
# In raising this issue, I confirm the following:
|
||||
|
||||
- [ ] 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.
|
||||
@@ -10,27 +30,18 @@ CCExtractor version (using the --version parameter preferably) : **X.X**
|
||||
- [ ] 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.
|
||||
- [ ] I have ticked all the boxes in this section and to prove it I'm deleting the section completely to remove boilerplate text.
|
||||
|
||||
**My familiarity with the project is as follows (check one, eg [X] - and delete unchecked ones):**
|
||||
# Necessary information
|
||||
|
||||
- [ ] 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.
|
||||
- Is this a regression (i.e. did it work before)? {YES/NO}
|
||||
- What platform did you use? {Window/Linux/Mac}
|
||||
- What were the used arguments? `{replace with the arguments}`
|
||||
|
||||
**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 were the used arguments? `-autoprogram`
|
||||
# Video links
|
||||
|
||||
**Video links (replace text below with your links) **
|
||||
* {Replace with a link to a video file}
|
||||
|
||||
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**
|
||||
# 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.
|
||||
|
||||
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,4 +1,4 @@
|
||||
Please prefix your pull request with one of the following: **[FEATURE]** **[FIX]** **[IMPROVEMENT]**.
|
||||
<!-- 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):**
|
||||
|
||||
|
||||
9
.github/dependabot.yml
vendored
Normal file
9
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "10:00"
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 10
|
||||
157
.github/workflows/build_appimage.yml
vendored
Normal file
157
.github/workflows/build_appimage.yml
vendored
Normal file
@@ -0,0 +1,157 @@
|
||||
name: Build Linux AppImage
|
||||
|
||||
on:
|
||||
# Build on releases
|
||||
release:
|
||||
types: [published]
|
||||
# Allow manual trigger
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
build_type:
|
||||
description: 'Build type (all, minimal, ocr, hardsubx)'
|
||||
required: false
|
||||
default: 'all'
|
||||
# Build on pushes to workflow file for testing
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/build_appimage.yml'
|
||||
- 'linux/build_appimage.sh'
|
||||
|
||||
jobs:
|
||||
build-appimage:
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [minimal, ocr, hardsubx]
|
||||
|
||||
steps:
|
||||
- name: Check if should build this variant
|
||||
id: should_build
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
INPUT_TYPE="${{ github.event.inputs.build_type }}"
|
||||
if [ "$INPUT_TYPE" = "all" ] || [ "$INPUT_TYPE" = "${{ matrix.build_type }}" ]; then
|
||||
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "should_build=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
else
|
||||
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Checkout repository
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install base dependencies
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
cmake \
|
||||
pkg-config \
|
||||
wget \
|
||||
file \
|
||||
libfuse2 \
|
||||
zlib1g-dev \
|
||||
libpng-dev \
|
||||
libjpeg-dev \
|
||||
libfreetype-dev \
|
||||
libxml2-dev \
|
||||
libcurl4-gnutls-dev \
|
||||
libssl-dev \
|
||||
clang \
|
||||
libclang-dev
|
||||
|
||||
- name: Install OCR dependencies
|
||||
if: steps.should_build.outputs.should_build == 'true' && (matrix.build_type == 'ocr' || matrix.build_type == 'hardsubx')
|
||||
run: |
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
tesseract-ocr \
|
||||
libtesseract-dev \
|
||||
libleptonica-dev \
|
||||
tesseract-ocr-eng
|
||||
|
||||
- name: Install FFmpeg dependencies (HardSubX)
|
||||
if: steps.should_build.outputs.should_build == 'true' && matrix.build_type == 'hardsubx'
|
||||
run: |
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
libavcodec-dev \
|
||||
libavformat-dev \
|
||||
libavutil-dev \
|
||||
libswscale-dev \
|
||||
libswresample-dev \
|
||||
libavfilter-dev \
|
||||
libavdevice-dev
|
||||
|
||||
- name: Install Rust toolchain
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Cache GPAC build
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
id: cache-gpac
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: /usr/local/lib/libgpac*
|
||||
key: gpac-v2.4.0-ubuntu22
|
||||
|
||||
- name: Build and install GPAC
|
||||
if: steps.should_build.outputs.should_build == 'true' && steps.cache-gpac.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
git clone -b v2.4.0 --depth 1 https://github.com/gpac/gpac
|
||||
cd gpac
|
||||
./configure
|
||||
make -j$(nproc) lib
|
||||
sudo make install-lib
|
||||
sudo ldconfig
|
||||
|
||||
- name: Update library cache
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: sudo ldconfig
|
||||
|
||||
- name: Build AppImage
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
cd linux
|
||||
chmod +x build_appimage.sh
|
||||
BUILD_TYPE=${{ matrix.build_type }} ./build_appimage.sh
|
||||
|
||||
- name: Get AppImage name
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
id: appimage_name
|
||||
run: |
|
||||
case "${{ matrix.build_type }}" in
|
||||
minimal)
|
||||
echo "name=ccextractor-minimal-x86_64.AppImage" >> $GITHUB_OUTPUT
|
||||
;;
|
||||
ocr)
|
||||
echo "name=ccextractor-x86_64.AppImage" >> $GITHUB_OUTPUT
|
||||
;;
|
||||
hardsubx)
|
||||
echo "name=ccextractor-hardsubx-x86_64.AppImage" >> $GITHUB_OUTPUT
|
||||
;;
|
||||
esac
|
||||
|
||||
- name: Test AppImage
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
chmod +x linux/${{ steps.appimage_name.outputs.name }}
|
||||
linux/${{ steps.appimage_name.outputs.name }} --version
|
||||
|
||||
- name: Upload AppImage artifact
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ steps.appimage_name.outputs.name }}
|
||||
path: linux/${{ steps.appimage_name.outputs.name }}
|
||||
|
||||
- name: Upload to Release
|
||||
if: steps.should_build.outputs.should_build == 'true' && github.event_name == 'release'
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: linux/${{ steps.appimage_name.outputs.name }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
283
.github/workflows/build_deb.yml
vendored
Normal file
283
.github/workflows/build_deb.yml
vendored
Normal file
@@ -0,0 +1,283 @@
|
||||
name: Build Linux .deb Package
|
||||
|
||||
on:
|
||||
# Build on releases
|
||||
release:
|
||||
types: [published]
|
||||
# Allow manual trigger
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
build_type:
|
||||
description: 'Build type (all, basic, hardsubx)'
|
||||
required: false
|
||||
default: 'all'
|
||||
# Build on pushes to workflow file for testing
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/build_deb.yml'
|
||||
|
||||
jobs:
|
||||
build-deb:
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [basic, hardsubx]
|
||||
|
||||
steps:
|
||||
- name: Check if should build this variant
|
||||
id: should_build
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
INPUT_TYPE="${{ github.event.inputs.build_type }}"
|
||||
if [ "$INPUT_TYPE" = "all" ] || [ "$INPUT_TYPE" = "${{ matrix.build_type }}" ]; then
|
||||
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "should_build=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
else
|
||||
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Checkout repository
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Get version
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
id: version
|
||||
run: |
|
||||
# Extract version from source or use tag
|
||||
if [ "${{ github.event_name }}" = "release" ]; then
|
||||
VERSION="${{ github.event.release.tag_name }}"
|
||||
VERSION="${VERSION#v}" # Remove 'v' prefix if present
|
||||
else
|
||||
# Extract version from lib_ccx.h (e.g., #define VERSION "0.96.5")
|
||||
VERSION=$(grep -oP '#define VERSION "\K[^"]+' src/lib_ccx/lib_ccx.h || echo "0.96")
|
||||
fi
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Building version: $VERSION"
|
||||
|
||||
- name: Install base dependencies
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
cmake \
|
||||
pkg-config \
|
||||
zlib1g-dev \
|
||||
libpng-dev \
|
||||
libjpeg-dev \
|
||||
libfreetype-dev \
|
||||
libxml2-dev \
|
||||
libcurl4-gnutls-dev \
|
||||
libssl-dev \
|
||||
clang \
|
||||
libclang-dev \
|
||||
tesseract-ocr \
|
||||
libtesseract-dev \
|
||||
libleptonica-dev \
|
||||
patchelf
|
||||
|
||||
- name: Install FFmpeg dependencies (HardSubX)
|
||||
if: steps.should_build.outputs.should_build == 'true' && matrix.build_type == 'hardsubx'
|
||||
run: |
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
libavcodec-dev \
|
||||
libavformat-dev \
|
||||
libavutil-dev \
|
||||
libswscale-dev \
|
||||
libswresample-dev \
|
||||
libavfilter-dev \
|
||||
libavdevice-dev
|
||||
|
||||
- name: Install Rust toolchain
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Cache GPAC build
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
id: cache-gpac
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/gpac-install
|
||||
key: gpac-abi-16.4-ubuntu24-deb
|
||||
|
||||
- name: Build GPAC
|
||||
if: steps.should_build.outputs.should_build == 'true' && steps.cache-gpac.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
git clone -b abi-16.4 --depth 1 https://github.com/gpac/gpac
|
||||
cd gpac
|
||||
./configure --prefix=/usr
|
||||
make -j$(nproc)
|
||||
make DESTDIR=$HOME/gpac-install install-lib
|
||||
|
||||
- name: Install GPAC to system
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
sudo cp -r $HOME/gpac-install/usr/lib/* /usr/lib/
|
||||
sudo cp -r $HOME/gpac-install/usr/include/* /usr/include/
|
||||
sudo ldconfig
|
||||
|
||||
- name: Build CCExtractor
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
if [ "${{ matrix.build_type }}" = "hardsubx" ]; then
|
||||
cmake ../src -DCMAKE_BUILD_TYPE=Release -DWITH_OCR=ON -DWITH_HARDSUBX=ON
|
||||
else
|
||||
cmake ../src -DCMAKE_BUILD_TYPE=Release -DWITH_OCR=ON
|
||||
fi
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Test build
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: ./build/ccextractor --version
|
||||
|
||||
- name: Create .deb package structure
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
VARIANT="${{ matrix.build_type }}"
|
||||
|
||||
if [ "$VARIANT" = "basic" ]; then
|
||||
PKG_NAME="ccextractor_${VERSION}_amd64"
|
||||
else
|
||||
PKG_NAME="ccextractor-${VARIANT}_${VERSION}_amd64"
|
||||
fi
|
||||
|
||||
mkdir -p ${PKG_NAME}/DEBIAN
|
||||
mkdir -p ${PKG_NAME}/usr/bin
|
||||
mkdir -p ${PKG_NAME}/usr/lib/ccextractor
|
||||
mkdir -p ${PKG_NAME}/usr/share/doc/ccextractor
|
||||
mkdir -p ${PKG_NAME}/usr/share/man/man1
|
||||
|
||||
# Copy binary
|
||||
cp build/ccextractor ${PKG_NAME}/usr/bin/
|
||||
|
||||
# Copy GPAC library
|
||||
cp $HOME/gpac-install/usr/lib/libgpac.so* ${PKG_NAME}/usr/lib/ccextractor/
|
||||
|
||||
# Set rpath so ccextractor finds bundled libgpac
|
||||
patchelf --set-rpath '/usr/lib/ccextractor:$ORIGIN/../lib/ccextractor' ${PKG_NAME}/usr/bin/ccextractor
|
||||
|
||||
# Copy documentation
|
||||
cp docs/CHANGES.TXT ${PKG_NAME}/usr/share/doc/ccextractor/changelog
|
||||
cp LICENSE.txt ${PKG_NAME}/usr/share/doc/ccextractor/copyright
|
||||
gzip -9 -n ${PKG_NAME}/usr/share/doc/ccextractor/changelog
|
||||
|
||||
# Generate man page
|
||||
help2man --no-info --name="closed captions and teletext subtitle extractor" \
|
||||
./build/ccextractor > ${PKG_NAME}/usr/share/man/man1/ccextractor.1 2>/dev/null || true
|
||||
if [ -f ${PKG_NAME}/usr/share/man/man1/ccextractor.1 ]; then
|
||||
gzip -9 -n ${PKG_NAME}/usr/share/man/man1/ccextractor.1
|
||||
fi
|
||||
|
||||
# Create control file
|
||||
if [ "$VARIANT" = "basic" ]; then
|
||||
PKG_DESCRIPTION="CCExtractor - closed captions and teletext subtitle extractor"
|
||||
else
|
||||
PKG_DESCRIPTION="CCExtractor (with HardSubX) - closed captions and teletext subtitle extractor"
|
||||
fi
|
||||
|
||||
INSTALLED_SIZE=$(du -sk ${PKG_NAME}/usr | cut -f1)
|
||||
|
||||
# Determine dependencies based on build variant (Ubuntu 24.04)
|
||||
if [ "$VARIANT" = "hardsubx" ]; then
|
||||
DEPENDS="libc6, libtesseract5, liblept5, libcurl3t64-gnutls, libavcodec60, libavformat60, libavutil58, libswscale7, libavdevice60, libswresample4, libavfilter9"
|
||||
else
|
||||
DEPENDS="libc6, libtesseract5, liblept5, libcurl3t64-gnutls"
|
||||
fi
|
||||
|
||||
cat > ${PKG_NAME}/DEBIAN/control << CTRL
|
||||
Package: ccextractor
|
||||
Version: ${VERSION}
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Installed-Size: ${INSTALLED_SIZE}
|
||||
Depends: ${DEPENDS}
|
||||
Maintainer: CCExtractor Development Team <carlos@ccextractor.org>
|
||||
Homepage: https://www.ccextractor.org
|
||||
Description: ${PKG_DESCRIPTION}
|
||||
CCExtractor is a tool that extracts closed captions and teletext subtitles
|
||||
from video files and streams. It supports a wide variety of input formats
|
||||
including MPEG, H.264/AVC, H.265/HEVC, MP4, MKV, WTV, and transport streams.
|
||||
.
|
||||
This package includes a bundled GPAC library for MP4 support.
|
||||
CTRL
|
||||
|
||||
# Remove leading spaces from control file
|
||||
sed -i 's/^ //' ${PKG_NAME}/DEBIAN/control
|
||||
|
||||
# Create postinst to update library cache
|
||||
cat > ${PKG_NAME}/DEBIAN/postinst << 'POSTINST'
|
||||
#!/bin/sh
|
||||
set -e
|
||||
ldconfig
|
||||
POSTINST
|
||||
chmod 755 ${PKG_NAME}/DEBIAN/postinst
|
||||
|
||||
# Create postrm to update library cache
|
||||
cat > ${PKG_NAME}/DEBIAN/postrm << 'POSTRM'
|
||||
#!/bin/sh
|
||||
set -e
|
||||
ldconfig
|
||||
POSTRM
|
||||
chmod 755 ${PKG_NAME}/DEBIAN/postrm
|
||||
|
||||
# Set permissions
|
||||
chmod 755 ${PKG_NAME}/usr/bin/ccextractor
|
||||
chmod 755 ${PKG_NAME}/usr/lib/ccextractor
|
||||
find ${PKG_NAME}/usr/lib/ccextractor -name "*.so*" -exec chmod 644 {} \;
|
||||
|
||||
# Build the .deb
|
||||
dpkg-deb --build --root-owner-group ${PKG_NAME}
|
||||
|
||||
echo "deb_name=${PKG_NAME}.deb" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Test .deb package
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
VARIANT="${{ matrix.build_type }}"
|
||||
|
||||
if [ "$VARIANT" = "basic" ]; then
|
||||
PKG_NAME="ccextractor_${VERSION}_amd64"
|
||||
else
|
||||
PKG_NAME="ccextractor-${VARIANT}_${VERSION}_amd64"
|
||||
fi
|
||||
|
||||
# Install and test (apt handles dependencies automatically)
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ./${PKG_NAME}.deb
|
||||
ccextractor --version
|
||||
|
||||
- name: Get .deb filename
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
id: deb_name
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
VARIANT="${{ matrix.build_type }}"
|
||||
|
||||
if [ "$VARIANT" = "basic" ]; then
|
||||
echo "name=ccextractor_${VERSION}_amd64.deb" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "name=ccextractor-${VARIANT}_${VERSION}_amd64.deb" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Upload .deb artifact
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ steps.deb_name.outputs.name }}
|
||||
path: ${{ steps.deb_name.outputs.name }}
|
||||
|
||||
- name: Upload to Release
|
||||
if: steps.should_build.outputs.should_build == 'true' && github.event_name == 'release'
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: ${{ steps.deb_name.outputs.name }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
275
.github/workflows/build_deb_debian13.yml
vendored
Normal file
275
.github/workflows/build_deb_debian13.yml
vendored
Normal file
@@ -0,0 +1,275 @@
|
||||
name: Build Debian 13 .deb Package
|
||||
|
||||
on:
|
||||
# Build on releases
|
||||
release:
|
||||
types: [published]
|
||||
# Allow manual trigger
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
build_type:
|
||||
description: 'Build type (all, basic, hardsubx)'
|
||||
required: false
|
||||
default: 'all'
|
||||
# Build on pushes to workflow file for testing
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/build_deb_debian13.yml'
|
||||
|
||||
jobs:
|
||||
build-deb:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: debian:trixie
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [basic, hardsubx]
|
||||
|
||||
steps:
|
||||
- name: Check if should build this variant
|
||||
id: should_build
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
INPUT_TYPE="${{ github.event.inputs.build_type }}"
|
||||
if [ "$INPUT_TYPE" = "all" ] || [ "$INPUT_TYPE" = "${{ matrix.build_type }}" ]; then
|
||||
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "should_build=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
else
|
||||
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Install git and dependencies for checkout
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y git ca-certificates
|
||||
|
||||
- name: Checkout repository
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Get version
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
id: version
|
||||
run: |
|
||||
# Extract version from source or use tag
|
||||
if [ "${{ github.event_name }}" = "release" ]; then
|
||||
VERSION="${{ github.event.release.tag_name }}"
|
||||
VERSION="${VERSION#v}" # Remove 'v' prefix if present
|
||||
else
|
||||
# Extract version from lib_ccx.h (e.g., #define VERSION "0.96.5")
|
||||
VERSION=$(grep -oP '#define VERSION "\K[^"]+' src/lib_ccx/lib_ccx.h || echo "0.96")
|
||||
fi
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Building version: $VERSION"
|
||||
|
||||
- name: Install base dependencies
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
cmake \
|
||||
pkg-config \
|
||||
zlib1g-dev \
|
||||
libpng-dev \
|
||||
libjpeg-dev \
|
||||
libfreetype-dev \
|
||||
libxml2-dev \
|
||||
libcurl4-gnutls-dev \
|
||||
libssl-dev \
|
||||
clang \
|
||||
libclang-dev \
|
||||
tesseract-ocr \
|
||||
libtesseract-dev \
|
||||
libleptonica-dev \
|
||||
patchelf \
|
||||
curl
|
||||
|
||||
- name: Install FFmpeg dependencies (HardSubX)
|
||||
if: steps.should_build.outputs.should_build == 'true' && matrix.build_type == 'hardsubx'
|
||||
run: |
|
||||
apt-get install -y --no-install-recommends \
|
||||
libavcodec-dev \
|
||||
libavformat-dev \
|
||||
libavutil-dev \
|
||||
libswscale-dev \
|
||||
libswresample-dev \
|
||||
libavfilter-dev \
|
||||
libavdevice-dev
|
||||
|
||||
- name: Install Rust toolchain
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Build GPAC
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
git clone -b abi-16.4 --depth 1 https://github.com/gpac/gpac
|
||||
cd gpac
|
||||
./configure --prefix=/usr
|
||||
make -j$(nproc)
|
||||
make install-lib
|
||||
ldconfig
|
||||
|
||||
- name: Build CCExtractor
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
mkdir build && cd build
|
||||
if [ "${{ matrix.build_type }}" = "hardsubx" ]; then
|
||||
cmake ../src -DCMAKE_BUILD_TYPE=Release -DWITH_OCR=ON -DWITH_HARDSUBX=ON
|
||||
else
|
||||
cmake ../src -DCMAKE_BUILD_TYPE=Release -DWITH_OCR=ON
|
||||
fi
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Test build
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: ./build/ccextractor --version
|
||||
|
||||
- name: Create .deb package structure
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
id: create_deb
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
VARIANT="${{ matrix.build_type }}"
|
||||
|
||||
if [ "$VARIANT" = "basic" ]; then
|
||||
PKG_NAME="ccextractor_${VERSION}_debian13_amd64"
|
||||
else
|
||||
PKG_NAME="ccextractor-${VARIANT}_${VERSION}_debian13_amd64"
|
||||
fi
|
||||
|
||||
mkdir -p ${PKG_NAME}/DEBIAN
|
||||
mkdir -p ${PKG_NAME}/usr/bin
|
||||
mkdir -p ${PKG_NAME}/usr/lib/ccextractor
|
||||
mkdir -p ${PKG_NAME}/usr/share/doc/ccextractor
|
||||
mkdir -p ${PKG_NAME}/usr/share/man/man1
|
||||
|
||||
# Copy binary
|
||||
cp build/ccextractor ${PKG_NAME}/usr/bin/
|
||||
|
||||
# Copy GPAC library
|
||||
cp /usr/lib/libgpac.so* ${PKG_NAME}/usr/lib/ccextractor/
|
||||
|
||||
# Set rpath so ccextractor finds bundled libgpac
|
||||
patchelf --set-rpath '/usr/lib/ccextractor:$ORIGIN/../lib/ccextractor' ${PKG_NAME}/usr/bin/ccextractor
|
||||
|
||||
# Copy documentation
|
||||
cp docs/CHANGES.TXT ${PKG_NAME}/usr/share/doc/ccextractor/changelog
|
||||
cp LICENSE.txt ${PKG_NAME}/usr/share/doc/ccextractor/copyright
|
||||
gzip -9 -n ${PKG_NAME}/usr/share/doc/ccextractor/changelog
|
||||
|
||||
# Create control file
|
||||
if [ "$VARIANT" = "basic" ]; then
|
||||
PKG_DESCRIPTION="CCExtractor - closed captions and teletext subtitle extractor"
|
||||
else
|
||||
PKG_DESCRIPTION="CCExtractor (with HardSubX) - closed captions and teletext subtitle extractor"
|
||||
fi
|
||||
|
||||
INSTALLED_SIZE=$(du -sk ${PKG_NAME}/usr | cut -f1)
|
||||
|
||||
# Determine dependencies based on build variant (Debian 13 Trixie)
|
||||
if [ "$VARIANT" = "hardsubx" ]; then
|
||||
DEPENDS="libc6, libtesseract5, libleptonica6, libcurl3t64-gnutls, libavcodec61, libavformat61, libavutil59, libswscale8, libavdevice61, libswresample5, libavfilter10"
|
||||
else
|
||||
DEPENDS="libc6, libtesseract5, libleptonica6, libcurl3t64-gnutls"
|
||||
fi
|
||||
|
||||
cat > ${PKG_NAME}/DEBIAN/control << CTRL
|
||||
Package: ccextractor
|
||||
Version: ${VERSION}
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Installed-Size: ${INSTALLED_SIZE}
|
||||
Depends: ${DEPENDS}
|
||||
Maintainer: CCExtractor Development Team <carlos@ccextractor.org>
|
||||
Homepage: https://www.ccextractor.org
|
||||
Description: ${PKG_DESCRIPTION}
|
||||
CCExtractor is a tool that extracts closed captions and teletext subtitles
|
||||
from video files and streams. It supports a wide variety of input formats
|
||||
including MPEG, H.264/AVC, H.265/HEVC, MP4, MKV, WTV, and transport streams.
|
||||
.
|
||||
This package includes a bundled GPAC library for MP4 support.
|
||||
Built for Debian 13 (Trixie).
|
||||
CTRL
|
||||
|
||||
# Remove leading spaces from control file
|
||||
sed -i 's/^ //' ${PKG_NAME}/DEBIAN/control
|
||||
|
||||
# Create postinst to update library cache
|
||||
cat > ${PKG_NAME}/DEBIAN/postinst << 'POSTINST'
|
||||
#!/bin/sh
|
||||
set -e
|
||||
ldconfig
|
||||
POSTINST
|
||||
chmod 755 ${PKG_NAME}/DEBIAN/postinst
|
||||
|
||||
# Create postrm to update library cache
|
||||
cat > ${PKG_NAME}/DEBIAN/postrm << 'POSTRM'
|
||||
#!/bin/sh
|
||||
set -e
|
||||
ldconfig
|
||||
POSTRM
|
||||
chmod 755 ${PKG_NAME}/DEBIAN/postrm
|
||||
|
||||
# Set permissions
|
||||
chmod 755 ${PKG_NAME}/usr/bin/ccextractor
|
||||
chmod 755 ${PKG_NAME}/usr/lib/ccextractor
|
||||
find ${PKG_NAME}/usr/lib/ccextractor -name "*.so*" -exec chmod 644 {} \;
|
||||
|
||||
# Build the .deb
|
||||
dpkg-deb --build --root-owner-group ${PKG_NAME}
|
||||
|
||||
echo "deb_name=${PKG_NAME}.deb" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Test .deb package
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
VARIANT="${{ matrix.build_type }}"
|
||||
|
||||
if [ "$VARIANT" = "basic" ]; then
|
||||
PKG_NAME="ccextractor_${VERSION}_debian13_amd64"
|
||||
else
|
||||
PKG_NAME="ccextractor-${VARIANT}_${VERSION}_debian13_amd64"
|
||||
fi
|
||||
|
||||
# Install and test (apt handles dependencies automatically)
|
||||
apt-get update
|
||||
apt-get install -y ./${PKG_NAME}.deb
|
||||
ccextractor --version
|
||||
|
||||
- name: Get .deb filename
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
id: deb_name
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
VARIANT="${{ matrix.build_type }}"
|
||||
|
||||
if [ "$VARIANT" = "basic" ]; then
|
||||
echo "name=ccextractor_${VERSION}_debian13_amd64.deb" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "name=ccextractor-${VARIANT}_${VERSION}_debian13_amd64.deb" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Upload .deb artifact
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ steps.deb_name.outputs.name }}
|
||||
path: ${{ steps.deb_name.outputs.name }}
|
||||
|
||||
- name: Upload to Release
|
||||
if: steps.should_build.outputs.should_build == 'true' && github.event_name == 'release'
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: ${{ steps.deb_name.outputs.name }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
96
.github/workflows/build_docker.yml
vendored
Normal file
96
.github/workflows/build_docker.yml
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
name: Build CCExtractor Docker Images
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/build_docker.yml'
|
||||
- 'docker/**'
|
||||
- '**.c'
|
||||
- '**.h'
|
||||
- '**CMakeLists.txt'
|
||||
- '**.cmake'
|
||||
- 'src/rust/**'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- '.github/workflows/build_docker.yml'
|
||||
- 'docker/**'
|
||||
- '**.c'
|
||||
- '**.h'
|
||||
- '**CMakeLists.txt'
|
||||
- '**.cmake'
|
||||
- 'src/rust/**'
|
||||
|
||||
jobs:
|
||||
build_minimal:
|
||||
name: Docker build (minimal)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Build minimal image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: docker/Dockerfile
|
||||
build-args: |
|
||||
BUILD_TYPE=minimal
|
||||
USE_LOCAL_SOURCE=1
|
||||
tags: ccextractor:minimal
|
||||
load: true
|
||||
cache-from: type=gha,scope=docker-minimal
|
||||
cache-to: type=gha,mode=max,scope=docker-minimal
|
||||
- name: Test minimal image
|
||||
run: |
|
||||
docker run --rm ccextractor:minimal --version
|
||||
echo "Minimal build successful"
|
||||
|
||||
build_ocr:
|
||||
name: Docker build (ocr)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Build OCR image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: docker/Dockerfile
|
||||
build-args: |
|
||||
BUILD_TYPE=ocr
|
||||
USE_LOCAL_SOURCE=1
|
||||
tags: ccextractor:ocr
|
||||
load: true
|
||||
cache-from: type=gha,scope=docker-ocr
|
||||
cache-to: type=gha,mode=max,scope=docker-ocr
|
||||
- name: Test OCR image
|
||||
run: |
|
||||
docker run --rm ccextractor:ocr --version
|
||||
echo "OCR build successful"
|
||||
|
||||
build_hardsubx:
|
||||
name: Docker build (hardsubx)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Build HardSubX image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: docker/Dockerfile
|
||||
build-args: |
|
||||
BUILD_TYPE=hardsubx
|
||||
USE_LOCAL_SOURCE=1
|
||||
tags: ccextractor:hardsubx
|
||||
load: true
|
||||
cache-from: type=gha,scope=docker-hardsubx
|
||||
cache-to: type=gha,mode=max,scope=docker-hardsubx
|
||||
- name: Test HardSubX image
|
||||
run: |
|
||||
docker run --rm ccextractor:hardsubx --version
|
||||
echo "HardSubX build successful"
|
||||
117
.github/workflows/build_linux.yml
vendored
Normal file
117
.github/workflows/build_linux.yml
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
name: Build CCExtractor on Linux
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/build_linux.yml'
|
||||
- '**.c'
|
||||
- '**.h'
|
||||
- '**CMakeLists.txt'
|
||||
- '**.cmake'
|
||||
- '**Makefile**'
|
||||
- 'linux/**'
|
||||
- 'package_creators/**'
|
||||
- 'src/rust/**'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- '.github/workflows/build_linux.yml'
|
||||
- '**.c'
|
||||
- '**.h'
|
||||
- '**CMakeLists.txt'
|
||||
- '**.cmake'
|
||||
- '**Makefile**'
|
||||
- 'linux/**'
|
||||
- 'package_creators/**'
|
||||
- 'src/rust/**'
|
||||
jobs:
|
||||
build_shell:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: sudo apt update && sudo apt-get install libgpac-dev libtesseract-dev libavcodec-dev libavdevice-dev libx11-dev libxcb1-dev libxcb-shm0-dev
|
||||
- uses: actions/checkout@v6
|
||||
- name: build
|
||||
run: ./build -hardsubx
|
||||
working-directory: ./linux
|
||||
- name: Display version information
|
||||
run: ./ccextractor --version
|
||||
working-directory: ./linux
|
||||
- name: Prepare artifacts
|
||||
run: mkdir ./linux/artifacts
|
||||
- name: Copy release artifact
|
||||
run: cp ./linux/ccextractor ./linux/artifacts/
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: CCExtractor Linux build
|
||||
path: ./linux/artifacts
|
||||
build_autoconf:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: sudo apt update && sudo apt-get install libgpac-dev
|
||||
- uses: actions/checkout@v6
|
||||
- name: run autogen
|
||||
run: ./autogen.sh
|
||||
working-directory: ./linux
|
||||
- name: configure
|
||||
run: ./configure --enable-debug
|
||||
working-directory: ./linux
|
||||
- name: make
|
||||
run: make
|
||||
working-directory: ./linux
|
||||
- name: Display version information
|
||||
run: ./ccextractor --version
|
||||
working-directory: ./linux
|
||||
cmake:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: sudo apt update && sudo apt-get install libgpac-dev
|
||||
- uses: actions/checkout@v6
|
||||
- name: cmake
|
||||
run: mkdir build && cd build && cmake ../src
|
||||
- name: build
|
||||
run: make -j$(nproc)
|
||||
working-directory: build
|
||||
- name: Display version information
|
||||
run: ./build/ccextractor --version
|
||||
cmake_ocr_hardsubx:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
run: sudo apt update && sudo apt install libgpac-dev libtesseract-dev libavformat-dev libavdevice-dev libswscale-dev yasm
|
||||
- name: cmake
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake -DWITH_OCR=ON -DWITH_HARDSUBX=ON ../src
|
||||
- name: build
|
||||
run: |
|
||||
make -j$(nproc)
|
||||
working-directory: build
|
||||
- name: Display version information
|
||||
run: ./build/ccextractor --version
|
||||
build_rust:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: sudo apt update && sudo apt-get install libgpac-dev
|
||||
- uses: actions/checkout@v6
|
||||
- name: cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
src/rust/.cargo/registry
|
||||
src/rust/.cargo/git
|
||||
src/rust/target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: ${{ runner.os }}-cargo-
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
- name: build
|
||||
run: cargo build
|
||||
working-directory: ./src/rust
|
||||
154
.github/workflows/build_linux_systemlibs.yml
vendored
Normal file
154
.github/workflows/build_linux_systemlibs.yml
vendored
Normal file
@@ -0,0 +1,154 @@
|
||||
name: Build Linux (System Libs)
|
||||
|
||||
on:
|
||||
# Build on releases
|
||||
release:
|
||||
types: [published]
|
||||
# Allow manual trigger
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
build_type:
|
||||
description: 'Build type (all, basic, hardsubx)'
|
||||
required: false
|
||||
default: 'all'
|
||||
# Build on pushes to workflow file for testing
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/build_linux_systemlibs.yml'
|
||||
- 'linux/build'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build-systemlibs:
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: [basic, hardsubx]
|
||||
|
||||
steps:
|
||||
- name: Check if should build this variant
|
||||
id: should_build
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
INPUT_TYPE="${{ github.event.inputs.build_type }}"
|
||||
if [ "$INPUT_TYPE" = "all" ] || [ "$INPUT_TYPE" = "${{ matrix.build_type }}" ]; then
|
||||
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "should_build=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
else
|
||||
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Checkout repository
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install base dependencies
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
pkg-config \
|
||||
zlib1g-dev \
|
||||
libpng-dev \
|
||||
libfreetype-dev \
|
||||
libutf8proc-dev \
|
||||
libgpac-dev \
|
||||
libtesseract-dev \
|
||||
libleptonica-dev \
|
||||
tesseract-ocr-eng \
|
||||
clang \
|
||||
libclang-dev
|
||||
|
||||
- name: Install FFmpeg dependencies (HardSubX)
|
||||
if: steps.should_build.outputs.should_build == 'true' && matrix.build_type == 'hardsubx'
|
||||
run: |
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
libavcodec-dev \
|
||||
libavformat-dev \
|
||||
libavutil-dev \
|
||||
libswscale-dev \
|
||||
libswresample-dev \
|
||||
libavfilter-dev \
|
||||
libavdevice-dev \
|
||||
libxcb1-dev \
|
||||
libxcb-shm0-dev \
|
||||
libx11-dev \
|
||||
liblzma-dev
|
||||
|
||||
- name: Install Rust toolchain
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Build with system libraries
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
cd linux
|
||||
if [ "${{ matrix.build_type }}" = "hardsubx" ]; then
|
||||
./build -system-libs -hardsubx
|
||||
else
|
||||
./build -system-libs
|
||||
fi
|
||||
|
||||
- name: Verify build
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
./linux/ccextractor --version
|
||||
echo "=== Library dependencies ==="
|
||||
ldd ./linux/ccextractor | grep -E 'freetype|png|utf8proc|tesseract|leptonica' || true
|
||||
|
||||
- name: Get output name
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
id: output_name
|
||||
run: |
|
||||
case "${{ matrix.build_type }}" in
|
||||
basic)
|
||||
echo "name=ccextractor-linux-systemlibs-x86_64" >> $GITHUB_OUTPUT
|
||||
;;
|
||||
hardsubx)
|
||||
echo "name=ccextractor-linux-systemlibs-hardsubx-x86_64" >> $GITHUB_OUTPUT
|
||||
;;
|
||||
esac
|
||||
|
||||
- name: Package binary
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
run: |
|
||||
mkdir -p package
|
||||
cp linux/ccextractor package/
|
||||
# Create a simple README for the package
|
||||
cat > package/README.txt << 'EOF'
|
||||
CCExtractor - System Libraries Build
|
||||
=====================================
|
||||
|
||||
This build uses system libraries (dynamic linking).
|
||||
|
||||
Required system packages (Debian/Ubuntu):
|
||||
sudo apt install libgpac12 libtesseract5 libleptonica6 \
|
||||
libpng16-16 libfreetype6 libutf8proc3
|
||||
|
||||
For HardSubX builds, also install:
|
||||
sudo apt install libavcodec60 libavformat60 libswscale7 libavfilter9
|
||||
|
||||
Run with: ./ccextractor --help
|
||||
EOF
|
||||
tar -czvf ${{ steps.output_name.outputs.name }}.tar.gz -C package .
|
||||
|
||||
- name: Upload artifact
|
||||
if: steps.should_build.outputs.should_build == 'true'
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: ${{ steps.output_name.outputs.name }}
|
||||
path: ${{ steps.output_name.outputs.name }}.tar.gz
|
||||
|
||||
- name: Upload to Release
|
||||
if: steps.should_build.outputs.should_build == 'true' && github.event_name == 'release'
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: ${{ steps.output_name.outputs.name }}.tar.gz
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
177
.github/workflows/build_mac.yml
vendored
Normal file
177
.github/workflows/build_mac.yml
vendored
Normal file
@@ -0,0 +1,177 @@
|
||||
name: Build CCExtractor on Mac
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/build_mac.yml'
|
||||
- '**.c'
|
||||
- '**.h'
|
||||
- '**CMakeLists.txt'
|
||||
- '**.cmake'
|
||||
- '**Makefile**'
|
||||
- 'mac/**'
|
||||
- 'package_creators/**'
|
||||
- 'src/rust/**'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- '.github/workflows/build_mac.yml'
|
||||
- '**.c'
|
||||
- '**.h'
|
||||
- '**CMakeLists.txt'
|
||||
- '**.cmake'
|
||||
- '**Makefile**'
|
||||
- 'mac/**'
|
||||
- 'package_creators/**'
|
||||
- 'src/rust/**'
|
||||
jobs:
|
||||
build_shell:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: brew install pkg-config autoconf automake libtool tesseract leptonica gpac
|
||||
- uses: actions/checkout@v6
|
||||
- name: build
|
||||
run: ./build.command
|
||||
working-directory: ./mac
|
||||
- name: Display version information
|
||||
run: ./ccextractor --version
|
||||
working-directory: ./mac
|
||||
- name: Prepare artifacts
|
||||
run: mkdir ./mac/artifacts
|
||||
- name: Copy release artifact
|
||||
run: cp ./mac/ccextractor ./mac/artifacts/
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: CCExtractor mac build
|
||||
path: ./mac/artifacts
|
||||
build_shell_system_libs:
|
||||
# Test building with system libraries via pkg-config (for Homebrew formula compatibility)
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: brew install pkg-config autoconf automake libtool tesseract leptonica gpac freetype libpng protobuf-c utf8proc zlib
|
||||
- uses: actions/checkout@v6
|
||||
- name: build with system libs
|
||||
run: ./build.command -system-libs
|
||||
working-directory: ./mac
|
||||
- name: Display version information
|
||||
run: ./ccextractor --version
|
||||
working-directory: ./mac
|
||||
build_autoconf:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
run: brew install pkg-config autoconf automake libtool gpac
|
||||
- name: run autogen
|
||||
run: ./autogen.sh
|
||||
working-directory: ./mac
|
||||
- name: configure
|
||||
run: ./configure --enable-debug
|
||||
working-directory: ./mac
|
||||
- name: make
|
||||
run: make
|
||||
working-directory: ./mac
|
||||
- name: Display version information
|
||||
run: ./ccextractor --version
|
||||
working-directory: ./mac
|
||||
cmake:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: dependencies
|
||||
run: brew install gpac
|
||||
- uses: actions/checkout@v6
|
||||
- name: cmake
|
||||
run: mkdir build && cd build && cmake ../src
|
||||
- name: build
|
||||
run: make -j$(nproc)
|
||||
working-directory: build
|
||||
- name: Display version information
|
||||
run: ./build/ccextractor --version
|
||||
cmake_ocr_hardsubx:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
run: brew install pkg-config autoconf automake libtool tesseract leptonica gpac ffmpeg
|
||||
- name: cmake
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake -DWITH_OCR=ON -DWITH_HARDSUBX=ON ../src
|
||||
- name: build
|
||||
run: |
|
||||
make -j$(nproc)
|
||||
working-directory: build
|
||||
- name: Display version information
|
||||
run: ./build/ccextractor --version
|
||||
build_shell_hardsubx:
|
||||
# Test build.command with -hardsubx flag (burned-in subtitle extraction)
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: brew install pkg-config autoconf automake libtool tesseract leptonica gpac ffmpeg
|
||||
- uses: actions/checkout@v6
|
||||
- name: build with hardsubx
|
||||
run: ./build.command -hardsubx
|
||||
working-directory: ./mac
|
||||
- name: Display version information
|
||||
run: ./ccextractor --version
|
||||
working-directory: ./mac
|
||||
- name: Verify hardsubx support
|
||||
run: |
|
||||
# Check that -hardsubx is recognized (will fail if not compiled in)
|
||||
./ccextractor -hardsubx --help 2>&1 | head -20 || true
|
||||
working-directory: ./mac
|
||||
build_autoconf_hardsubx:
|
||||
# Test autoconf build with HARDSUBX enabled (fixes issue #1173)
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
run: brew install pkg-config autoconf automake libtool tesseract leptonica gpac ffmpeg
|
||||
- name: run autogen
|
||||
run: ./autogen.sh
|
||||
working-directory: ./mac
|
||||
- name: configure with hardsubx
|
||||
run: |
|
||||
# Set Homebrew paths for configure to find libraries
|
||||
export HOMEBREW_PREFIX="$(brew --prefix)"
|
||||
export LDFLAGS="-L${HOMEBREW_PREFIX}/lib"
|
||||
export CPPFLAGS="-I${HOMEBREW_PREFIX}/include"
|
||||
export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/lib/pkgconfig"
|
||||
./configure --enable-hardsubx --enable-ocr
|
||||
working-directory: ./mac
|
||||
- name: make
|
||||
run: make
|
||||
working-directory: ./mac
|
||||
- name: Display version information
|
||||
run: ./ccextractor --version
|
||||
working-directory: ./mac
|
||||
- name: Verify hardsubx support
|
||||
run: |
|
||||
# Check that -hardsubx is recognized
|
||||
./ccextractor -hardsubx --help 2>&1 | head -20 || true
|
||||
working-directory: ./mac
|
||||
build_rust:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
src/rust/.cargo/registry
|
||||
src/rust/.cargo/git
|
||||
src/rust/target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: ${{ runner.os }}-cargo-
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
- name: build
|
||||
run: cargo build
|
||||
working-directory: ./src/rust
|
||||
51
.github/workflows/build_snap.yml
vendored
Normal file
51
.github/workflows/build_snap.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
name: Build CCExtractor Snap
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build_snap:
|
||||
name: Build Snap package
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install snapd
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y snapd
|
||||
|
||||
- name: Start snapd
|
||||
run: |
|
||||
sudo systemctl start snapd.socket
|
||||
sudo systemctl start snapd
|
||||
|
||||
- name: Install Snapcraft
|
||||
run: |
|
||||
sudo snap install core22
|
||||
sudo snap install snapcraft --classic
|
||||
|
||||
- name: Show Snapcraft version
|
||||
run: snapcraft --version
|
||||
|
||||
- name: Build snap
|
||||
run: sudo snapcraft --destructive-mode
|
||||
|
||||
- name: List generated snap
|
||||
run: ls -lh *.snap
|
||||
|
||||
- name: Upload snap as workflow artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: CCExtractor Snap
|
||||
path: "*.snap"
|
||||
|
||||
- name: Upload snap to GitHub Release
|
||||
if: github.event_name == 'release'
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: "*.snap"
|
||||
142
.github/workflows/build_windows.yml
vendored
Normal file
142
.github/workflows/build_windows.yml
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
name: Build CCExtractor on Windows
|
||||
|
||||
env:
|
||||
RUSTFLAGS: -Ctarget-feature=+crt-static
|
||||
VCPKG_DEFAULT_TRIPLET: x64-windows-static
|
||||
VCPKG_COMMIT: ab2977be50c702126336e5088f4836060733c899
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- ".github/workflows/build_windows.yml"
|
||||
- "**.c"
|
||||
- "**.h"
|
||||
- "**CMakeLists.txt"
|
||||
- "**.cmake"
|
||||
- "windows/**"
|
||||
- "src/rust/**"
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- ".github/workflows/build_windows.yml"
|
||||
- "**.c"
|
||||
- "**.h"
|
||||
- "**CMakeLists.txt"
|
||||
- "**.cmake"
|
||||
- "windows/**"
|
||||
- "src/rust/**"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup MSBuild.exe
|
||||
uses: microsoft/setup-msbuild@v2.0.0
|
||||
with:
|
||||
msbuild-architecture: x64
|
||||
|
||||
# Install GPAC (fast, ~30s, not worth caching complexity)
|
||||
- name: Install gpac
|
||||
run: choco install gpac --version 2.4.0 --no-progress
|
||||
|
||||
# Use lukka/run-vcpkg for better caching
|
||||
- name: Setup vcpkg
|
||||
uses: lukka/run-vcpkg@v11
|
||||
id: runvcpkg
|
||||
with:
|
||||
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
|
||||
vcpkgDirectory: ${{ github.workspace }}/vcpkg
|
||||
vcpkgJsonGlob: 'windows/vcpkg.json'
|
||||
|
||||
# Cache vcpkg installed packages separately for faster restores
|
||||
- name: Cache vcpkg installed packages
|
||||
id: vcpkg-installed-cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ github.workspace }}/vcpkg/installed
|
||||
key: vcpkg-installed-${{ runner.os }}-${{ env.VCPKG_COMMIT }}-${{ hashFiles('windows/vcpkg.json') }}
|
||||
restore-keys: |
|
||||
vcpkg-installed-${{ runner.os }}-${{ env.VCPKG_COMMIT }}-
|
||||
|
||||
- name: Install vcpkg dependencies
|
||||
if: steps.vcpkg-installed-cache.outputs.cache-hit != 'true'
|
||||
run: ${{ github.workspace }}/vcpkg/vcpkg.exe install --x-install-root ${{ github.workspace }}/vcpkg/installed/
|
||||
working-directory: windows
|
||||
|
||||
# Cache Rust/Cargo artifacts
|
||||
- name: Cache Cargo registry
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-registry-
|
||||
|
||||
# Cache Cargo build artifacts - rust.bat sets CARGO_TARGET_DIR to windows/
|
||||
# which results in artifacts at windows/x86_64-pc-windows-msvc/
|
||||
- name: Cache Cargo build artifacts
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ github.workspace }}/windows/x86_64-pc-windows-msvc
|
||||
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('src/rust/**/*.rs') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-
|
||||
${{ runner.os }}-cargo-build-
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Install Win 10 SDK
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
# Build Release-Full
|
||||
- name: Build Release-Full
|
||||
env:
|
||||
LIBCLANG_PATH: "C:\\Program Files\\LLVM\\lib"
|
||||
LLVM_CONFIG_PATH: "C:\\Program Files\\LLVM\\bin\\llvm-config"
|
||||
BINDGEN_EXTRA_CLANG_ARGS: -fmsc-version=0
|
||||
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
|
||||
run: msbuild ccextractor.sln /p:Configuration=Release-Full /p:Platform=x64
|
||||
working-directory: ./windows
|
||||
|
||||
- name: Display Release version information
|
||||
run: ./ccextractorwinfull.exe --version
|
||||
working-directory: ./windows/x64/Release-Full
|
||||
|
||||
- name: Upload Release artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: CCExtractor Windows Release build
|
||||
path: |
|
||||
./windows/x64/Release-Full/ccextractorwinfull.exe
|
||||
./windows/x64/Release-Full/*.dll
|
||||
|
||||
# Build Debug-Full (reuses cached Cargo artifacts)
|
||||
- name: Build Debug-Full
|
||||
env:
|
||||
LIBCLANG_PATH: "C:\\Program Files\\LLVM\\lib"
|
||||
LLVM_CONFIG_PATH: "C:\\Program Files\\LLVM\\bin\\llvm-config"
|
||||
BINDGEN_EXTRA_CLANG_ARGS: -fmsc-version=0
|
||||
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
|
||||
run: msbuild ccextractor.sln /p:Configuration=Debug-Full /p:Platform=x64
|
||||
working-directory: ./windows
|
||||
|
||||
- name: Display Debug version information
|
||||
continue-on-error: true
|
||||
run: ./ccextractorwinfull.exe --version
|
||||
working-directory: ./windows/x64/Debug-Full
|
||||
|
||||
- name: Upload Debug artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: CCExtractor Windows Debug build
|
||||
path: |
|
||||
./windows/x64/Debug-Full/ccextractorwinfull.exe
|
||||
./windows/x64/Debug-Full/ccextractorwinfull.pdb
|
||||
./windows/x64/Debug-Full/*.dll
|
||||
57
.github/workflows/format.yml
vendored
Normal file
57
.github/workflows/format.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: Format sourcecode
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/format.yml'
|
||||
- 'src/**.c'
|
||||
- 'src/**.h'
|
||||
- 'src/rust/**'
|
||||
tags-ignore: # ignore push via new tag
|
||||
- '*.*'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- '.github/workflows/format.yml'
|
||||
- 'src/**.c'
|
||||
- 'src/**.h'
|
||||
- 'src/rust/**'
|
||||
jobs:
|
||||
format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Format code
|
||||
run: |
|
||||
find src/ -type f -not -path "src/thirdparty/*" -not -path "src/lib_ccx/zvbi/*" -name '*.c' -not -path "src/GUI/icon_data.c" | xargs clang-format -i
|
||||
git diff-index --quiet HEAD -- || (git diff && exit 1)
|
||||
format_rust:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
workdir: ['./src/rust', './src/rust/lib_ccxr']
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ matrix.workdir }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
${{ matrix.workdir }}/.cargo/registry
|
||||
${{ matrix.workdir }}/.cargo/git
|
||||
${{ matrix.workdir }}/target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('${{ matrix.workdir }}/Cargo.lock') }}
|
||||
restore-keys: ${{ runner.os }}-cargo-
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- name: dependencies
|
||||
run: sudo apt update && sudo apt install libtesseract-dev libavformat-dev libavdevice-dev libswscale-dev yasm
|
||||
- name: rustfmt
|
||||
run: cargo fmt --all -- --check
|
||||
- name: clippy
|
||||
run: |
|
||||
cargo clippy -- -D warnings
|
||||
15
.github/workflows/homebrew.yml
vendored
Normal file
15
.github/workflows/homebrew.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
name: Bump Homebrew Formula
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
homebrew:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Update Homebrew formula
|
||||
uses: dawidd6/action-homebrew-bump-formula@v7
|
||||
with:
|
||||
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||
formula: ccextractor
|
||||
136
.github/workflows/publish_chocolatey.yml
vendored
Normal file
136
.github/workflows/publish_chocolatey.yml
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
# Publish to Chocolatey Community Repository
|
||||
#
|
||||
# PREREQUISITES:
|
||||
# 1. Create a Chocolatey account at https://community.chocolatey.org/account/Register
|
||||
# 2. Get your API key from https://community.chocolatey.org/account
|
||||
# 3. Add the API key as repository secret: CHOCOLATEY_API_KEY
|
||||
#
|
||||
# Reference: https://docs.chocolatey.org/en-us/create/create-packages-quick-start
|
||||
|
||||
name: Publish to Chocolatey
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release_tag:
|
||||
description: 'Release tag to publish (e.g., v0.96.1)'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Get version from tag
|
||||
id: version
|
||||
shell: bash
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.release_tag || github.event.release.tag_name }}"
|
||||
# Strip 'v' prefix if present
|
||||
VERSION="${TAG#v}"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Download MSI from release
|
||||
shell: pwsh
|
||||
run: |
|
||||
$version = "${{ steps.version.outputs.version }}"
|
||||
$tag = "${{ steps.version.outputs.tag }}"
|
||||
$msiUrl = "https://github.com/CCExtractor/ccextractor/releases/download/$tag/CCExtractor.$version.msi"
|
||||
|
||||
Write-Host "Downloading MSI from: $msiUrl"
|
||||
Invoke-WebRequest -Uri $msiUrl -OutFile "CCExtractor.msi"
|
||||
|
||||
# Calculate SHA256 checksum
|
||||
$hash = (Get-FileHash -Path "CCExtractor.msi" -Algorithm SHA256).Hash
|
||||
Write-Host "SHA256: $hash"
|
||||
echo "MSI_CHECKSUM=$hash" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Update nuspec version
|
||||
shell: pwsh
|
||||
run: |
|
||||
$version = "${{ steps.version.outputs.version }}"
|
||||
$nuspecPath = "packaging/chocolatey/ccextractor.nuspec"
|
||||
|
||||
$content = Get-Content $nuspecPath -Raw
|
||||
$content = $content -replace '<version>.*</version>', "<version>$version</version>"
|
||||
Set-Content -Path $nuspecPath -Value $content
|
||||
|
||||
Write-Host "Updated nuspec to version $version"
|
||||
|
||||
- name: Update install script
|
||||
shell: pwsh
|
||||
run: |
|
||||
$version = "${{ steps.version.outputs.version }}"
|
||||
$tag = "${{ steps.version.outputs.tag }}"
|
||||
$checksum = $env:MSI_CHECKSUM
|
||||
$installScript = "packaging/chocolatey/tools/chocolateyInstall.ps1"
|
||||
|
||||
$content = Get-Content $installScript -Raw
|
||||
|
||||
# Update URL
|
||||
$newUrl = "https://github.com/CCExtractor/ccextractor/releases/download/$tag/CCExtractor.$version.msi"
|
||||
$content = $content -replace "url64bit\s*=\s*'[^']*'", "url64bit = '$newUrl'"
|
||||
|
||||
# Update checksum
|
||||
$content = $content -replace "checksum64\s*=\s*'[^']*'", "checksum64 = '$checksum'"
|
||||
|
||||
Set-Content -Path $installScript -Value $content
|
||||
|
||||
Write-Host "Updated install script with URL and checksum"
|
||||
|
||||
- name: Build Chocolatey package
|
||||
shell: pwsh
|
||||
run: |
|
||||
cd packaging/chocolatey
|
||||
choco pack ccextractor.nuspec
|
||||
|
||||
# List the generated package
|
||||
Get-ChildItem *.nupkg
|
||||
|
||||
- name: Test package locally
|
||||
shell: pwsh
|
||||
run: |
|
||||
cd packaging/chocolatey
|
||||
$nupkg = Get-ChildItem *.nupkg | Select-Object -First 1
|
||||
Write-Host "Testing package: $($nupkg.Name)"
|
||||
|
||||
# Install from local package
|
||||
choco install ccextractor --source="'.;https://community.chocolatey.org/api/v2/'" --yes --force
|
||||
|
||||
# Verify installation
|
||||
$ccx = Get-Command ccextractor -ErrorAction SilentlyContinue
|
||||
if ($ccx) {
|
||||
Write-Host "CCExtractor found at: $($ccx.Source)"
|
||||
& ccextractor --version
|
||||
} else {
|
||||
Write-Host "CCExtractor not found in PATH, checking Program Files..."
|
||||
$exePath = Join-Path $env:ProgramFiles "CCExtractor\ccextractor.exe"
|
||||
if (Test-Path $exePath) {
|
||||
& $exePath --version
|
||||
}
|
||||
}
|
||||
|
||||
- name: Push to Chocolatey
|
||||
shell: pwsh
|
||||
env:
|
||||
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
|
||||
run: |
|
||||
cd packaging/chocolatey
|
||||
$nupkg = Get-ChildItem *.nupkg | Select-Object -First 1
|
||||
|
||||
Write-Host "Pushing $($nupkg.Name) to Chocolatey..."
|
||||
choco push $nupkg.Name --source="https://push.chocolatey.org/" --api-key="$env:CHOCOLATEY_API_KEY"
|
||||
|
||||
Write-Host "Package submitted to Chocolatey! It may take some time to be moderated and published."
|
||||
|
||||
- name: Upload package artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: chocolatey-package
|
||||
path: packaging/chocolatey/*.nupkg
|
||||
38
.github/workflows/publish_winget.yml
vendored
Normal file
38
.github/workflows/publish_winget.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
# Publish to Windows Package Manager (winget)
|
||||
#
|
||||
# PREREQUISITES:
|
||||
# 1. CCExtractor must already have ONE version in winget-pkgs before this works
|
||||
# - Submit the initial manifest manually from packaging/winget/
|
||||
# - PR to: https://github.com/microsoft/winget-pkgs
|
||||
#
|
||||
# 2. Create a fork of microsoft/winget-pkgs under the CCExtractor organization
|
||||
# - https://github.com/CCExtractor/winget-pkgs (needs to be created)
|
||||
#
|
||||
# 3. Create a GitHub Personal Access Token (classic) with 'public_repo' scope
|
||||
# - Add as repository secret: WINGET_TOKEN
|
||||
#
|
||||
# Reference: https://github.com/vedantmgoyal9/winget-releaser
|
||||
|
||||
name: Publish to WinGet
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release_tag:
|
||||
description: 'Release tag to publish (e.g., v0.96.1)'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Publish to WinGet
|
||||
uses: vedantmgoyal9/winget-releaser@v2
|
||||
with:
|
||||
identifier: CCExtractor.CCExtractor
|
||||
installers-regex: '\.msi$' # Only use the MSI installer
|
||||
token: ${{ secrets.WINGET_TOKEN }}
|
||||
release-tag: ${{ github.event.inputs.release_tag || github.event.release.tag_name }}
|
||||
137
.github/workflows/release.yml
vendored
Normal file
137
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
name: Upload releases
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
RUSTFLAGS: -Ctarget-feature=+crt-static
|
||||
VCPKG_DEFAULT_TRIPLET: x64-windows-static
|
||||
VCPKG_DEFAULT_BINARY_CACHE: C:\vcpkg\.cache
|
||||
VCPKG_COMMIT: ab2977be50c702126336e5088f4836060733c899
|
||||
|
||||
jobs:
|
||||
build_windows:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v6
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: |
|
||||
# Extract version from tag, strip 'v' prefix and everything after first dash
|
||||
VERSION=${GITHUB_REF/refs\/tags\/v/}
|
||||
VERSION=${VERSION%%-*}
|
||||
# Save display version for filenames (e.g., 0.96.1)
|
||||
echo ::set-output name=DISPLAY_VERSION::$VERSION
|
||||
# Count dots to determine version format
|
||||
DOTS="${VERSION//[^.]}"
|
||||
PART_COUNT=$((${#DOTS} + 1))
|
||||
# MSI requires 4-part version (major.minor.build.revision)
|
||||
if [ "$PART_COUNT" -eq 2 ]; then
|
||||
MSI_VERSION="${VERSION}.0.0"
|
||||
elif [ "$PART_COUNT" -eq 3 ]; then
|
||||
MSI_VERSION="${VERSION}.0"
|
||||
else
|
||||
MSI_VERSION="${VERSION}"
|
||||
fi
|
||||
echo ::set-output name=VERSION::$MSI_VERSION
|
||||
shell: bash
|
||||
- name: Setup MSBuild.exe
|
||||
uses: microsoft/setup-msbuild@v2.0.0
|
||||
with:
|
||||
msbuild-architecture: x64
|
||||
- name: Install gpac
|
||||
run: choco install gpac --version 2.4.0
|
||||
- name: Setup vcpkg
|
||||
run: mkdir C:\vcpkg\.cache
|
||||
- name: Cache vcpkg
|
||||
id: cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
C:\vcpkg\.cache
|
||||
key: vcpkg-${{ runner.os }}-${{ env.VCPKG_COMMIT }}
|
||||
- name: Build vcpkg
|
||||
run: |
|
||||
git clone https://github.com/microsoft/vcpkg
|
||||
./vcpkg/bootstrap-vcpkg.bat
|
||||
- name: Install dependencies
|
||||
run: ${{ github.workspace }}/vcpkg/vcpkg.exe install --x-install-root ${{ github.workspace }}/vcpkg/installed/
|
||||
working-directory: windows
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
- name: Install Win 10 SDK
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
- name: build Release-Full
|
||||
env:
|
||||
LIBCLANG_PATH: "C:\\Program Files\\LLVM\\lib"
|
||||
LLVM_CONFIG_PATH: "C:\\Program Files\\LLVM\\bin\\llvm-config"
|
||||
CARGO_TARGET_DIR: "..\\..\\windows"
|
||||
BINDGEN_EXTRA_CLANG_ARGS: -fmsc-version=0
|
||||
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
|
||||
run: msbuild ccextractor.sln /p:Configuration=Release-Full /p:Platform=x64
|
||||
working-directory: ./windows
|
||||
- name: Copy files to directory for installer
|
||||
run: mkdir installer; cp ./x64/Release-Full/ccextractorwinfull.exe ./installer; cp ./x64/Release-Full/*.dll ./installer
|
||||
working-directory: ./windows
|
||||
- name: Download tessdata for OCR support
|
||||
run: |
|
||||
mkdir -p ./installer/tessdata
|
||||
# Download English traineddata from tessdata_fast (smaller, faster, good for most use cases)
|
||||
Invoke-WebRequest -Uri "https://github.com/tesseract-ocr/tessdata_fast/raw/main/eng.traineddata" -OutFile "./installer/tessdata/eng.traineddata"
|
||||
# Download OSD (Orientation and Script Detection) for automatic script detection
|
||||
Invoke-WebRequest -Uri "https://github.com/tesseract-ocr/tessdata_fast/raw/main/osd.traineddata" -OutFile "./installer/tessdata/osd.traineddata"
|
||||
working-directory: ./windows
|
||||
- name: install WiX
|
||||
run: dotnet tool uninstall --global wix; dotnet tool install --global wix --version 6.0.2 && wix extension add -g WixToolset.UI.wixext/6.0.2
|
||||
- name: Make sure WiX works
|
||||
run: wix --version && wix extension list -g
|
||||
- name: Download Flutter GUI
|
||||
run: ((Invoke-WebRequest -UseBasicParsing https://api.github.com/repos/CCExtractor/ccextractorfluttergui/releases/latest).Content | ConvertFrom-Json).assets | ForEach-Object {if ($_.name -eq "windows.zip") { Invoke-WebRequest -UseBasicParsing -Uri $_.browser_download_url -OutFile windows.zip}}
|
||||
working-directory: ./windows
|
||||
- name: Display contents of dir
|
||||
run: ls
|
||||
working-directory: ./windows
|
||||
- name: Unzip Flutter GUI
|
||||
run: Expand-Archive -Path ./windows.zip -DestinationPath ./installer -Force
|
||||
working-directory: ./windows
|
||||
- name: Display installer folder contents
|
||||
run: Get-ChildItem -Recurse ./installer
|
||||
working-directory: ./windows
|
||||
- name: Create portable zip
|
||||
run: Compress-Archive -Path ./installer/* -DestinationPath ./CCExtractor.${{ steps.get_version.outputs.DISPLAY_VERSION }}_win_portable.zip
|
||||
working-directory: ./windows
|
||||
- name: Build installer
|
||||
run: wix build -arch x64 -ext WixToolset.UI.wixext -d "AppVersion=${{ steps.get_version.outputs.VERSION }}" -o CCExtractor.${{ steps.get_version.outputs.DISPLAY_VERSION }}.msi installer.wxs CustomUI.wxs
|
||||
working-directory: ./windows
|
||||
- name: Upload as asset
|
||||
uses: AButler/upload-release-assets@v3.0
|
||||
with:
|
||||
files: './windows/CCExtractor.${{ steps.get_version.outputs.DISPLAY_VERSION }}.msi;./windows/CCExtractor.${{ steps.get_version.outputs.DISPLAY_VERSION }}_win_portable.zip'
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
create_linux_package:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
path: ./ccextractor
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: |
|
||||
VERSION=${GITHUB_REF/refs\/tags\/v/}
|
||||
VERSION=${VERSION%%-*}
|
||||
echo ::set-output name=DISPLAY_VERSION::$VERSION
|
||||
- name: Create .tar.gz without git and windows folders
|
||||
run: tar -pczf ./ccextractor.${{ steps.get_version.outputs.DISPLAY_VERSION }}.tar.gz --exclude "ccextractor/windows" --exclude "ccextractor/.git" ccextractor
|
||||
- name: Upload as asset
|
||||
uses: AButler/upload-release-assets@v3.0
|
||||
with:
|
||||
files: './ccextractor.${{ steps.get_version.outputs.DISPLAY_VERSION }}.tar.gz'
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
41
.github/workflows/test_rust.yml
vendored
Normal file
41
.github/workflows/test_rust.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Unit Test Rust
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- ".github/workflows/test.yml"
|
||||
- "src/rust/**"
|
||||
tags-ignore:
|
||||
- "*.*"
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- ".github/workflows/test.yml"
|
||||
- "src/rust/**"
|
||||
jobs:
|
||||
test_rust:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./src/rust
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
src/rust/.cargo/registry
|
||||
src/rust/.cargo/git
|
||||
src/rust/target
|
||||
src/rust/lib_ccxr/target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: ${{ runner.os }}-cargo-
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
- name: Test main module
|
||||
run: cargo test
|
||||
working-directory: ./src/rust
|
||||
- name: Test lib_ccxr module
|
||||
run: cargo test
|
||||
working-directory: ./src/rust/lib_ccxr
|
||||
37
.gitignore
vendored
37
.gitignore
vendored
@@ -17,8 +17,11 @@ CVS
|
||||
mac/ccextractor
|
||||
linux/ccextractor
|
||||
linux/depend
|
||||
linux/build_scan/
|
||||
windows/x86_64-pc-windows-msvc/**
|
||||
windows/Debug/**
|
||||
windows/Debug-OCR/**
|
||||
windows/release-with-debug/**
|
||||
windows/Release/**
|
||||
windows/Release-Full/**
|
||||
windows/Release-OCR/**
|
||||
@@ -26,6 +29,7 @@ windows/Debug-Full/**
|
||||
windows/x64/**
|
||||
windows/ccextractor.VC.db
|
||||
build/
|
||||
build_*/
|
||||
|
||||
####
|
||||
# Python
|
||||
@@ -84,6 +88,7 @@ linux/aclocal.m4
|
||||
linux/*.in
|
||||
linux/configure
|
||||
linux/build-conf/
|
||||
mac/rust/
|
||||
mac/config.h
|
||||
mac/config.log
|
||||
mac/config.status
|
||||
@@ -97,16 +102,12 @@ 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/
|
||||
@@ -137,3 +138,31 @@ mac/cmake_install.cmake
|
||||
mac/CMakeFiles/
|
||||
mac/CMakeCache.txt
|
||||
*.py.bak
|
||||
|
||||
# Bazel
|
||||
bazel*
|
||||
|
||||
#Intellij IDEs
|
||||
.idea/
|
||||
|
||||
# Plans (local only)
|
||||
plans/
|
||||
|
||||
# Rust build and MakeFiles (and CMake files)
|
||||
src/rust/CMakeFiles/
|
||||
src/rust/CMakeCache.txt
|
||||
src/rust/Makefile
|
||||
src/rust/cmake_install.cmake
|
||||
src/rust/target/
|
||||
src/rust/lib_ccxr/target/
|
||||
windows/ccx_rust.lib
|
||||
windows/*/debug/*
|
||||
windows/*/CACHEDIR.TAG
|
||||
windows/.rustc_info.json
|
||||
linux/configure~
|
||||
|
||||
# Plans and temporary files
|
||||
plans/
|
||||
tess.log
|
||||
**/tess.log
|
||||
ut=srt*
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
MAINTAINER = Marc Espie <espie@openbsd.org>
|
||||
CATEGORIES = multimedia
|
||||
COMMENT = closed caption subtitles extractor
|
||||
HOMEPAGE = http://ccextractor.sourceforge.net/
|
||||
V = 0.88
|
||||
HOMEPAGE = https://ccextractor.org
|
||||
V = 0.96.5
|
||||
DISTFILES = ccextractor.${V:S/.//}-src.zip
|
||||
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=ccextractor/}
|
||||
DISTNAME = ccextractor-$V
|
||||
|
||||
62
README.md
62
README.md
@@ -2,11 +2,10 @@
|
||||
|
||||
# CCExtractor
|
||||
|
||||
<a href="https://travis-ci.org/CCExtractor/ccextractor"><img src="https://raw.githubusercontent.com/CCExtractor/ccextractor-org-media/master/static/macOS-build-badge-logo.png" width="20"></a> [](https://travis-ci.org/CCExtractor/ccextractor)
|
||||
[](https://sampleplatform.ccextractor.org/test/master/windows)
|
||||
[](https://sampleplatform.ccextractor.org/test/master/linux)
|
||||
[](https://sourceforge.net/projects/ccextractor/)
|
||||

|
||||
[](https://github.com/CCExtractor/ccextractor/releases/latest)
|
||||
|
||||
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.
|
||||
|
||||
@@ -27,7 +26,26 @@ The core functionality is written in C. Other languages used include C++ and Pyt
|
||||
|
||||
## Installation and Usage
|
||||
|
||||
Downloads for precompiled binaries and source code can be found [on our website](https://www.ccextractor.org?id=public:general:downloads).
|
||||
Downloads for precompiled binaries and source code can be found [on our website](https://ccextractor.org/public/general/downloads/).
|
||||
|
||||
|
||||
### Windows Package Managers
|
||||
|
||||
**WinGet:**
|
||||
```powershell
|
||||
winget install CCExtractor.CCExtractor
|
||||
```
|
||||
|
||||
**Chocolatey:**
|
||||
```powershell
|
||||
choco install ccextractor
|
||||
```
|
||||
|
||||
**Scoop:**
|
||||
```powershell
|
||||
scoop bucket add extras
|
||||
scoop install ccextractor
|
||||
```
|
||||
|
||||
Extracting subtitles is relatively simple. Just run the following command:
|
||||
|
||||
@@ -37,11 +55,41 @@ This will extract the subtitles.
|
||||
|
||||
More usage information can be found on our website:
|
||||
|
||||
- [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)
|
||||
- [Using the command line tool](https://ccextractor.org/public/general/command_line_usage/)
|
||||
- [Using the Flutter GUI](https://ccextractor.org/public/general/flutter_gui/)
|
||||
|
||||
You can also find the list of parameters and their brief description by running `ccextractor` without any arguments.
|
||||
|
||||
You can find sample files on [our website](https://ccextractor.org/public/general/tvsamples/) to test the software.
|
||||
|
||||
### Building from Source
|
||||
|
||||
- [Building on Windows using WSL](docs/build-wsl.md)
|
||||
|
||||
#### Linux (Autotools) build notes
|
||||
|
||||
CCExtractor also supports an autotools-based build system under the `linux/`
|
||||
directory.
|
||||
|
||||
Important notes:
|
||||
- The autotools workflow lives inside `linux/`. The `configure` script is
|
||||
generated there and should be run from that directory.
|
||||
- Typical build steps are:
|
||||
```
|
||||
cd linux
|
||||
./autogen.sh
|
||||
./configure
|
||||
make
|
||||
```
|
||||
- Rust support is enabled automatically if `cargo` and `rustc` are available
|
||||
on the system. In that case, Rust components are built and linked during
|
||||
`make`.
|
||||
- If you encounter unexpected build or linking issues, a clean rebuild
|
||||
(`make clean` or a fresh clone) is recommended, especially when Rust is
|
||||
involved.
|
||||
|
||||
This build flow has been tested on Linux and WSL.
|
||||
|
||||
## 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).
|
||||
@@ -52,9 +100,9 @@ By far the best way to get support is by opening an issue at our [issue tracker]
|
||||
|
||||
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.
|
||||
|
||||
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 have a question or a problem you can also [contact us by email or chat with the team in Slack](https://ccextractor.org/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)
|
||||
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://sourceforge.net/donate/index.php?group_id=190832)
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
from builtins import str
|
||||
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)
|
||||
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
from __future__ import print_function
|
||||
###
|
||||
#MANDATORY UPDATES IN EVERY PYTHON SCRIPT
|
||||
###
|
||||
import sys
|
||||
|
||||
import ccextractor as cc
|
||||
|
||||
|
||||
def callback(line, encoding):
|
||||
print(line)
|
||||
|
||||
|
||||
def init_ccextractor(callback):
|
||||
"""
|
||||
:param callback: The callback which we use to handle
|
||||
the extracted subtitle info
|
||||
:return return the initialized options
|
||||
"""
|
||||
optionos = cc.api_init_options()
|
||||
cc.check_configuration_file(optionos)
|
||||
for arg in sys.argv[1:]:
|
||||
cc.api_add_param(optionos, arg)
|
||||
compile_ret = cc.compile_params(optionos, len(sys.argv[1:]))
|
||||
|
||||
# use my_pythonapi to add callback in C source code
|
||||
cc.my_pythonapi(optionos, callback)
|
||||
|
||||
return optionos
|
||||
|
||||
|
||||
def main():
|
||||
options = init_ccextractor(callback)
|
||||
cc.api_start(options)
|
||||
|
||||
|
||||
if __name__=="__main__":
|
||||
main()
|
||||
@@ -1,97 +0,0 @@
|
||||
#!/bin/bash
|
||||
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DPYTHON_API"
|
||||
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 -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')"
|
||||
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"
|
||||
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')"
|
||||
# the `swig -python ccextractor.i` will generate ccextractor_wrap.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 $SRC_FREETYPE"
|
||||
|
||||
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept -l python3.6m"
|
||||
|
||||
echo "Running pre-build script..."
|
||||
../linux/pre-build.sh
|
||||
echo "Trying to compile..."
|
||||
|
||||
|
||||
out=$((swig -python ccextractor.i && LC_ALL=C gcc -fPIC -c $BLD_FLAGS $BLD_INCLUDE $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
|
||||
if [[ "$out" != "" ]] ; then
|
||||
echo "$out"
|
||||
echo "Compilation successful, compiler message shown in previous lines"
|
||||
else
|
||||
echo "Compilation successful, no compiler messages."
|
||||
fi
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/bin/bash
|
||||
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept -l python2.7"
|
||||
WRAPPER_FLAGS="-Wl,-wrap,write"
|
||||
|
||||
out=$((./build_api && gcc -shared $(find -name '*.o') -o _ccextractor.so $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
|
||||
rm *.o
|
||||
echo "Compilation successful";
|
||||
@@ -1,18 +0,0 @@
|
||||
%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"
|
||||
%}
|
||||
struct ccx_s_options* api_init_options();
|
||||
void check_configuration_file(struct ccx_s_options api_options);
|
||||
int compile_params(struct ccx_s_options *api_options,int argc);
|
||||
void api_add_param(struct ccx_s_options* api_options,char* arg);
|
||||
int api_start(struct ccx_s_options api_options);
|
||||
void my_pythonapi(struct ccx_s_options *api_options, PyObject *func);
|
||||
@@ -1,63 +0,0 @@
|
||||
from __future__ import print_function
|
||||
from builtins import str
|
||||
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
|
||||
@@ -1,155 +0,0 @@
|
||||
from __future__ import print_function
|
||||
from builtins import zip
|
||||
from builtins import str
|
||||
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 list(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'] = [str(item,encoding_format) for item in d['text']]
|
||||
else:
|
||||
d['text'] = [str(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()
|
||||
@@ -1,26 +0,0 @@
|
||||
from __future__ import print_function
|
||||
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)
|
||||
239
docker/Dockerfile
Normal file
239
docker/Dockerfile
Normal file
@@ -0,0 +1,239 @@
|
||||
# CCExtractor Docker Build
|
||||
#
|
||||
# Build variants via BUILD_TYPE argument:
|
||||
# - minimal: Basic CCExtractor without OCR
|
||||
# - ocr: CCExtractor with OCR support (default)
|
||||
# - hardsubx: CCExtractor with burned-in subtitle extraction (requires FFmpeg)
|
||||
#
|
||||
# Source options via USE_LOCAL_SOURCE argument:
|
||||
# - 0 (default): Clone from GitHub (standalone Dockerfile usage)
|
||||
# - 1: Use local source (when building from cloned repo)
|
||||
#
|
||||
# Build examples:
|
||||
#
|
||||
# # Standalone (just the Dockerfile, clones from GitHub):
|
||||
# docker build -t ccextractor docker/
|
||||
# docker build --build-arg BUILD_TYPE=hardsubx -t ccextractor docker/
|
||||
#
|
||||
# # From cloned repository (faster, uses local source):
|
||||
# docker build --build-arg USE_LOCAL_SOURCE=1 -f docker/Dockerfile -t ccextractor .
|
||||
# docker build --build-arg USE_LOCAL_SOURCE=1 --build-arg BUILD_TYPE=minimal -f docker/Dockerfile -t ccextractor .
|
||||
|
||||
ARG DEBIAN_VERSION=bookworm-slim
|
||||
|
||||
FROM debian:${DEBIAN_VERSION} AS base
|
||||
|
||||
FROM base AS builder
|
||||
|
||||
# Build arguments
|
||||
ARG BUILD_TYPE=ocr
|
||||
ARG USE_LOCAL_SOURCE=0
|
||||
# BUILD_TYPE: minimal, ocr, hardsubx
|
||||
# USE_LOCAL_SOURCE: 0 = git clone, 1 = copy local source
|
||||
|
||||
# Avoid interactive prompts during package installation
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install base build dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
git \
|
||||
curl \
|
||||
ca-certificates \
|
||||
gcc \
|
||||
g++ \
|
||||
cmake \
|
||||
make \
|
||||
pkg-config \
|
||||
bash \
|
||||
zlib1g-dev \
|
||||
libpng-dev \
|
||||
libjpeg-dev \
|
||||
libssl-dev \
|
||||
libfreetype-dev \
|
||||
libxml2-dev \
|
||||
libcurl4-gnutls-dev \
|
||||
clang \
|
||||
libclang-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Rust toolchain
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
|
||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||
|
||||
# Install OCR dependencies (for ocr and hardsubx builds)
|
||||
RUN if [ "$BUILD_TYPE" = "ocr" ] || [ "$BUILD_TYPE" = "hardsubx" ]; then \
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
tesseract-ocr \
|
||||
libtesseract-dev \
|
||||
libleptonica-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*; \
|
||||
fi
|
||||
|
||||
# Install FFmpeg dependencies (for hardsubx build)
|
||||
RUN if [ "$BUILD_TYPE" = "hardsubx" ]; then \
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
libavcodec-dev \
|
||||
libavformat-dev \
|
||||
libavutil-dev \
|
||||
libswscale-dev \
|
||||
libswresample-dev \
|
||||
libavfilter-dev \
|
||||
libavdevice-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*; \
|
||||
fi
|
||||
|
||||
# Build and install GPAC library
|
||||
WORKDIR /root
|
||||
RUN git clone -b v2.4.0 --depth 1 https://github.com/gpac/gpac
|
||||
WORKDIR /root/gpac
|
||||
RUN ./configure && make -j$(nproc) lib && make install-lib && ldconfig
|
||||
WORKDIR /root
|
||||
RUN rm -rf /root/gpac
|
||||
|
||||
# Get CCExtractor source (either clone or copy based on USE_LOCAL_SOURCE)
|
||||
WORKDIR /root
|
||||
# First, copy local source if provided (will be empty dir if building standalone)
|
||||
COPY . /root/ccextractor-local/
|
||||
|
||||
# Then get source: use local copy if USE_LOCAL_SOURCE=1 and source exists,
|
||||
# otherwise clone from GitHub
|
||||
RUN if [ "$USE_LOCAL_SOURCE" = "1" ] && [ -f /root/ccextractor-local/src/ccextractor.c ]; then \
|
||||
echo "Using local source"; \
|
||||
mv /root/ccextractor-local /root/ccextractor; \
|
||||
else \
|
||||
echo "Cloning from GitHub"; \
|
||||
rm -rf /root/ccextractor-local; \
|
||||
git clone --depth 1 https://github.com/CCExtractor/ccextractor.git /root/ccextractor; \
|
||||
fi
|
||||
|
||||
WORKDIR /root/ccextractor/linux
|
||||
|
||||
# Generate build info
|
||||
RUN ./pre-build.sh
|
||||
|
||||
# Build Rust library with appropriate features
|
||||
RUN if [ "$BUILD_TYPE" = "hardsubx" ]; then \
|
||||
cd ../src/rust && \
|
||||
CARGO_TARGET_DIR=../../linux/rust cargo build --release --features hardsubx_ocr; \
|
||||
else \
|
||||
cd ../src/rust && \
|
||||
CARGO_TARGET_DIR=../../linux/rust cargo build --release; \
|
||||
fi
|
||||
|
||||
RUN cp rust/release/libccx_rust.a ./libccx_rust.a
|
||||
|
||||
# Compile CCExtractor
|
||||
RUN if [ "$BUILD_TYPE" = "minimal" ]; then \
|
||||
BLD_FLAGS="-std=gnu99 -Wno-write-strings -Wno-pointer-sign -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP -DGPAC_64_BITS"; \
|
||||
BLD_INCLUDE="-I../src -I../src/lib_ccx/ -I /usr/include/gpac/ -I../src/thirdparty/libpng -I../src/thirdparty/zlib -I../src/lib_ccx/zvbi -I../src/thirdparty/lib_hash -I../src/thirdparty -I../src/thirdparty/freetype/include"; \
|
||||
BLD_LINKER="-lm -Wl,--allow-multiple-definition -lpthread -ldl -lgpac ./libccx_rust.a"; \
|
||||
elif [ "$BUILD_TYPE" = "hardsubx" ]; then \
|
||||
BLD_FLAGS="-std=gnu99 -Wno-write-strings -Wno-pointer-sign -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DENABLE_HARDSUBX -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP -DGPAC_64_BITS"; \
|
||||
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I /usr/include/gpac/ -I../src/thirdparty/libpng -I../src/thirdparty/zlib -I../src/lib_ccx/zvbi -I../src/thirdparty/lib_hash -I../src/thirdparty -I../src/thirdparty/freetype/include"; \
|
||||
BLD_LINKER="-lm -Wl,--allow-multiple-definition -ltesseract -lleptonica -lpthread -ldl -lgpac -lswscale -lavutil -lavformat -lavcodec -lavfilter -lswresample ./libccx_rust.a"; \
|
||||
else \
|
||||
BLD_FLAGS="-std=gnu99 -Wno-write-strings -Wno-pointer-sign -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP -DGPAC_64_BITS"; \
|
||||
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I /usr/include/gpac/ -I../src/thirdparty/libpng -I../src/thirdparty/zlib -I../src/lib_ccx/zvbi -I../src/thirdparty/lib_hash -I../src/thirdparty -I../src/thirdparty/freetype/include"; \
|
||||
BLD_LINKER="-lm -Wl,--allow-multiple-definition -ltesseract -lleptonica -lpthread -ldl -lgpac ./libccx_rust.a"; \
|
||||
fi && \
|
||||
SRC_LIBPNG="$(find ../src/thirdparty/libpng/ -name '*.c')" && \
|
||||
SRC_ZLIB="$(find ../src/thirdparty/zlib/ -name '*.c')" && \
|
||||
SRC_CCX="$(find ../src/lib_ccx/ -name '*.c')" && \
|
||||
SRC_GPAC="$(find /usr/include/gpac/ -name '*.c' 2>/dev/null || true)" && \
|
||||
SRC_HASH="$(find ../src/thirdparty/lib_hash/ -name '*.c')" && \
|
||||
SRC_UTF8PROC="../src/thirdparty/utf8proc/utf8proc.c" && \
|
||||
SRC_FREETYPE="../src/thirdparty/freetype/autofit/autofit.c \
|
||||
../src/thirdparty/freetype/base/ftbase.c \
|
||||
../src/thirdparty/freetype/base/ftbbox.c \
|
||||
../src/thirdparty/freetype/base/ftbdf.c \
|
||||
../src/thirdparty/freetype/base/ftbitmap.c \
|
||||
../src/thirdparty/freetype/base/ftcid.c \
|
||||
../src/thirdparty/freetype/base/ftfntfmt.c \
|
||||
../src/thirdparty/freetype/base/ftfstype.c \
|
||||
../src/thirdparty/freetype/base/ftgasp.c \
|
||||
../src/thirdparty/freetype/base/ftglyph.c \
|
||||
../src/thirdparty/freetype/base/ftgxval.c \
|
||||
../src/thirdparty/freetype/base/ftinit.c \
|
||||
../src/thirdparty/freetype/base/ftlcdfil.c \
|
||||
../src/thirdparty/freetype/base/ftmm.c \
|
||||
../src/thirdparty/freetype/base/ftotval.c \
|
||||
../src/thirdparty/freetype/base/ftpatent.c \
|
||||
../src/thirdparty/freetype/base/ftpfr.c \
|
||||
../src/thirdparty/freetype/base/ftstroke.c \
|
||||
../src/thirdparty/freetype/base/ftsynth.c \
|
||||
../src/thirdparty/freetype/base/ftsystem.c \
|
||||
../src/thirdparty/freetype/base/fttype1.c \
|
||||
../src/thirdparty/freetype/base/ftwinfnt.c \
|
||||
../src/thirdparty/freetype/bdf/bdf.c \
|
||||
../src/thirdparty/freetype/bzip2/ftbzip2.c \
|
||||
../src/thirdparty/freetype/cache/ftcache.c \
|
||||
../src/thirdparty/freetype/cff/cff.c \
|
||||
../src/thirdparty/freetype/cid/type1cid.c \
|
||||
../src/thirdparty/freetype/gzip/ftgzip.c \
|
||||
../src/thirdparty/freetype/lzw/ftlzw.c \
|
||||
../src/thirdparty/freetype/pcf/pcf.c \
|
||||
../src/thirdparty/freetype/pfr/pfr.c \
|
||||
../src/thirdparty/freetype/psaux/psaux.c \
|
||||
../src/thirdparty/freetype/pshinter/pshinter.c \
|
||||
../src/thirdparty/freetype/psnames/psnames.c \
|
||||
../src/thirdparty/freetype/raster/raster.c \
|
||||
../src/thirdparty/freetype/sfnt/sfnt.c \
|
||||
../src/thirdparty/freetype/smooth/smooth.c \
|
||||
../src/thirdparty/freetype/truetype/truetype.c \
|
||||
../src/thirdparty/freetype/type1/type1.c \
|
||||
../src/thirdparty/freetype/type42/type42.c \
|
||||
../src/thirdparty/freetype/winfonts/winfnt.c" && \
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_LIBPNG $SRC_HASH $SRC_UTF8PROC $SRC_FREETYPE" && \
|
||||
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER
|
||||
|
||||
# Copy binary to known location
|
||||
RUN cp /root/ccextractor/linux/ccextractor /ccextractor
|
||||
|
||||
# Final minimal image
|
||||
FROM base AS final
|
||||
|
||||
ARG BUILD_TYPE=ocr
|
||||
|
||||
# Avoid interactive prompts
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install runtime dependencies based on build type
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libpng16-16 \
|
||||
libjpeg62-turbo \
|
||||
zlib1g \
|
||||
libssl3 \
|
||||
libcurl4 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# OCR runtime dependencies
|
||||
RUN if [ "$BUILD_TYPE" = "ocr" ] || [ "$BUILD_TYPE" = "hardsubx" ]; then \
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
tesseract-ocr \
|
||||
liblept5 \
|
||||
&& rm -rf /var/lib/apt/lists/*; \
|
||||
fi
|
||||
|
||||
# HardSubX runtime dependencies
|
||||
RUN if [ "$BUILD_TYPE" = "hardsubx" ]; then \
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
libavcodec59 \
|
||||
libavformat59 \
|
||||
libavutil57 \
|
||||
libswscale6 \
|
||||
libswresample4 \
|
||||
libavfilter8 \
|
||||
libavdevice59 \
|
||||
&& rm -rf /var/lib/apt/lists/*; \
|
||||
fi
|
||||
|
||||
# Copy GPAC library from builder
|
||||
COPY --from=builder /usr/local/lib/libgpac.so* /usr/local/lib/
|
||||
|
||||
# Update library cache
|
||||
RUN ldconfig
|
||||
|
||||
# Copy CCExtractor binary
|
||||
COPY --from=builder /ccextractor /ccextractor
|
||||
|
||||
ENTRYPOINT ["/ccextractor"]
|
||||
91
docker/README.md
Normal file
91
docker/README.md
Normal file
@@ -0,0 +1,91 @@
|
||||
# CCExtractor Docker Image
|
||||
|
||||
This Dockerfile builds CCExtractor with support for multiple build variants.
|
||||
|
||||
## Build Variants
|
||||
|
||||
| Variant | Description | Features |
|
||||
|---------|-------------|----------|
|
||||
| `minimal` | Basic CCExtractor | No OCR support |
|
||||
| `ocr` | With OCR support (default) | Tesseract OCR for bitmap subtitles |
|
||||
| `hardsubx` | With burned-in subtitle extraction | OCR + FFmpeg for hardcoded subtitles |
|
||||
|
||||
## Building
|
||||
|
||||
### Standalone Build (from Dockerfile only)
|
||||
|
||||
You can build CCExtractor using just the Dockerfile - it will clone the source from GitHub:
|
||||
|
||||
```bash
|
||||
# Default build (OCR enabled)
|
||||
docker build -t ccextractor docker/
|
||||
|
||||
# Minimal build (no OCR)
|
||||
docker build --build-arg BUILD_TYPE=minimal -t ccextractor docker/
|
||||
|
||||
# HardSubX build (OCR + FFmpeg for burned-in subtitles)
|
||||
docker build --build-arg BUILD_TYPE=hardsubx -t ccextractor docker/
|
||||
```
|
||||
|
||||
### Build from Cloned Repository (faster)
|
||||
|
||||
If you have already cloned the repository, you can use local source for faster builds:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/CCExtractor/ccextractor.git
|
||||
cd ccextractor
|
||||
|
||||
# Default build (OCR enabled)
|
||||
docker build --build-arg USE_LOCAL_SOURCE=1 -f docker/Dockerfile -t ccextractor .
|
||||
|
||||
# Minimal build
|
||||
docker build --build-arg USE_LOCAL_SOURCE=1 --build-arg BUILD_TYPE=minimal -f docker/Dockerfile -t ccextractor .
|
||||
|
||||
# HardSubX build
|
||||
docker build --build-arg USE_LOCAL_SOURCE=1 --build-arg BUILD_TYPE=hardsubx -f docker/Dockerfile -t ccextractor .
|
||||
```
|
||||
|
||||
## Build Arguments
|
||||
|
||||
| Argument | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `BUILD_TYPE` | `ocr` | Build variant: `minimal`, `ocr`, or `hardsubx` |
|
||||
| `USE_LOCAL_SOURCE` | `0` | Set to `1` to use local source instead of cloning |
|
||||
| `DEBIAN_VERSION` | `bookworm-slim` | Debian version to use as base |
|
||||
|
||||
## Usage
|
||||
|
||||
### Basic Usage
|
||||
|
||||
```bash
|
||||
# Show version
|
||||
docker run --rm ccextractor --version
|
||||
|
||||
# Show help
|
||||
docker run --rm ccextractor --help
|
||||
```
|
||||
|
||||
### Processing Local Files
|
||||
|
||||
Mount your local directory to process files:
|
||||
|
||||
```bash
|
||||
# Process a video file with output file
|
||||
docker run --rm -v $(pwd):$(pwd) -w $(pwd) ccextractor input.mp4 -o output.srt
|
||||
|
||||
# Process using stdout
|
||||
docker run --rm -v $(pwd):$(pwd) -w $(pwd) ccextractor input.mp4 --stdout > output.srt
|
||||
```
|
||||
|
||||
### Interactive Mode
|
||||
|
||||
```bash
|
||||
docker run --rm -it --entrypoint=/bin/bash ccextractor
|
||||
```
|
||||
|
||||
## Image Size
|
||||
|
||||
The multi-stage build produces runtime images:
|
||||
- `minimal`: ~130MB
|
||||
- `ocr`: ~215MB (includes Tesseract)
|
||||
- `hardsubx`: ~610MB (includes Tesseract + FFmpeg)
|
||||
@@ -29,7 +29,7 @@ To do:
|
||||
though. No samples, no support.
|
||||
- A few commands are not yet supported, specifically those related
|
||||
to delay.
|
||||
- Detect and extract captions from MP4 (MOV) files, handled by gpacmp4
|
||||
- Detect and extract captions from MP4 (MOV) files, handled by gpac
|
||||
|
||||
Done (18.08.2015):
|
||||
|
||||
|
||||
157
docs/Building_macos_system_libs.md
Normal file
157
docs/Building_macos_system_libs.md
Normal file
@@ -0,0 +1,157 @@
|
||||
# Building CCExtractor on macOS using System Libraries (-system-libs)
|
||||
|
||||
## Overview
|
||||
|
||||
This document explains how to build CCExtractor on macOS using system-installed libraries instead of bundled third-party libraries.
|
||||
|
||||
This build mode is required for Homebrew compatibility and is enabled via the `-system-libs` flag introduced in PR #1862.
|
||||
|
||||
## Why is -system-libs needed?
|
||||
|
||||
### Background
|
||||
|
||||
CCExtractor was removed from Homebrew (homebrew-core) because:
|
||||
|
||||
- Homebrew does not allow bundling third-party libraries
|
||||
- The default CCExtractor build compiles libraries from `src/thirdparty/`
|
||||
- This violates Homebrew packaging policies
|
||||
|
||||
### What -system-libs fixes
|
||||
|
||||
The `-system-libs` flag allows CCExtractor to:
|
||||
|
||||
- Use system-installed libraries via Homebrew
|
||||
- Resolve headers and linker flags using `pkg-config`
|
||||
- Skip compiling bundled copies of common libraries
|
||||
|
||||
This makes CCExtractor acceptable for Homebrew packaging.
|
||||
|
||||
## Build Modes Explained
|
||||
|
||||
### 1️⃣ Default Build (Bundled Libraries)
|
||||
|
||||
**Command:**
|
||||
|
||||
```bash
|
||||
./mac/build.command
|
||||
```
|
||||
|
||||
**Behavior:**
|
||||
|
||||
- Compiles bundled libraries:
|
||||
- `freetype`
|
||||
- `libpng`
|
||||
- `zlib`
|
||||
- `utf8proc`
|
||||
- Self-contained binary
|
||||
- Larger size
|
||||
- Suitable for standalone builds
|
||||
|
||||
### 2️⃣ System Libraries Build (Homebrew-compatible)
|
||||
|
||||
**Command:**
|
||||
|
||||
```bash
|
||||
./mac/build.command -system-libs
|
||||
```
|
||||
|
||||
**Behavior:**
|
||||
|
||||
- Uses system libraries via `pkg-config`
|
||||
- Does not compile bundled libraries
|
||||
- Smaller binary
|
||||
- Faster build
|
||||
- Required for Homebrew
|
||||
|
||||
## Required Homebrew Dependencies
|
||||
|
||||
Install required dependencies:
|
||||
|
||||
```bash
|
||||
brew install pkg-config autoconf automake libtool \
|
||||
gpac freetype libpng protobuf-c utf8proc zlib
|
||||
```
|
||||
|
||||
**Optional** (OCR / HARDSUBX support):
|
||||
|
||||
```bash
|
||||
brew install tesseract leptonica ffmpeg
|
||||
```
|
||||
|
||||
## How to Build
|
||||
|
||||
```bash
|
||||
cd mac
|
||||
./build.command -system-libs
|
||||
```
|
||||
|
||||
**Verify:**
|
||||
|
||||
```bash
|
||||
./ccextractor --version
|
||||
```
|
||||
|
||||
## What Changes Internally with -system-libs
|
||||
|
||||
### Libraries NOT compiled (system-provided)
|
||||
|
||||
- **FreeType**
|
||||
- **libpng**
|
||||
- **zlib**
|
||||
- **utf8proc**
|
||||
|
||||
### Libraries STILL bundled
|
||||
|
||||
- **lib_hash** (Custom SHA-256 implementation, no system equivalent)
|
||||
|
||||
## CI Coverage
|
||||
|
||||
A new CI job was added:
|
||||
|
||||
- `build_shell_system_libs`
|
||||
|
||||
**What it does:**
|
||||
|
||||
- Installs Homebrew dependencies
|
||||
- Runs `./build.command -system-libs`
|
||||
- Verifies the binary runs correctly
|
||||
|
||||
This ensures Homebrew-compatible builds stay working.
|
||||
|
||||
## Verification (Local)
|
||||
|
||||
You can confirm system libraries are used:
|
||||
|
||||
```bash
|
||||
otool -L mac/ccextractor
|
||||
```
|
||||
|
||||
**Expected output includes paths like:**
|
||||
|
||||
```
|
||||
/opt/homebrew/opt/gpac/lib/libgpac.dylib
|
||||
```
|
||||
|
||||
## Homebrew Formula Usage (Future)
|
||||
|
||||
Example formula snippet:
|
||||
|
||||
```ruby
|
||||
def install
|
||||
system "./mac/build.command", "-system-libs"
|
||||
bin.install "mac/ccextractor"
|
||||
end
|
||||
```
|
||||
|
||||
## Summary
|
||||
|
||||
- `-system-libs` is opt-in
|
||||
- Default build remains unchanged
|
||||
- Enables CCExtractor to return to Homebrew
|
||||
- Fully tested in CI and locally
|
||||
|
||||
## Related
|
||||
|
||||
- **PR #1862** — Add `-system-libs` flag
|
||||
- **Issue #1580** — Homebrew compatibility
|
||||
- **Issue #1534** — System library support
|
||||
418
docs/CHANGES.TXT
418
docs/CHANGES.TXT
@@ -1,3 +1,170 @@
|
||||
0.96.6 (unreleased)
|
||||
-------------------
|
||||
- New: Add Snap packaging support with Snapcraft configuration and GitHub Actions CI workflow.
|
||||
- Fix: Clear status line output on Linux/WSL to prevent text artifacts (#2017)
|
||||
- Fix: Prevent infinite loop on truncated MKV files
|
||||
- Fix: Various memory safety and stability fixes in demuxers (MP4, PS, MKV, DVB)
|
||||
- Fix: Delete empty output files instead of leaving 0-byte files (#1282)
|
||||
- Fix: --mkvlang now supports BCP 47 language tags (e.g., en-US, zh-Hans-CN) and multiple codes
|
||||
|
||||
0.96.5 (2026-01-05)
|
||||
-------------------
|
||||
- New: CCExtractor is available again via Homebrew on macOS and Linux.
|
||||
- New: Add support for raw CDP (Caption Distribution Packet) files (#1406)
|
||||
- New: Add --scc-accurate-timing option for bandwidth-aware SCC output (#1120)
|
||||
- Fix: MXF files containing CEA-708 captions not being detected/extracted (#1647)
|
||||
- Docs: Add Windows WSL build instructions
|
||||
- Fix: Security fixes (out-of-bounds read/write) in a few places in the legacy C code.
|
||||
|
||||
0.96.4 (2026-01-01)
|
||||
-------------------
|
||||
- New: Persistent CEA-708 decoder context - maintains state across multiple calls for proper subtitle continuity
|
||||
- New: OCR character blacklist options (--ocr-blacklist, --ocr-blacklist-file) for improved accuracy
|
||||
- New: OCR line-split option (--ocr-splitontimechange) for better subtitle segmentation
|
||||
- Fix: 32-bit build failures on i686 and armv7l architectures
|
||||
- Fix: Legacy command-line argument compatibility (-1, -2, -12, --sc, --svc)
|
||||
- Fix: Prevent heap buffer overflow in Teletext processing (security fix)
|
||||
- Fix: Prevent integer overflow leading to heap buffer overflow in Transport Stream handling (security fix)
|
||||
- Fix: Lazy OCR initialization - only initialize when first DVB subtitle is encountered
|
||||
- Build: Optimized Windows CI workflow for faster builds
|
||||
- Fix: Updated GUI with version 0.7.1. A blind attempt to fix a hang on start on some Windows.
|
||||
|
||||
0.96.3 (2025-12-29)
|
||||
-------------------
|
||||
- New: VOBSUB subtitle extraction with OCR support for MP4 files
|
||||
- New: VOBSUB subtitle extraction support for MKV/Matroska files
|
||||
- New: Native SCC (Scenarist Closed Caption) input file support - CCExtractor can now read SCC files
|
||||
- New: Configurable frame rate (--scc-framerate) and styled PAC codes for SCC output
|
||||
- Fix: Apply --delay option to DVB/bitmap subtitles (previously only worked with text-based subtitles)
|
||||
- Fix: 200ms timing offset in MOV/MP4 caption extraction
|
||||
- Fix: utf8proc include path for system library builds
|
||||
- Fix: Use fixed-width integer types in MP4 bswap functions for better portability
|
||||
- Fix: Guard ocr_text access with ENABLE_OCR preprocessor check
|
||||
- Fix: Preserve FFmpeg libs when building with -system-libs -hardsubx
|
||||
- Build: Add vobsub_decoder to Windows and autoconf build systems
|
||||
- Build: Add winget and Chocolatey packaging workflows for Windows distribution
|
||||
- Docs: Add VOBSUB extraction documentation and subtile-ocr Dockerfile
|
||||
|
||||
0.96.2 (2025-12-26)
|
||||
-------------------
|
||||
- Fix: Resolve utf8proc header include path when building against system libraries on Linux.
|
||||
- Rebundle Windows version to include required runtime files to process hardcoded subtitles
|
||||
(hardcodex mode).
|
||||
- New: Add optional -system-libs flag to Linux build script for package manager compatibility
|
||||
|
||||
0.96.1 (2025-12-25)
|
||||
-------------------
|
||||
- Rebundle Windows version to include an updated GUI. No changes in CCExtractor itself.
|
||||
|
||||
0.96 (2025-12-23)
|
||||
-----------------
|
||||
- New: Multi-page teletext extraction support (#665)
|
||||
- Extract multiple teletext pages simultaneously with separate output files
|
||||
- Use --tpage multiple times (e.g., --tpage 100 --tpage 200)
|
||||
- Output files are named with page suffix (e.g., output_p100.srt, output_p200.srt)
|
||||
- Fix: SPUPNG subtitle offset calculation to center based on actual image dimensions
|
||||
|
||||
- New: Added --list-tracks (-L) option to list all tracks in media files without processing
|
||||
New: Chinese, Korean, Japanese support - proper encoding and OCR.
|
||||
New: Correct McPoodle DVD raw format support
|
||||
Fix: Timing is now frame perfect (using FFMpeg timing dump as reference) in all formats.
|
||||
Fix: Solved garbling in all the pending issues we had on GitHub.
|
||||
Fix: All causes of "premature end of file" messages due to bugs and not actual file cuts.
|
||||
Fix: All memory leaks, double frees and usual C nastyness that valgrind could find.
|
||||
- Fix Include ATSC VCT virtual channel numbers and call signs in XMLTV output
|
||||
- Fix: Restore ATSC XMLTV generation with ETT parsing for extended descriptions, multi-segment handling, extended table ID's (EIT/VCT), corrected <programme> XMLTV formatting, buffer bounds fixes
|
||||
- Fix: Add HEVC/H.265 stream type recognition to prevent crashes on ATSC 3.0 streams.
|
||||
Fix: Tolerance to damaged streams - recover where possible instead of terminating.
|
||||
Issues closed: Over 40! Too many to list here, but each of them was either a bug squashed or a feature implemented.
|
||||
|
||||
0.95 (2025-09-15 - never formally packaged)
|
||||
-----------------
|
||||
- New: Create a Docker image to simplify the CCExtractor usage without any environmental hustle (#1611)
|
||||
- New: Add SCC support for CEA-708 decoder (#1595)
|
||||
Refactor: Lots of code ported to Rust.
|
||||
- Fix: Improved handling of IETF language tags in Matroska files (#1665)
|
||||
- Breaking: Major argument flags revamp for CCExtractor (#1564 & #1619)
|
||||
- Fix: segmentation fault in using hardsubx
|
||||
- Fix: WebVTT X-TIMESTAMP-MAP placement (#1463)
|
||||
- Fix: ffmpeg 5.0, tesseract 5.0 compatibility and remove deprecated methods
|
||||
- Fix: tesseract 5.x traineddata location in ocr
|
||||
- Improvement: Ignore MXF Caption Essence Container version byte to enhance SRT subtitle extraction compatibility
|
||||
- New: Add tesseract page segmentation modes control with `--psm` flag
|
||||
- Fix: Support for MINGW-w64 cross compiling
|
||||
|
||||
0.94 (2021-12-14)
|
||||
-----------------
|
||||
- BOM is no longer enabled by default on windows platforms
|
||||
- CEA-708: Rust decoder is now default instead of C decoder
|
||||
- CEA-708 subs are now extracted by default
|
||||
- New: Add check for Minimum supported rust version (MSRV) (#1387)
|
||||
- Fix: Fix CEA-708 Carriage Return command implementation
|
||||
- Fix: Fix bug with startat/endat parameter (#1396)
|
||||
- Fix: Mac Build processes (#1390)
|
||||
- Fix: Fix bug with negative delay parameter (#1365)
|
||||
|
||||
0.93 (2021-08-16)
|
||||
-----------------
|
||||
- Minor Rust updates (format, typos, docs)
|
||||
- Updated GUI
|
||||
|
||||
0.92 (2021-08-10)
|
||||
-----------------
|
||||
- Rust updates: Added srt writer
|
||||
- Rust updates:-Added writers for transcripts and SAMI
|
||||
- Added missing DLL to Windows installer
|
||||
- Updated Windows GUI
|
||||
|
||||
0.91 (2021-07-26)
|
||||
-----------------
|
||||
- More Rust in the 708 decoder (Add Pen Presets and timing functions)
|
||||
- Updated GUI
|
||||
|
||||
0.90 (2021-07-14)
|
||||
-----------------
|
||||
- New installer (WiX based)
|
||||
- New GUI (flutter based)
|
||||
- More Rust (the 708 decoder is being rewritten)
|
||||
|
||||
0.89 (2021-06-13)
|
||||
-----------------
|
||||
- Fix: Fix broken links in README
|
||||
- Fix: Timing in DVB, sub duration check for timeout.
|
||||
- New: Added support for SCC and CCD encoder formats
|
||||
- New: Added support to output captions to MCC file (#733).
|
||||
- New: Add support for censoring words ("Kid Friendly") (#1139)
|
||||
- New: Extend support of capitalization for all BITMAP and 608 subtitles (#1214)
|
||||
- New: Added an option to disable timestamps for WebVTT (In response to issue #1127)
|
||||
- Fix: Change inet_ntop to inet_ntoa for Windows XP compatibility
|
||||
- Fix: Added italics, underline, and color rendering support for -out=spupng with EIA608/teletext
|
||||
- Fix: ccx_demuxer_mxf.c: Parse framerate from MXF captions to fix caption timings.
|
||||
- Fix: hardsubx_decoder.c: Fix memory leaks using Leptonica API.
|
||||
- Fix: linux/Makefile.am: added some sources to enable rpms to be created.
|
||||
- Fix: Crash when using -sc (sentence case) option (#1115)
|
||||
- Fix: Segmentation fault on VOB #1128
|
||||
- Fix: Hang while processing video #1121
|
||||
- Fix: lib_ccx.c: Initialize fatal error logging function before first usage in init_libraries
|
||||
- Fix: A few (minor) memory leaks around the code.
|
||||
- Fix: General code clean up / reformatting
|
||||
- Fix: Fix multiple definitions with new -fno-common default in GCC 10
|
||||
- Fix: Mac now builds reproducibly again without errors on the date command (#1230)
|
||||
- Fix: Allow all oem modes with tesseract v4 (#1264)
|
||||
- Doc: Updated ccextractor.cnf.sample.
|
||||
- Update: Updated LibPNG to 1.6.37
|
||||
- Remove: Python API (since no one cares about it and it's unmaintained)
|
||||
- Remove: -cf , just use FFmpeg if you want a ES from a TS or PS, CCExtractor is a bad tool
|
||||
for this.
|
||||
- Fix: Segmentation fault on Windows
|
||||
- Update: Updated libGPAC to 1.0.1
|
||||
- Fix: Segmentation fault with unsupported and multitrack file reports
|
||||
- Fix: Write subtitle header to multitrack outputs
|
||||
- Fix: Write multitrack files to the output file directory
|
||||
- Fix: Correct frame number calculation in SCC (#1340)
|
||||
- Fix: Regression on Teletext that caused dates to be wrong (RT 78 on the sample platform)
|
||||
- Fix: CEA-708: Better timing, fixes for missing subtitles
|
||||
- Fix: timing for direct rollup
|
||||
- Fix: timing for VOB files with multiple chapters
|
||||
|
||||
0.88 (2019-05-21)
|
||||
-----------------
|
||||
- New: More tapping points for debug image in ccextractor.
|
||||
@@ -17,7 +184,7 @@
|
||||
- New: Add support for DVB inside .mkv
|
||||
- Fix: Added -latrusmap Map Latin symbols to Cyrillic ones in special cases
|
||||
of Russian Teletext files (issue #1086)
|
||||
- Fix: Several OCR crashes
|
||||
- Fix: Several OCR crashes
|
||||
|
||||
0.87 (2018-10-23)
|
||||
-----------------
|
||||
@@ -97,10 +264,10 @@
|
||||
- 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.
|
||||
(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
|
||||
- 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.
|
||||
@@ -111,29 +278,29 @@
|
||||
- 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: Upgrade library zlib
|
||||
- New: Upgrade library LibPNG
|
||||
- New: Support for Source-Specific Multicast
|
||||
- New: Added Travis CI support
|
||||
- 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: 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: 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`
|
||||
- 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: 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
|
||||
@@ -180,7 +347,7 @@
|
||||
|
||||
0.84 (2016-12-16)
|
||||
-----------------
|
||||
- New: In Windows, both with and without-OCR binaries are bundled, since the OCR one causes problems due to
|
||||
- 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).
|
||||
@@ -203,7 +370,7 @@
|
||||
- Fix: Added detail in many error messages.
|
||||
- Fix: Memory leaks in videos with XDS.
|
||||
- Fix: Makefile compatibility issues with Raspberry pi.
|
||||
- Fix: missing separation between WebVTT header and body.
|
||||
- Fix: missing separation between WebVTT header and body.
|
||||
- Fix: Stupid bug in M2TS that preventing it from working.
|
||||
- Fix: OCR libraries dependencies for the release version in Windows.
|
||||
- Fix: non-buffered reading from pipes.
|
||||
@@ -250,7 +417,7 @@
|
||||
- Fix: Timing in -ucla
|
||||
- Fix: Timing in ISDB (some instances)
|
||||
- Fix: "mfra" mp4 box weight changed to 1 (this helps with correct file format detection)
|
||||
- Fix: Fix for TARGET File is null.
|
||||
- Fix: Fix for TARGET File is null.
|
||||
- Fix: Fixed SegFaults while parsing parameters (if mandatory parameter is not present in -outinterval, -codec or -nocodec)
|
||||
- Fix: Crash when input small is too small
|
||||
- Fix: Update some URLs in code (references to docs)
|
||||
@@ -308,7 +475,7 @@
|
||||
- CCExtractor can be used as library if compiled using cmake
|
||||
- By default the Windows version adds BOM to generated UTF files (this is
|
||||
because it's needed to open the files correctly) while all other
|
||||
builds don't add it (because it messes with text processing tools).
|
||||
builds don't add it (because it messes with text processing tools).
|
||||
You can use -bom and -nobom to change the behaviour.
|
||||
|
||||
0.74 (2014-09-24)
|
||||
@@ -347,7 +514,7 @@
|
||||
------------------------
|
||||
This is the first release that is part of Google's Summer of Code.
|
||||
Anshul, Ruslan and Willem joined CCExtractor to work on a number of things
|
||||
over the summer, and their work is already reaching the mainstream
|
||||
over the summer, and their work is already reaching the mainstream
|
||||
version of CCExtractor.
|
||||
|
||||
- Added a huge dictionary submitted by Matt Stockard.
|
||||
@@ -380,7 +547,7 @@ version of CCExtractor.
|
||||
0000101 is the default setting for transcripts
|
||||
1110101 is the default for timed transcripts
|
||||
1111001 is the default setting for -ucla
|
||||
Make sure you use this parameter after others that might affect these
|
||||
Make sure you use this parameter after others that might affect these
|
||||
settings (-out, -ucla, -xds, -txt, -ttxt, ...)
|
||||
- Fixed Negative timing Bug
|
||||
|
||||
@@ -398,7 +565,7 @@ version of CCExtractor.
|
||||
- Started refactoring and clean-up.
|
||||
- Fix: MPEG clock rollover (happens each 26 hours) caused a time
|
||||
discontinuity.
|
||||
- Windows GUI: Started work on HDHomeRun support. For now it just looks
|
||||
- Windows GUI: Started work on HDHomeRun support. For now it just looks
|
||||
for HDHomeRun devices. Lots of other things will arrive in the next
|
||||
versions.
|
||||
- Windows GUI: Some code refactoring, since the HDHomeRun support makes
|
||||
@@ -415,7 +582,7 @@ version of CCExtractor.
|
||||
a good test sample file...
|
||||
- Color and fonts in PAC commands were ignored, fixed (Helen Buus).
|
||||
- Added a new output format, spupng. It consists on one .png file
|
||||
for each subtitle frame and one .xml with all the timing
|
||||
for each subtitle frame and one .xml with all the timing
|
||||
(Heleen Buus).
|
||||
- Some fixes (Chris Small).
|
||||
|
||||
@@ -437,12 +604,12 @@ version of CCExtractor.
|
||||
- Added -latin1 to select Latin 1 as encoding. Default is now
|
||||
UTF-8 (-utf8 still exists but it's not needed).
|
||||
- Added -ru1, which emulates a (non-existing in real life) 1 line
|
||||
roll-up mode.
|
||||
roll-up mode.
|
||||
|
||||
|
||||
0.66 (2013-07-01)
|
||||
-----------------
|
||||
- Fixed bug in auto detection code that triggered a message
|
||||
- Fixed bug in auto detection code that triggered a message
|
||||
about file being auto of sync.
|
||||
- Added -investigate_packets
|
||||
The PMT is used to select the most promising elementary stream
|
||||
@@ -451,39 +618,39 @@ version of CCExtractor.
|
||||
manually, in case the CC location is not obvious from the PMT
|
||||
contents. To assist looking for the right stream, the parameter
|
||||
"-investigate_packets" will have CCExtractor look inside each
|
||||
stream, looking for CC markers, and report the streams that
|
||||
stream, looking for CC markers, and report the streams that
|
||||
are likely to contain CC data even if it can't be determined from
|
||||
their PMT entry.
|
||||
- Added -datastreamtype to manually selecting a stream based on
|
||||
its type instead of its PID. Useful if your recording program
|
||||
always hides the caption under the stream type.
|
||||
always hides the caption under the stream type.
|
||||
- Added -streamtype so if an elementary stream is selected manually
|
||||
for processing, the streamtype can be selected too. This can be
|
||||
needed if you process, for example a stream that is declared as
|
||||
for processing, the streamtype can be selected too. This can be
|
||||
needed if you process, for example a stream that is declared as
|
||||
"private MPEG" in the PMT, so CCExtractor can't tell what it is.
|
||||
Usually you'll want -streamtype 2 (MPEG video) or -streamtype 6
|
||||
(MPEG private data).
|
||||
- PMT content listing improved, it now shows the stream type for
|
||||
more types.
|
||||
- Fixes in roll-up, cursor was being moved to column 1 if a
|
||||
- Fixes in roll-up, cursor was being moved to column 1 if a
|
||||
RU2, RU3 or RU4 was received even if already in roll-up mode.
|
||||
- Added -autoprogram. If a multiprogram TS is processed and
|
||||
- Added -autoprogram. If a multiprogram TS is processed and
|
||||
-autoprogram is used, CCExtractor will analyze all PMTs and use
|
||||
the first program that has a suitable data stream.
|
||||
- Timed transcript (ttxt) now also exports the caption mode
|
||||
(roll-up, paint-on, etc.) next to each line, as it's useful to
|
||||
- Timed transcript (ttxt) now also exports the caption mode
|
||||
(roll-up, paint-on, etc.) next to each line, as it's useful to
|
||||
detect things like commercials.
|
||||
- Content Advisory information from XDS is now decoded if it's
|
||||
transmitted in "US TV parental guidelines" or "MPA".
|
||||
Other encoding such as Canada's are not supported yet due
|
||||
transmitted in "US TV parental guidelines" or "MPA".
|
||||
Other encoding such as Canada's are not supported yet due
|
||||
to lack of samples.
|
||||
- Copy Management information from XDS is now decoded.
|
||||
- Added -xds. If present and export format is timed transcript
|
||||
(only), XDS information will be saved to file (same file as the
|
||||
transcript, with XDS being clearly marked). Note that for now
|
||||
all XDS data is exported even if it doesn't change, so the
|
||||
all XDS data is exported even if it doesn't change, so the
|
||||
transcript file will be significantly larger.
|
||||
- Added some PaintOn support, at least enough to prevent it
|
||||
- Added some PaintOn support, at least enough to prevent it
|
||||
from breaking things when the other modes are used.
|
||||
- Removed afd_data() warning. AFD doesn't carry any caption related
|
||||
data. AFD still detected in code in case we want to do something
|
||||
@@ -501,21 +668,21 @@ version of CCExtractor.
|
||||
calculated distance, the maximum allowed distance, and whether
|
||||
the strings are ultimately considered equivalent or not, i.e.
|
||||
the calculated distance is less or equal than the max allowed.
|
||||
-levdistmincnt value: Minimum distance we always allow
|
||||
regardless of the length of the strings. Default 2. This means
|
||||
that if the calculated distance is 0, 1 or 2, we consider the
|
||||
-levdistmincnt value: Minimum distance we always allow
|
||||
regardless of the length of the strings. Default 2. This means
|
||||
that if the calculated distance is 0, 1 or 2, we consider the
|
||||
strings to be equivalent.
|
||||
-levdistmaxpct value: Maximum distance we allow, as a
|
||||
percentage of the shortest string length. Default 10%. For
|
||||
example, consider a comparison of one string of 30 characters
|
||||
and one of 60 characters. We want to determine whether the
|
||||
first 30 characters of the longer string are more or less the
|
||||
same as the shortest string, i.e. whether the longest string
|
||||
is the shortest one plus new characters and maybe some
|
||||
corrections. Since the shortest string is 30 characters and
|
||||
the default percentage is 10%, we would allow a distance of
|
||||
-levdistmaxpct value: Maximum distance we allow, as a
|
||||
percentage of the shortest string length. Default 10%. For
|
||||
example, consider a comparison of one string of 30 characters
|
||||
and one of 60 characters. We want to determine whether the
|
||||
first 30 characters of the longer string are more or less the
|
||||
same as the shortest string, i.e. whether the longest string
|
||||
is the shortest one plus new characters and maybe some
|
||||
corrections. Since the shortest string is 30 characters and
|
||||
the default percentage is 10%, we would allow a distance of
|
||||
up to 3 between the first 30 characters.
|
||||
- Added -lf : Use UNIX line terminator (LF) instead of Windows (CRLF).
|
||||
- Added -lf : Use UNIX line terminator (LF) instead of Windows (CRLF).
|
||||
- Added -noautotimeref: Prevent UTC reference from being auto set from
|
||||
the stream data.
|
||||
|
||||
@@ -525,7 +692,7 @@ version of CCExtractor.
|
||||
- Added end timestamps in timed transcripts
|
||||
- Added support for SMPTE (patch by John Kemp)
|
||||
- Initial support for MPEG2 video tracks inside MP4 files (thanks a
|
||||
lot to GPAC's Jean who assisted in analyzing the sample and
|
||||
lot to GPAC's Jean who assisted in analyzing the sample and
|
||||
doing the required changes in GPAC).
|
||||
- Improved MP4 auto detection
|
||||
- Support for PCR if PTS is not available (needed for some teletext
|
||||
@@ -551,7 +718,7 @@ version of CCExtractor.
|
||||
data (bypassing detections).
|
||||
- Added -ru2 and -ru3 to limit the number of visible lines in roll-up
|
||||
captions (bypassing whatever the broadcast says).
|
||||
- Added support for a .hex (hexadecimal) dump of data.
|
||||
- Added support for a .hex (hexadecimal) dump of data.
|
||||
- Added support for wtv in Windows. This is done by using a new program
|
||||
(wtvccdump.exe) and a new DirectShow filter (CCExtractorDump.dll) that
|
||||
process the .wtv using DirecShow's filters and export the line 21 data
|
||||
@@ -562,9 +729,9 @@ version of CCExtractor.
|
||||
0.63 (2012-08-17)
|
||||
-----------------
|
||||
- Telext support added, by integrating Petr Kutalek's telxcc. Integration is
|
||||
still quite basic (there's equivalent code from both CCExtractor and
|
||||
telxcc) and some clean up is needed, but it works. Petr has announced that
|
||||
he's abandoning telxcc so further development will happen directly in
|
||||
still quite basic (there's equivalent code from both CCExtractor and
|
||||
telxcc) and some clean up is needed, but it works. Petr has announced that
|
||||
he's abandoning telxcc so further development will happen directly in
|
||||
CCExtractor.
|
||||
- Some bug fixes, as usual.
|
||||
|
||||
@@ -574,14 +741,14 @@ version of CCExtractor.
|
||||
Mac users that sent this.
|
||||
- Hauppauge mode now uses PES timing, needed for files that don't have
|
||||
caption data during all the video (such as in commercial breaks).
|
||||
- Added -mp4 and -in:mp4 to force the input to be processed as MP4.
|
||||
- Added -mp4 and -in:mp4 to force the input to be processed as MP4.
|
||||
- CC608 data embedded in a separate stream (as opposed as in the video
|
||||
stream itself) in MP4 files is now supported (not heavily tested).
|
||||
stream itself) in MP4 files is now supported (not heavily tested).
|
||||
This should be rather useful since closed captioned files from iTunes
|
||||
use this format.
|
||||
- More CEA-708 work. The debugger is now able to dump the "TV" contents for
|
||||
the first time. Also, a .srt can be generated, however timing is not quite
|
||||
good yet (still need to figure out why).
|
||||
the first time. Also, a .srt can be generated, however timing is not quite
|
||||
good yet (still need to figure out why).
|
||||
- Added -svc (or --service) to select the CEA-708 services to be processed.
|
||||
For example, -svc 1,2 will process the primary and secondary language
|
||||
services. Valid values are 1-63, where 1 is the primary language, 2 is
|
||||
@@ -596,9 +763,9 @@ version of CCExtractor.
|
||||
- Fix: GCC 3.4.4 can now build CCExtractor.
|
||||
- Fix: Damaged TS packets (those that come with 'error in transport' bit
|
||||
on) are now skipped.
|
||||
- Fix: Part of the changes for MP4 support (CC packets buffering in
|
||||
particular) broke some stuff for other files, causing at least very
|
||||
annoying character duplication. We hope we've fixed it without breaking
|
||||
- Fix: Part of the changes for MP4 support (CC packets buffering in
|
||||
particular) broke some stuff for other files, causing at least very
|
||||
annoying character duplication. We hope we've fixed it without breaking
|
||||
anything but please report).
|
||||
- Some non-interesting cleanup.
|
||||
|
||||
@@ -609,13 +776,13 @@ version of CCExtractor.
|
||||
code, the stream must be a file (no streaming), etc.
|
||||
- Fix: The Windows version was writing text files with double \r.
|
||||
- Fix: Closed captions blocks with no data could cause a crash.
|
||||
- Fix: -noru (to generate files without duplicate lines in
|
||||
- Fix: -noru (to generate files without duplicate lines in
|
||||
roll-up) was broken, with complete lines being missing.
|
||||
- Fix: bin format not working as input.
|
||||
- Fix: bin format not working as input.
|
||||
|
||||
0.59 (2011-10-07)
|
||||
-----------------
|
||||
- More AVC/H.264 work. pic_order_cnt_type != 0 will be processed now.
|
||||
- More AVC/H.264 work. pic_order_cnt_type != 0 will be processed now.
|
||||
- Fix: Roll-up captions with interruptions for Text (with ResumeTextDisplay
|
||||
in the middle of the caption data) were missing complete lines.
|
||||
- Added a timed text transcript output format, probably only useful for
|
||||
@@ -638,7 +805,7 @@ version of CCExtractor.
|
||||
- Added -stdout => If used, the captions will be sent to stdout (console)
|
||||
instead of file. Combined with -, CCExtractor can work as a filter in
|
||||
a larger process, receiving the stream from stdin and sending the
|
||||
captions to stdout.
|
||||
captions to stdout.
|
||||
- Some code clean up, minor refactoring.
|
||||
- Teletext detection (not yet processing).
|
||||
|
||||
@@ -647,20 +814,20 @@ version of CCExtractor.
|
||||
- Implemented new PTS based mode to order the caption information
|
||||
of AVC/H.264 data streams. The old pic_order_cnt_lsb based method
|
||||
is still available via the -poc or --usepicorder command switches.
|
||||
- Removed a couple of those annoying "Impossible!" error messages
|
||||
- Removed a couple of those annoying "Impossible!" error messages
|
||||
that appears when processing some (possibly broken, unsure) files.
|
||||
- Added -nots --notypesettings to prevent italics and underline
|
||||
- Added -nots --notypesettings to prevent italics and underline
|
||||
codes from being displayed.
|
||||
- Note to those not liking the paragraph symbol being used for the
|
||||
- Note to those not liking the paragraph symbol being used for the
|
||||
music note: Submit a VALID replacement in latin-1.
|
||||
- Added preliminary support for multiple program TS files. The
|
||||
- Added preliminary support for multiple program TS files. The
|
||||
parameter --program-number (or -pn) will let you choose which
|
||||
program number to process. If no number is passed and the TS
|
||||
program number to process. If no number is passed and the TS
|
||||
file contains more than one, CCExtractor will display a list of
|
||||
found programs and terminate.
|
||||
- Added support (basic, because I only received one sample) for some
|
||||
Hauppauge cards that save CC data in their own format. Use the
|
||||
parameter -haup to enable it (CCExtractor will display a notice
|
||||
parameter -haup to enable it (CCExtractor will display a notice
|
||||
if it thinks that it's processing a Hauppauge capture anyway).
|
||||
- Fixed bug in roll-up.
|
||||
- More AVC work, now TS files from echostar that provided garbled
|
||||
@@ -670,7 +837,7 @@ version of CCExtractor.
|
||||
0.57 (2010-12-16)
|
||||
-----------------
|
||||
- Bug fixes in the Windows version. Some debug code was unintentionally
|
||||
left in the released version.
|
||||
left in the released version.
|
||||
|
||||
0.56 (2010-12-09)
|
||||
-----------------
|
||||
@@ -687,10 +854,10 @@ version of CCExtractor.
|
||||
- Start implementation of EIA-708 decoding (not active yet).
|
||||
- Add -gt / --goptime switch to use GOP timing instead of PTS timing.
|
||||
- Start implementation of AVC/H.264 decoding (not active yet).
|
||||
- Fixed: The basic problem is that when 24fps movie film gets converted to 30fps NTSC
|
||||
they repeat every 4th frame. Some pics have 3 fields of CC data with field 3 CC data
|
||||
belongs to the same channel as field 1. The following pics have the fields reversed
|
||||
because of the odd number of fields. I used top_field_first to tell when the channels
|
||||
- Fixed: The basic problem is that when 24fps movie film gets converted to 30fps NTSC
|
||||
they repeat every 4th frame. Some pics have 3 fields of CC data with field 3 CC data
|
||||
belongs to the same channel as field 1. The following pics have the fields reversed
|
||||
because of the odd number of fields. I used top_field_first to tell when the channels
|
||||
are reversed. See Table 6-1 of the SCTE 20 [Paul Fernquist]
|
||||
|
||||
0.54 (2009-04-16)
|
||||
@@ -700,9 +867,9 @@ version of CCExtractor.
|
||||
- Improve synchronization of captions for source files with
|
||||
jumps in their time information or gaps in the caption
|
||||
information.
|
||||
- [R. Abarca] Changed Mac script, it now compiles/link
|
||||
everything from the /src directory.
|
||||
- It's now possible to have CCExtractor add credits
|
||||
- [R. Abarca] Changed Mac script, it now compiles/link
|
||||
everything from the /src directory.
|
||||
- It's now possible to have CCExtractor add credits
|
||||
automatically.
|
||||
- Added a feature to add start and end messages (for credits).
|
||||
See help screen for details.
|
||||
@@ -723,13 +890,13 @@ version of CCExtractor.
|
||||
for Raw Captions With Time). This new format
|
||||
allows one file to contain all the available
|
||||
closed caption data instead of just one stream.
|
||||
- Added --no_progress_bar to disable status
|
||||
- Added --no_progress_bar to disable status
|
||||
information (mostly used when debugging, as the
|
||||
progress information is annoying in the middle
|
||||
of debug logs).
|
||||
- The Windows GUI was reported to freeze in some
|
||||
- The Windows GUI was reported to freeze in some
|
||||
conditions. Fixed.
|
||||
- The Windows GUI is now targeted for .NET 2.0
|
||||
- The Windows GUI is now targeted for .NET 2.0
|
||||
instead of 3.5. This allows Windows 2000 to run
|
||||
it (there's not .NET 3.5 for Windows 2000), as
|
||||
requested by a couple of key users.
|
||||
@@ -737,17 +904,17 @@ version of CCExtractor.
|
||||
0.51 (unreleased)
|
||||
-----------------
|
||||
- Removed -autopad and -goppad, no longer needed.
|
||||
- In preparation to a new binary format we have
|
||||
renamed the current .bin to .raw. Raw files
|
||||
- In preparation to a new binary format we have
|
||||
renamed the current .bin to .raw. Raw files
|
||||
have only CC data (with no header, timing, etc.).
|
||||
- The input file format (when forced) is now
|
||||
specified with
|
||||
specified with
|
||||
-in=format
|
||||
such as -in=ts, -in=raw, -in=ps ...
|
||||
The old switches (-ts, -ps, etc.) still work.
|
||||
The only exception is -bin which has been removed
|
||||
(reserved for the new binary format). Use
|
||||
-in=raw to process a raw file.
|
||||
-in=raw to process a raw file.
|
||||
- Removed -d, which when produced a raw file used
|
||||
a DVD format. This has been merged into a new
|
||||
output type "dvdraw". So now instead of using
|
||||
@@ -756,7 +923,7 @@ version of CCExtractor.
|
||||
- Removed --noff
|
||||
- Added gui_mode_reports for frontend communications,
|
||||
see related file.
|
||||
- Windows GUI rewritten. Source code now included,
|
||||
- Windows GUI rewritten. Source code now included,
|
||||
too.
|
||||
- [Volker] Dish Network clean-up
|
||||
|
||||
@@ -769,12 +936,12 @@ version of CCExtractor.
|
||||
0.49 (2008-12-10)
|
||||
-----------------
|
||||
- [Volker] Major MPEG parser rework. Code much
|
||||
cleaner now.
|
||||
cleaner now.
|
||||
- Some stations transmit broken roll-up captions,
|
||||
and for some reason don't send CRs but RUs...
|
||||
Added work-around code to make captions readable.
|
||||
- Started work on EIA-708 (DTV). Right now you can
|
||||
add -debug-708 to get a dump of the 708 data.
|
||||
add -debug-708 to get a dump of the 708 data.
|
||||
An actually useful decoder will come soon.
|
||||
- Some of the changes MIGHT HAVE BROKEN MythTV's
|
||||
code. I don't use MythTV myself so I rely on
|
||||
@@ -790,9 +957,9 @@ version of CCExtractor.
|
||||
can now process files that are being recorded
|
||||
at the same time.
|
||||
|
||||
- [Volker] Added a new DVR-MS loop - this is
|
||||
- [Volker] Added a new DVR-MS loop - this is
|
||||
completely new, DVR-MS specific code, so we no
|
||||
longer use the generic MPEG code for DVR-MS.
|
||||
longer use the generic MPEG code for DVR-MS.
|
||||
DVR-MS should (or will be eventually at least)
|
||||
be as reliable as TS.
|
||||
Note: For now, it's only ATSC recordings, not
|
||||
@@ -811,11 +978,11 @@ version of CCExtractor.
|
||||
new options.
|
||||
- Added -lg --largegops
|
||||
From the help screen:
|
||||
Each Group-of-Picture comes with timing
|
||||
information. When this info is too separate
|
||||
(for example because there are a lot of
|
||||
frames in a GOP) ccextractor may prefer not
|
||||
to use GOP timing. Use this option is you
|
||||
Each Group-of-Picture comes with timing
|
||||
information. When this info is too separate
|
||||
(for example because there are a lot of
|
||||
frames in a GOP) ccextractor may prefer not
|
||||
to use GOP timing. Use this option is you
|
||||
need ccextractor to use GOP timing in large
|
||||
GOPs.
|
||||
|
||||
@@ -834,8 +1001,8 @@ version of CCExtractor.
|
||||
0.43 (2008-06-20)
|
||||
-----------------
|
||||
- Fixed a bug in the read loop (no less)
|
||||
that caused some files to fail when
|
||||
reading without buffering (which is
|
||||
that caused some files to fail when
|
||||
reading without buffering (which is
|
||||
the default in the Linux build).
|
||||
- Several improvements in the GUI, such as
|
||||
saving current options as default.
|
||||
@@ -852,8 +1019,8 @@ version of CCExtractor.
|
||||
-----------------
|
||||
- Default output is now .srt instead of .bin,
|
||||
use -raw if you need the data dump instead of
|
||||
.srt.
|
||||
- Added -trim, which removes blank spaces at
|
||||
.srt.
|
||||
- Added -trim, which removes blank spaces at
|
||||
the left and rights of each line in .srt.
|
||||
Note that those spaces are there to help
|
||||
deaf people know if the person talking is
|
||||
@@ -863,8 +1030,8 @@ version of CCExtractor.
|
||||
|
||||
0.40 (2008-05-20)
|
||||
-----------------
|
||||
- Fixed a bug in the sanity check function
|
||||
that caused the Myth branch to abort.
|
||||
- Fixed a bug in the sanity check function
|
||||
that caused the Myth branch to abort.
|
||||
- Fixed the OSX build script, it needed a
|
||||
new #define to work.
|
||||
|
||||
@@ -874,30 +1041,30 @@ version of CCExtractor.
|
||||
have no time information. Also, if in roll-up
|
||||
mode there will be no repeated lines.
|
||||
- Lots of changes in the MPEG parser, most of
|
||||
them submitted by Volker Quetschke.
|
||||
them submitted by Volker Quetschke.
|
||||
- Fixed a bug in the CC decoder that could cause
|
||||
the first line not to be cleared in roll-up
|
||||
mode.
|
||||
mode.
|
||||
- CCExtractor can now follow number sequences in
|
||||
file names, by suffixing the name with +.
|
||||
For example,
|
||||
|
||||
DVD0001.VOB+
|
||||
DVD0001.VOB+
|
||||
|
||||
means DVD0001.VOB, DVD0002.VOB, etc. This works
|
||||
for all files, so part001.ts+ does what you
|
||||
could expect.
|
||||
- Added -90090 which changes the clock frequency
|
||||
from the MPEG standard 90000 to 90090. It
|
||||
from the MPEG standard 90000 to 90090. It
|
||||
*could* (remains to be seen) help if there are
|
||||
timing issues.
|
||||
timing issues.
|
||||
- Better support for Tivo files.
|
||||
- By default ccextractor now considers the whole
|
||||
input file list a one large file, instead of
|
||||
several, independent, video files. This has
|
||||
been changed because most programs (for example
|
||||
DVDDecrypt) just cut the files by size.
|
||||
If you need the old behaviour (because you
|
||||
DVDDecrypt) just cut the files by size.
|
||||
If you need the old behaviour (because you
|
||||
actually edited the video files and want to
|
||||
join the subs), use -ve.
|
||||
|
||||
@@ -915,7 +1082,7 @@ version of CCExtractor.
|
||||
that have been added because old behaviour was
|
||||
annoying to most people: _1 and _2 at the end
|
||||
of the output file names is now added ONLY if
|
||||
-12 is used (i.e. when there are two output
|
||||
-12 is used (i.e. when there are two output
|
||||
files to produce). So
|
||||
|
||||
ccextractor -srt sopranos.mpg
|
||||
@@ -976,7 +1143,7 @@ version of CCExtractor.
|
||||
Alan
|
||||
Tony
|
||||
|
||||
So you get
|
||||
So you get
|
||||
|
||||
You better respect
|
||||
this robe, Alan.
|
||||
@@ -985,7 +1152,7 @@ version of CCExtractor.
|
||||
have a different spelling file per TV
|
||||
show, or a large file with a lot of
|
||||
words, etc.
|
||||
- ccextractor has been reported to
|
||||
- ccextractor has been reported to
|
||||
compile and run on Mac with a minor
|
||||
change in the build script, so I've
|
||||
created a mac directory with the
|
||||
@@ -999,17 +1166,17 @@ version of CCExtractor.
|
||||
-----------------
|
||||
- Added -scr or --screenfuls, to select the
|
||||
number of screenfuls ccextractor should
|
||||
write before exiting. A screenful is
|
||||
write before exiting. A screenful is
|
||||
a change of screen contents caused by
|
||||
a CC command (not new characters). In
|
||||
practice, this means that for .srt each
|
||||
group of lines is a screenful, except when
|
||||
using -dru (which produces a lot of
|
||||
using -dru (which produces a lot of
|
||||
groups of lines because each new character
|
||||
produces a new group).
|
||||
- Completed tables for all encodings.
|
||||
- Fixed bug in .srt related to milliseconds
|
||||
in time lines.
|
||||
in time lines.
|
||||
- Font colors are back for .srt (apparently
|
||||
some programs do support them after all).
|
||||
Use -nofc or --nofontcolor if you don't
|
||||
@@ -1018,7 +1185,7 @@ version of CCExtractor.
|
||||
0.32 (unreleased)
|
||||
-----------------
|
||||
- Added -delay ms, which adds (or subtracts)
|
||||
a number of milliseconds to all times in
|
||||
a number of milliseconds to all times in
|
||||
.srt/.sami files. For example,
|
||||
|
||||
-delay 400
|
||||
@@ -1049,8 +1216,8 @@ version of CCExtractor.
|
||||
- Fix in extended char decoding, I wasn't
|
||||
replacing the previous char.
|
||||
- When a sequence code was found before
|
||||
having a PTS, reported time was
|
||||
undefined.
|
||||
having a PTS, reported time was
|
||||
undefined.
|
||||
|
||||
0.29 (unreleased)
|
||||
-----------------
|
||||
@@ -1075,7 +1242,7 @@ version of CCExtractor.
|
||||
0.26 (unreleased)
|
||||
-----------------
|
||||
- Added -gp (or -goppad) to make ccextractor use
|
||||
GOP timing. Try it for non TS files where
|
||||
GOP timing. Try it for non TS files where
|
||||
subs start OK but desync as the video advances.
|
||||
|
||||
0.25 (unreleased)
|
||||
@@ -1084,7 +1251,7 @@ version of CCExtractor.
|
||||
-nomyth to prevent the MytvTV code path to be
|
||||
called. I've seen apparently correct files that
|
||||
make MythTV's MPEG decoder to choke. So, if it
|
||||
doesn't work correctly automatically: Try
|
||||
doesn't work correctly automatically: Try
|
||||
-nomyth and -myth. Hopefully one of the two
|
||||
options will work.
|
||||
|
||||
@@ -1097,7 +1264,7 @@ version of CCExtractor.
|
||||
- Reworked input buffer code, faster now.
|
||||
- Completed MythTV's MPEG decoder for Program Streams,
|
||||
which results in better processing of some specific
|
||||
files.
|
||||
files.
|
||||
- Automatic file format detection for all kind of
|
||||
files and closed caption storage method. No need to
|
||||
tell ccextractor anything about your file (but you
|
||||
@@ -1106,10 +1273,10 @@ version of CCExtractor.
|
||||
|
||||
0.22 (2007-05-15)
|
||||
-----------------
|
||||
- Added text mode handling into decoder, which gets rids
|
||||
- Added text mode handling into decoder, which gets rids
|
||||
of junk when text mode data is present.
|
||||
- Added support for certain (possibly non standard
|
||||
compliant) DVDs that add more captions block in a
|
||||
compliant) DVDs that add more captions block in a
|
||||
user data block than they should (such as Red October).
|
||||
- Fix in roll-up init code that caused the previous popup
|
||||
captions not to be written to disk.
|
||||
@@ -1120,13 +1287,13 @@ version of CCExtractor.
|
||||
-----------------
|
||||
- Unicode should be decent now.
|
||||
- Added support for Hauppauge PVR 250 cards, and (possibly)
|
||||
many others (bttv) with the same closed caption recording
|
||||
many others (bttv) with the same closed caption recording
|
||||
format.
|
||||
This is the result of hacking MythTV's MPEG parser into
|
||||
CCExtractor. Integration is not very good (to put it
|
||||
midly) but it seems to work. Depending on the feedback I
|
||||
may continue working on this or just leave it 'as it'
|
||||
(good enough).
|
||||
(good enough).
|
||||
If you want to process a file generated by one of these
|
||||
analog cards, use -myth. This is essential as it will
|
||||
make the program take a totally different code path.
|
||||
@@ -1136,10 +1303,10 @@ version of CCExtractor.
|
||||
|
||||
0.19 (2007-05-03)
|
||||
-----------------
|
||||
- Work on Dish Network streams, timing was completely broken.
|
||||
- Work on Dish Network streams, timing was completely broken.
|
||||
It's fixed now at least for the samples I have, if it's not
|
||||
completely fixed let me know. Credit for this goes to
|
||||
Jack Ha who sent me a couple of samples and a first
|
||||
Jack Ha who sent me a couple of samples and a first
|
||||
implementation of a semi working-fix.
|
||||
- Added support for several input files (see help screen for
|
||||
details).
|
||||
@@ -1176,4 +1343,3 @@ version of CCExtractor.
|
||||
- Added video information (as extracted from sequence header).
|
||||
- Some code clean-up.
|
||||
- FF sanity check enabled by default.
|
||||
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
# Installation
|
||||
|
||||
## Homebrew
|
||||
The easiest way to install CCExtractor for Mac and Linux is through Homebrew:
|
||||
|
||||
```bash
|
||||
brew install ccextractor
|
||||
```
|
||||
Note: If you don't have Homebrew installed, see [brew.sh](https://brew.sh/)
|
||||
for installation instructions.
|
||||
|
||||
---
|
||||
|
||||
# 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.
|
||||
@@ -6,48 +19,99 @@ Downloads for precompiled binaries and source code can be found [on our website]
|
||||
|
||||
Clone the latest repository from Github
|
||||
|
||||
```
|
||||
```bash
|
||||
git clone https://github.com/CCExtractor/ccextractor.git
|
||||
```
|
||||
|
||||
### Hardsubx (Burned-in Subtitles) and FFmpeg Versions
|
||||
|
||||
CCExtractor's hardsubx feature extracts burned-in subtitles from videos using OCR. It requires FFmpeg libraries. The build system automatically selects appropriate FFmpeg versions for each platform:
|
||||
|
||||
- **Linux**: FFmpeg 6.x (default)
|
||||
- **Windows**: FFmpeg 6.x (default)
|
||||
- **macOS**: FFmpeg 8.x (default)
|
||||
|
||||
You can override the default by setting the `FFMPEG_VERSION` environment variable to `ffmpeg6`, `ffmpeg7`, or `ffmpeg8` before building. This flexibility ensures compatibility with different FFmpeg installations across platforms.
|
||||
|
||||
## Docker
|
||||
You can now use docker image to build latest source of CCExtractor without any environmental hustle. Follow these [instructions](https://github.com/CCExtractor/ccextractor/tree/master/docker/README.md) for building docker image & usage of it.
|
||||
|
||||
## Linux
|
||||
|
||||
1. Make sure all the dependencies are met.
|
||||
|
||||
Debian:
|
||||
|
||||
```bash
|
||||
sudo apt-get install -y libgpac-dev libglew-dev libglfw3-dev cmake gcc libcurl4-gnutls-dev tesseract-ocr libtesseract-dev libleptonica-dev clang libclang-dev
|
||||
```
|
||||
sudo apt-get install -y libglew-dev
|
||||
sudo apt-get install -y libglfw3-dev
|
||||
sudo apt-get install -y cmake
|
||||
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
|
||||
|
||||
RHEL/Fedora:
|
||||
|
||||
```bash
|
||||
yum install -y glew-devel glfw-devel cmake gcc libcurl-devel tesseract-devel leptonica-devel clang gpac-devel
|
||||
```
|
||||
**Note:** On Ubuntu Version 18.04 (Bionic) and (probably) later, install `libtesseract-dev` rather than `tesseract-ocr-dev`, which does not exist anymore.
|
||||
|
||||
Arch:
|
||||
```bash
|
||||
sudo paru -S glew glfw curl tesseract leptonica cmake gcc clang gpac
|
||||
```
|
||||
or
|
||||
```bash
|
||||
sudo pacman -S glew glfw curl tesseract leptonica cmake gcc clang gpac
|
||||
```
|
||||
|
||||
Rust 1.54 or above is also required. [Install Rust](https://www.rust-lang.org/tools/install). Check specific compilation methods below, on how to compile without rust.
|
||||
|
||||
**Note:** On Ubuntu Version 23.10 (Mantic) and later, `libgpac-dev` isn't available, you should build gpac from source by following the easy build instructions [here](https://github.com/gpac/gpac/wiki/GPAC-Build-Guide-for-Linux)
|
||||
|
||||
**Note:** On Ubuntu Version 18.04 (Bionic) and later, `libtesseract-dev` is installed rather than `tesseract-ocr-dev`, which does not exist anymore.
|
||||
|
||||
**Note:** On Ubuntu Version 14.04 (Trusty) and earlier, you should build leptonica and tesseract from source
|
||||
|
||||
2. Compiling
|
||||
|
||||
### Using the build script
|
||||
|
||||
**Using the build script**
|
||||
By default build script does not include debugging information hence, you cannot debug the executable produced (i.e. `./ccextractor`) on a debugger. To include debugging information, use the `builddebug` script.
|
||||
|
||||
|
||||
```
|
||||
#Navigate to linux directory and call the build script
|
||||
```bash
|
||||
# navigate to linux directory and call the build script
|
||||
|
||||
cd ccextractor/linux
|
||||
|
||||
# compile without debug flags
|
||||
./build
|
||||
|
||||
# compile with debug info
|
||||
./build -debug # same as ./builddebug
|
||||
|
||||
# compile with hardsubx (burned-in subtitle extraction)
|
||||
# Hardsubx requires FFmpeg libraries. Different FFmpeg versions are used by default:
|
||||
# - Linux: FFmpeg 6.x (automatic)
|
||||
# - Windows: FFmpeg 6.x (automatic)
|
||||
# - macOS: FFmpeg 8.x (automatic)
|
||||
|
||||
./build -hardsubx # uses platform-specific FFmpeg version
|
||||
|
||||
# To override the default FFmpeg version, set FFMPEG_VERSION:
|
||||
FFMPEG_VERSION=ffmpeg8 ./build -hardsubx # force FFmpeg 8 on any platform
|
||||
FFMPEG_VERSION=ffmpeg6 ./build -hardsubx # force FFmpeg 6 on any platform
|
||||
FFMPEG_VERSION=ffmpeg7 ./build -hardsubx # force FFmpeg 7 on any platform
|
||||
|
||||
# [Optional] For custom FFmpeg installations, set these environment variables:
|
||||
FFMPEG_INCLUDE_DIR=/usr/include
|
||||
FFMPEG_PKG_CONFIG_PATH=/usr/lib/pkgconfig
|
||||
|
||||
|
||||
# test your build
|
||||
./ccextractor
|
||||
```
|
||||
|
||||
**Standard linux compilation through Autoconf scripts**
|
||||
### Standard linux compilation through Autoconf scripts
|
||||
|
||||
```
|
||||
sudo apt-get install autoconf #Dependency to generate configuration script
|
||||
```bash
|
||||
sudo apt-get install autoconf # dependency to generate configuration script
|
||||
cd ccextractor/linux
|
||||
./autogen.sh
|
||||
./configure
|
||||
@@ -60,18 +124,16 @@ make
|
||||
sudo make install
|
||||
```
|
||||
|
||||
**Using CMake**
|
||||
|
||||
```
|
||||
#Create and navigate to directory where you want to store built files
|
||||
### Using CMake
|
||||
|
||||
```bash
|
||||
# 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/
|
||||
# generate makefile using cmake and then compile
|
||||
cmake ../src/ # options here
|
||||
make
|
||||
|
||||
# test your build
|
||||
@@ -81,117 +143,142 @@ make
|
||||
sudo make install
|
||||
```
|
||||
|
||||
`cmake` also accepts the options:
|
||||
`-DWITH_OCR=ON` to enable OCR
|
||||
`-DWITH_HARDSUBX=ON` to enable burned-in subtitles (requires FFmpeg)
|
||||
|
||||
For hardsubx with specific FFmpeg versions:
|
||||
Set `FFMPEG_VERSION=ffmpeg6` for FFmpeg 6.x (default on Linux and Windows)
|
||||
Set `FFMPEG_VERSION=ffmpeg7` for FFmpeg 7.x
|
||||
Set `FFMPEG_VERSION=ffmpeg8` for FFmpeg 8.x
|
||||
(Defaults: Linux=FFmpeg 6, Windows=FFmpeg 6, macOS=FFmpeg 8)
|
||||
|
||||
**Compiling with GUI:**
|
||||
([OPTIONAL] For custom FFmpeg installations, set these environment variables)
|
||||
|
||||
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)
|
||||
FFMPEG_INCLUDE_DIR=/usr/include
|
||||
FFMPEG_PKG_CONFIG_PATH=/usr/lib/pkgconfig
|
||||
|
||||
In order to compile it you'll need to configure it using autoconf by passing the `-with-gui` option.
|
||||
### Compiling with GUI
|
||||
|
||||
```
|
||||
./autogen.sh
|
||||
./configure --with-gui
|
||||
make
|
||||
|
||||
# make build systemwide
|
||||
sudo make install
|
||||
```
|
||||
|
||||
Once set up you can run the GUI interface from the terminal `./ccextractorGUI`
|
||||
The GUI for CCExtractor has been moved to a separate repository ([https://github.com/CCExtractor/ccextractorfluttergui](https://github.com/CCExtractor/ccextractorfluttergui)).
|
||||
|
||||
## macOS
|
||||
|
||||
1. Make sure all the dependencies are met. They can be installed via Homebrew as
|
||||
1. Make sure all the dependencies are met. Decide if you want OCR; if so, you'll need to install tesseract and leptonica.
|
||||
Dependencies can be installed via Homebrew as:
|
||||
|
||||
```
|
||||
```bash
|
||||
brew install pkg-config
|
||||
brew install autoconf automake libtool
|
||||
brew install cmake gpac
|
||||
# optional if you want OCR:
|
||||
brew install tesseract
|
||||
brew install leptonica
|
||||
# optional if you want hardsubx (burned-in subtitle extraction):
|
||||
brew install ffmpeg
|
||||
```
|
||||
|
||||
To verify tesseract and leptonica are detected by pkg-config, e.g.
|
||||
If configuring OCR, use pkg-config to verify tesseract and leptonica dependencies, e.g.
|
||||
|
||||
````
|
||||
```bash
|
||||
pkg-config --exists --print-errors tesseract
|
||||
pkg-config --exists --print-errors lept
|
||||
````
|
||||
|
||||
2. Compiling
|
||||
|
||||
**Using build.command script:**
|
||||
|
||||
```
|
||||
|
||||
### Compiling
|
||||
|
||||
#### Using build.command script:
|
||||
|
||||
```bash
|
||||
cd ccextractor/mac
|
||||
./build.command OCR
|
||||
./build.command # basic build
|
||||
./build.command -ocr # build with OCR support
|
||||
./build.command -hardsubx # build with hardsubx (uses FFmpeg 8 by default on macOS)
|
||||
|
||||
# Override FFmpeg version if needed:
|
||||
FFMPEG_VERSION=ffmpeg7 ./build.command -hardsubx
|
||||
|
||||
# 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
|
||||
#### Using CMake
|
||||
|
||||
```bash
|
||||
# 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/
|
||||
# generate makefile using cmake and then compile
|
||||
cmake ../src/ # options here
|
||||
make
|
||||
|
||||
# test your build
|
||||
./ccextractor
|
||||
```
|
||||
|
||||
**Standard compilation through Autoconf scripts :**
|
||||
`cmake` also accepts the options:
|
||||
`-DWITH_OCR=ON` to enable OCR
|
||||
`-DWITH_HARDSUBX=ON` to enable burned-in subtitles
|
||||
|
||||
```
|
||||
#### Standard compilation through Autoconf scripts:
|
||||
|
||||
```bash
|
||||
cd ccextractor/mac
|
||||
./autogen.sh
|
||||
./configure
|
||||
./configure
|
||||
make
|
||||
|
||||
# test your build
|
||||
./ccextractor
|
||||
```
|
||||
|
||||
**Compiling with GUI:**
|
||||
#### 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`
|
||||
The GUI for CCExtractor has been moved to a separate repository ([https://github.com/CCExtractor/ccextractorfluttergui](https://github.com/CCExtractor/ccextractorfluttergui)).
|
||||
|
||||
## Windows
|
||||
Dependencies are clang and rust. To enable OCR, rust x86_64-pc-windows-msvc or i686-pc-windows-msvc target should be installed
|
||||
|
||||
GPAC is also required, you can install it through chocolatey:
|
||||
```
|
||||
choco install gpac
|
||||
```
|
||||
|
||||
Other dependencies are required through vcpkg, so you can follow below steps:
|
||||
1. Download vcpkg (prefer version `2023.02.24` as it is supported)
|
||||
2. Integrate vcpkg into your system, run the below command in the downloaded vcpkg folder:
|
||||
```
|
||||
vcpkg integrate install
|
||||
```
|
||||
3. Set Environment Variable for Vcpkg triplet, you can choose between x86 or x64 based on your system.
|
||||
```
|
||||
setx VCPKG_DEFAULT_TRIPLET "x64-windows-static"
|
||||
setx RUSTFLAGS "-Ctarget-feature=+crt-static"
|
||||
```
|
||||
4. Install dependencies from vcpkg
|
||||
|
||||
In this step we are using `x64-windows-static` triplet, but you will have to use the triplet you set in Step 3
|
||||
|
||||
if building Debug-Full, Release-Full (HardSubx)
|
||||
```
|
||||
vcpkg install ffmpeg leptonica tesseract --triplet x64-windows-static
|
||||
```
|
||||
Note: Windows builds use FFmpeg 6 by default. To override:
|
||||
```
|
||||
set FFMPEG_VERSION=ffmpeg8
|
||||
msbuild ccextractor.sln /p:Configuration=Debug-Full /p:Platform=x64
|
||||
```
|
||||
|
||||
otherwise if you have Debug, Release
|
||||
```
|
||||
vcpkg install libpng --triplet x64-windows-static
|
||||
```
|
||||
|
||||
Note: Following screenshots and steps are based on Visual Studio 2017, but they should be more or less same for other versions.
|
||||
|
||||
1.Open `windows/` directory to locate `ccextractor.vcxproj`, `ccextractorGUI.vcxproj` (blue arrows) and `ccextractor.sln` (red arrow).
|
||||
1.Open `windows/` directory to locate `ccextractor.vcxproj` and `ccextractor.sln` (red arrow).
|
||||
|
||||

|
||||
|
||||
@@ -218,15 +305,31 @@ Configurations options are: `(Debug|Release)-Full`
|
||||
|
||||
Configurations options include dependent libraries which are used for OCR.
|
||||
|
||||
**Using CMake**
|
||||
### Using CMake
|
||||
|
||||
You may also generate `.sln` files for Visual Studio and build using build tools, or open `.sln` files using Visual Studio.
|
||||
|
||||
```
|
||||
```bash
|
||||
cmake ../src/ -G "Visual Studio 14 2015"
|
||||
cmake --build . --config Release --ccextractor
|
||||
```
|
||||
|
||||
### Using MSBuild
|
||||
|
||||
Run the following command in `windows/` directory
|
||||
|
||||
```bash
|
||||
msbuild ccextractor.sln /p:Configuration=Release /p:Platform=x64
|
||||
```
|
||||
Different configuration options are,
|
||||
|
||||
| Configuration | Platform | Rust target required |
|
||||
| ------------- |:-------------:| -----:|
|
||||
| Release | x64 | default |
|
||||
| Debug | x64 | default |
|
||||
| Release-Full(OCR) | Win32 | i686-pc-windows-msvc |
|
||||
| Debug-Full(OCR) | Win32 | i686-pc-windows-msvc |
|
||||
|
||||
## Building Installation Packages
|
||||
|
||||
### Arch Linux
|
||||
@@ -236,4 +339,3 @@ 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`
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
Overview
|
||||
========
|
||||
FFmpeg Integration was done to support multiple encapsulations.
|
||||
|
||||
Dependency
|
||||
=========
|
||||
FFmpeg library's
|
||||
|
||||
Download and Install FFmpeg on your Linux pc.
|
||||
---------------------------------------------
|
||||
|
||||
Download latest source code from following link
|
||||
https://ffmpeg.org/download.html
|
||||
|
||||
then following command to install ffmpeg
|
||||
./configure && make && make install
|
||||
|
||||
Note:If you installed ffmpeg on non-standard location, please change/update your
|
||||
environment variable $PATH and $LD_LIBRARY_PATH
|
||||
|
||||
Download and Install FFmpeg on your Windows pc.
|
||||
----------------------------------------------
|
||||
Download prebuild library from following link
|
||||
http://ffmpeg.zeranoe.com/builds/
|
||||
|
||||
You need to download Shared Versions to run the program and Dev Versions to compile.
|
||||
|
||||
How to compile ccextractor
|
||||
==========================
|
||||
|
||||
In Linux
|
||||
--------
|
||||
make ENABLE_FFMPEG=yes
|
||||
|
||||
On Windows
|
||||
----------
|
||||
put the path of libs/include of ffmpeg library in library paths.
|
||||
Step 1) In visual studio 2013 right click <Project> and select property.
|
||||
Step 2) Select Configuration properties in left panel(column) of property.
|
||||
Step 3) Select VC++ Directory.
|
||||
Step 4) In the right pane, in the right-hand column of the VC++ Directory property,
|
||||
open the drop-down menu and choose Edit.
|
||||
Step 5) Add path of Directory where you have kept uncompressed library of FFmpeg.
|
||||
|
||||
|
||||
Set preprocessor flag ENABLE_FFMPEG=1
|
||||
Step 1) In visual studio 2013 right click <Project> and select property.
|
||||
Step 2) In the left panel, select Configuration Properties, C/C++, Preprocessor.
|
||||
Step 3) In the right panel, in the right-hand column of the Preprocessor Definitions property, open the drop-down menu and choose Edit.
|
||||
Step 4) In the Preprocessor Definitions dialog box, add ENABLE_FFMPEG=1. Choose OK to save your changes.
|
||||
|
||||
Add library in linker
|
||||
Step 1) Open property of project
|
||||
Step 2) Select Configuration properties
|
||||
Step 3) Select Linker in left panel(column)
|
||||
Step 4) Select Input
|
||||
Step 5) Select Additional dependencies in right panel
|
||||
Step 6) Add all FFmpeg's lib in new line
|
||||
48
docs/FFMPEG.md
Normal file
48
docs/FFMPEG.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# Overview
|
||||
|
||||
FFmpeg Integration was done to support multiple encapsulations.
|
||||
|
||||
## Dependencies
|
||||
FFmpeg libraries
|
||||
|
||||
### Download and Install FFmpeg on your Linux pc:
|
||||
Download latest source code from following link
|
||||
https://ffmpeg.org/download.html
|
||||
|
||||
Then following command to install ffmpeg:
|
||||
`./configure && make && make install`
|
||||
|
||||
Note:If you installed ffmpeg on non-standard location, please change/update your
|
||||
environment variable `$PATH` and `$LD_LIBRARY_PATH`
|
||||
|
||||
### Download and Install FFmpeg on your Windows pc:
|
||||
1. Download vcpkg (prefer version `2023.02.24` as it is supported)
|
||||
2. Integrate vcpkg into your system, run the below command in the downloaded vcpkg folder:
|
||||
```
|
||||
vcpkg integrate install
|
||||
```
|
||||
3. Set Environment Variable for Vcpkg triplet, you can choose between x86 or x64 based on your system.
|
||||
```
|
||||
setx VCPKG_DEFAULT_TRIPLET "x64-windows-static"
|
||||
setx RUSTFLAGS "-Ctarget-feature=+crt-static"
|
||||
```
|
||||
4. Install ffmpeg from vcpkg
|
||||
|
||||
|
||||
In this step we are using `x64-windows-static` triplet, but you will have to use the triplet you set in Step 3
|
||||
|
||||
```
|
||||
vcpkg install ffmpeg --triplet x64-windows-static
|
||||
```
|
||||
|
||||
## How to compile ccextractor
|
||||
|
||||
### On Linux:
|
||||
`make ENABLE_FFMPEG=yes`
|
||||
|
||||
### On Windows:
|
||||
#### Set preprocessor flag `ENABLE_FFMPEG=1`
|
||||
1. In visual studio 2022 right click <Project> and select property.
|
||||
2. In the left panel, select Configuration Properties, C/C++, Preprocessor.
|
||||
3. In the right panel, in the right-hand column of the Preprocessor Definitions property, open the drop-down menu and choose Edit.
|
||||
4. In the Preprocessor Definitions dialog box, add `ENABLE_FFMPEG=1`. Choose OK to save your changes.
|
||||
@@ -20,6 +20,10 @@ Linux
|
||||
Make sure Tesseract, Leptonica and FFMPeg are installed, and that their libraries can be found using pkg-config.
|
||||
Refer to OCR.txt for installation details.
|
||||
|
||||
FFmpeg from packages (on Debian) plus a couple of other dependencies you will need:
|
||||
sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxcb-shm0-dev liblzma-dev
|
||||
|
||||
FFmpeg from source:
|
||||
To install FFmpeg (libav), follow the steps at:-
|
||||
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu - For Ubuntu, Debian and Linux Mint
|
||||
https://trac.ffmpeg.org/wiki/CompilationGuide/Generic - For generic Linux compilation
|
||||
@@ -50,6 +54,32 @@ To build the program with hardsubx support,
|
||||
|
||||
NOTE: The build has been tested with FFMpeg version 3.1.0, and Tesseract 3.04.
|
||||
|
||||
macOS
|
||||
-----
|
||||
|
||||
Install the required dependencies using Homebrew:
|
||||
brew install tesseract leptonica ffmpeg
|
||||
|
||||
To build the program with hardsubx support, use one of these methods:
|
||||
|
||||
== Using build.command (Recommended):
|
||||
cd ccextractor/mac
|
||||
./build.command -hardsubx
|
||||
|
||||
== Using autoconf:
|
||||
cd ccextractor/mac
|
||||
./autogen.sh
|
||||
./configure --enable-hardsubx --enable-ocr
|
||||
make
|
||||
|
||||
== Using cmake:
|
||||
cd ccextractor
|
||||
mkdir build && cd build
|
||||
cmake -DWITH_OCR=ON -DWITH_HARDSUBX=ON ../src/
|
||||
make
|
||||
|
||||
NOTE: The -hardsubx parameter uses a single dash (not --hardsubx).
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ cd ccextractor/linux
|
||||
```
|
||||
cd ccextractor/linux
|
||||
./autogen.sh
|
||||
./configure --with-gui --enable-oc
|
||||
./configure --with-gui --enable-ocr
|
||||
make
|
||||
```
|
||||
|
||||
@@ -93,7 +93,7 @@ Download prebuild library of leptonica and tesseract from following link
|
||||
https://drive.google.com/file/d/0B2ou7ZfB-2nZOTRtc3hJMHBtUFk/view?usp=sharing
|
||||
|
||||
put the path of libs/include of leptonica and tesseract in library paths.
|
||||
1. In visual studio 2013 right click <Project> and select property.
|
||||
1. In visual studio 2022 right click <Project> and select property.
|
||||
2. Select Configuration properties in left panel(column) of property.
|
||||
3. Select VC++ Directory.
|
||||
4. In the right pane, in the right-hand column of the VC++ Directory property, open the drop-down menu and choose Edit.
|
||||
@@ -101,7 +101,7 @@ put the path of libs/include of leptonica and tesseract in library paths.
|
||||
|
||||
|
||||
Set preprocessor flag ENABLE_OCR=1
|
||||
1. In visual studio 2013 right click <Project> and select property.
|
||||
1. In visual studio 2022 right click <Project> and select property.
|
||||
2. In the left panel, select Configuration Properties, C/C++, Preprocessor.
|
||||
3. In the right panel, in the right-hand column of the Preprocessor Definitions property, open the drop-down menu and choose Edit.
|
||||
4. In the Preprocessor Definitions dialog box, add ENABLE_OCR=1. Choose OK to save your changes.
|
||||
|
||||
@@ -1,246 +0,0 @@
|
||||
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. So we need a global variable to store the py callback function for the future using which type is PyObject*.
|
||||
The major point to note is that the compilation of Python extension module includes setting a macro PYTHON_API 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 PYTHON_API macro is used to define the functions/variables which are needed only by the extension module.
|
||||
Another major advantage of defining the macro PYTHON_API 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 PYTHON_API 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 wrappers defined in the wrappers/ directories. 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 -DPYTHON_API which is used by GCC to define a macro PYTHON_API. 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- void my_pythonapi(struct ccx_s_options *api_options, PyObject *callback_func)
|
||||
The my_pythonapi is aimed to provide a Python api to add the callback function when the subtitle extractor had done everyline
|
||||
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.
|
||||
****
|
||||
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 CCExtractor’s 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 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 CCExtractor’s 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 binding’s 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 also in ccx_encoders_python.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
|
||||
identifier = 4 ---> end of frame
|
||||
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 py_callback which has been defined in ccextractor.c.
|
||||
****
|
||||
py_callback
|
||||
Function declaration- void py_callback(char *line, int encoding);
|
||||
The py_callback function takes two arguments and their description is as follows:
|
||||
The first argument is the line which needs to be passed to Python.
|
||||
The second is the line's encoding.
|
||||
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 ccx_encoders_python.c file. In this file, the user needs to find the lines where the function py_callback is called with its parameter which are subtitle line and encoding.
|
||||
|
||||
----
|
||||
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 doesn’t 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 CCExtractor’s Python bindings run the CCExtractor’s 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 doesn’t 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 CCExtractor’s 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 CCExtractor’s 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 py_callback 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 function’s 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 method’s 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 function’s 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, CCExtractor’s 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.
|
||||
@@ -1,20 +1,16 @@
|
||||
CCExtractor
|
||||
(check AUTHORS.TXT for history and developers)
|
||||
----------------------------------------------
|
||||
## CCExtractor
|
||||
check AUTHORS.TXT for history and developers
|
||||
|
||||
License
|
||||
-------
|
||||
## License
|
||||
GPL 2.0.
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
## Description
|
||||
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
|
||||
-----------
|
||||
## Basic Usage
|
||||
(please run ccextractor with no parameters for the complete manual -
|
||||
this is for your convenience, really).
|
||||
|
||||
@@ -30,9 +26,16 @@ Running ccextractor without parameters shows the help screen. Usage is
|
||||
trivial - you just need to pass the input file and (optionally) some
|
||||
details about the input and output files.
|
||||
|
||||
Example:
|
||||
|
||||
Languages
|
||||
---------
|
||||
ccextractor input_video.ts
|
||||
|
||||
This command extracts subtitles from the input video file and generates a subtitle output file
|
||||
(such as .srt) in the same directory.
|
||||
|
||||
|
||||
|
||||
## Languages
|
||||
Usually English captions are transmitted in line 21 field 1 data,
|
||||
using channel 1, so the default values are correct so you don't
|
||||
need to do anything and you don't need to understand what it all
|
||||
@@ -50,20 +53,17 @@ So try adding these parameter combinations to your other parameters.
|
||||
|
||||
If there are Spanish subtitles, one of them should work.
|
||||
|
||||
McPoodle's page
|
||||
---------------
|
||||
## McPoodle's page
|
||||
http://www.theneitherworld.com/mcpoodle/SCC_TOOLS/DOCS/SCC_TOOLS.HTML
|
||||
|
||||
Essential CC related information and free (with source) tools.
|
||||
|
||||
Encoding
|
||||
--------
|
||||
## Encoding
|
||||
This version, in both its Linux and Windows builds generates by
|
||||
default Unicode files. You can use -latin1 and -utf8 if you prefer
|
||||
these encodings (usually it just depends on what your specific
|
||||
player likes).
|
||||
|
||||
Future work
|
||||
-----------
|
||||
## Future work
|
||||
- Please check www.ccextractor.org for news and future work.
|
||||
|
||||
71
docs/Rust_migration_guide.md
Normal file
71
docs/Rust_migration_guide.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# C to Rust Migration Guide
|
||||
|
||||
## Porting C Functions to Rust
|
||||
|
||||
This guide outlines the process of migrating C functions to Rust while maintaining compatibility with existing C code.
|
||||
|
||||
### Step 1: Identify the C Function
|
||||
|
||||
First, identify the C function you want to port. For example, let's consider a function named `net_send_cc()` in a file called `networking.c`:
|
||||
|
||||
```c
|
||||
void net_send_cc() {
|
||||
// Some C code
|
||||
}
|
||||
```
|
||||
|
||||
### Step 2: Create a Pure Rust Equivalent
|
||||
|
||||
Write an equivalent function in pure Rust within the `lib_ccxr` module:
|
||||
|
||||
```rust
|
||||
fn net_send_cc() {
|
||||
// Rust equivalent code to `net_send_cc` function in `networking.c`
|
||||
}
|
||||
```
|
||||
|
||||
### Step 3: Create a C-Compatible Rust Function
|
||||
|
||||
In the `libccxr_exports` module, create a new function that will be callable from C:
|
||||
|
||||
```rust
|
||||
#[no_mangle]
|
||||
pub extern "C" fn ccxr_net_send_cc() {
|
||||
net_send_cc() // Call the pure Rust function
|
||||
}
|
||||
```
|
||||
|
||||
### Step 4: Declare the Rust Function in C
|
||||
|
||||
In the original C file (`networking.c`), declare the Rust function as an external function:
|
||||
|
||||
```rust
|
||||
extern void ccxr_net_send_cc();
|
||||
```
|
||||
|
||||
### Step 5: Modify the Original C Function
|
||||
|
||||
Update the original C function to use the Rust implementation when available:
|
||||
|
||||
```c
|
||||
void net_send_cc() {
|
||||
#ifndef DISABLE_RUST
|
||||
return ccxr_net_send_cc(); // Use the Rust implementation
|
||||
#else
|
||||
// Original C code
|
||||
#endif
|
||||
}
|
||||
```
|
||||
|
||||
## Rust module system
|
||||
|
||||
- `lib_ccxr` crate -> **The Idiomatic Rust layer**
|
||||
|
||||
- Path: `src/rust/lib_ccxr`
|
||||
- This layer will contain the migrated idiomatic Rust. It will have complete documentation and tests.
|
||||
|
||||
- `libccxr_exports` module -> **The C-like Rust layer**
|
||||
|
||||
- Path: `src/rust/src/libccxr_exports`
|
||||
- This layer will have function names the same as defined in C but with the prefix `ccxr_`. These are the functions defined in the `lib_ccx` crate under appropriate modules. And these functions will be provided to the C library.
|
||||
- Ex: `extern "C" fn ccxr_<function_name>(<args>) {}`
|
||||
129
docs/VOBSUB.md
Normal file
129
docs/VOBSUB.md
Normal file
@@ -0,0 +1,129 @@
|
||||
# VOBSUB Subtitle Extraction from MKV Files
|
||||
|
||||
CCExtractor supports extracting VOBSUB (S_VOBSUB) subtitles from Matroska (MKV) containers. VOBSUB is an image-based subtitle format originally from DVD video.
|
||||
|
||||
## Overview
|
||||
|
||||
VOBSUB subtitles consist of two files:
|
||||
- `.idx` - Index file containing metadata, palette, and timestamp/position entries
|
||||
- `.sub` - Binary file containing the actual subtitle bitmap data in MPEG Program Stream format
|
||||
|
||||
## Basic Usage
|
||||
|
||||
```bash
|
||||
ccextractor movie.mkv
|
||||
```
|
||||
|
||||
This will extract all VOBSUB tracks and create paired `.idx` and `.sub` files:
|
||||
- `movie_eng.idx` + `movie_eng.sub` (first English track)
|
||||
- `movie_eng_1.idx` + `movie_eng_1.sub` (second English track, if present)
|
||||
- etc.
|
||||
|
||||
## Converting VOBSUB to SRT (Text)
|
||||
|
||||
Since VOBSUB subtitles are images, you need OCR (Optical Character Recognition) to convert them to text-based formats like SRT.
|
||||
|
||||
### Using subtile-ocr (Recommended)
|
||||
|
||||
[subtile-ocr](https://github.com/gwen-lg/subtile-ocr) is an actively maintained Rust tool that provides accurate OCR conversion.
|
||||
|
||||
#### Option 1: Docker (Easiest)
|
||||
|
||||
We provide a Dockerfile that builds subtile-ocr with all dependencies:
|
||||
|
||||
```bash
|
||||
# Build the Docker image (one-time)
|
||||
cd tools/vobsubocr
|
||||
docker build -t subtile-ocr .
|
||||
|
||||
# Extract VOBSUB from MKV
|
||||
ccextractor movie.mkv
|
||||
|
||||
# Convert to SRT using OCR
|
||||
docker run --rm -v $(pwd):/data subtile-ocr -l eng -o /data/movie_eng.srt /data/movie_eng.idx
|
||||
```
|
||||
|
||||
#### Option 2: Install subtile-ocr Natively
|
||||
|
||||
If you have Rust and Tesseract development libraries installed:
|
||||
|
||||
```bash
|
||||
# Install dependencies (Ubuntu/Debian)
|
||||
sudo apt-get install libleptonica-dev libtesseract-dev tesseract-ocr tesseract-ocr-eng
|
||||
|
||||
# Install subtile-ocr
|
||||
cargo install --git https://github.com/gwen-lg/subtile-ocr
|
||||
|
||||
# Convert
|
||||
subtile-ocr -l eng -o movie_eng.srt movie_eng.idx
|
||||
```
|
||||
|
||||
### subtile-ocr Options
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `-l, --lang <LANG>` | Tesseract language code (required). Examples: `eng`, `fra`, `deu`, `chi_sim` |
|
||||
| `-o, --output <FILE>` | Output SRT file (stdout if not specified) |
|
||||
| `-t, --threshold <0.0-1.0>` | Binarization threshold (default: 0.6) |
|
||||
| `-d, --dpi <DPI>` | Image DPI for OCR (default: 150) |
|
||||
| `--dump` | Save processed subtitle images as PNG files |
|
||||
|
||||
### Language Codes
|
||||
|
||||
Install additional Tesseract language packs as needed:
|
||||
|
||||
```bash
|
||||
# Examples
|
||||
sudo apt-get install tesseract-ocr-fra # French
|
||||
sudo apt-get install tesseract-ocr-deu # German
|
||||
sudo apt-get install tesseract-ocr-spa # Spanish
|
||||
sudo apt-get install tesseract-ocr-chi-sim # Simplified Chinese
|
||||
```
|
||||
|
||||
## Technical Details
|
||||
|
||||
### .idx File Format
|
||||
|
||||
The index file contains:
|
||||
1. Header with metadata (size, palette, alignment settings)
|
||||
2. Language identifier line
|
||||
3. Timestamp entries with file positions
|
||||
|
||||
Example:
|
||||
```
|
||||
# VobSub index file, v7 (do not modify this line!)
|
||||
size: 720x576
|
||||
palette: 000000, 828282, ...
|
||||
|
||||
id: eng, index: 0
|
||||
timestamp: 00:01:12:920, filepos: 000000000
|
||||
timestamp: 00:01:18:640, filepos: 000000800
|
||||
...
|
||||
```
|
||||
|
||||
### .sub File Format
|
||||
|
||||
The binary file contains MPEG Program Stream packets:
|
||||
- Each subtitle is wrapped in a PS Pack header (14 bytes) + PES header (15 bytes)
|
||||
- Subtitles are aligned to 2048-byte boundaries
|
||||
- Contains raw SPU (SubPicture Unit) bitmap data
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Empty output files
|
||||
- Ensure the MKV file actually contains VOBSUB tracks (check with `mediainfo` or `ffprobe`)
|
||||
- CCExtractor will report "No VOBSUB subtitles to write" if the track is empty
|
||||
|
||||
### OCR quality issues
|
||||
- Try adjusting the `-t` threshold parameter
|
||||
- Ensure the correct language pack is installed
|
||||
- Use `--dump` to inspect the processed images
|
||||
|
||||
### Docker permission issues
|
||||
- The output files may be owned by root; use `sudo chown` to fix ownership
|
||||
- Or run Docker with `--user $(id -u):$(id -g)`
|
||||
|
||||
## See Also
|
||||
|
||||
- [OCR.md](OCR.md) - General OCR support in CCExtractor
|
||||
- [subtile-ocr GitHub](https://github.com/gwen-lg/subtile-ocr) - OCR tool documentation
|
||||
137
docs/build-wsl.md
Normal file
137
docs/build-wsl.md
Normal file
@@ -0,0 +1,137 @@
|
||||
# Building CCExtractor on Windows using WSL
|
||||
|
||||
This guide explains how to build CCExtractor on Windows using WSL (Ubuntu).
|
||||
It is based on a fresh setup and includes all required dependencies and
|
||||
common build issues encountered during compilation.
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Windows 10 or Windows 11
|
||||
- WSL enabled
|
||||
- Ubuntu installed via Microsoft Store
|
||||
|
||||
---
|
||||
|
||||
## Install WSL and Ubuntu
|
||||
|
||||
From PowerShell (run as Administrator):
|
||||
|
||||
```powershell
|
||||
wsl --install -d Ubuntu
|
||||
```
|
||||
|
||||
Restart the system if prompted, then launch Ubuntu from the Start menu.
|
||||
|
||||
---
|
||||
|
||||
## Update system packages
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Install basic build tools
|
||||
|
||||
```bash
|
||||
sudo apt install -y build-essential git pkg-config
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Install Rust (required)
|
||||
|
||||
CCExtractor includes Rust components, so Rust and Cargo are required.
|
||||
|
||||
```bash
|
||||
curl https://sh.rustup.rs -sSf | sh
|
||||
source ~/.cargo/env
|
||||
```
|
||||
|
||||
Verify installation:
|
||||
|
||||
```bash
|
||||
cargo --version
|
||||
rustc --version
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Install required libraries
|
||||
|
||||
```bash
|
||||
sudo apt install -y \
|
||||
libclang-dev clang \
|
||||
libtesseract-dev tesseract-ocr \
|
||||
libgpac-dev
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Clone the repository
|
||||
|
||||
```bash
|
||||
git clone https://github.com/CCExtractor/ccextractor.git
|
||||
cd ccextractor
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Build CCExtractor
|
||||
|
||||
```bash
|
||||
cd linux
|
||||
./build
|
||||
```
|
||||
|
||||
After a successful build, verify by running:
|
||||
|
||||
```bash
|
||||
./ccextractor
|
||||
```
|
||||
|
||||
You should see the help/usage output.
|
||||
|
||||
---
|
||||
|
||||
## Common build issues
|
||||
|
||||
### cargo: command not found
|
||||
|
||||
```bash
|
||||
source ~/.cargo/env
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Unable to find libclang
|
||||
|
||||
```bash
|
||||
sudo apt install libclang-dev clang
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### gpac/isomedia.h: No such file or directory
|
||||
|
||||
```bash
|
||||
sudo apt install libgpac-dev
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### please install tesseract development library
|
||||
|
||||
```bash
|
||||
sudo apt install libtesseract-dev tesseract-ocr
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Notes
|
||||
|
||||
- Compiler warnings during the build process are expected and do not indicate failure.
|
||||
- This guide was tested on Ubuntu (WSL) running on Windows 11.
|
||||
@@ -1,5 +1,5 @@
|
||||
#######################################################
|
||||
# Version 0.01
|
||||
# Version 0.02
|
||||
#
|
||||
# To enable required option please uncomment option
|
||||
#
|
||||
@@ -12,12 +12,15 @@
|
||||
# 0 = file
|
||||
# 1 = stdin
|
||||
# 2 = network
|
||||
# 3 = tcp
|
||||
|
||||
INPUT_SOURCE=0
|
||||
|
||||
# The Buffer Input tag
|
||||
# This tag takes number in its input.
|
||||
|
||||
# Is it ccx_bufferdata_type ?
|
||||
|
||||
#BUFFER_INPUT=0
|
||||
|
||||
# The Direct Rollup tag
|
||||
@@ -45,22 +48,28 @@ INPUT_SOURCE=0
|
||||
#NOTYPE_SETTING=
|
||||
|
||||
# The Codec Tag takes the preference of codec
|
||||
# tag CCX_CODEC_ANY is by default
|
||||
# tag CCX_CODEC_ANY by default
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 0 = CCX_CODEC_ANY (default)
|
||||
# 1 = CCX_CODEC_TELETEXT
|
||||
# 2 = CCX_CODEC_DVB
|
||||
# 3 = CCX_CODEC_ISDB_CC
|
||||
# 4 = CCX_CODEC_ATSC_CC
|
||||
# 5 = CCX_CODEC_NONE
|
||||
|
||||
#CODEC=
|
||||
|
||||
# The NO Codec Tag uses codec specified
|
||||
# tag CCX_CODEC_NONE by default
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 0 = CCX_CODEC_ANY
|
||||
# 1 = CCX_CODEC_TELETEXT
|
||||
# 2 = CCX_CODEC_DVB
|
||||
|
||||
#CODEC=
|
||||
|
||||
# The NO Codec Tag do not use codec specified
|
||||
# tag CCX_CODEC_NONE is by default
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 1 = CCX_CODEC_TELETEXT
|
||||
# 2 = CCX_CODEC_DVB
|
||||
# 3 = CCX_CODEC_NONE
|
||||
# 3 = CCX_CODEC_ISDB_CC
|
||||
# 4 = CCX_CODEC_ATSC_CC
|
||||
# 5 = CCX_CODEC_NONE (default)
|
||||
|
||||
#NOCODEC=
|
||||
|
||||
@@ -68,15 +77,21 @@ INPUT_SOURCE=0
|
||||
# by default output format is srt
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 0 = CCX_OF_RAW
|
||||
# 1 = CCX_OF_SRT (default)
|
||||
# 2 = CCX_OF_SAMI
|
||||
# 3 = CCX_OF_TRANSCRIPT
|
||||
# 4 = CCX_OF_RCWT
|
||||
# 5 = CCX_OF_NULL
|
||||
# 6 = CCX_OF_SMPTETT
|
||||
# 7 = CCX_OF_SPUPNG
|
||||
# 8 = CCX_OF_DVDRAW
|
||||
# 0 = CCX_OF_RAW
|
||||
# 1 = CCX_OF_SRT (default)
|
||||
# 2 = CCX_OF_SAMI
|
||||
# 3 = CCX_OF_TRANSCRIPT
|
||||
# 4 = CCX_OF_RCWT
|
||||
# 5 = CCX_OF_NULL
|
||||
# 6 = CCX_OF_SMPTETT
|
||||
# 7 = CCX_OF_SPUPNG
|
||||
# 8 = CCX_OF_DVDRAW
|
||||
# 9 = CCX_OF_WEBVTT
|
||||
# 10 = CCX_OF_SIMPLE_XML
|
||||
# 11 = CCX_OF_G608
|
||||
# 12 = CCX_OF_CURL
|
||||
# 13 = CCX_OF_SSA
|
||||
# 14 = CCX_OF_MCC
|
||||
|
||||
#OUTPUT_FORMAT=
|
||||
|
||||
|
||||
821
docs/guidoc.md
821
docs/guidoc.md
@@ -1,821 +0,0 @@
|
||||
# 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) *ctx, int x, int y, int width, int height, struct [main_tab](#struct-main-tab) *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 *main_settings);
|
||||
char* [truncate_path_string](#func-truncate-path-string)(char *filePath);
|
||||
void [remove_path_entry](#func-remove-path-entry)(struct [main_tab](#struct-main-tab) *main_settings, int indexToRemove);
|
||||
|
||||
ccx_cli_thread.c || ccx_cli_thread.h
|
||||
void* [read_activity_data](#func-read-activity-data)(void *read_args);
|
||||
void* [read_data_from_thread](#func-read-data-from-thread)(void* read_args);
|
||||
void* [extract_thread](#func-extract-thread)(void* extract_args);
|
||||
void* [feed_files_for_extraction](#func-feed-files-for-extraction)(void* file_args);
|
||||
void [setup_and_create_thread](#fun-setup-and-create-thread)(struct [main_tab](#struct-main-tab) *main_settings, struct [built_string](#struct-built-string) *command);
|
||||
void&asst; [find_hd_homerun_devices](#func-hd-homerun-devices)(void *args);
|
||||
void* [setup_hd_homerun_device](#func-setup-hd-homerun-device)(void *args);
|
||||
|
||||
command_builder.c || command_builder.h
|
||||
void [command_builder](#func-command-builder)(struct [built_string](#struct-built-string) *command,
|
||||
struct [main_tab](#struct-main-tab) *main_settings,
|
||||
struct [network_popup](#struct-network-popup) *network_settings,
|
||||
struct [input_tab](#struct-input-tab) *input,
|
||||
struct [advanced_input_tab](#struct-advanced-input-tab) *advanced_input,
|
||||
struct [output_tab](#struct-output-tab) *output,
|
||||
struct [decoders_tab](#struct-output-tab) *decoders,
|
||||
struct [credits_tab](#struct-output-tab) *credits,
|
||||
struct [debug_tab](#struct-debug-tab) *debug,
|
||||
struct [burned_subs_tab](#struct-debug-tab) *burned_subs);
|
||||
|
||||
file_browser.c || file_browser.h
|
||||
void [die](#func-die)(const char *fmt, ...);
|
||||
char* [file_load](#func-file-load)(const char* path, size_t* siz);
|
||||
char* [str_duplicate](#func-str-duplicate)(const char *src);
|
||||
void [dir_free_list](#func-dir-free-list)(char **list, size_t size);
|
||||
char** [dir_list](#func-dir-list)(const char *dir, int return_subdirs, size_t *count);
|
||||
struct file_group [FILE_GROUP](#func-file-group)(enum file_groups group, const char *name, struct nk_image *icon);
|
||||
struct file [FILE_DEF](#func-file-def)(enum file_types type, const char *suffix, enum file_groups group);
|
||||
struct nk_image* [media_icon_for_file](#func-media-icon-for-file)(struct media *media, const char *file);
|
||||
void [media_init](#func-media-init)(struct media *media);
|
||||
void [file_browser_reload_directory_content](#func-file-browser-reload-directory-content)(struct file_browser *browser, const char *path);
|
||||
void [get_drives](#func-get-drives)(struct file_browser *browser);
|
||||
void [file_browser_init](#func-file-browser-init)(struct file_browser *browser, struct media *media);
|
||||
void [file_browser_free](#func-file-browser-free)(struct file_browser *browser);
|
||||
int [file_browser_run](#func-file-browser-run)(struct file_browser *browser, struct [nk_context](#nk-context) *ctx, struct [main_tab](#struct-main-tab) *main_settings, struct [output_tab](#struct-output-tab) *output, struct [debug_tab](#struct-debug-tab) *debug, struct [hd_homerun_tab](#struct-hd-homerun-tab) *hd_homerun);
|
||||
|
||||
popups.c || popups.h
|
||||
void [draw_network_popup](#func-draw-network-popup)(struct [nk_context](#nk-context) *ctx, int *show_preferences_network, struct [network_popup](#struct-network-popup) *network_settings);
|
||||
void [draw_getting_started_popup](#func-draw-getting-started-popup)(struct [nk_context](#nk-context) *ctx, int *show_getting_started);
|
||||
void [draw_about_ccx_popup](#func-draw-about-ccx-popup)(struct [nk_context](#nk-context) *ctx, int *show_about_ccx, struct nk_user_font *droid_big, struct nk_user_font *droid_head);
|
||||
void [draw_progress_details_popup](#func-draw-progress-details-popup)(struct [nk_context](#nk-context) *ctx, int *show_progress_details, struct [main_tab](#struct-main-tab) *main_settings);
|
||||
void [draw_color_popup](#func-draw-color-popup)(struct [nk_context](#nk-context) *ctx, struct [output_tab](#struct-output-tab) *output);
|
||||
void [draw_thread_popup](#fun-draw-thread-popup)(struct [nk_context](#nk-context) *ctx, int *show_thread_popup);
|
||||
void [setup_network_settings](#func-setup-network-settings)(struct [network_popup](#struct-network-popup) *network_settings);
|
||||
|
||||
preview.c || preview.h
|
||||
int [preview](#func-preview)(struct [nk_context](#nk-context) *ctx, int x, int y, int width, int height, struct [main_tab](#struct-main-tab) *main_settings);
|
||||
|
||||
save_load_data.c || save_load_data.h
|
||||
void [load_data](#func-load-data)(FILE *file,
|
||||
struct [main_tab](#struct-main-tab) *main_settings,
|
||||
struct [input_tab](#struct-input-tab) *input,
|
||||
struct [advanced_input_tab](#struct-advanced-input-tab) *advanced_input,
|
||||
struct [output_tab](#struct-output-tab) *output,
|
||||
struct [decoders_tab](#struct-decoders-tab) *decoders,
|
||||
struct [credits_tab](#struct-credits-tab) *credits,
|
||||
struct [debug_tab](#struct-debug-tab) *debug,
|
||||
struct [hd_homerun_tab](#struct-hd-homerun-tab) *hd_homerun,
|
||||
struct [burned_subs_tab](#struct-burned-subs-tab) *burned_subs);
|
||||
|
||||
void [save_data](#func-save-data)(FILE *file,
|
||||
struct [main_tab](#struct-main-tab) *main_settings,
|
||||
struct [input_tab](#struct-input-tab) *input,
|
||||
struct [advanced_input_tab](#struct-advanced-input-tab) *advanced_input,
|
||||
struct [output_tab](#struct-output-tab) *output,
|
||||
struct [decoders_tab](#struct-decoders-tab) *decoders,
|
||||
struct [credits_tab](#struct-credits-tab) *credits,
|
||||
struct [debug_tab](#struct-debug-tab) *debug,
|
||||
struct [hd_homerun_tab](#struct-hd-homerun-tab) *hd_homerun,
|
||||
struct [burned_subs_tab](#struct-burned-subs-tab) *burned_subs);
|
||||
|
||||
void [write_credits](#func-write-credits)(FILE* file, struct [credits_tab](#struct-credits-tab) *credits);
|
||||
void [read_credits](#func-read-credits)(FILE* file, struct [credits_tab](#struct-credits-tab) *credits);
|
||||
|
||||
terminal.c
|
||||
int [terminal](#func-terminal)(struct [nk_context](#nk-context) *ctx, int x, int y, int width, int height, char *command);
|
||||
|
||||
### About CCExtractor specific functions
|
||||
#### int <a id="func-activity">activity</a>(struct nk_context *ctx, int x, int y, int width, int height, struct [main_tab](#struct-main-tab) *main_settings);
|
||||
##### Info:
|
||||
--Contains the procedure to be carried out when Activity Window is toggled.
|
||||
##### Parameters:
|
||||
* *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.
|
||||
* *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) *main_settings);
|
||||
##### Info:
|
||||
Setups the required defaults of variables in [`main_tab`](#struct-main-tab) structure.
|
||||
##### Parameters:
|
||||
* *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 *filePath);
|
||||
##### Info:
|
||||
Truncated the Path String of file to visible area using `...`
|
||||
##### Parameters:
|
||||
* *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) *main_settings, int indexToRemove);
|
||||
##### Info:
|
||||
Removes the selected path in the extraction queue (Selected entry's index is passed).
|
||||
##### Parameters:
|
||||
* *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* <a id="func-read-activity-data">read_activity_data</a>(void *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:
|
||||
* *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*
|
||||
|
||||
#### void* <a id="func-read-data-from-thread>read_data_from_thread</a>(void* 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:
|
||||
* *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*
|
||||
|
||||
#### void* <a id="func-extract-thread">extract_thread</a>(void* extract_args);
|
||||
##### Info:
|
||||
Passes command with all options from GUI to CLI CCExtractor.
|
||||
##### Parameters:
|
||||
* *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*
|
||||
|
||||
#### void* <a id="func-feed-files-for-extraction">feed_files_for_extraction</a>(void* 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:
|
||||
* *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*
|
||||
|
||||
#### void <a id="func-setup-and-create-thread">setup_and_create_thread</a>(struct [main_tab](#struct-main-tab) *main_settings, struct [built_string](#struct-built-string) *command);
|
||||
##### Info:
|
||||
Initialises some values for the structure used in thread arguments and creates [feed_files_for_extraction](#feed-files-for-extraction).
|
||||
##### Parameters:
|
||||
* *main_settings - Pointer to `main_tab` struct.
|
||||
* *command - Pointer to `built_string` struct.
|
||||
##### Return type: void*
|
||||
|
||||
#### void* <a id="func-hind-hd-homerun-devices">find_hd_homerun_devices</a>(void *args);
|
||||
Finds devices connected to HD HomeRun Network.
|
||||
#### Parameters:
|
||||
* *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*
|
||||
|
||||
#### void* <a id="func-setup-hd-homerun-device">setup_hd_homerun_device</a>(void *args);
|
||||
##### Info:
|
||||
Sets up various parameters required to extract subtitle from incoming stream from a HD HomeRun Device.
|
||||
##### Parameters:
|
||||
* *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*
|
||||
|
||||
#### void [command_builder](#func-command-builder)(struct [built_string](#struct-built-string) *command, struct [main_tab](#struct-main-tab) *main_settings, struct [network_popup](#struct-network-popup) *network_settings, struct [input_tab](#struct-input-tab) *input, struct [advanced_input_tab](#struct-advanced-input-tab) *advanced_input, struct [output_tab](#struct-output-tab) *output, struct [decoders_tab](#struct-output-tab) *decoders, struct [credits_tab](#struct-output-tab) *credits, struct [debug_tab](#struct-debug-tab) *debug, struct [burned_subs_tab](#struct-debug-tab) *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:
|
||||
* *command - Pointer to `built_string` command.
|
||||
* *main_settings - Pointer to `main_tab` struct.
|
||||
* *network_settings - Pointer to `network_popup` struct.
|
||||
* *input - Pointer to `input_tab` struct.
|
||||
* *advance_input - Pointer to `advanced_input` struct.
|
||||
* *output - Pointer to `output_tab` struct.
|
||||
* *decoders - Pointer to `decoders_tab` struct.
|
||||
* *credits - Pointer to `credits_tab` struct.
|
||||
* *debug - Pointer to `debug_tab` struct.
|
||||
* *burned_subs - Pointer to `burned_subs_tab` struct.
|
||||
##### Return type: void
|
||||
|
||||
#### void <a id="func-die">die</a>(const char *fmt, ...);
|
||||
##### Info:
|
||||
Custom function to generate error if something in File Browser goes wrong.
|
||||
##### Parameters:
|
||||
* *fmt - Format of char string along with place holder for variables.
|
||||
* ... - Variables in order of their specified place holder.
|
||||
##### Return type: void
|
||||
|
||||
#### char* <a id="func-file-load">file_load</a>(const char* path, size_t* siz);
|
||||
##### Info:
|
||||
Custom function to load file and read data from loaded file.
|
||||
##### Parameters:
|
||||
* *path - Pointer to string literal (Path of the file).
|
||||
* *siz - Size of string literal provided (To allocate memory accordingly).
|
||||
##### Return type: void
|
||||
|
||||
#### char* <a id="func-str-duplicate">str_duplicate</a>(const char *src);
|
||||
##### Info:
|
||||
Dynamically copies specified string to memory.
|
||||
##### Parameters:
|
||||
* *src - The String to be copied.
|
||||
##### Return type: char*
|
||||
* Pointer to the string in the memory.
|
||||
|
||||
#### void <a id="func-dir-free-list">dir_free_list</a>(char **list, size_t size);
|
||||
##### Info:
|
||||
Frees the memory allocated to Files' and Directories' name and path.
|
||||
##### Parameters:
|
||||
* **char - Pointer to list (array of strings) to be freed
|
||||
##### Return type: void
|
||||
|
||||
#### char** <a id="func-dir-list">dir_list</a>(const char *dir, int return_subdirs, size_t *count);
|
||||
##### Info:
|
||||
Opens the selected directory and adds its path to list and returns the same list.
|
||||
#####Parameters:
|
||||
* *dir - Pointer to string (name of directory to be opened).
|
||||
* return_subdirs - `nk_true` if subdirectories are to be returned then.
|
||||
* *count - Number of directories in opened directories.
|
||||
#### Retrun type: char**
|
||||
* 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 *name, struct nk_image *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`.
|
||||
* *name - Pointer to a string literal (to set `name` member in `file_group`.
|
||||
* *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 *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`.
|
||||
* *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* <a id="func-media-icon-for-file">media_icon_for_file</a>(struct media *media, const char *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:
|
||||
* *media - pointer to `media` struct.
|
||||
* *file - pointer to string literal (name of file with extension)
|
||||
##### Return type: struct `nk_image`*
|
||||
* Returns appropriate `nk_image` corresponding to the file.
|
||||
|
||||
#### void <a id="func-media-init">media_init</a>(struct media *media);
|
||||
##### Info:
|
||||
Assigns icons to `file` and `file_group` members from.
|
||||
##### Parameters:
|
||||
* *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 *browser, const char *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:
|
||||
* *browser - Pointer to `file_browser` struct.
|
||||
* *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 *browser);
|
||||
##### Info:
|
||||
NOTE: Windows Specific Function.
|
||||
Detects the number of drives and their respective Drive Letters to show the same in File Browser.
|
||||
#####Parameters:
|
||||
* *browser - pointer to `file_browser` struct.
|
||||
##### Return type: void
|
||||
|
||||
#### void <a id="func-file-browser-init">file_browser_init</a>(struct file_browser *browser, struct media *media);
|
||||
##### Info:
|
||||
Initialised various variables/attributes required whenever the File Browser is run.
|
||||
##### Parameters:
|
||||
* *browser - Pointer to `file_browser` struct.
|
||||
* *media - pointer to `media` struct.
|
||||
##### Return type: void
|
||||
|
||||
#### void <a id="func-file-browser-free">file_browser_free</a>(struct file_browser *browser);
|
||||
##### Info:
|
||||
Frees the memory allocated to various variables in [file_browser_init](#func-file-browser-init).
|
||||
##### Parameters:
|
||||
* *browser - pointer to `file_browser` struct.
|
||||
##### Return type: void
|
||||
|
||||
#### int <a id="func-file-browser-run">file_browser_run</a>(struct file_browser *browser, struct [nk_context](#nk-context) *ctx, struct [main_tab](#struct-main-tab) *main_settings, struct [output_tab](#struct-output-tab) *output, struct [debug_tab](#struct-debug-tab) *debug, struct [hd_homerun_tab](#struct-hd-homerun-tab) *hd_homerun);
|
||||
##### Info:
|
||||
Provides runtime of File Browser on GUI.
|
||||
##### Parameters:
|
||||
* *browser - pointer to `file_browser` struct.
|
||||
* *ctx - pointer to `nk_context` struct.
|
||||
* *main_settings - pointer to `main_tab` struct.
|
||||
* *output - poiter to `output_tab` struct.
|
||||
* *debug - pointer to `debug_tab` struct.
|
||||
* *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) *ctx, int *show_preferences_network, struct [network_popup](#struct-network-popup) *network_settings);
|
||||
##### Info:
|
||||
Draws popup with Network Settings on GUI.
|
||||
##### Parameters:
|
||||
* *ctx - pointer to `nk_context` struct.
|
||||
* *show_preferences_network - pointer to variable status if which triggers the popup.
|
||||
* *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) *ctx, int *show_getting_started);
|
||||
##### Info:
|
||||
Draws popup on screen which shows Getting Started Info.
|
||||
##### Parameters:
|
||||
* *ctx - pointer to `nk_context` struct.
|
||||
* *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) *ctx, int *show_about_ccx, struct nk_user_font *droid_big, struct nk_user_font *droid_head);
|
||||
##### Info:
|
||||
Draws popup on screen containing information about CCExtractor.
|
||||
##### Parameters:
|
||||
* *ctx - pointer to `nk_context` struct.
|
||||
* *show_about_ccx - pointer to variable status if which triggers the popup.
|
||||
* *droid_big - pointer to `nk_user_font` struct.
|
||||
* *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) *ctx, int *show_progress_details, struct [main_tab](#struct-main-tab) *main_settings);
|
||||
##### Info:
|
||||
Draws popup on screen which shows progress details.
|
||||
##### Parameters:
|
||||
* *ctx - pointer to `nk_context` struct.
|
||||
* *show_pogress_details - pointer to variable status if which triggers the popup.
|
||||
* *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) *ctx, struct [output_tab](#struct-output-tab) *output);
|
||||
##### Info:
|
||||
Draws popup on screen which shows color-picker.
|
||||
##### Parameters:
|
||||
* *ctx - pointer to `nk_context` struct.
|
||||
* *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) *ctx, int *show_thread_popup);
|
||||
##### Info:
|
||||
This popup is shown if anyhow the GUI is unable to read file.
|
||||
##### Parameters:
|
||||
* *ctx - pointer to `nk_context` struct.
|
||||
* *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) *network_settings);
|
||||
##### Info:
|
||||
Sets up defaults for Network Settings.
|
||||
##### Parameters:
|
||||
* *network_settings - pointer to `network_popup` struct.
|
||||
##### Return type: void
|
||||
|
||||
#### int <a id="func-preview">preview</a>(struct [nk_context](#nk-context) *ctx, int x, int y, int width, int height, struct [main_tab](#struct-main-tab) *main_settings);
|
||||
##### Info:
|
||||
Draws `Preview` Nuklear window and shows preview strings (lines of subtitles extracted in realtime).
|
||||
##### Parameters:
|
||||
* *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.
|
||||
* *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) *main_settings, struct [input_tab](#struct-input-tab) *input, struct [advanced_input_tab](#struct-advanced-input-tab) *advanced_input, struct [output_tab](#struct-output-tab) *output, struct [decoders_tab](#struct-decoders-tab) *decoders, struct [credits_tab](#struct-credits-tab) *credits, struct [debug_tab](#struct-debug-tab) *debug, struct [hd_homerun_tab](#struct-hd-homerun-tab) *hd_homerun, struct [burned_subs_tab](#struct-burned-subs-tab) *burned_subs);
|
||||
##### Info:
|
||||
Loads values of all the variables stored in a file at last exit of GUI.
|
||||
##### Parameters:
|
||||
* *file - pointer to `FILE`.
|
||||
* *main_settings - pointer to `main_tab` struct.
|
||||
* *intput - pointer to `input_tab` struct.
|
||||
* *advanced_input - pointer to `advanced_input_tab` struct.
|
||||
* *output - pointer to `output_tab` struct.
|
||||
* *decoders - pointer to `decoders_tab` struct.
|
||||
* *credits - poitner to `credits_tab` struct.
|
||||
* *debug - pointer to `debug_tab` struct.
|
||||
* *hd_homerun - pointer to `hd_homerun_tab` struct.
|
||||
* *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) *main_settings, struct [input_tab](#struct-input-tab) *input, struct [advanced_input_tab](#struct-advanced-input-tab) *advanced_input, struct [output_tab](#struct-output-tab) *output, struct [decoders_tab](#struct-decoders-tab) *decoders, struct [credits_tab](#struct-credits-tab) *credits, struct [debug_tab](#struct-debug-tab) *debug, struct [hd_homerun_tab](#struct-hd-homerun-tab) *hd_homerun, struct [burned_subs_tab](#struct-burned-subs-tab) *burned_subs);
|
||||
##### info:
|
||||
Saves values of all the variables as a "Current State" in a file on exit.
|
||||
##### Parameters:
|
||||
* *file - pointer to `FILE`.
|
||||
* *main_settings - pointer to `main_tab` struct.
|
||||
* *intput - pointer to `input_tab` struct.
|
||||
* *advanced_input - pointer to `advanced_input_tab` struct.
|
||||
* *output - pointer to `output_tab` struct.
|
||||
* *decoders - pointer to `decoders_tab` struct.
|
||||
* *credits - poitner to `credits_tab` struct.
|
||||
* *debug - pointer to `debug_tab` struct.
|
||||
* *hd_homerun - pointer to `hd_homerun_tab` struct.
|
||||
* *burned_subs - pointer to `burned_subs_tab` struct.
|
||||
##### Return type: void
|
||||
|
||||
#### void <a id="func-write-credits">write_credits</a>(FILE *file, struct [credits_tab](#struct-credits-tab) *credits);
|
||||
##### Info:
|
||||
Writes Credits to files after some operations, since extra`\n` character gives problems while reading file.
|
||||
##### Parameters:
|
||||
* *file - pointer to `FILE`.
|
||||
* *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) *credits);
|
||||
##### Info:
|
||||
Reads credits from file in a specific format (as written by [write_credits](#func-write-credits)) from file.
|
||||
##### Parameters:
|
||||
* *file - pointer to `FILE`.
|
||||
* *credits - pointer to `credits_tab` struct.
|
||||
##### Return type: void
|
||||
|
||||
#### int <a id="func-terminal">terminal</a>(struct [nk_context](#nk-context) *ctx, int x, int y, int width, int height, char *command);
|
||||
##### Info:
|
||||
Writes the command string (that would be passed to CLI CCExtractor) in "Terminal" Nuklear Window.
|
||||
##### Parameters:
|
||||
* *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.
|
||||
* *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*, const char *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* - Pointer to `nk_context` structure.
|
||||
* *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:
|
||||
* *ctx - Pointer to `nk_context` structure.
|
||||
##### Return type: void
|
||||
|
||||
#### void <a id="nk-layout-row-dynamic">nk_layout_row_dynamic</a>(struct nk_context*, 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:
|
||||
* *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*, const char*);
|
||||
##### 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* - Pointer to `nk_context` structure.
|
||||
* char* - Pointer to string literal (to view).
|
||||
|
||||
#### int <a id="nk-window-is-closed">nk_window_is_closed</a>(struct nk_context *ctx, const char *name);
|
||||
##### Info:
|
||||
Checks if the active Nuklear Window is closed (by any trigger).
|
||||
##### Parameters:
|
||||
* *ctx - Pointer to `nk_context` structure.
|
||||
* *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 *ctx);
|
||||
##### Info:
|
||||
Marks the end of Menu Bar definition(Menubar code).
|
||||
##### Parameters:
|
||||
* *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:
|
||||
* *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*, 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* - 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 *ctx, const char *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:
|
||||
* *ctx - pointer to `nk_context` structure.
|
||||
* *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*);
|
||||
##### Info:
|
||||
Marks the end of the MenuBar definition.
|
||||
##### Parameters:
|
||||
* nk_context* - Pointer to `nk_context` structure.
|
||||
##### Return type: void
|
||||
|
||||
#### void <a id="nk-layout-space-begin">nk_layout_space_begin</a>(struct nk_context *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:
|
||||
* *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 *ctx);
|
||||
##### Info:
|
||||
Marks the end of custom space (empty) definition.
|
||||
##### Parameters:
|
||||
* *ctx - pointer to `nk_context` structure.
|
||||
##### Return type: void
|
||||
|
||||
#### int <a id="nk-style-push-vec2">nk_style_push_vec2</a>(struct nk_context* struct nk_vec2*, 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* - Pointer to `nk_context` structure.
|
||||
* nk_vec2* - Pointer to attribute to be modified.
|
||||
* nk_vec2* - 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*, float*, 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* - Pointer to `nk_context` structure.
|
||||
* float* - 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*, const char *title);
|
||||
##### Info:
|
||||
Draws a Button with provided label.
|
||||
##### Parameters:
|
||||
* nk_context* - Pointer to `nk_context` struct.
|
||||
* *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*);
|
||||
##### 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* - 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 *ctx, const char *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:
|
||||
* *ctx - pointer to `nk_context` struct.
|
||||
* *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 *ctx);
|
||||
##### Info:
|
||||
Marks the end of the group created by [nk_group_begin](#nk-group-begin).
|
||||
##### Parameters:
|
||||
* *ctx - pointer to `nk_context` struct.
|
||||
##### Return type: void
|
||||
|
||||
#### void <a id="nk-layout-row">nk_layout_row</a>(struct nk_context*, enum nk_layout_format, float height, int cols, const float *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* - 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.
|
||||
* *ratio - Ratio for widget placement.
|
||||
##### Return type: void
|
||||
|
||||
#### void <a id="nk-spacing">nk_spacing</a>(struct nk_context*, int cols);
|
||||
##### Info:
|
||||
Used to create spacing (blank) of specified columns.
|
||||
##### Parameters:
|
||||
* nk_context* - 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 *ctx, const char *label, int *active);
|
||||
##### Info:
|
||||
Creates a checkbox with specified label.
|
||||
##### Parameters:
|
||||
* *ctx - Pointer to `nk_context` struct.
|
||||
* * - Pointer to string literal(Label of checkbox).
|
||||
* * - 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 *ctx, const char *label, int active);
|
||||
##### Info:
|
||||
Draws radio button (among radio group) with specified label.
|
||||
##### Parameters:
|
||||
* *ctx - pointer to `nk_context` struct.
|
||||
* *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*, const char*, nk_flags align, int *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* - pointer to `nk_context` struct.
|
||||
* char* - Pointer to string literal (Label to display on GUI).
|
||||
* align - required alignment flags from `nk_flags` like `NK_TEXT_LEFT`.
|
||||
* *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*, const char **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* - Pointer to `nk_context` structure.
|
||||
* **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 *ctx, const char *str, nk_flags alignment);
|
||||
##### Info:
|
||||
Draws a plain text on Nuklear Window, Popup or group.
|
||||
##### Parameters:
|
||||
* *ctx - pointer to `nk_context` structure.
|
||||
* *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 *ctx, nk_size *cur, nk_size max, int is_modifyable);
|
||||
##### Info:
|
||||
Draws a progress bar.
|
||||
##### Parameters:
|
||||
* *ctx - Poitner to `nk_context` struct.
|
||||
* *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.
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 131 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 101 KiB |
@@ -13,7 +13,7 @@ Step 2) create a separate directory where you want to build the target.
|
||||
|
||||
Step 3) make the build system using cmake. Params in [] are optional and have
|
||||
been explained later in the document.
|
||||
~> cmake [-DWITH_FFMPEG=ON] [-DWITH_OCR=ON] [-DWITH_SHARING=ON]
|
||||
~> cmake [-DWITH_FFMPEG=ON] [-DWITH_OCR=ON]
|
||||
[-DWITH_HARDSUBX=ON] ../src/
|
||||
|
||||
Step 4) Compile the code.
|
||||
@@ -29,9 +29,6 @@ cmake -DWITH_FFMPEG=ON ../src/
|
||||
If you want to build CCExtractor with OCR you need to pass
|
||||
cmake -DWITH_OCR=ON ../src/
|
||||
|
||||
If you want to build CCExtractor with Sharing and Translating service:
|
||||
cmake -DWITH_SHARING=ON ../src/
|
||||
|
||||
If you want to build CCExtractor with HARDSUBX support
|
||||
cmake -DWITH_HARDSUBX=ON ../src/
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/bash
|
||||
find /vagrant/Second\ phase\ evaluation/ -name '*.ts' -exec sh -c '
|
||||
for file do
|
||||
python ../../api/api_testing.py $file -quiet
|
||||
done
|
||||
' sh {} +
|
||||
2
linux/.gitignore
vendored
Normal file
2
linux/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
libccx_rust.a
|
||||
rust
|
||||
@@ -1,118 +1,69 @@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4/
|
||||
|
||||
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_dump.c \
|
||||
../src/gpacmp4/box_code_meta.c \
|
||||
../src/gpacmp4/box_funcs.c \
|
||||
../src/gpacmp4/color.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/hint_track.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/color.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/maths.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 \
|
||||
/usr/include/gpac/avparse.h \
|
||||
/usr/include/gpac/base_coding.h \
|
||||
/usr/include/gpac/bitstream.h \
|
||||
/usr/include/gpac/color.h \
|
||||
/usr/include/gpac/config_file.h \
|
||||
/usr/include/gpac/configuration.h \
|
||||
/usr/include/gpac/constants.h \
|
||||
/usr/include/gpac/events_constants.h \
|
||||
/usr/include/gpac/ietf.h \
|
||||
/usr/include/gpac/isomedia.h \
|
||||
/usr/include/gpac/list.h \
|
||||
/usr/include/gpac/maths.h \
|
||||
/usr/include/gpac/media_tools.h \
|
||||
/usr/include/gpac/mpeg4_odf.h \
|
||||
/usr/include/gpac/network.h \
|
||||
/usr/include/gpac/revision.h \
|
||||
/usr/include/gpac/setup.h \
|
||||
/usr/include/gpac/tools.h \
|
||||
/usr/include/gpac/utf.h \
|
||||
/usr/include/gpac/version.h \
|
||||
/usr/include/gpac/iso639.h \
|
||||
/usr/include/gpac/internal/avilib.h \
|
||||
/usr/include/gpac/internal/isomedia_dev.h \
|
||||
/usr/include/gpac/internal/media_dev.h \
|
||||
/usr/include/gpac/internal/odf_dev.h \
|
||||
/usr/include/gpac/internal/odf_parse_common.h \
|
||||
/usr/include/gpac/internal/ogg.h \
|
||||
../src/thirdparty/libpng/pngstruct.h \
|
||||
../src/thirdparty/libpng/pngpriv.h \
|
||||
../src/thirdparty/libpng/pnginfo.h \
|
||||
../src/thirdparty/libpng/pnglibconf.h \
|
||||
../src/thirdparty/libpng/pngconf.h \
|
||||
../src/thirdparty/libpng/pngdebug.h \
|
||||
../src/thirdparty/libpng/png.h \
|
||||
../src/thirdparty/libpng/png.c \
|
||||
../src/thirdparty/libpng/pngerror.c \
|
||||
../src/thirdparty/libpng/pngget.c \
|
||||
../src/thirdparty/libpng/pngmem.c \
|
||||
../src/thirdparty/libpng/pngpread.c \
|
||||
../src/thirdparty/libpng/pngread.c \
|
||||
../src/thirdparty/libpng/pngrio.c \
|
||||
../src/thirdparty/libpng/pngrtran.c \
|
||||
../src/thirdparty/libpng/pngrutil.c \
|
||||
../src/thirdparty/libpng/pngset.c \
|
||||
../src/thirdparty/libpng/pngtrans.c \
|
||||
../src/thirdparty/libpng/pngwio.c \
|
||||
../src/thirdparty/libpng/pngwrite.c \
|
||||
../src/thirdparty/libpng/pngwtran.c \
|
||||
../src/thirdparty/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/cc_bitstream.h \
|
||||
../src/lib_ccx/ccx_common_option.c \
|
||||
../src/lib_ccx/ccx_common_common.c \
|
||||
../src/lib_ccx/compile_info_real.h \
|
||||
../src/lib_ccx/utility.c \
|
||||
../src/lib_ccx/activity.c \
|
||||
../src/lib_ccx/asf_functions.c \
|
||||
@@ -155,8 +106,10 @@ ccextractor_SOURCES = \
|
||||
../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_mcc.c \
|
||||
../src/lib_ccx/ccx_encoders_mcc.h \
|
||||
../src/lib_ccx/ccx_encoders_sami.c \
|
||||
../src/lib_ccx/ccx_encoders_scc.c \
|
||||
../src/lib_ccx/ccx_encoders_smptett.c \
|
||||
../src/lib_ccx/ccx_encoders_splitbysentence.c \
|
||||
../src/lib_ccx/ccx_encoders_spupng.c \
|
||||
@@ -170,10 +123,6 @@ ccextractor_SOURCES = \
|
||||
../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 \
|
||||
@@ -202,6 +151,9 @@ ccextractor_SOURCES = \
|
||||
../src/lib_ccx/list.h \
|
||||
../src/lib_ccx/matroska.c \
|
||||
../src/lib_ccx/matroska.h \
|
||||
../src/lib_ccx/vobsub_decoder.c \
|
||||
../src/lib_ccx/vobsub_decoder.h \
|
||||
../src/lib_ccx/mp4.c \
|
||||
../src/lib_ccx/myth.c \
|
||||
../src/lib_ccx/networking.c \
|
||||
../src/lib_ccx/networking.h \
|
||||
@@ -222,125 +174,141 @@ ccextractor_SOURCES = \
|
||||
../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/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
|
||||
../src/thirdparty/zlib/adler32.c \
|
||||
../src/thirdparty/zlib/compress.c \
|
||||
../src/thirdparty/zlib/crc32.c \
|
||||
../src/thirdparty/zlib/crc32.h \
|
||||
../src/thirdparty/zlib/deflate.c \
|
||||
../src/thirdparty/zlib/deflate.h \
|
||||
../src/thirdparty/zlib/gzclose.c \
|
||||
../src/thirdparty/zlib/gzguts.h \
|
||||
../src/thirdparty/zlib/gzlib.c \
|
||||
../src/thirdparty/zlib/gzread.c \
|
||||
../src/thirdparty/zlib/gzwrite.c \
|
||||
../src/thirdparty/zlib/infback.c \
|
||||
../src/thirdparty/zlib/inffast.c \
|
||||
../src/thirdparty/zlib/inffast.h \
|
||||
../src/thirdparty/zlib/inffixed.h \
|
||||
../src/thirdparty/zlib/inflate.c \
|
||||
../src/thirdparty/zlib/inflate.h \
|
||||
../src/thirdparty/zlib/inftrees.c \
|
||||
../src/thirdparty/zlib/inftrees.h \
|
||||
../src/thirdparty/zlib/trees.c \
|
||||
../src/thirdparty/zlib/trees.h \
|
||||
../src/thirdparty/zlib/uncompr.c \
|
||||
../src/thirdparty/zlib/zconf.h \
|
||||
../src/thirdparty/zlib/zlib.h \
|
||||
../src/thirdparty/zlib/zutil.c \
|
||||
../src/thirdparty/zlib/zutil.h \
|
||||
../src/thirdparty/utf8proc/utf8proc.c \
|
||||
../src/thirdparty/utf8proc/utf8proc.h \
|
||||
../src/thirdparty/lib_hash/sha2.c \
|
||||
../src/thirdparty/lib_hash/sha2.h \
|
||||
../src/lib_ccx/zvbi/bcd.h \
|
||||
../src/lib_ccx/zvbi/bit_slicer.c \
|
||||
../src/lib_ccx/zvbi/bit_slicer.h \
|
||||
../src/lib_ccx/zvbi/decoder.c \
|
||||
../src/lib_ccx/zvbi/macros.h \
|
||||
../src/lib_ccx/zvbi/misc.h \
|
||||
../src/lib_ccx/zvbi/raw_decoder.c \
|
||||
../src/lib_ccx/zvbi/raw_decoder.h \
|
||||
../src/lib_ccx/zvbi/sampling_par.c \
|
||||
../src/lib_ccx/zvbi/sampling_par.h \
|
||||
../src/lib_ccx/zvbi/sliced.h \
|
||||
../src/lib_ccx/zvbi/zvbi_decoder.h \
|
||||
../src/freetype/* \
|
||||
../src/thirdparty/freetype/autofit/autofit.c \
|
||||
../src/thirdparty/freetype/base/ftbase.c \
|
||||
../src/thirdparty/freetype/base/ftbbox.c \
|
||||
../src/thirdparty/freetype/base/ftbdf.c \
|
||||
../src/thirdparty/freetype/base/ftbitmap.c \
|
||||
../src/thirdparty/freetype/base/ftcid.c \
|
||||
../src/thirdparty/freetype/base/ftfntfmt.c \
|
||||
../src/thirdparty/freetype/base/ftfstype.c \
|
||||
../src/thirdparty/freetype/base/ftgasp.c \
|
||||
../src/thirdparty/freetype/base/ftglyph.c \
|
||||
../src/thirdparty/freetype/base/ftgxval.c \
|
||||
../src/thirdparty/freetype/base/ftinit.c \
|
||||
../src/thirdparty/freetype/base/ftlcdfil.c \
|
||||
../src/thirdparty/freetype/base/ftmm.c \
|
||||
../src/thirdparty/freetype/base/ftotval.c \
|
||||
../src/thirdparty/freetype/base/ftpatent.c \
|
||||
../src/thirdparty/freetype/base/ftpfr.c \
|
||||
../src/thirdparty/freetype/base/ftstroke.c \
|
||||
../src/thirdparty/freetype/base/ftsynth.c \
|
||||
../src/thirdparty/freetype/base/ftsystem.c \
|
||||
../src/thirdparty/freetype/base/fttype1.c \
|
||||
../src/thirdparty/freetype/base/ftwinfnt.c \
|
||||
../src/thirdparty/freetype/bdf/bdf.c \
|
||||
../src/thirdparty/freetype/bzip2/ftbzip2.c \
|
||||
../src/thirdparty/freetype/cache/ftcache.c \
|
||||
../src/thirdparty/freetype/cff/cff.c \
|
||||
../src/thirdparty/freetype/cid/type1cid.c \
|
||||
../src/thirdparty/freetype/gzip/ftgzip.c \
|
||||
../src/thirdparty/freetype/include/ft2build.h \
|
||||
../src/thirdparty/freetype/lzw/ftlzw.c \
|
||||
../src/thirdparty/freetype/pcf/pcf.c \
|
||||
../src/thirdparty/freetype/pfr/pfr.c \
|
||||
../src/thirdparty/freetype/psaux/psaux.c \
|
||||
../src/thirdparty/freetype/pshinter/pshinter.c \
|
||||
../src/thirdparty/freetype/psnames/psnames.c \
|
||||
../src/thirdparty/freetype/raster/raster.c \
|
||||
../src/thirdparty/freetype/sfnt/sfnt.c \
|
||||
../src/thirdparty/freetype/smooth/smooth.c \
|
||||
../src/thirdparty/freetype/truetype/truetype.c \
|
||||
../src/thirdparty/freetype/type1/type1.c \
|
||||
../src/thirdparty/freetype/type42/type42.c \
|
||||
../src/thirdparty/freetype/winfonts/winfnt.c
|
||||
|
||||
ccextractor_CFLAGS = -std=gnu99 -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP
|
||||
if SYS_IS_APPLE_SILICON
|
||||
ccextractor_SOURCES += ../src/thirdparty/libpng/arm/arm_init.c \
|
||||
../src/thirdparty/libpng/arm/filter_neon_intrinsics.c \
|
||||
../src/thirdparty/libpng/arm/palette_neon_intrinsics.c
|
||||
endif
|
||||
|
||||
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_CFLAGS = -std=gnu99 -Wno-write-strings -Wno-pointer-sign -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP
|
||||
|
||||
ccextractor_CPPFLAGS =-I../src/lib_ccx/ -I/usr/include/ -I../src/thirdparty/libpng/ -I../src/thirdparty/zlib/ -I../src/lib_ccx/zvbi/ -I../src/thirdparty/lib_hash/ -I../src/thirdparty -I../src/ -I../src/thirdparty/freetype/include/
|
||||
|
||||
|
||||
ccextractor_LDADD=-lm
|
||||
ccextractor_LDADD=-lm -lpthread -ldl -lgpac
|
||||
|
||||
|
||||
if SYS_IS_LINUX
|
||||
ccextractor_CFLAGS += -O3 -s -DGPAC_CONFIG_LINUX
|
||||
ccextractor_CFLAGS += -O3 -s
|
||||
endif
|
||||
|
||||
if SYS_IS_MAC
|
||||
ccextractor_CFLAGS += -DPAC_CONFIG_DARWIN -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek
|
||||
ccextractor_LDADD += -liconv -lz
|
||||
ccextractor_LDADD += -liconv -lz
|
||||
endif
|
||||
|
||||
if SYS_IS_64_BIT
|
||||
ccextractor_CFLAGS += -DGPAC_64_BITS
|
||||
endif
|
||||
|
||||
HARDSUBX_FEATURE_RUST=
|
||||
|
||||
if HARDSUBX_IS_ENABLED
|
||||
ccextractor_CFLAGS += -DENABLE_HARDSUBX
|
||||
ccextractor_CPPFLAGS+= ${libavcodec_CFLAGS}
|
||||
ccextractor_CPPFLAGS+= ${libavformat_CFLAGS}
|
||||
ccextractor_CPPFLAGS+= ${libavfilter_CFLAGS}
|
||||
ccextractor_CPPFLAGS+= ${libavutil_CFALGS}
|
||||
ccextractor_CPPFLAGS+= ${libswscale_CFLAGS}
|
||||
# HARDSUBX requires tesseract/leptonica for OCR (same as OCR feature)
|
||||
ccextractor_CPPFLAGS+= ${tesseract_CFLAGS}
|
||||
ccextractor_CPPFLAGS+= ${lept_CFLAGS}
|
||||
AV_LIB = ${libavcodec_LIBS}
|
||||
AV_LIB += ${libavformat_LIBS}
|
||||
AV_LIB += ${libavfilter_LIBS}
|
||||
AV_LIB += ${libavutil_LIBS}
|
||||
AV_LIB += ${libswscale_LIBS}
|
||||
ccextractor_LDADD += $(AV_LIB)
|
||||
# HARDSUBX requires tesseract/leptonica libs for OCR
|
||||
ccextractor_LDADD += ${tesseract_LIBS}
|
||||
ccextractor_LDADD += ${lept_LIBS}
|
||||
HARDSUBX_FEATURE_RUST += --features "hardsubx_ocr"
|
||||
endif
|
||||
|
||||
if OCR_IS_ENABLED
|
||||
@@ -367,64 +335,17 @@ 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/
|
||||
ccextractor_LDADD += ./rust/@RUST_TARGET_SUBDIR@/libccx_rust.a
|
||||
|
||||
#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
|
||||
if DEBUG_RELEASE
|
||||
CARGO_RELEASE_ARGS=
|
||||
else
|
||||
CARGO_RELEASE_ARGS=--release
|
||||
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
|
||||
./rust/@RUST_TARGET_SUBDIR@/libccx_rust.a:
|
||||
cd ../src/rust && \
|
||||
CARGO_TARGET_DIR=../../linux/rust $(CARGO) build $(HARDSUBX_FEATURE_RUST) $(CARGO_RELEASE_ARGS);
|
||||
|
||||
if HARDSUBX_IS_ENABLED
|
||||
if OCR_IS_ENABLED
|
||||
ccextractorGUI_CFLAGS += -DENABLE_OCR
|
||||
endif
|
||||
endif
|
||||
|
||||
EXTRA_DIST += ../icon/ ../fonts/
|
||||
|
||||
endif
|
||||
EXTRA_DIST = /usr/include/gpac/sync_layer.h ../src/lib_ccx/ccfont2.xbm ../src/thirdparty/utf8proc/utf8proc_data.c fonts/ icon/
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
./pre-build.sh
|
||||
autoreconf -i
|
||||
|
||||
224
linux/build
224
linux/build
@@ -1,68 +1,178 @@
|
||||
#!/bin/bash
|
||||
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP"
|
||||
#!/usr/bin/env bash
|
||||
|
||||
RUST_LIB="rust/release/libccx_rust.a"
|
||||
RUST_PROFILE="--release"
|
||||
USE_SYSTEM_LIBS=false
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
-debug)
|
||||
DEBUG=true
|
||||
BLD_FLAGS="$BLD_FLAGS -g -fsanitize=address"
|
||||
RUST_PROFILE=""
|
||||
RUST_LIB="rust/debug/libccx_rust.a"
|
||||
shift
|
||||
;;
|
||||
-hardsubx)
|
||||
HARDSUBX=true
|
||||
# Allow overriding FFmpeg version via environment variable
|
||||
if [ -n "$FFMPEG_VERSION" ]; then
|
||||
RUST_FEATURES="--features hardsubx_ocr,$FFMPEG_VERSION"
|
||||
else
|
||||
RUST_FEATURES="--features hardsubx_ocr"
|
||||
fi
|
||||
BLD_FLAGS="$BLD_FLAGS -DENABLE_HARDSUBX"
|
||||
BLD_LINKER="$BLD_LINKER -lswscale -lavutil -pthread -lavformat -lavcodec -lavfilter -lxcb-shm -lxcb -lX11 -llzma -lswresample"
|
||||
shift
|
||||
;;
|
||||
-system-libs)
|
||||
USE_SYSTEM_LIBS=true
|
||||
shift
|
||||
;;
|
||||
-*)
|
||||
echo "Unknown option $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$USE_SYSTEM_LIBS" = true ]; then
|
||||
command -v pkg-config >/dev/null || {
|
||||
echo "Error: pkg-config is required for -system-libs mode"
|
||||
exit 1
|
||||
}
|
||||
|
||||
MISSING=""
|
||||
for lib in libpng zlib freetype2 libutf8proc; do
|
||||
if ! pkg-config --exists "$lib" 2>/dev/null; then
|
||||
MISSING="$MISSING $lib"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$MISSING" ]; then
|
||||
echo "Error: Missing required system libraries:$MISSING"
|
||||
echo ""
|
||||
echo "On Debian/Ubuntu: sudo apt install libpng-dev zlib1g-dev libfreetype-dev libutf8proc-dev"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for hdr in leptonica/allheaders.h tesseract/capi.h; do
|
||||
if ! echo "#include <$hdr>" | gcc -E - >/dev/null 2>&1; then
|
||||
echo "Error: Missing headers for <$hdr>"
|
||||
echo "On Debian/Ubuntu: sudo apt install libleptonica-dev libtesseract-dev"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
PKG_CFLAGS="$(pkg-config --cflags libpng zlib freetype2 libutf8proc)"
|
||||
PKG_LIBS="$(pkg-config --libs libpng zlib freetype2 libutf8proc)"
|
||||
fi
|
||||
|
||||
BLD_FLAGS="$BLD_FLAGS -std=gnu99 -Wno-write-strings -Wno-pointer-sign -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP"
|
||||
if [ "$USE_SYSTEM_LIBS" != true ]; then
|
||||
BLD_FLAGS="$BLD_FLAGS -DFT2_BUILD_LIBRARY"
|
||||
fi
|
||||
bit_os=$(getconf LONG_BIT)
|
||||
if [ "$bit_os"=="64" ]
|
||||
if [ "$bit_os" == "64" ]
|
||||
then
|
||||
BLD_FLAGS="$BLD_FLAGS -DGPAC_64_BITS"
|
||||
fi
|
||||
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')"
|
||||
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I /usr/include/gpac/ -I../src/thirdparty/libpng -I../src/thirdparty/zlib -I../src/lib_ccx/zvbi -I../src/thirdparty/lib_hash -I../src/thirdparty -I../src/thirdparty/freetype/include"
|
||||
SRC_LIBPNG="$(find ../src/thirdparty/libpng/ -name '*.c')"
|
||||
SRC_ZLIB="$(find ../src/thirdparty/zlib/ -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"
|
||||
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')"
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $SRC_FREETYPE"
|
||||
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept"
|
||||
SRC_GPAC="$(find /usr/include/gpac/ -name '*.c' 2>/dev/null)"
|
||||
SRC_HASH="$(find ../src/thirdparty/lib_hash/ -name '*.c')"
|
||||
SRC_UTF8PROC="../src/thirdparty/utf8proc/utf8proc.c"
|
||||
SRC_FREETYPE="../src/thirdparty/freetype/autofit/autofit.c
|
||||
../src/thirdparty/freetype/base/ftbase.c
|
||||
../src/thirdparty/freetype/base/ftbbox.c
|
||||
../src/thirdparty/freetype/base/ftbdf.c
|
||||
../src/thirdparty/freetype/base/ftbitmap.c
|
||||
../src/thirdparty/freetype/base/ftcid.c
|
||||
../src/thirdparty/freetype/base/ftfntfmt.c
|
||||
../src/thirdparty/freetype/base/ftfstype.c
|
||||
../src/thirdparty/freetype/base/ftgasp.c
|
||||
../src/thirdparty/freetype/base/ftglyph.c
|
||||
../src/thirdparty/freetype/base/ftgxval.c
|
||||
../src/thirdparty/freetype/base/ftinit.c
|
||||
../src/thirdparty/freetype/base/ftlcdfil.c
|
||||
../src/thirdparty/freetype/base/ftmm.c
|
||||
../src/thirdparty/freetype/base/ftotval.c
|
||||
../src/thirdparty/freetype/base/ftpatent.c
|
||||
../src/thirdparty/freetype/base/ftpfr.c
|
||||
../src/thirdparty/freetype/base/ftstroke.c
|
||||
../src/thirdparty/freetype/base/ftsynth.c
|
||||
../src/thirdparty/freetype/base/ftsystem.c
|
||||
../src/thirdparty/freetype/base/fttype1.c
|
||||
../src/thirdparty/freetype/base/ftwinfnt.c
|
||||
../src/thirdparty/freetype/bdf/bdf.c
|
||||
../src/thirdparty/freetype/bzip2/ftbzip2.c
|
||||
../src/thirdparty/freetype/cache/ftcache.c
|
||||
../src/thirdparty/freetype/cff/cff.c
|
||||
../src/thirdparty/freetype/cid/type1cid.c
|
||||
../src/thirdparty/freetype/gzip/ftgzip.c
|
||||
../src/thirdparty/freetype/lzw/ftlzw.c
|
||||
../src/thirdparty/freetype/pcf/pcf.c
|
||||
../src/thirdparty/freetype/pfr/pfr.c
|
||||
../src/thirdparty/freetype/psaux/psaux.c
|
||||
../src/thirdparty/freetype/pshinter/pshinter.c
|
||||
../src/thirdparty/freetype/psnames/psnames.c
|
||||
../src/thirdparty/freetype/raster/raster.c
|
||||
../src/thirdparty/freetype/sfnt/sfnt.c
|
||||
../src/thirdparty/freetype/smooth/smooth.c
|
||||
../src/thirdparty/freetype/truetype/truetype.c
|
||||
../src/thirdparty/freetype/type1/type1.c
|
||||
../src/thirdparty/freetype/type42/type42.c
|
||||
../src/thirdparty/freetype/winfonts/winfnt.c"
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_LIBPNG $SRC_HASH $SRC_UTF8PROC $SRC_FREETYPE"
|
||||
BLD_LINKER="$BLD_LINKER -lm -zmuldefs -l tesseract -l leptonica -lpthread -ldl -lgpac"
|
||||
|
||||
if [ "$USE_SYSTEM_LIBS" = true ]; then
|
||||
LEPTONICA_CFLAGS="$(pkg-config --cflags --silence-errors lept)"
|
||||
TESSERACT_CFLAGS="$(pkg-config --cflags --silence-errors tesseract)"
|
||||
GPAC_CFLAGS="$(pkg-config --cflags --silence-errors gpac)"
|
||||
|
||||
BLD_INCLUDE="-I../src -I../src/lib_ccx -I../src/lib_ccx/zvbi -I../src/thirdparty/lib_hash \
|
||||
$PKG_CFLAGS $LEPTONICA_CFLAGS $TESSERACT_CFLAGS $GPAC_CFLAGS"
|
||||
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_HASH"
|
||||
# Preserve FFmpeg libraries if -hardsubx was specified
|
||||
FFMPEG_LIBS=""
|
||||
if [ "$HARDSUBX" = true ]; then
|
||||
FFMPEG_LIBS="-lswscale -lavutil -pthread -lavformat -lavcodec -lavfilter -lxcb-shm -lxcb -lX11 -llzma -lswresample"
|
||||
fi
|
||||
BLD_LINKER="$PKG_LIBS -ltesseract -lleptonica -lgpac -lpthread -ldl -lm $FFMPEG_LIBS"
|
||||
fi
|
||||
|
||||
|
||||
echo "Running pre-build script..."
|
||||
./pre-build.sh
|
||||
echo "Trying to compile..."
|
||||
|
||||
BLD_LINKER="$BLD_LINKER ./libccx_rust.a"
|
||||
echo "Checking for cargo..."
|
||||
if ! [ -x "$(command -v cargo)" ]; then
|
||||
echo 'Error: cargo is not installed.' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rustc_version="$(rustc --version)"
|
||||
semver=( ${rustc_version//./ } )
|
||||
version="${semver[1]}.${semver[2]}.${semver[3]}"
|
||||
MSRV="1.87.0"
|
||||
if [ "$(printf '%s\n' "$MSRV" "$version" | sort -V | head -n1)" = "$MSRV" ]; then
|
||||
echo "rustc >= MSRV(${MSRV})"
|
||||
else
|
||||
echo "Minimum supported rust version(MSRV) is ${MSRV}, please upgrade rust"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Building rust files..."
|
||||
(cd ../src/rust && CARGO_TARGET_DIR=../../linux/rust cargo build $RUST_PROFILE $RUST_FEATURES) || { echo "Failed. " ; exit 1; }
|
||||
|
||||
cp $RUST_LIB ./libccx_rust.a
|
||||
|
||||
echo "Building ccextractor"
|
||||
out=$((LC_ALL=C gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER)2>&1)
|
||||
res=$?
|
||||
if [[ $out == *"gcc: command not found"* ]]
|
||||
@@ -97,3 +207,7 @@ if [[ "$out" != "" ]] ; then
|
||||
else
|
||||
echo "Compilation successful, no compiler messages."
|
||||
fi
|
||||
|
||||
if [ -d ./utf8proc_compat ]; then
|
||||
rm -rf ./utf8proc_compat
|
||||
fi
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
#!/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;
|
||||
230
linux/build_appimage.sh
Executable file
230
linux/build_appimage.sh
Executable file
@@ -0,0 +1,230 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# CCExtractor AppImage Build Script
|
||||
#
|
||||
# Build variants via BUILD_TYPE environment variable:
|
||||
# - minimal: Basic CCExtractor without OCR (smallest size)
|
||||
# - ocr: CCExtractor with OCR support (default)
|
||||
# - hardsubx: CCExtractor with burned-in subtitle extraction (requires FFmpeg)
|
||||
#
|
||||
# Usage:
|
||||
# ./build_appimage.sh # Builds 'ocr' variant (default)
|
||||
# BUILD_TYPE=minimal ./build_appimage.sh
|
||||
# BUILD_TYPE=hardsubx ./build_appimage.sh
|
||||
#
|
||||
# Requirements:
|
||||
# - CMake, GCC, pkg-config, Rust toolchain
|
||||
# - For OCR: tesseract-ocr, libtesseract-dev, libleptonica-dev
|
||||
# - For HardSubX: libavcodec-dev, libavformat-dev, libswscale-dev, etc.
|
||||
# - wget for downloading linuxdeploy
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
# Build type: minimal, ocr, hardsubx (default: ocr)
|
||||
BUILD_TYPE="${BUILD_TYPE:-ocr}"
|
||||
|
||||
echo "=========================================="
|
||||
echo "CCExtractor AppImage Builder"
|
||||
echo "Build type: $BUILD_TYPE"
|
||||
echo "=========================================="
|
||||
|
||||
# Validate build type
|
||||
case "$BUILD_TYPE" in
|
||||
minimal|ocr|hardsubx)
|
||||
;;
|
||||
*)
|
||||
echo "Error: Invalid BUILD_TYPE '$BUILD_TYPE'"
|
||||
echo "Valid options: minimal, ocr, hardsubx"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Store paths
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(dirname "$SCRIPT_DIR")"
|
||||
BUILD_DIR="$SCRIPT_DIR/appimage_build"
|
||||
|
||||
# Clean up function
|
||||
cleanup() {
|
||||
if [ -d "$BUILD_DIR" ]; then
|
||||
echo "Cleaning up build directory..."
|
||||
rm -rf "$BUILD_DIR"
|
||||
fi
|
||||
}
|
||||
|
||||
# Cleanup on exit (comment out for debugging)
|
||||
trap cleanup EXIT
|
||||
|
||||
# Create fresh build directory
|
||||
rm -rf "$BUILD_DIR" 2>/dev/null || true
|
||||
mkdir -p "$BUILD_DIR"
|
||||
|
||||
cd "$BUILD_DIR"
|
||||
|
||||
# Determine CMake options based on build type
|
||||
CMAKE_OPTIONS=""
|
||||
case "$BUILD_TYPE" in
|
||||
minimal)
|
||||
CMAKE_OPTIONS=""
|
||||
;;
|
||||
ocr)
|
||||
CMAKE_OPTIONS="-DWITH_OCR=ON"
|
||||
;;
|
||||
hardsubx)
|
||||
CMAKE_OPTIONS="-DWITH_OCR=ON -DWITH_HARDSUBX=ON -DWITH_FFMPEG=ON"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "CMake options: $CMAKE_OPTIONS"
|
||||
|
||||
# Configure with CMake
|
||||
echo "Configuring with CMake..."
|
||||
cmake $CMAKE_OPTIONS "$REPO_ROOT/src"
|
||||
|
||||
# Build
|
||||
echo "Building CCExtractor..."
|
||||
make -j$(nproc)
|
||||
|
||||
# Verify binary was built
|
||||
if [ ! -f "$BUILD_DIR/ccextractor" ]; then
|
||||
echo "Error: ccextractor binary not found after build"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Build successful!"
|
||||
"$BUILD_DIR/ccextractor" --version
|
||||
|
||||
# Download linuxdeploy
|
||||
echo "Downloading linuxdeploy..."
|
||||
LINUXDEPLOY_URL="https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
|
||||
wget -q --show-progress "$LINUXDEPLOY_URL" -O linuxdeploy-x86_64.AppImage
|
||||
chmod +x linuxdeploy-x86_64.AppImage
|
||||
|
||||
# Create AppDir structure
|
||||
echo "Creating AppDir structure..."
|
||||
mkdir -p AppDir/usr/bin
|
||||
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
|
||||
mkdir -p AppDir/usr/share/applications
|
||||
mkdir -p AppDir/usr/share/tessdata
|
||||
|
||||
# Copy binary
|
||||
cp "$BUILD_DIR/ccextractor" AppDir/usr/bin/
|
||||
|
||||
# Download icon
|
||||
echo "Downloading icon..."
|
||||
PNG_URL="https://ccextractor.org/images/ccextractor.png"
|
||||
if wget -q "$PNG_URL" -O AppDir/usr/share/icons/hicolor/256x256/apps/ccextractor.png 2>/dev/null; then
|
||||
echo "Icon downloaded successfully"
|
||||
else
|
||||
# Create a simple placeholder icon if download fails
|
||||
echo "Warning: Could not download icon, creating placeholder"
|
||||
convert -size 256x256 xc:navy -fill white -gravity center -pointsize 40 -annotate 0 "CCX" \
|
||||
AppDir/usr/share/icons/hicolor/256x256/apps/ccextractor.png 2>/dev/null || \
|
||||
echo "P3 256 256 255" > AppDir/usr/share/icons/hicolor/256x256/apps/ccextractor.ppm
|
||||
fi
|
||||
|
||||
# Create desktop file
|
||||
cat > AppDir/usr/share/applications/ccextractor.desktop << 'EOF'
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=CCExtractor
|
||||
Comment=Extract closed captions and subtitles from video files
|
||||
Exec=ccextractor
|
||||
Icon=ccextractor
|
||||
Categories=AudioVideo;Video;
|
||||
Terminal=true
|
||||
NoDisplay=true
|
||||
EOF
|
||||
|
||||
# Copy desktop file to AppDir root (required by linuxdeploy)
|
||||
cp AppDir/usr/share/applications/ccextractor.desktop AppDir/
|
||||
|
||||
# Copy icon to AppDir root
|
||||
cp AppDir/usr/share/icons/hicolor/256x256/apps/ccextractor.png AppDir/ 2>/dev/null || true
|
||||
|
||||
# For OCR builds, bundle tessdata
|
||||
if [ "$BUILD_TYPE" = "ocr" ] || [ "$BUILD_TYPE" = "hardsubx" ]; then
|
||||
echo "Bundling tessdata for OCR support..."
|
||||
|
||||
# Try to find system tessdata
|
||||
TESSDATA_PATHS=(
|
||||
"/usr/share/tesseract-ocr/5/tessdata"
|
||||
"/usr/share/tesseract-ocr/4.00/tessdata"
|
||||
"/usr/share/tessdata"
|
||||
"/usr/local/share/tessdata"
|
||||
)
|
||||
|
||||
TESSDATA_SRC=""
|
||||
for path in "${TESSDATA_PATHS[@]}"; do
|
||||
if [ -d "$path" ] && [ -f "$path/eng.traineddata" ]; then
|
||||
TESSDATA_SRC="$path"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$TESSDATA_SRC" ]; then
|
||||
echo "Found tessdata at: $TESSDATA_SRC"
|
||||
# Copy English language data (most common)
|
||||
cp "$TESSDATA_SRC/eng.traineddata" AppDir/usr/share/tessdata/ 2>/dev/null || true
|
||||
# Copy OSD (orientation and script detection) if available
|
||||
cp "$TESSDATA_SRC/osd.traineddata" AppDir/usr/share/tessdata/ 2>/dev/null || true
|
||||
else
|
||||
echo "Warning: tessdata not found, downloading English language data..."
|
||||
wget -q "https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata" \
|
||||
-O AppDir/usr/share/tessdata/eng.traineddata || true
|
||||
fi
|
||||
|
||||
# Create wrapper script that sets TESSDATA_PREFIX
|
||||
mv AppDir/usr/bin/ccextractor AppDir/usr/bin/ccextractor.bin
|
||||
cat > AppDir/usr/bin/ccextractor << 'WRAPPER'
|
||||
#!/bin/bash
|
||||
SELF_DIR="$(dirname "$(readlink -f "$0")")"
|
||||
export TESSDATA_PREFIX="${SELF_DIR}/../share/tessdata"
|
||||
exec "${SELF_DIR}/ccextractor.bin" "$@"
|
||||
WRAPPER
|
||||
chmod +x AppDir/usr/bin/ccextractor
|
||||
fi
|
||||
|
||||
# Determine output name based on build type
|
||||
ARCH="x86_64"
|
||||
case "$BUILD_TYPE" in
|
||||
minimal)
|
||||
OUTPUT_NAME="ccextractor-minimal-${ARCH}.AppImage"
|
||||
;;
|
||||
ocr)
|
||||
OUTPUT_NAME="ccextractor-${ARCH}.AppImage"
|
||||
;;
|
||||
hardsubx)
|
||||
OUTPUT_NAME="ccextractor-hardsubx-${ARCH}.AppImage"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Build AppImage
|
||||
echo "Building AppImage..."
|
||||
export OUTPUT="$OUTPUT_NAME"
|
||||
|
||||
# Determine which executable to pass to linuxdeploy
|
||||
# For OCR builds, we have a wrapper script, so pass the actual binary (.bin)
|
||||
if [ -f "AppDir/usr/bin/ccextractor.bin" ]; then
|
||||
LINUXDEPLOY_EXEC="AppDir/usr/bin/ccextractor.bin"
|
||||
else
|
||||
LINUXDEPLOY_EXEC="AppDir/usr/bin/ccextractor"
|
||||
fi
|
||||
|
||||
./linuxdeploy-x86_64.AppImage \
|
||||
--appdir=AppDir \
|
||||
--executable="$LINUXDEPLOY_EXEC" \
|
||||
--desktop-file=AppDir/ccextractor.desktop \
|
||||
--icon-file=AppDir/ccextractor.png \
|
||||
--output=appimage
|
||||
|
||||
# Move to output directory
|
||||
mv "$OUTPUT_NAME" "$SCRIPT_DIR/"
|
||||
|
||||
echo "=========================================="
|
||||
echo "AppImage built successfully!"
|
||||
echo "Output: $SCRIPT_DIR/$OUTPUT_NAME"
|
||||
echo ""
|
||||
echo "Test with: $SCRIPT_DIR/$OUTPUT_NAME --version"
|
||||
echo "=========================================="
|
||||
@@ -1,64 +1,3 @@
|
||||
#!/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 -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP"
|
||||
bit_os=$(getconf LONG_BIT)
|
||||
if [ "$bit_os"=="64" ]
|
||||
then
|
||||
BLD_FLAGS="$BLD_FLAGS -DGPAC_64_BITS"
|
||||
fi
|
||||
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')"
|
||||
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')"
|
||||
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 $API_WRAPPERS $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"
|
||||
#!/usr/bin/env bash
|
||||
|
||||
./pre-build.sh
|
||||
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER
|
||||
./build -hardsubx
|
||||
|
||||
100
linux/builddebug
100
linux/builddebug
@@ -1,99 +1,3 @@
|
||||
#!/bin/bash
|
||||
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP"
|
||||
bit_os=$(getconf LONG_BIT)
|
||||
if [ "$bit_os"=="64" ]
|
||||
then
|
||||
BLD_FLAGS="$BLD_FLAGS -DGPAC_64_BITS"
|
||||
fi
|
||||
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')"
|
||||
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"
|
||||
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')"
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $SRC_FREETYPE"
|
||||
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept"
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "Running pre-build script..."
|
||||
./pre-build.sh
|
||||
echo "Trying to compile..."
|
||||
|
||||
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 (libtesseract-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
|
||||
if [[ "$out" != "" ]] ; then
|
||||
echo "$out"
|
||||
echo "Compilation successful, compiler message shown in previous lines"
|
||||
else
|
||||
echo "Compilation successful, no compiler messages."
|
||||
fi
|
||||
./build -debug
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
make distclean > /dev/null 2>&1 || true
|
||||
rm -rf Makefile configure *.in config.status config.log aclocal.m4 build-conf autom4te.cache
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT([CCExtractor], [0.88], [carlos@ccextractor.org])
|
||||
AC_PREREQ([2.71])
|
||||
AC_INIT([CCExtractor], [0.96.5], [carlos@ccextractor.org])
|
||||
AC_CONFIG_AUX_DIR([build-conf])
|
||||
AC_CONFIG_SRCDIR([../src/ccextractor.c])
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||
|
||||
AC_CONFIG_MACRO_DIRS([m4])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
@@ -15,7 +15,7 @@ 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
|
||||
if test m4_ifdef([PKG_CHECK_MODULES], [yes], [no]) = yes; then
|
||||
AC_MSG_RESULT([yes]);
|
||||
else
|
||||
AC_MSG_RESULT([no]);
|
||||
@@ -25,13 +25,18 @@ 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([leptonica], [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])
|
||||
|
||||
# Check for GPAC library (required for MP4 support)
|
||||
PKG_CHECK_MODULES([gpac], [gpac], [HAS_GPAC=1], [HAS_GPAC=0])
|
||||
AS_IF([test $HAS_GPAC -eq 0],
|
||||
[AC_MSG_ERROR([GPAC library not found. Install gpac-devel (Fedora/RHEL), libgpac-dev (Debian/Ubuntu), or gpac (Arch) before proceeding.])])
|
||||
|
||||
# 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])
|
||||
|
||||
@@ -63,7 +68,7 @@ AC_CHECK_FUNCS([floor ftruncate gethostbyname gettimeofday inet_ntoa mblen memch
|
||||
|
||||
# Checks for arguments with configure
|
||||
AC_ARG_ENABLE([hardsubx],
|
||||
AC_HELP_STRING([--enable-hardsubx], [Enables extraction of burnt subtitles (hard subtitles)]),
|
||||
AS_HELP_STRING([--enable-hardsubx], [Enables extraction of burnt subtitles (hard subtitles)]),
|
||||
[case "${enableval}" in
|
||||
yes) hardsubx=true ;;
|
||||
no) hardsubx=false ;;
|
||||
@@ -71,7 +76,7 @@ AC_HELP_STRING([--enable-hardsubx], [Enables extraction of burnt subtitles (hard
|
||||
esac],[hardsubx=false])
|
||||
|
||||
AC_ARG_ENABLE([ocr],
|
||||
AC_HELP_STRING([--enable-ocr], [Enables Optical Character Recognition]),
|
||||
AS_HELP_STRING([--enable-ocr], [Enables Optical Character Recognition]),
|
||||
[case "${enableval}" in
|
||||
yes) ocr=true ;;
|
||||
no) ocr=false ;;
|
||||
@@ -79,18 +84,57 @@ AC_HELP_STRING([--enable-ocr], [Enables Optical Character Recognition]),
|
||||
esac],[ocr=false])
|
||||
|
||||
AC_ARG_ENABLE([ffmpeg],
|
||||
AC_HELP_STRING([--enable-ffmpeg], [Enable FFmpeg integration]),
|
||||
AS_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])
|
||||
#Add argument for rust
|
||||
AC_ARG_WITH([rust],
|
||||
AS_HELP_STRING([--with-rust], [Builds CCExtractor with rust library]),
|
||||
[with_rust=$withval],
|
||||
[with_rust=yes])
|
||||
|
||||
AC_MSG_CHECKING(whether to build with rust library)
|
||||
if test "x$with_rust" = "xyes" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
|
||||
#Check if cargo and rust is installed
|
||||
AC_PATH_PROG([CARGO], [cargo], [notfound])
|
||||
AS_IF([test "$CARGO" = "notfound"], [AC_MSG_ERROR([cargo is required])])
|
||||
|
||||
AC_PATH_PROG([RUSTC], [rustc], [notfound])
|
||||
AS_IF([test "$RUSTC" = "notfound"], [AC_MSG_ERROR([rustc is required])])
|
||||
|
||||
rustc_version=$(rustc --version)
|
||||
MSRV="1.87.0"
|
||||
AX_COMPARE_VERSION($rustc_version, [ge], [$MSRV],
|
||||
[AC_MSG_RESULT(rustc >= $MSRV)],
|
||||
[AC_MSG_ERROR([Minimum supported rust version(MSRV) is $MSRV, please upgrade rust])])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_RUST], [test "x$with_rust" = "xyes"])
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
AS_HELP_STRING([--enable-debug],
|
||||
[Build Rust code with debugging information [default=no]]),
|
||||
[debug_release=$enableval],
|
||||
[debug_release=no])
|
||||
|
||||
AC_MSG_CHECKING(whether to build Rust code with debugging information)
|
||||
if test "x$debug_release" = "xyes" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
RUST_TARGET_SUBDIR=debug
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
RUST_TARGET_SUBDIR=release
|
||||
fi
|
||||
AM_CONDITIONAL([DEBUG_RELEASE], [test "x$debug_release" = "xyes"])
|
||||
|
||||
AC_SUBST([RUST_TARGET_SUBDIR])
|
||||
|
||||
#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)])
|
||||
@@ -101,21 +145,21 @@ AS_IF([ test x$hardsubx = xtrue && test $HAS_AVUTIL -gt 0 ], [AC_MSG_NOTICE(avut
|
||||
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 ], [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 ], [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"])
|
||||
AM_CONDITIONAL(SYS_IS_64_BIT,[test `getconf LONG_BIT` = "64"])
|
||||
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(SYS_IS_APPLE_SILICON, [ test $(uname -a | awk '{print $NF}') = "arm64" ])
|
||||
AM_CONDITIONAL(SYS_IS_64_BIT,[test $(getconf LONG_BIT) = "64"])
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
177
linux/m4/ax_compare_version.m4
Normal file
177
linux/m4/ax_compare_version.m4
Normal file
@@ -0,0 +1,177 @@
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_compare_version.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro compares two version strings. Due to the various number of
|
||||
# minor-version numbers that can exist, and the fact that string
|
||||
# comparisons are not compatible with numeric comparisons, this is not
|
||||
# necessarily trivial to do in a autoconf script. This macro makes doing
|
||||
# these comparisons easy.
|
||||
#
|
||||
# The six basic comparisons are available, as well as checking equality
|
||||
# limited to a certain number of minor-version levels.
|
||||
#
|
||||
# The operator OP determines what type of comparison to do, and can be one
|
||||
# of:
|
||||
#
|
||||
# eq - equal (test A == B)
|
||||
# ne - not equal (test A != B)
|
||||
# le - less than or equal (test A <= B)
|
||||
# ge - greater than or equal (test A >= B)
|
||||
# lt - less than (test A < B)
|
||||
# gt - greater than (test A > B)
|
||||
#
|
||||
# Additionally, the eq and ne operator can have a number after it to limit
|
||||
# the test to that number of minor versions.
|
||||
#
|
||||
# eq0 - equal up to the length of the shorter version
|
||||
# ne0 - not equal up to the length of the shorter version
|
||||
# eqN - equal up to N sub-version levels
|
||||
# neN - not equal up to N sub-version levels
|
||||
#
|
||||
# When the condition is true, shell commands ACTION-IF-TRUE are run,
|
||||
# otherwise shell commands ACTION-IF-FALSE are run. The environment
|
||||
# variable 'ax_compare_version' is always set to either 'true' or 'false'
|
||||
# as well.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
|
||||
# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
|
||||
#
|
||||
# would both be true.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
|
||||
# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
|
||||
#
|
||||
# would both be false.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
|
||||
#
|
||||
# would be true because it is only comparing two minor versions.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
|
||||
#
|
||||
# would be true because it is only comparing the lesser number of minor
|
||||
# versions of the two values.
|
||||
#
|
||||
# Note: The characters that separate the version numbers do not matter. An
|
||||
# empty string is the same as version 0. OP is evaluated by autoconf, not
|
||||
# configure, so must be a string, not a variable.
|
||||
#
|
||||
# The author would like to acknowledge Guido Draheim whose advice about
|
||||
# the m4_case and m4_ifvaln functions make this macro only include the
|
||||
# portions necessary to perform the specific comparison specified by the
|
||||
# OP argument in the final configure script.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 13
|
||||
|
||||
dnl #########################################################################
|
||||
AC_DEFUN([AX_COMPARE_VERSION], [
|
||||
AC_REQUIRE([AC_PROG_AWK])
|
||||
|
||||
# Used to indicate true or false condition
|
||||
ax_compare_version=false
|
||||
|
||||
# Convert the two version strings to be compared into a format that
|
||||
# allows a simple string comparison. The end result is that a version
|
||||
# string of the form 1.12.5-r617 will be converted to the form
|
||||
# 0001001200050617. In other words, each number is zero padded to four
|
||||
# digits, and non digits are removed.
|
||||
AS_VAR_PUSHDEF([A],[ax_compare_version_A])
|
||||
A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
|
||||
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/[[^0-9]]//g'`
|
||||
|
||||
AS_VAR_PUSHDEF([B],[ax_compare_version_B])
|
||||
B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
|
||||
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/[[^0-9]]//g'`
|
||||
|
||||
dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
|
||||
dnl # then the first line is used to determine if the condition is true.
|
||||
dnl # The sed right after the echo is to remove any indented white space.
|
||||
m4_case(m4_tolower($2),
|
||||
[lt],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
|
||||
],
|
||||
[gt],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
|
||||
],
|
||||
[le],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
|
||||
],
|
||||
[ge],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
|
||||
],[
|
||||
dnl Split the operator from the subversion count if present.
|
||||
m4_bmatch(m4_substr($2,2),
|
||||
[0],[
|
||||
# A count of zero means use the length of the shorter version.
|
||||
# Determine the number of characters in A and B.
|
||||
ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
|
||||
ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
|
||||
|
||||
# Set A to no more than B's length and B to no more than A's length.
|
||||
A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
|
||||
B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
|
||||
],
|
||||
[[0-9]+],[
|
||||
# A count greater than zero means use only that many subversions
|
||||
A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
|
||||
B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
|
||||
],
|
||||
[.+],[
|
||||
AC_WARNING(
|
||||
[invalid OP numeric parameter: $2])
|
||||
],[])
|
||||
|
||||
# Pad zeros at end of numbers to make same length.
|
||||
ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
|
||||
B="$B`echo $A | sed 's/./0/g'`"
|
||||
A="$ax_compare_version_tmp_A"
|
||||
|
||||
# Check for equality or inequality as necessary.
|
||||
m4_case(m4_tolower(m4_substr($2,0,2)),
|
||||
[eq],[
|
||||
test "x$A" = "x$B" && ax_compare_version=true
|
||||
],
|
||||
[ne],[
|
||||
test "x$A" != "x$B" && ax_compare_version=true
|
||||
],[
|
||||
AC_WARNING([invalid OP parameter: $2])
|
||||
])
|
||||
])
|
||||
|
||||
AS_VAR_POPDEF([A])dnl
|
||||
AS_VAR_POPDEF([B])dnl
|
||||
|
||||
dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
|
||||
if test "$ax_compare_version" = "true" ; then
|
||||
m4_ifvaln([$4],[$4],[:])dnl
|
||||
m4_ifvaln([$5],[else $5])dnl
|
||||
fi
|
||||
]) dnl AX_COMPARE_VERSION
|
||||
@@ -1,13 +1,10 @@
|
||||
#!/bin/bash
|
||||
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
|
||||
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
|
||||
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
|
||||
#!/usr/bin/env bash
|
||||
SRC_LIBPNG="$(find ../src/thirdparty/libpng/ -name '*.c')"
|
||||
SRC_ZLIB="$(find ../src/thirdparty/zlib/ -name '*.c')"
|
||||
SRC_ZVBI="$(find ../src/thirdparty/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_HASH="$(find ../src/thirdparty/lib_hash/ -name '*.c')"
|
||||
SRC_UTF8PROC="../src/utf8proc/utf8proc.c"
|
||||
API_WRAPPERS="$(find ../src/wrappers/ -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"
|
||||
BLD_SOURCES="../src/ccextractor.c ../src/ccextractorapi_wrap.c $SRC_CCX $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_UTF8PROC"
|
||||
|
||||
python setup.py $BLD_SOURCES
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
echo "Obtaining Git commit"
|
||||
commit=(`git rev-parse HEAD 2>/dev/null`)
|
||||
if [ -z "$commit" ]; then
|
||||
|
||||
404
mac/Makefile.am
404
mac/Makefile.am
@@ -1,116 +1,39 @@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4/
|
||||
|
||||
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_dump.c \
|
||||
../src/gpacmp4/box_code_meta.c \
|
||||
../src/gpacmp4/box_funcs.c \
|
||||
../src/gpacmp4/color.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/hint_track.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/color.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/maths.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/thirdparty/libpng/pngstruct.h \
|
||||
../src/thirdparty/libpng/pngpriv.h \
|
||||
../src/thirdparty/libpng/pnginfo.h \
|
||||
../src/thirdparty/libpng/pnglibconf.h \
|
||||
../src/thirdparty/libpng/pngconf.h \
|
||||
../src/thirdparty/libpng/pngdebug.h \
|
||||
../src/thirdparty/libpng/png.h \
|
||||
../src/thirdparty/libpng/png.c \
|
||||
../src/thirdparty/libpng/pngerror.c \
|
||||
../src/thirdparty/libpng/pngget.c \
|
||||
../src/thirdparty/libpng/pngmem.c \
|
||||
../src/thirdparty/libpng/pngpread.c \
|
||||
../src/thirdparty/libpng/pngread.c \
|
||||
../src/thirdparty/libpng/pngrio.c \
|
||||
../src/thirdparty/libpng/pngrtran.c \
|
||||
../src/thirdparty/libpng/pngrutil.c \
|
||||
../src/thirdparty/libpng/pngset.c \
|
||||
../src/thirdparty/libpng/pngtrans.c \
|
||||
../src/thirdparty/libpng/pngwio.c \
|
||||
../src/thirdparty/libpng/pngwrite.c \
|
||||
../src/thirdparty/libpng/pngwtran.c \
|
||||
../src/thirdparty/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/cc_bitstream.h \
|
||||
../src/lib_ccx/ccx_common_option.c \
|
||||
../src/lib_ccx/ccx_common_common.c \
|
||||
../src/lib_ccx/utility.c \
|
||||
@@ -155,8 +78,10 @@ ccextractor_SOURCES = \
|
||||
../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_mcc.c \
|
||||
../src/lib_ccx/ccx_encoders_mcc.h \
|
||||
../src/lib_ccx/ccx_encoders_sami.c \
|
||||
../src/lib_ccx/ccx_encoders_scc.c \
|
||||
../src/lib_ccx/ccx_encoders_smptett.c \
|
||||
../src/lib_ccx/ccx_encoders_splitbysentence.c \
|
||||
../src/lib_ccx/ccx_encoders_spupng.c \
|
||||
@@ -170,10 +95,6 @@ ccextractor_SOURCES = \
|
||||
../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 \
|
||||
@@ -202,6 +123,9 @@ ccextractor_SOURCES = \
|
||||
../src/lib_ccx/list.h \
|
||||
../src/lib_ccx/matroska.c \
|
||||
../src/lib_ccx/matroska.h \
|
||||
../src/lib_ccx/vobsub_decoder.c \
|
||||
../src/lib_ccx/vobsub_decoder.h \
|
||||
../src/lib_ccx/mp4.c \
|
||||
../src/lib_ccx/myth.c \
|
||||
../src/lib_ccx/networking.c \
|
||||
../src/lib_ccx/networking.h \
|
||||
@@ -222,122 +146,136 @@ ccextractor_SOURCES = \
|
||||
../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/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
|
||||
|
||||
../src/thirdparty/zlib/adler32.c \
|
||||
../src/thirdparty/zlib/compress.c \
|
||||
../src/thirdparty/zlib/crc32.c \
|
||||
../src/thirdparty/zlib/crc32.h \
|
||||
../src/thirdparty/zlib/deflate.c \
|
||||
../src/thirdparty/zlib/deflate.h \
|
||||
../src/thirdparty/zlib/gzclose.c \
|
||||
../src/thirdparty/zlib/gzguts.h \
|
||||
../src/thirdparty/zlib/gzlib.c \
|
||||
../src/thirdparty/zlib/gzread.c \
|
||||
../src/thirdparty/zlib/gzwrite.c \
|
||||
../src/thirdparty/zlib/infback.c \
|
||||
../src/thirdparty/zlib/inffast.c \
|
||||
../src/thirdparty/zlib/inffast.h \
|
||||
../src/thirdparty/zlib/inffixed.h \
|
||||
../src/thirdparty/zlib/inflate.c \
|
||||
../src/thirdparty/zlib/inflate.h \
|
||||
../src/thirdparty/zlib/inftrees.c \
|
||||
../src/thirdparty/zlib/inftrees.h \
|
||||
../src/thirdparty/zlib/trees.c \
|
||||
../src/thirdparty/zlib/trees.h \
|
||||
../src/thirdparty/zlib/uncompr.c \
|
||||
../src/thirdparty/zlib/zconf.h \
|
||||
../src/thirdparty/zlib/zlib.h \
|
||||
../src/thirdparty/zlib/zutil.c \
|
||||
../src/thirdparty/zlib/zutil.h \
|
||||
../src/thirdparty/utf8proc/utf8proc.c \
|
||||
../src/thirdparty/utf8proc/utf8proc.h \
|
||||
../src/thirdparty/lib_hash/sha2.c \
|
||||
../src/thirdparty/lib_hash/sha2.h \
|
||||
../src/lib_ccx/zvbi/bcd.h \
|
||||
../src/lib_ccx/zvbi/bit_slicer.c \
|
||||
../src/lib_ccx/zvbi/bit_slicer.h \
|
||||
../src/lib_ccx/zvbi/decoder.c \
|
||||
../src/lib_ccx/zvbi/macros.h \
|
||||
../src/lib_ccx/zvbi/misc.h \
|
||||
../src/lib_ccx/zvbi/raw_decoder.c \
|
||||
../src/lib_ccx/zvbi/raw_decoder.h \
|
||||
../src/lib_ccx/zvbi/sampling_par.c \
|
||||
../src/lib_ccx/zvbi/sampling_par.h \
|
||||
../src/lib_ccx/zvbi/sliced.h \
|
||||
../src/lib_ccx/zvbi/zvbi_decoder.h \
|
||||
../src/freetype/* \
|
||||
../src/thirdparty/freetype/autofit/autofit.c \
|
||||
../src/thirdparty/freetype/base/ftbase.c \
|
||||
../src/thirdparty/freetype/base/ftbbox.c \
|
||||
../src/thirdparty/freetype/base/ftbdf.c \
|
||||
../src/thirdparty/freetype/base/ftbitmap.c \
|
||||
../src/thirdparty/freetype/base/ftcid.c \
|
||||
../src/thirdparty/freetype/base/ftfntfmt.c \
|
||||
../src/thirdparty/freetype/base/ftfstype.c \
|
||||
../src/thirdparty/freetype/base/ftgasp.c \
|
||||
../src/thirdparty/freetype/base/ftglyph.c \
|
||||
../src/thirdparty/freetype/base/ftgxval.c \
|
||||
../src/thirdparty/freetype/base/ftinit.c \
|
||||
../src/thirdparty/freetype/base/ftlcdfil.c \
|
||||
../src/thirdparty/freetype/base/ftmm.c \
|
||||
../src/thirdparty/freetype/base/ftotval.c \
|
||||
../src/thirdparty/freetype/base/ftpatent.c \
|
||||
../src/thirdparty/freetype/base/ftpfr.c \
|
||||
../src/thirdparty/freetype/base/ftstroke.c \
|
||||
../src/thirdparty/freetype/base/ftsynth.c \
|
||||
../src/thirdparty/freetype/base/ftsystem.c \
|
||||
../src/thirdparty/freetype/base/fttype1.c \
|
||||
../src/thirdparty/freetype/base/ftwinfnt.c \
|
||||
../src/thirdparty/freetype/bdf/bdf.c \
|
||||
../src/thirdparty/freetype/bzip2/ftbzip2.c \
|
||||
../src/thirdparty/freetype/cache/ftcache.c \
|
||||
../src/thirdparty/freetype/cff/cff.c \
|
||||
../src/thirdparty/freetype/cid/type1cid.c \
|
||||
../src/thirdparty/freetype/gzip/ftgzip.c \
|
||||
../src/thirdparty/freetype/include/ft2build.h \
|
||||
../src/thirdparty/freetype/lzw/ftlzw.c \
|
||||
../src/thirdparty/freetype/pcf/pcf.c \
|
||||
../src/thirdparty/freetype/pfr/pfr.c \
|
||||
../src/thirdparty/freetype/psaux/psaux.c \
|
||||
../src/thirdparty/freetype/pshinter/pshinter.c \
|
||||
../src/thirdparty/freetype/psnames/psnames.c \
|
||||
../src/thirdparty/freetype/raster/raster.c \
|
||||
../src/thirdparty/freetype/sfnt/sfnt.c \
|
||||
../src/thirdparty/freetype/smooth/smooth.c \
|
||||
../src/thirdparty/freetype/truetype/truetype.c \
|
||||
../src/thirdparty/freetype/type1/type1.c \
|
||||
../src/thirdparty/freetype/type42/type42.c \
|
||||
../src/thirdparty/freetype/winfonts/winfnt.c
|
||||
|
||||
ccextractor_CFLAGS = -std=gnu99 -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP
|
||||
if SYS_IS_APPLE_SILICON
|
||||
ccextractor_SOURCES += ../src/thirdparty/libpng/arm/arm_init.c \
|
||||
../src/thirdparty/libpng/arm/filter_neon_intrinsics.c \
|
||||
../src/thirdparty/libpng/arm/palette_neon_intrinsics.c
|
||||
endif
|
||||
|
||||
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_CFLAGS = -std=gnu99 -Wno-write-strings -Wno-pointer-sign -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP
|
||||
|
||||
ccextractor_LDFLAGS = $(shell pkg-config --libs gpac)
|
||||
GPAC_CPPFLAGS = $(shell pkg-config --cflags gpac)
|
||||
|
||||
ccextractor_LDADD=-lm
|
||||
ccextractor_CPPFLAGS =-I../src/lib_ccx/ -I../src/thirdparty/libpng/ -I../src/thirdparty/zlib/ -I../src/lib_ccx/zvbi/ -I../src/thirdparty/lib_hash/ -I../src/thirdparty -I../src/ -I../src/thirdparty/freetype/include/
|
||||
ccextractor_CPPFLAGS += $(GPAC_CPPFLAGS)
|
||||
ccextractor_CPPFLAGS += $(FFMPEG_CPPFLAGS)
|
||||
|
||||
ccextractor_LDADD=-lm -lpthread -ldl
|
||||
|
||||
if SYS_IS_LINUX
|
||||
ccextractor_CFLAGS += -O3 -s -DGPAC_CONFIG_LINUX
|
||||
ccextractor_CFLAGS += -O3 -s
|
||||
endif
|
||||
|
||||
if SYS_IS_MAC
|
||||
ccextractor_CFLAGS += -DPAC_CONFIG_DARWIN -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek
|
||||
ccextractor_LDADD += -liconv -lz
|
||||
ccextractor_CFLAGS += -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek
|
||||
ccextractor_LDADD += -liconv -lz
|
||||
endif
|
||||
|
||||
if SYS_IS_64_BIT
|
||||
ccextractor_CFLAGS += -DGPAC_64_BITS
|
||||
endif
|
||||
|
||||
HARDSUBX_FEATURE_RUST=
|
||||
|
||||
if HARDSUBX_IS_ENABLED
|
||||
ccextractor_CFLAGS += -DENABLE_HARDSUBX
|
||||
ccextractor_CPPFLAGS+= ${libavcodec_CFLAGS}
|
||||
ccextractor_CPPFLAGS+= ${libavformat_CFLAGS}
|
||||
ccextractor_CPPFLAGS+= ${libavutil_CFALGS}
|
||||
ccextractor_CPPFLAGS+= ${libavutil_CFLAGS}
|
||||
ccextractor_CPPFLAGS+= ${libswscale_CFLAGS}
|
||||
AV_LIB = ${libavcodec_LIBS}
|
||||
AV_LIB += ${libavformat_LIBS}
|
||||
AV_LIB += ${libavutil_LIBS}
|
||||
AV_LIB += ${libswscale_LIBS}
|
||||
ccextractor_LDADD += $(AV_LIB)
|
||||
HARDSUBX_FEATURE_RUST += --features "hardsubx_ocr"
|
||||
endif
|
||||
|
||||
if OCR_IS_ENABLED
|
||||
@@ -364,64 +302,18 @@ 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
|
||||
ccextractor_LDADD += ./rust/@RUST_TARGET_SUBDIR@/libccx_rust.a
|
||||
|
||||
|
||||
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
|
||||
if DEBUG_RELEASE
|
||||
CARGO_RELEASE_ARGS=
|
||||
else
|
||||
CARGO_RELEASE_ARGS=--release
|
||||
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
|
||||
./rust/@RUST_TARGET_SUBDIR@/libccx_rust.a:
|
||||
cd ../src/rust && \
|
||||
CARGO_TARGET_DIR=../../mac/rust $(CARGO) build $(HARDSUBX_FEATURE_RUST) $(CARGO_RELEASE_ARGS);
|
||||
|
||||
if HARDSUBX_IS_ENABLED
|
||||
if OCR_IS_ENABLED
|
||||
ccextractorGUI_CFLAGS += -DENABLE_OCR
|
||||
endif
|
||||
endif
|
||||
|
||||
EXTRA_DIST += ../icon/ ../fonts/
|
||||
|
||||
endif
|
||||
EXTRA_DIST = ../src/lib_ccx/ccfont2.xbm ../src/thirdparty/utf8proc/utf8proc_data.c fonts/ icon/
|
||||
|
||||
|
||||
@@ -1,62 +1,320 @@
|
||||
#!/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 -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP"
|
||||
[[ $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="../src/utf8proc/utf8proc.c"
|
||||
SRC_ZLIB="$(find ../src/zlib -name '*.c')"
|
||||
SRC_ZVBI="$(find ../src/zvbi -name '*.c')"
|
||||
API_WRAPPERS="$(find ../src/wrappers/ -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"
|
||||
BLD_LINKER="-lm -liconv"
|
||||
[[ $1 = "OCR" ]] && BLD_LINKER="$BLD_LINKER `pkg-config --libs --silence-errors tesseract` `pkg-config --libs --silence-errors lept`"
|
||||
|
||||
RUST_LIB="rust/release/libccx_rust.a"
|
||||
RUST_PROFILE="--release"
|
||||
RUST_FEATURES=""
|
||||
|
||||
# Parse command line arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
OCR)
|
||||
ENABLE_OCR=true
|
||||
shift
|
||||
;;
|
||||
-debug)
|
||||
DEBUG=true
|
||||
RUST_PROFILE=""
|
||||
RUST_LIB="rust/debug/libccx_rust.a"
|
||||
shift
|
||||
;;
|
||||
-hardsubx)
|
||||
HARDSUBX=true
|
||||
ENABLE_OCR=true
|
||||
# Allow overriding FFmpeg version via environment variable
|
||||
if [ -n "$FFMPEG_VERSION" ]; then
|
||||
RUST_FEATURES="--features hardsubx_ocr,$FFMPEG_VERSION"
|
||||
else
|
||||
RUST_FEATURES="--features hardsubx_ocr"
|
||||
fi
|
||||
shift
|
||||
;;
|
||||
-system-libs)
|
||||
# Use system-installed libraries via pkg-config instead of bundled ones
|
||||
# This is required for Homebrew formula compatibility
|
||||
USE_SYSTEM_LIBS=true
|
||||
shift
|
||||
;;
|
||||
-*)
|
||||
echo "Unknown option $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Determine architecture based on cargo (to ensure consistency with Rust part)
|
||||
CARGO_ARCH=$(file $(which cargo) | grep -o 'x86_64\|arm64')
|
||||
if [[ "$CARGO_ARCH" == "x86_64" ]]; then
|
||||
echo "Detected Intel (x86_64) Cargo. Forcing x86_64 build to match Rust and libraries..."
|
||||
BLD_ARCH="-arch x86_64"
|
||||
else
|
||||
BLD_ARCH="-arch arm64"
|
||||
fi
|
||||
|
||||
BLD_FLAGS="$BLD_ARCH -std=gnu99 -Wno-write-strings -Wno-pointer-sign -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek"
|
||||
|
||||
# Add flags for bundled libraries (not needed when using system libs)
|
||||
if [[ "$USE_SYSTEM_LIBS" != "true" ]]; then
|
||||
BLD_FLAGS="$BLD_FLAGS -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP"
|
||||
fi
|
||||
|
||||
# Add debug flags if needed
|
||||
if [[ "$DEBUG" == "true" ]]; then
|
||||
BLD_FLAGS="$BLD_FLAGS -g -fsanitize=address"
|
||||
fi
|
||||
|
||||
# Add OCR support if requested
|
||||
if [[ "$ENABLE_OCR" == "true" ]]; then
|
||||
BLD_FLAGS="$BLD_FLAGS -DENABLE_OCR"
|
||||
fi
|
||||
|
||||
# Add hardsubx support if requested
|
||||
if [[ "$HARDSUBX" == "true" ]]; then
|
||||
BLD_FLAGS="$BLD_FLAGS -DENABLE_HARDSUBX"
|
||||
fi
|
||||
|
||||
# Set up include paths based on whether we're using system libs or bundled
|
||||
if [[ "$USE_SYSTEM_LIBS" == "true" ]]; then
|
||||
# Use system libraries via pkg-config (for Homebrew compatibility)
|
||||
# Note: -I../src/thirdparty/lib_hash is needed so that "../lib_hash/sha2.h" resolves correctly
|
||||
# (the .. goes up from lib_hash to thirdparty, then lib_hash/sha2.h finds the file)
|
||||
BLD_INCLUDE="-I../src/ -I../src/lib_ccx -I../src/thirdparty/lib_hash -I../src/thirdparty"
|
||||
BLD_INCLUDE="$BLD_INCLUDE $(pkg-config --cflags --silence-errors freetype2)"
|
||||
BLD_INCLUDE="$BLD_INCLUDE $(pkg-config --cflags --silence-errors gpac)"
|
||||
BLD_INCLUDE="$BLD_INCLUDE $(pkg-config --cflags --silence-errors libpng)"
|
||||
BLD_INCLUDE="$BLD_INCLUDE $(pkg-config --cflags --silence-errors libprotobuf-c)"
|
||||
BLD_INCLUDE="$BLD_INCLUDE $(pkg-config --cflags --silence-errors libutf8proc)"
|
||||
else
|
||||
# Use bundled libraries (default for standalone builds)
|
||||
BLD_INCLUDE="-I../src/ -I../src/lib_ccx -I../src/thirdparty/lib_hash -I../src/thirdparty/libpng -I../src/thirdparty -I../src/thirdparty/zlib -I../src/thirdparty/freetype/include $(pkg-config --cflags --silence-errors gpac)"
|
||||
fi
|
||||
|
||||
# Add FFmpeg include path for Mac
|
||||
if [[ -d "/opt/homebrew/Cellar/ffmpeg" ]]; then
|
||||
FFMPEG_VERSION=$(ls -1 /opt/homebrew/Cellar/ffmpeg | head -1)
|
||||
if [[ -n "$FFMPEG_VERSION" ]]; then
|
||||
BLD_INCLUDE="$BLD_INCLUDE -I/opt/homebrew/Cellar/ffmpeg/$FFMPEG_VERSION/include"
|
||||
fi
|
||||
elif [[ -d "/usr/local/Cellar/ffmpeg" ]]; then
|
||||
FFMPEG_VERSION=$(ls -1 /usr/local/Cellar/ffmpeg | head -1)
|
||||
if [[ -n "$FFMPEG_VERSION" ]]; then
|
||||
BLD_INCLUDE="$BLD_INCLUDE -I/usr/local/Cellar/ffmpeg/$FFMPEG_VERSION/include"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Add Leptonica include path for Mac
|
||||
if [[ -d "/opt/homebrew/Cellar/leptonica" ]]; then
|
||||
LEPT_VERSION=$(ls -1 /opt/homebrew/Cellar/leptonica | head -1)
|
||||
if [[ -n "$LEPT_VERSION" ]]; then
|
||||
BLD_INCLUDE="$BLD_INCLUDE -I/opt/homebrew/Cellar/leptonica/$LEPT_VERSION/include"
|
||||
fi
|
||||
elif [[ -d "/usr/local/Cellar/leptonica" ]]; then
|
||||
LEPT_VERSION=$(ls -1 /usr/local/Cellar/leptonica | head -1)
|
||||
if [[ -n "$LEPT_VERSION" ]]; then
|
||||
BLD_INCLUDE="$BLD_INCLUDE -I/usr/local/Cellar/leptonica/$LEPT_VERSION/include"
|
||||
fi
|
||||
elif [[ -d "/opt/homebrew/include/leptonica" ]]; then
|
||||
BLD_INCLUDE="$BLD_INCLUDE -I/opt/homebrew/include"
|
||||
elif [[ -d "/usr/local/include/leptonica" ]]; then
|
||||
BLD_INCLUDE="$BLD_INCLUDE -I/usr/local/include"
|
||||
fi
|
||||
|
||||
# Add Tesseract include path for Mac
|
||||
if [[ -d "/opt/homebrew/Cellar/tesseract" ]]; then
|
||||
TESS_VERSION=$(ls -1 /opt/homebrew/Cellar/tesseract | head -1)
|
||||
if [[ -n "$TESS_VERSION" ]]; then
|
||||
BLD_INCLUDE="$BLD_INCLUDE -I/opt/homebrew/Cellar/tesseract/$TESS_VERSION/include"
|
||||
fi
|
||||
elif [[ -d "/usr/local/Cellar/tesseract" ]]; then
|
||||
TESS_VERSION=$(ls -1 /usr/local/Cellar/tesseract | head -1)
|
||||
if [[ -n "$TESS_VERSION" ]]; then
|
||||
BLD_INCLUDE="$BLD_INCLUDE -I/usr/local/Cellar/tesseract/$TESS_VERSION/include"
|
||||
fi
|
||||
elif [[ -d "/opt/homebrew/include/tesseract" ]]; then
|
||||
BLD_INCLUDE="$BLD_INCLUDE -I/opt/homebrew/include"
|
||||
elif [[ -d "/usr/local/include/tesseract" ]]; then
|
||||
BLD_INCLUDE="$BLD_INCLUDE -I/usr/local/include"
|
||||
fi
|
||||
|
||||
if [[ "$ENABLE_OCR" == "true" ]]; then
|
||||
BLD_INCLUDE="$BLD_INCLUDE `pkg-config --cflags --silence-errors tesseract`"
|
||||
fi
|
||||
|
||||
SRC_CCX="$(find ../src/lib_ccx -name '*.c')"
|
||||
SRC_LIB_HASH="$(find ../src/thirdparty/lib_hash -name '*.c')"
|
||||
|
||||
# Set up sources and linker based on whether we're using system libs or bundled
|
||||
if [[ "$USE_SYSTEM_LIBS" == "true" ]]; then
|
||||
# Use system libraries - don't compile bundled sources
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_LIB_HASH"
|
||||
|
||||
BLD_LINKER="-lm -liconv -lpthread -ldl"
|
||||
BLD_LINKER="$BLD_LINKER $(pkg-config --libs --silence-errors freetype2)"
|
||||
BLD_LINKER="$BLD_LINKER $(pkg-config --libs --silence-errors gpac)"
|
||||
BLD_LINKER="$BLD_LINKER $(pkg-config --libs --silence-errors libpng)"
|
||||
BLD_LINKER="$BLD_LINKER $(pkg-config --libs --silence-errors libprotobuf-c)"
|
||||
BLD_LINKER="$BLD_LINKER $(pkg-config --libs --silence-errors libutf8proc)"
|
||||
BLD_LINKER="$BLD_LINKER $(pkg-config --libs --silence-errors zlib)"
|
||||
else
|
||||
# Use bundled libraries (default)
|
||||
SRC_LIBPNG="$(find ../src/thirdparty/libpng -name '*.c')"
|
||||
SRC_UTF8="../src/thirdparty/utf8proc/utf8proc.c"
|
||||
SRC_ZLIB="$(find ../src/thirdparty/zlib -name '*.c')"
|
||||
SRC_FREETYPE="../src/thirdparty/freetype/autofit/autofit.c \
|
||||
../src/thirdparty/freetype/base/ftbase.c \
|
||||
../src/thirdparty/freetype/base/ftbbox.c \
|
||||
../src/thirdparty/freetype/base/ftbdf.c \
|
||||
../src/thirdparty/freetype/base/ftbitmap.c \
|
||||
../src/thirdparty/freetype/base/ftcid.c \
|
||||
../src/thirdparty/freetype/base/ftfntfmt.c \
|
||||
../src/thirdparty/freetype/base/ftfstype.c \
|
||||
../src/thirdparty/freetype/base/ftgasp.c \
|
||||
../src/thirdparty/freetype/base/ftglyph.c \
|
||||
../src/thirdparty/freetype/base/ftgxval.c \
|
||||
../src/thirdparty/freetype/base/ftinit.c \
|
||||
../src/thirdparty/freetype/base/ftlcdfil.c \
|
||||
../src/thirdparty/freetype/base/ftmm.c \
|
||||
../src/thirdparty/freetype/base/ftotval.c \
|
||||
../src/thirdparty/freetype/base/ftpatent.c \
|
||||
../src/thirdparty/freetype/base/ftpfr.c \
|
||||
../src/thirdparty/freetype/base/ftstroke.c \
|
||||
../src/thirdparty/freetype/base/ftsynth.c \
|
||||
../src/thirdparty/freetype/base/ftsystem.c \
|
||||
../src/thirdparty/freetype/base/fttype1.c \
|
||||
../src/thirdparty/freetype/base/ftwinfnt.c \
|
||||
../src/thirdparty/freetype/bdf/bdf.c \
|
||||
../src/thirdparty/freetype/bzip2/ftbzip2.c \
|
||||
../src/thirdparty/freetype/cache/ftcache.c \
|
||||
../src/thirdparty/freetype/cff/cff.c \
|
||||
../src/thirdparty/freetype/cid/type1cid.c \
|
||||
../src/thirdparty/freetype/gzip/ftgzip.c \
|
||||
../src/thirdparty/freetype/lzw/ftlzw.c \
|
||||
../src/thirdparty/freetype/pcf/pcf.c \
|
||||
../src/thirdparty/freetype/pfr/pfr.c \
|
||||
../src/thirdparty/freetype/psaux/psaux.c \
|
||||
../src/thirdparty/freetype/pshinter/pshinter.c \
|
||||
../src/thirdparty/freetype/psnames/psnames.c \
|
||||
../src/thirdparty/freetype/raster/raster.c \
|
||||
../src/thirdparty/freetype/sfnt/sfnt.c \
|
||||
../src/thirdparty/freetype/smooth/smooth.c \
|
||||
../src/thirdparty/freetype/truetype/truetype.c \
|
||||
../src/thirdparty/freetype/type1/type1.c \
|
||||
../src/thirdparty/freetype/type42/type42.c \
|
||||
../src/thirdparty/freetype/winfonts/winfnt.c"
|
||||
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_LIB_HASH $SRC_LIBPNG $SRC_UTF8 $SRC_ZLIB $SRC_FREETYPE"
|
||||
BLD_LINKER="-lm -liconv -lpthread -ldl $(pkg-config --libs --silence-errors gpac)"
|
||||
fi
|
||||
|
||||
if [[ "$ENABLE_OCR" == "true" ]]; then
|
||||
BLD_LINKER="$BLD_LINKER `pkg-config --libs --silence-errors tesseract` `pkg-config --libs --silence-errors lept`"
|
||||
fi
|
||||
|
||||
if [[ "$HARDSUBX" == "true" ]]; then
|
||||
# Add FFmpeg library path for Mac
|
||||
if [[ -d "/opt/homebrew/Cellar/ffmpeg" ]]; then
|
||||
FFMPEG_VERSION=$(ls -1 /opt/homebrew/Cellar/ffmpeg | head -1)
|
||||
if [[ -n "$FFMPEG_VERSION" ]]; then
|
||||
BLD_LINKER="$BLD_LINKER -L/opt/homebrew/Cellar/ffmpeg/$FFMPEG_VERSION/lib"
|
||||
fi
|
||||
elif [[ -d "/usr/local/Cellar/ffmpeg" ]]; then
|
||||
FFMPEG_VERSION=$(ls -1 /usr/local/Cellar/ffmpeg | head -1)
|
||||
if [[ -n "$FFMPEG_VERSION" ]]; then
|
||||
BLD_LINKER="$BLD_LINKER -L/usr/local/Cellar/ffmpeg/$FFMPEG_VERSION/lib"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Add library paths for Leptonica and Tesseract from Cellar
|
||||
if [[ -d "/opt/homebrew/Cellar/leptonica" ]]; then
|
||||
LEPT_VERSION=$(ls -1 /opt/homebrew/Cellar/leptonica | head -1)
|
||||
if [[ -n "$LEPT_VERSION" ]]; then
|
||||
BLD_LINKER="$BLD_LINKER -L/opt/homebrew/Cellar/leptonica/$LEPT_VERSION/lib"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -d "/opt/homebrew/Cellar/tesseract" ]]; then
|
||||
TESS_VERSION=$(ls -1 /opt/homebrew/Cellar/tesseract | head -1)
|
||||
if [[ -n "$TESS_VERSION" ]]; then
|
||||
BLD_LINKER="$BLD_LINKER -L/opt/homebrew/Cellar/tesseract/$TESS_VERSION/lib"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Also add homebrew lib path as fallback
|
||||
if [[ -d "/opt/homebrew/lib" ]]; then
|
||||
BLD_LINKER="$BLD_LINKER -L/opt/homebrew/lib"
|
||||
elif [[ -d "/usr/local/lib" ]]; then
|
||||
BLD_LINKER="$BLD_LINKER -L/usr/local/lib"
|
||||
fi
|
||||
|
||||
BLD_LINKER="$BLD_LINKER -lswscale -lavutil -pthread -lavformat -lavcodec -lavfilter -lleptonica -ltesseract"
|
||||
fi
|
||||
|
||||
echo "Running pre-build script..."
|
||||
./pre-build.sh
|
||||
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER
|
||||
echo "Trying to compile..."
|
||||
|
||||
# Check for cargo
|
||||
echo "Checking for cargo..."
|
||||
if ! [ -x "$(command -v cargo)" ]; then
|
||||
echo 'Error: cargo is not installed.' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check rust version
|
||||
rustc_version="$(rustc --version)"
|
||||
semver=( ${rustc_version//./ } )
|
||||
version="${semver[1]}.${semver[2]}.${semver[3]}"
|
||||
MSRV="1.87.0"
|
||||
if [ "$(printf '%s\n' "$MSRV" "$version" | sort -V | head -n1)" = "$MSRV" ]; then
|
||||
echo "rustc >= MSRV(${MSRV})"
|
||||
else
|
||||
echo "Minimum supported rust version(MSRV) is ${MSRV}, please upgrade rust"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Building rust files..."
|
||||
(cd ../src/rust && CARGO_TARGET_DIR=../../mac/rust cargo build $RUST_PROFILE $RUST_FEATURES) || { echo "Failed building Rust components." ; exit 1; }
|
||||
|
||||
# Copy the Rust library
|
||||
cp $RUST_LIB ./libccx_rust.a
|
||||
|
||||
# Add Rust library to linker flags
|
||||
BLD_LINKER="$BLD_LINKER ./libccx_rust.a"
|
||||
|
||||
echo "Building ccextractor"
|
||||
out=$((LC_ALL=C gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER) 2>&1)
|
||||
res=$?
|
||||
|
||||
# Handle common error cases
|
||||
if [[ $out == *"gcc: command not found"* ]]; then
|
||||
echo "Error: please install gcc or Xcode command line tools"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $out == *"curl.h: No such file or directory"* ]]; then
|
||||
echo "Error: please install curl development library"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [[ $out == *"capi.h: No such file or directory"* ]]; then
|
||||
echo "Error: please install tesseract development library"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
if [[ $out == *"allheaders.h: No such file or directory"* ]]; then
|
||||
echo "Error: please install leptonica development library"
|
||||
exit 4
|
||||
fi
|
||||
|
||||
if [[ $res -ne 0 ]]; then # Unknown error
|
||||
echo "Compiled with errors"
|
||||
>&2 echo "$out"
|
||||
exit 5
|
||||
fi
|
||||
|
||||
if [[ "$out" != "" ]]; then
|
||||
echo "$out"
|
||||
echo "Compilation successful, compiler message shown in previous lines"
|
||||
else
|
||||
echo "Compilation successful, no compiler messages."
|
||||
fi
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT([CCExtractor], [0.88], [carlos@ccextractor.org])
|
||||
AC_PREREQ([2.71])
|
||||
AC_INIT([CCExtractor],[0.96.5],[carlos@ccextractor.org])
|
||||
AC_CONFIG_AUX_DIR([build-conf])
|
||||
AC_CONFIG_SRCDIR([../src/ccextractor.c])
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||
|
||||
AC_CONFIG_MACRO_DIRS([m4])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
@@ -15,7 +15,7 @@ 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
|
||||
if test m4_ifdef([PKG_CHECK_MODULES], [yes], [no]) = yes; then
|
||||
AC_MSG_RESULT([yes]);
|
||||
else
|
||||
AC_MSG_RESULT([no]);
|
||||
@@ -25,7 +25,7 @@ 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([leptonica], [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])
|
||||
@@ -63,7 +63,7 @@ AC_CHECK_FUNCS([floor ftruncate gethostbyname gettimeofday inet_ntoa mblen memch
|
||||
|
||||
# Checks for arguments with configure
|
||||
AC_ARG_ENABLE([hardsubx],
|
||||
AC_HELP_STRING([--enable-hardsubx], [Enables extraction of burnt subtitles (hard subtitles)]),
|
||||
AS_HELP_STRING([--enable-hardsubx],[Enables extraction of burnt subtitles (hard subtitles)]),
|
||||
[case "${enableval}" in
|
||||
yes) hardsubx=true ;;
|
||||
no) hardsubx=false ;;
|
||||
@@ -71,7 +71,7 @@ AC_HELP_STRING([--enable-hardsubx], [Enables extraction of burnt subtitles (hard
|
||||
esac],[hardsubx=false])
|
||||
|
||||
AC_ARG_ENABLE([ocr],
|
||||
AC_HELP_STRING([--enable-ocr], [Enables Optical Character Recognition]),
|
||||
AS_HELP_STRING([--enable-ocr],[Enables Optical Character Recognition]),
|
||||
[case "${enableval}" in
|
||||
yes) ocr=true ;;
|
||||
no) ocr=false ;;
|
||||
@@ -79,20 +79,58 @@ AC_HELP_STRING([--enable-ocr], [Enables Optical Character Recognition]),
|
||||
esac],[ocr=false])
|
||||
|
||||
AC_ARG_ENABLE([ffmpeg],
|
||||
AC_HELP_STRING([--enable-ffmpeg], [Enable FFmpeg integration]),
|
||||
AS_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])
|
||||
#Add argument for rust
|
||||
AC_ARG_WITH([rust],
|
||||
AS_HELP_STRING([--with-rust],[Builds CCExtractor with rust library]),
|
||||
[with_rust=$withval],
|
||||
[with_rust=yes])
|
||||
|
||||
AC_MSG_CHECKING(whether to build with rust library)
|
||||
if test "x$with_rust" = "xyes" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
|
||||
#Checks and prompts if libraries found/not found to avoild failure while building
|
||||
#Check if cargo and rust is installed
|
||||
AC_PATH_PROG([CARGO], [cargo], [notfound])
|
||||
AS_IF([test "$CARGO" = "notfound"], [AC_MSG_ERROR([cargo is required])])
|
||||
|
||||
AC_PATH_PROG([RUSTC], [rustc], [notfound])
|
||||
AS_IF([test "$RUSTC" = "notfound"], [AC_MSG_ERROR([rustc is required])])
|
||||
|
||||
rustc_version=$(rustc --version)
|
||||
MSRV="1.87.0"
|
||||
AX_COMPARE_VERSION($rustc_version, [ge], [$MSRV],
|
||||
[AC_MSG_RESULT(rustc >= $MSRV)],
|
||||
[AC_MSG_ERROR([Minimum supported rust version(MSRV) is $MSRV, please upgrade rust])])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_RUST], [test "x$with_rust" = "xyes"])
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
AS_HELP_STRING([--enable-debug],[Build Rust code with debugging information [default=no]]),
|
||||
[debug_release=$enableval],
|
||||
[debug_release=no])
|
||||
|
||||
AC_MSG_CHECKING(whether to build Rust code with debugging information)
|
||||
if test "x$debug_release" = "xyes" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
RUST_TARGET_SUBDIR=debug
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
RUST_TARGET_SUBDIR=release
|
||||
fi
|
||||
AM_CONDITIONAL([DEBUG_RELEASE], [test "x$debug_release" = "xyes"])
|
||||
|
||||
AC_SUBST([RUST_TARGET_SUBDIR])
|
||||
|
||||
#Checks and prompts if libraries found/not found to avoid 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)])
|
||||
@@ -101,20 +139,21 @@ AS_IF([ test x$hardsubx = xtrue && test $HAS_AVUTIL -gt 0 ], [AC_MSG_NOTICE(avut
|
||||
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 ], [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 ], [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"])
|
||||
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(SYS_IS_APPLE_SILICON, [ test $(uname -a | awk '{print $NF}') = "arm64" ])
|
||||
AM_CONDITIONAL(SYS_IS_64_BIT,[test $(getconf LONG_BIT) = "64"])
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
BIN
mac/gui/InstallCCExtractorMacGUI.app.zip
Normal file
BIN
mac/gui/InstallCCExtractorMacGUI.app.zip
Normal file
Binary file not shown.
BIN
mac/gui/InstallCCExtractorMacGUI.app/Contents/Info.plist
Normal file
BIN
mac/gui/InstallCCExtractorMacGUI.app/Contents/Info.plist
Normal file
Binary file not shown.
BIN
mac/gui/InstallCCExtractorMacGUI.app/Contents/MacOS/InstallCCExtractorMacGUI
Executable file
BIN
mac/gui/InstallCCExtractorMacGUI.app/Contents/MacOS/InstallCCExtractorMacGUI
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
mac/gui/InstallCCExtractorMacGUI.app/Contents/Resources/MainMenu.nib
generated
Normal file
BIN
mac/gui/InstallCCExtractorMacGUI.app/Contents/Resources/MainMenu.nib
generated
Normal file
Binary file not shown.
BIN
mac/gui/InstallCCExtractorMacGUI.app/Contents/Resources/script
Executable file
BIN
mac/gui/InstallCCExtractorMacGUI.app/Contents/Resources/script
Executable file
Binary file not shown.
2
mac/gui/README.md
Normal file
2
mac/gui/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
## Simple MacOS GUI for CCExtractor
|
||||
This is a simple GUI for MacOS. It was generated using the open source Platypus tool created by [Sveinbjörn Þórðarson](https://sveinbjorn.org). You can learn more about Platypus [here.](https://sveinbjorn.org/platypus) It is recommended if you need more customization please use the CLI tool as this app only has the default settings.
|
||||
BIN
mac/gui/src/CCExtractor.app/Contents/Info.plist
Normal file
BIN
mac/gui/src/CCExtractor.app/Contents/Info.plist
Normal file
Binary file not shown.
BIN
mac/gui/src/CCExtractor.app/Contents/MacOS/CCExtractor
Executable file
BIN
mac/gui/src/CCExtractor.app/Contents/MacOS/CCExtractor
Executable file
Binary file not shown.
BIN
mac/gui/src/CCExtractor.app/Contents/Resources/AppIcon.icns
Normal file
BIN
mac/gui/src/CCExtractor.app/Contents/Resources/AppIcon.icns
Normal file
Binary file not shown.
BIN
mac/gui/src/CCExtractor.app/Contents/Resources/AppSettings.plist
Normal file
BIN
mac/gui/src/CCExtractor.app/Contents/Resources/AppSettings.plist
Normal file
Binary file not shown.
BIN
mac/gui/src/CCExtractor.app/Contents/Resources/MainMenu.nib
generated
Normal file
BIN
mac/gui/src/CCExtractor.app/Contents/Resources/MainMenu.nib
generated
Normal file
Binary file not shown.
12
mac/gui/src/CCExtractor.app/Contents/Resources/script
Executable file
12
mac/gui/src/CCExtractor.app/Contents/Resources/script
Executable file
@@ -0,0 +1,12 @@
|
||||
/usr/local/bin/ccextractor $1
|
||||
|
||||
function display() {
|
||||
osascript <<EOT
|
||||
tell app "System Events"
|
||||
display dialog "$1" buttons {"OK"} default button 1 with title "CCExtractor"
|
||||
return
|
||||
end tell
|
||||
EOT
|
||||
}
|
||||
echo "Done"
|
||||
display "Process Complete. Check the source file's folder for the subtitles."
|
||||
BIN
mac/gui/src/CCExtractor.dmg
Normal file
BIN
mac/gui/src/CCExtractor.dmg
Normal file
Binary file not shown.
25
mac/gui/src/HowToGenerateApp.md
Normal file
25
mac/gui/src/HowToGenerateApp.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# HowToGenerateApp
|
||||
|
||||
## Main App
|
||||
|
||||
Script Type: Shell
|
||||
|
||||
Script Path: script.sh located in src folder
|
||||
|
||||
Interface: Droplet
|
||||
|
||||
Remain running after execution: Enabled
|
||||
|
||||
Accept Dropped Files: Enabled
|
||||
|
||||
## Install App
|
||||
|
||||
Script Type: Apple Script
|
||||
|
||||
Script Path: InstallCCExtractor.scpt located in src folder
|
||||
|
||||
Interface: Progress Bar
|
||||
|
||||
Bundled Files: CCExtractor.dmg located in src folder
|
||||
|
||||
Remain running after execution: Disabled
|
||||
BIN
mac/gui/src/InstallCCExtractor.scpt
Normal file
BIN
mac/gui/src/InstallCCExtractor.scpt
Normal file
Binary file not shown.
BIN
mac/gui/src/ccx_logo_icon.png
Normal file
BIN
mac/gui/src/ccx_logo_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
1
mac/gui/src/placeholder.md
Normal file
1
mac/gui/src/placeholder.md
Normal file
@@ -0,0 +1 @@
|
||||
place
|
||||
12
mac/gui/src/script.sh
Normal file
12
mac/gui/src/script.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
/usr/local/bin/ccextractor $1
|
||||
|
||||
function display() {
|
||||
osascript <<EOT
|
||||
tell app "System Events"
|
||||
display dialog "$1" buttons {"OK"} default button 1 with title "CCExtractor"
|
||||
return
|
||||
end tell
|
||||
EOT
|
||||
}
|
||||
echo "Done"
|
||||
display "Process Complete. Check the source file's folder for the subtitles."
|
||||
177
mac/m4/ax_compare_version.m4
Normal file
177
mac/m4/ax_compare_version.m4
Normal file
@@ -0,0 +1,177 @@
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_compare_version.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro compares two version strings. Due to the various number of
|
||||
# minor-version numbers that can exist, and the fact that string
|
||||
# comparisons are not compatible with numeric comparisons, this is not
|
||||
# necessarily trivial to do in a autoconf script. This macro makes doing
|
||||
# these comparisons easy.
|
||||
#
|
||||
# The six basic comparisons are available, as well as checking equality
|
||||
# limited to a certain number of minor-version levels.
|
||||
#
|
||||
# The operator OP determines what type of comparison to do, and can be one
|
||||
# of:
|
||||
#
|
||||
# eq - equal (test A == B)
|
||||
# ne - not equal (test A != B)
|
||||
# le - less than or equal (test A <= B)
|
||||
# ge - greater than or equal (test A >= B)
|
||||
# lt - less than (test A < B)
|
||||
# gt - greater than (test A > B)
|
||||
#
|
||||
# Additionally, the eq and ne operator can have a number after it to limit
|
||||
# the test to that number of minor versions.
|
||||
#
|
||||
# eq0 - equal up to the length of the shorter version
|
||||
# ne0 - not equal up to the length of the shorter version
|
||||
# eqN - equal up to N sub-version levels
|
||||
# neN - not equal up to N sub-version levels
|
||||
#
|
||||
# When the condition is true, shell commands ACTION-IF-TRUE are run,
|
||||
# otherwise shell commands ACTION-IF-FALSE are run. The environment
|
||||
# variable 'ax_compare_version' is always set to either 'true' or 'false'
|
||||
# as well.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
|
||||
# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
|
||||
#
|
||||
# would both be true.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
|
||||
# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
|
||||
#
|
||||
# would both be false.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
|
||||
#
|
||||
# would be true because it is only comparing two minor versions.
|
||||
#
|
||||
# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
|
||||
#
|
||||
# would be true because it is only comparing the lesser number of minor
|
||||
# versions of the two values.
|
||||
#
|
||||
# Note: The characters that separate the version numbers do not matter. An
|
||||
# empty string is the same as version 0. OP is evaluated by autoconf, not
|
||||
# configure, so must be a string, not a variable.
|
||||
#
|
||||
# The author would like to acknowledge Guido Draheim whose advice about
|
||||
# the m4_case and m4_ifvaln functions make this macro only include the
|
||||
# portions necessary to perform the specific comparison specified by the
|
||||
# OP argument in the final configure script.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 13
|
||||
|
||||
dnl #########################################################################
|
||||
AC_DEFUN([AX_COMPARE_VERSION], [
|
||||
AC_REQUIRE([AC_PROG_AWK])
|
||||
|
||||
# Used to indicate true or false condition
|
||||
ax_compare_version=false
|
||||
|
||||
# Convert the two version strings to be compared into a format that
|
||||
# allows a simple string comparison. The end result is that a version
|
||||
# string of the form 1.12.5-r617 will be converted to the form
|
||||
# 0001001200050617. In other words, each number is zero padded to four
|
||||
# digits, and non digits are removed.
|
||||
AS_VAR_PUSHDEF([A],[ax_compare_version_A])
|
||||
A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
|
||||
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/[[^0-9]]//g'`
|
||||
|
||||
AS_VAR_PUSHDEF([B],[ax_compare_version_B])
|
||||
B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
|
||||
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
|
||||
-e 's/[[^0-9]]//g'`
|
||||
|
||||
dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
|
||||
dnl # then the first line is used to determine if the condition is true.
|
||||
dnl # The sed right after the echo is to remove any indented white space.
|
||||
m4_case(m4_tolower($2),
|
||||
[lt],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
|
||||
],
|
||||
[gt],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
|
||||
],
|
||||
[le],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
|
||||
],
|
||||
[ge],[
|
||||
ax_compare_version=`echo "x$A
|
||||
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
|
||||
],[
|
||||
dnl Split the operator from the subversion count if present.
|
||||
m4_bmatch(m4_substr($2,2),
|
||||
[0],[
|
||||
# A count of zero means use the length of the shorter version.
|
||||
# Determine the number of characters in A and B.
|
||||
ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
|
||||
ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
|
||||
|
||||
# Set A to no more than B's length and B to no more than A's length.
|
||||
A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
|
||||
B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
|
||||
],
|
||||
[[0-9]+],[
|
||||
# A count greater than zero means use only that many subversions
|
||||
A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
|
||||
B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
|
||||
],
|
||||
[.+],[
|
||||
AC_WARNING(
|
||||
[invalid OP numeric parameter: $2])
|
||||
],[])
|
||||
|
||||
# Pad zeros at end of numbers to make same length.
|
||||
ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
|
||||
B="$B`echo $A | sed 's/./0/g'`"
|
||||
A="$ax_compare_version_tmp_A"
|
||||
|
||||
# Check for equality or inequality as necessary.
|
||||
m4_case(m4_tolower(m4_substr($2,0,2)),
|
||||
[eq],[
|
||||
test "x$A" = "x$B" && ax_compare_version=true
|
||||
],
|
||||
[ne],[
|
||||
test "x$A" != "x$B" && ax_compare_version=true
|
||||
],[
|
||||
AC_WARNING([invalid OP parameter: $2])
|
||||
])
|
||||
])
|
||||
|
||||
AS_VAR_POPDEF([A])dnl
|
||||
AS_VAR_POPDEF([B])dnl
|
||||
|
||||
dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
|
||||
if test "$ax_compare_version" = "true" ; then
|
||||
m4_ifvaln([$4],[$4],[:])dnl
|
||||
m4_ifvaln([$5],[else $5])dnl
|
||||
fi
|
||||
]) dnl AX_COMPARE_VERSION
|
||||
@@ -21,7 +21,7 @@ fi
|
||||
if [ -z "$commit" ]; then
|
||||
commit="Unknown"
|
||||
fi
|
||||
builddate=`date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d`
|
||||
builddate=`date -j -u -r "${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d`
|
||||
echo "Storing variables in file"
|
||||
echo "Commit: $commit"
|
||||
echo "Date: $builddate"
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
pkgname=ccextractor
|
||||
pkgver=0.88
|
||||
pkgver=0.96.5
|
||||
pkgrel=1
|
||||
pkgdesc="A closed captions and teletext subtitles extractor for video streams."
|
||||
arch=('i686' 'x86_64')
|
||||
url="http://www.ccextractor.org"
|
||||
url="https://www.ccextractor.org"
|
||||
license=('GPL')
|
||||
depends=('gcc-libs' 'tesseract')
|
||||
depends=('gcc-libs' 'tesseract' 'leptonica' 'ffmpeg' 'rust' 'clang')
|
||||
source=(
|
||||
$pkgname-$pkgver.tar.gz
|
||||
https://github.com/CCExtractor/ccextractor/releases/download/v$pkgver/ccextractor_minimal.tar.gz
|
||||
)
|
||||
|
||||
build() {
|
||||
cd "$srcdir/$pkgname-$pkgver"
|
||||
CC=gcc ./configure --enable-ocr --prefix="$pkgdir/usr/local"
|
||||
make -j4
|
||||
cd "$srcdir/$pkgname/linux"
|
||||
./build_hardsubx
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir/$pkgname-$pkgver"
|
||||
make install
|
||||
cd "$srcdir/$pkgname/linux"
|
||||
install -Dm755 "$pkgname" "$pkgdir/usr/bin/$pkgname"
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
Name: ccextractor
|
||||
Version: 0.88
|
||||
Version: 0.96.5
|
||||
Release: 1
|
||||
Summary: A closed captions and teletext subtitles extractor for video streams.
|
||||
Group: Applications/Internet
|
||||
License: GPL
|
||||
URL: http://ccextractor.org/
|
||||
URL: https://ccextractor.org/
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
TYPE="debian" # can be one of 'slackware', 'debian', 'rpm'
|
||||
PROGRAM_NAME="ccextractor"
|
||||
VERSION="0.88"
|
||||
VERSION="0.96.5"
|
||||
RELEASE="1"
|
||||
LICENSE="GPL-2.0"
|
||||
MAINTAINER="carlos@ccextractor.org"
|
||||
|
||||
96
packaging/README.md
Normal file
96
packaging/README.md
Normal file
@@ -0,0 +1,96 @@
|
||||
# CCExtractor Packaging
|
||||
|
||||
This directory contains packaging configurations for Windows package managers.
|
||||
|
||||
## Windows Package Manager (winget)
|
||||
|
||||
### Initial Setup (One-time)
|
||||
|
||||
1. **Calculate MSI hash** for the current release:
|
||||
```powershell
|
||||
certutil -hashfile CCExtractor.0.96.1.msi SHA256
|
||||
```
|
||||
|
||||
2. **Update the manifest files** in `winget/` with the SHA256 hash
|
||||
|
||||
3. **Fork microsoft/winget-pkgs** to the CCExtractor organization:
|
||||
- Go to https://github.com/microsoft/winget-pkgs
|
||||
- Fork to https://github.com/CCExtractor/winget-pkgs
|
||||
|
||||
4. **Submit initial manifest** via PR:
|
||||
- Clone your fork
|
||||
- Create directory: `manifests/c/CCExtractor/CCExtractor/0.96.1/`
|
||||
- Copy the three YAML files from `winget/`
|
||||
- Submit PR to microsoft/winget-pkgs
|
||||
|
||||
5. **Create GitHub token** for automation:
|
||||
- Go to GitHub Settings > Developer settings > Personal access tokens > Tokens (classic)
|
||||
- Create token with `public_repo` scope
|
||||
- Add as secret `WINGET_TOKEN` in CCExtractor/ccextractor repository
|
||||
|
||||
### Automated Updates
|
||||
|
||||
After the initial submission is merged, the `publish_winget.yml` workflow will automatically submit PRs for new releases.
|
||||
|
||||
## Chocolatey
|
||||
|
||||
### Initial Setup (One-time)
|
||||
|
||||
1. **Create Chocolatey account**:
|
||||
- Register at https://community.chocolatey.org/account/Register
|
||||
|
||||
2. **Get API key**:
|
||||
- Go to https://community.chocolatey.org/account
|
||||
- Copy your API key
|
||||
|
||||
3. **Add secret**:
|
||||
- Add `CHOCOLATEY_API_KEY` secret to CCExtractor/ccextractor repository
|
||||
|
||||
### Package Structure
|
||||
|
||||
```
|
||||
chocolatey/
|
||||
├── ccextractor.nuspec # Package metadata
|
||||
└── tools/
|
||||
├── chocolateyInstall.ps1 # Installation script
|
||||
└── chocolateyUninstall.ps1 # Uninstallation script
|
||||
```
|
||||
|
||||
### Manual Testing
|
||||
|
||||
```powershell
|
||||
cd packaging/chocolatey
|
||||
|
||||
# Update version and checksum in files first, then:
|
||||
choco pack ccextractor.nuspec
|
||||
|
||||
# Test locally
|
||||
choco install ccextractor --source="'.'" --yes --force
|
||||
|
||||
# Verify
|
||||
ccextractor --version
|
||||
```
|
||||
|
||||
### Automated Updates
|
||||
|
||||
The `publish_chocolatey.yml` workflow automatically:
|
||||
1. Downloads the MSI from the release
|
||||
2. Calculates the SHA256 checksum
|
||||
3. Updates the nuspec and install script
|
||||
4. Builds and tests the package
|
||||
5. Pushes to Chocolatey
|
||||
|
||||
Note: Chocolatey packages go through moderation before being publicly available.
|
||||
|
||||
## Workflow Triggers
|
||||
|
||||
Both workflows trigger on:
|
||||
- **Release published**: Automatic publishing when a new release is created
|
||||
- **Manual dispatch**: Can be triggered manually with a specific tag
|
||||
|
||||
## Secrets Required
|
||||
|
||||
| Secret | Purpose |
|
||||
|--------|---------|
|
||||
| `WINGET_TOKEN` | GitHub PAT with `public_repo` scope for winget PRs |
|
||||
| `CHOCOLATEY_API_KEY` | Chocolatey API key for package uploads |
|
||||
43
packaging/chocolatey/ccextractor.nuspec
Normal file
43
packaging/chocolatey/ccextractor.nuspec
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>ccextractor</id>
|
||||
<version>0.96.5</version>
|
||||
<title>CCExtractor</title>
|
||||
<authors>CCExtractor Development Team</authors>
|
||||
<owners>CCExtractor</owners>
|
||||
<licenseUrl>https://github.com/CCExtractor/ccextractor/blob/master/LICENSE.txt</licenseUrl>
|
||||
<projectUrl>https://ccextractor.org</projectUrl>
|
||||
<iconUrl>https://raw.githubusercontent.com/CCExtractor/ccextractor/master/windows/CCX.ico</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>CCExtractor is a tool that analyzes video files and produces independent subtitle files from the closed captions data.
|
||||
|
||||
### Features
|
||||
- Extracts closed captions from various video formats (MPEG, H.264, MKV, MP4, etc.)
|
||||
- Supports multiple input sources including DVDs, DVRs, and live TV captures
|
||||
- Outputs to multiple formats (SRT, WebVTT, SAMI, transcript, etc.)
|
||||
- OCR support for bitmap-based subtitles (DVB, teletext)
|
||||
- Includes a graphical user interface
|
||||
|
||||
### Usage
|
||||
After installation, run `ccextractor` from the command line or use the GUI.
|
||||
|
||||
```
|
||||
ccextractor video.ts -o output.srt
|
||||
```
|
||||
|
||||
For more options: `ccextractor --help`
|
||||
</description>
|
||||
<summary>Extract closed captions and subtitles from video files</summary>
|
||||
<releaseNotes>https://github.com/CCExtractor/ccextractor/releases</releaseNotes>
|
||||
<copyright>Copyright (c) CCExtractor Development</copyright>
|
||||
<tags>subtitles closed-captions video extraction accessibility srt dvb teletext ocr media cli</tags>
|
||||
<projectSourceUrl>https://github.com/CCExtractor/ccextractor</projectSourceUrl>
|
||||
<packageSourceUrl>https://github.com/CCExtractor/ccextractor/tree/master/packaging/chocolatey</packageSourceUrl>
|
||||
<docsUrl>https://github.com/CCExtractor/ccextractor/wiki</docsUrl>
|
||||
<bugTrackerUrl>https://github.com/CCExtractor/ccextractor/issues</bugTrackerUrl>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="tools\**" target="tools" />
|
||||
</files>
|
||||
</package>
|
||||
24
packaging/chocolatey/tools/chocolateyInstall.ps1
Normal file
24
packaging/chocolatey/tools/chocolateyInstall.ps1
Normal file
@@ -0,0 +1,24 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$packageName = 'ccextractor'
|
||||
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
|
||||
|
||||
# Package parameters
|
||||
$packageArgs = @{
|
||||
packageName = $packageName
|
||||
fileType = 'MSI'
|
||||
url64bit = 'https://github.com/CCExtractor/ccextractor/releases/download/v0.96.5/CCExtractor.0.96.5.msi'
|
||||
checksum64 = 'FFCAB0D766180AFC2832277397CDEC885D15270DECE33A9A51947B790F1F095B'
|
||||
checksumType64 = 'sha256'
|
||||
silentArgs = '/quiet /norestart'
|
||||
validExitCodes = @(0, 3010, 1641)
|
||||
}
|
||||
|
||||
Install-ChocolateyPackage @packageArgs
|
||||
|
||||
# Add to PATH if not already there
|
||||
$installPath = Join-Path $env:ProgramFiles 'CCExtractor'
|
||||
if (Test-Path $installPath) {
|
||||
Install-ChocolateyPath -PathToInstall $installPath -PathType 'Machine'
|
||||
Write-Host "CCExtractor installed to: $installPath"
|
||||
}
|
||||
23
packaging/chocolatey/tools/chocolateyUninstall.ps1
Normal file
23
packaging/chocolatey/tools/chocolateyUninstall.ps1
Normal file
@@ -0,0 +1,23 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$packageName = 'ccextractor'
|
||||
|
||||
# Get the uninstall registry key
|
||||
$regKey = Get-UninstallRegistryKey -SoftwareName 'CCExtractor*'
|
||||
|
||||
if ($regKey) {
|
||||
$silentArgs = '/quiet /norestart'
|
||||
$file = $regKey.UninstallString -replace 'msiexec.exe','msiexec.exe ' -replace '/I','/X'
|
||||
|
||||
$packageArgs = @{
|
||||
packageName = $packageName
|
||||
fileType = 'MSI'
|
||||
silentArgs = "$($regKey.PSChildName) $silentArgs"
|
||||
file = ''
|
||||
validExitCodes = @(0, 3010, 1605, 1614, 1641)
|
||||
}
|
||||
|
||||
Uninstall-ChocolateyPackage @packageArgs
|
||||
} else {
|
||||
Write-Warning "CCExtractor was not found in the registry. It may have been uninstalled already."
|
||||
}
|
||||
21
packaging/winget/CCExtractor.CCExtractor.installer.yaml
Normal file
21
packaging/winget/CCExtractor.CCExtractor.installer.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.9.0.schema.json
|
||||
PackageIdentifier: CCExtractor.CCExtractor
|
||||
PackageVersion: 0.96.5
|
||||
Platform:
|
||||
- Windows.Desktop
|
||||
MinimumOSVersion: 10.0.0.0
|
||||
InstallModes:
|
||||
- interactive
|
||||
- silent
|
||||
- silentWithProgress
|
||||
InstallerSwitches:
|
||||
Silent: /quiet
|
||||
SilentWithProgress: /passive
|
||||
UpgradeBehavior: install
|
||||
Installers:
|
||||
- Architecture: x64
|
||||
InstallerType: msi
|
||||
InstallerUrl: https://github.com/CCExtractor/ccextractor/releases/download/v0.96.5/CCExtractor.0.96.5.msi
|
||||
InstallerSha256: FFCAB0D766180AFC2832277397CDEC885D15270DECE33A9A51947B790F1F095B
|
||||
ManifestType: installer
|
||||
ManifestVersion: 1.9.0
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user