mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2024-12-25 04:11:38 +00:00
-Added -nospupngocr (don't OCR bitmaps when generating spupng, faster)
This commit is contained in:
parent
62dab0dde9
commit
0c0bf1aafd
@ -33,6 +33,7 @@ void init_options (struct ccx_s_options *options)
|
||||
options->no_progress_bar=0; // If 1, suppress the output of the progress to stdout
|
||||
options->enc_cfg.sentence_cap =0 ; // FIX CASE? = Fix case?
|
||||
options->enc_cfg.splitbysentence = 0; // Split text into complete sentences and prorate time?
|
||||
options->enc_cfg.nospupngocr = 0;
|
||||
options->sentence_cap_file=NULL; // Extra words file?
|
||||
options->live_stream=0; // 0 -> A regular file
|
||||
options->messages_target=1; // 1=stdout
|
||||
|
@ -70,6 +70,7 @@ struct encoder_cfg
|
||||
LLONG subs_delay; // ms to delay (or advance) subs
|
||||
int program_number;
|
||||
unsigned char in_format;
|
||||
int nospupngocr; // 1 if we don't want to OCR bitmaps to add the text as comments in the XML file in spupng
|
||||
|
||||
//CEA-708
|
||||
int services_enabled[CCX_DTVCC_MAX_SERVICES];
|
||||
|
@ -1039,6 +1039,7 @@ struct encoder_ctx *init_encoder(struct encoder_cfg *opt)
|
||||
|
||||
ctx->segment_pending = 0;
|
||||
ctx->segment_last_key_frame = 0;
|
||||
ctx->nospupngocr = opt->nospupngocr;
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
@ -128,6 +128,9 @@ struct encoder_ctx
|
||||
// Segmenting
|
||||
int segment_pending;
|
||||
int segment_last_key_frame;
|
||||
|
||||
// OCR in SPUPNG
|
||||
int nospupngocr;
|
||||
};
|
||||
|
||||
#define INITIAL_ENC_BUFFER_CAPACITY 2048
|
||||
|
@ -612,7 +612,8 @@ void print_usage (void)
|
||||
mprint (" ISO-639-2 form (like \"fre\" for french) or a language\n");
|
||||
mprint (" code followed by a dash and a country code for specialities\n");
|
||||
mprint (" in languages (like \"fre-ca\" for Canadian French).\n");
|
||||
|
||||
mprint (" -nospupngocr When processing DVB don't use the OCR to write the text as");
|
||||
mprint (" comments in the XML file.\n");
|
||||
mprint ("\n");
|
||||
mprint ("Options that affect how ccextractor reads and writes (buffering):\n");
|
||||
|
||||
@ -1464,6 +1465,12 @@ int parse_parameters (struct ccx_s_options *opt, int argc, char *argv[])
|
||||
opt->ocrlang[char_index] = cctolower(opt->ocrlang[char_index]);
|
||||
continue;
|
||||
}
|
||||
if (strcmp(argv[i], "-nospupngocr") == 0)
|
||||
{
|
||||
opt->enc_cfg.nospupngocr = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (strcmp(argv[i], "-oem") == 0)
|
||||
{
|
||||
|
@ -565,7 +565,8 @@ int write_cc_bitmap_as_spupng(struct cc_subtitle *sub, struct encoder_ctx *conte
|
||||
|
||||
/* TODO do rectangle wise, one color table should not be used for all rectangles */
|
||||
mapclut_paletee(palette, alpha, (uint32_t *)rect[0].data[1],rect[0].nb_colors);
|
||||
#ifdef ENABLE_OCR
|
||||
#ifdef ENABLE_OCR
|
||||
if (!context->nospupngocr)
|
||||
{
|
||||
char *str;
|
||||
str = paraof_ocrtext(sub, context->encoded_crlf, context->encoded_crlf_length);
|
||||
|
Loading…
Reference in New Issue
Block a user