mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2024-12-25 04:11:38 +00:00
Finished Custom TTXT
Finished. - Reordered parameters - Fully removed ccx_options.ucla_settings as it's fully replaced by the transcript_settings - Added parameter parsing + explanation for the custom TTXT - Finished teletext changes for custom TTXT format
This commit is contained in:
parent
a0f9387889
commit
c258207e4f
@ -16,8 +16,8 @@ ccx_transcript_format ccx_default_transcript_settings =
|
||||
{
|
||||
.showStartTime = 0,
|
||||
.showEndTime = 0,
|
||||
.showCC = 0,
|
||||
.showMode = 0,
|
||||
.showMode = 0,
|
||||
.showCC = 0,
|
||||
.relativeTimestamp = 1,
|
||||
.xds = 0,
|
||||
.useColors = 1
|
||||
@ -155,8 +155,6 @@ void init_options (struct ccx_s_options *options)
|
||||
options->autodash=0; // Add dashes (-) before each speaker automatically?
|
||||
options->teletext_mode=CCX_TXT_AUTO_NOT_YET_FOUND; // 0=Disabled, 1 = Not found, 2=Found
|
||||
|
||||
options->ucla_settings=0; // Enables convenient settings for UCLA's project.
|
||||
|
||||
options->transcript_settings = ccx_default_transcript_settings;
|
||||
options->millis_separator=',';
|
||||
options->screens_to_process=-1; // How many screenfuls we want?
|
||||
|
@ -36,8 +36,8 @@ struct ccx_boundary_time
|
||||
typedef struct {
|
||||
// TODO: add more options, and (perhaps) reduce other ccextractor options?
|
||||
int showStartTime, showEndTime; // Show start and/or end time.
|
||||
int showCC; // Show which CC channel has been captured.
|
||||
int showMode; // Show which mode if available (E.G.: POP, RU1, ...)
|
||||
int showCC; // Show which CC channel has been captured.
|
||||
int relativeTimestamp; // Timestamps relative to start of sample or in UTC?
|
||||
int xds; // Show XDS or not
|
||||
int useColors; // Add colors or no colors
|
||||
@ -95,7 +95,6 @@ struct ccx_s_options // Options from user parameters
|
||||
int usepicorder; // Force the use of pic_order_cnt_lsb in AVC/H.264 data streams
|
||||
int autodash; // Add dashes (-) before each speaker automatically?
|
||||
unsigned teletext_mode; // 0=Disabled, 1 = Not found, 2=Found
|
||||
unsigned ucla_settings; // Enables convenient settings for UCLA's project. TODO: replace this with below.
|
||||
ccx_transcript_format transcript_settings; // Keeps the settings for generating transcript output files.
|
||||
char millis_separator;
|
||||
LLONG screens_to_process; // How many screenfuls we want?
|
||||
|
58
src/params.c
58
src/params.c
@ -536,14 +536,18 @@ void usage (void)
|
||||
mprint (" -autodash: Based on position on screen, attempt to determine\n");
|
||||
mprint (" the different speakers and a dash (-) when each\n");
|
||||
mprint (" of them talks (.srt only, -trim required).");
|
||||
|
||||
mprint ("Options that affect how ccextractor reads and writes (buffering):\n");
|
||||
|
||||
mprint (" -bi --bufferinput: Forces input buffering.\n");
|
||||
mprint (" -nobi -nobufferinput: Disables input buffering.\n");
|
||||
mprint (" -bs --buffersize val: Specify a size for reading, in bytes (suffix with K or\n");
|
||||
mprint (" or M for kilobytes and megabytes). Default is 16M.\n");
|
||||
mprint ("\n");
|
||||
mprint ("Note: -bo is only used when writing raw files, not .srt or .sami\n\n");
|
||||
|
||||
mprint ("Options that affect the built-in closed caption decoder:\n");
|
||||
|
||||
mprint (" -dru: Direct Roll-Up. When in roll-up mode, write character by\n");
|
||||
mprint (" character instead of line by line. Note that this\n");
|
||||
mprint (" produces (much) larger files.\n");
|
||||
@ -561,7 +565,9 @@ void usage (void)
|
||||
mprint (" of the first character received which is possibly more\n");
|
||||
mprint (" accurate.\n");
|
||||
mprint ("\n");
|
||||
|
||||
mprint ("Options that affect timing:\n");
|
||||
|
||||
mprint (" -delay ms: For srt/sami, add this number of milliseconds to\n");
|
||||
mprint (" all times. For example, -delay 400 makes subtitles\n");
|
||||
mprint (" appear 400ms late. You can also use negative numbers\n");
|
||||
@ -573,6 +579,7 @@ void usage (void)
|
||||
mprint ("5:00 and end at 7:00.\n\n");
|
||||
|
||||
mprint ("Options that affect what segment of the input file(s) to process:\n");
|
||||
|
||||
mprint (" -startat time: Only write caption information that starts after the\n");
|
||||
mprint (" given time.\n");
|
||||
mprint (" Time can be seconds, MM:SS or HH:MM:SS.\n");
|
||||
@ -586,6 +593,7 @@ void usage (void)
|
||||
mprint ("-scr --screenfuls num: Write 'num' screenfuls and terminate processing.\n\n");
|
||||
|
||||
mprint ("Options that affect which codec is to be used have to be searched in input\n");
|
||||
|
||||
mprint (" If codec type is not selected then first elementry stream suitable for \n"
|
||||
" subtitle is selected, please consider -teletext -noteletext override this\n"
|
||||
" option.\n"
|
||||
@ -603,6 +611,7 @@ void usage (void)
|
||||
" taken in consideration\n");
|
||||
|
||||
mprint ("Adding start and end credits:\n");
|
||||
|
||||
mprint (" CCExtractor can _try_ to add a custom message (for credits for example) at\n");
|
||||
mprint (" the start and end of the file, looking for a window where there are no\n");
|
||||
mprint (" captions. If there is no such window, then no text will be added.\n");
|
||||
@ -627,7 +636,9 @@ void usage (void)
|
||||
mprint (" --endcreditsforatmost time: End credits should be displayed for at most\n");
|
||||
mprint (" this time (S, or MM:SS). Default: %s\n", DEF_VAL_ENDCREDITSFORATMOST);
|
||||
mprint ("\n");
|
||||
|
||||
mprint ("Options that affect debug data:\n");
|
||||
|
||||
mprint (" -debug: Show lots of debugging output.\n");
|
||||
mprint (" -608: Print debug traces from the EIA-608 decoder.\n");
|
||||
mprint (" If you need to submit a bug report, please send\n");
|
||||
@ -651,7 +662,9 @@ void usage (void)
|
||||
mprint (" -parsePMT: Print Program Map Table dump.\n");
|
||||
mprint (" -investigate_packets: If no CC packets are detected based on the PMT, try\n");
|
||||
mprint (" to find data in all packets by scanning.\n\n");
|
||||
|
||||
mprint ("Teletext related options:\n");
|
||||
|
||||
mprint (" -tpage page: Use this page for subtitles (if this parameter\n");
|
||||
mprint (" is not used, try to autodetect). In Spain the\n");
|
||||
mprint (" page is always 888, may vary in other countries.\n");
|
||||
@ -664,7 +677,31 @@ void usage (void)
|
||||
mprint (" and CEA-608/708 packets (if teletext is processed\n");
|
||||
mprint (" then CEA-608/708 processing is disabled).\n");
|
||||
mprint ("\n");
|
||||
|
||||
mprint("Transcript customizing options:\n");
|
||||
|
||||
mprint(" -customtxt format: Use the passed format to customize the (Timed) Transcript\n");
|
||||
mprint(" output. The format must be like this: 1100100 (7 digits).\n");
|
||||
mprint(" These indicate whether the next things should be displayed\n");
|
||||
mprint(" or not in the (timed) transcript. They represent (in order):\n");
|
||||
mprint(" - Display start time\n");
|
||||
mprint(" - Display end time\n");
|
||||
mprint(" - Display caption mode\n");
|
||||
mprint(" - Display caption channel\n");
|
||||
mprint(" - Use a relative timestamp ( relative to the sample)\n");
|
||||
mprint(" - Display XDS info\n");
|
||||
mprint(" - Use colors\n");
|
||||
mprint(" Examples:\n");
|
||||
mprint(" 0000101 is the default setting for transcripts\n");
|
||||
mprint(" 1101101 is the default for timed transcripts\n");
|
||||
mprint(" 1111001 is the default setting for -ucla\n");
|
||||
mprint(" Make sure you use this parameter after others that might\n");
|
||||
mprint(" affect these settings (-out, -ucla, -xds, -txt, -ttxt, ...)\n");
|
||||
|
||||
mprint("\n");
|
||||
|
||||
mprint ("Communication with other programs and console output:\n");
|
||||
|
||||
mprint (" --gui_mode_reports: Report progress and interesting events to stderr\n");
|
||||
mprint (" in a easy to parse format. This is intended to be\n");
|
||||
mprint (" used by other programs. See docs directory for.\n");
|
||||
@ -1450,6 +1487,27 @@ void parse_parameters (int argc, char *argv[])
|
||||
ccx_options.teletext_mode=CCX_TXT_FORBIDDEN;
|
||||
continue;
|
||||
}
|
||||
/* Custom transcript */
|
||||
if (strcmp(argv[i], "-customtxt") == 0 && i<argc - 1){
|
||||
char *format = argv[i + 1];
|
||||
if (strlen(format) == 7){
|
||||
if (ccx_options.date_format == ODF_NONE)
|
||||
ccx_options.date_format = ODF_HHMMSSMS; // Necessary for displaying times, if any would be used.
|
||||
ccx_options.transcript_settings.showStartTime = format[0]-'0';
|
||||
ccx_options.transcript_settings.showEndTime = format[1] - '0';
|
||||
ccx_options.transcript_settings.showMode = format[2] - '0';
|
||||
ccx_options.transcript_settings.showCC = format[3] - '0';
|
||||
ccx_options.transcript_settings.relativeTimestamp = format[4] - '0';
|
||||
ccx_options.transcript_settings.xds = format[5] - '0';
|
||||
ccx_options.transcript_settings.useColors = format[6] - '0';
|
||||
i++;
|
||||
}
|
||||
else {
|
||||
fatal(EXIT_MALFORMED_PARAMETER, "Custom TXT format not OK: %s, expected 7 bits string\n",
|
||||
format);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
/* Network stuff */
|
||||
if (strcmp (argv[i],"-udp")==0 && i<argc-1)
|
||||
{
|
||||
|
22
src/telxcc.c
22
src/telxcc.c
@ -360,14 +360,22 @@ void telxcc_dump_prev_page (void)
|
||||
char c_temp1[80],c_temp2[80]; // For timing
|
||||
if (!page_buffer_prev)
|
||||
return;
|
||||
if (ccx_options.date_format!=ODF_NONE)
|
||||
{
|
||||
millis_to_date (prev_show_timestamp, c_temp1); // Note: Delay not added here because it was already accounted for
|
||||
millis_to_date (prev_hide_timestamp, c_temp2);
|
||||
fdprintf(wbout1.fh,"%s|%s|", c_temp1,c_temp2);
|
||||
|
||||
if (ccx_options.transcript_settings.showStartTime){
|
||||
millis_to_date(prev_show_timestamp, c_temp1); // Note: Delay not added here because it was already accounted for
|
||||
fdprintf(wbout1.fh, "%s|", c_temp1);
|
||||
}
|
||||
if (ccx_options.transcript_settings.showEndTime)
|
||||
{
|
||||
millis_to_date (prev_hide_timestamp, c_temp2);
|
||||
fdprintf(wbout1.fh,"%s|",c_temp2);
|
||||
}
|
||||
if (ccx_options.transcript_settings.showMode){
|
||||
fdprintf(wbout1.fh, "TLT|");
|
||||
}
|
||||
if (ccx_options.transcript_settings.showCC){
|
||||
fdprintf(wbout1.fh, "%.3u|", bcd_page_to_int(tlt_config.page));
|
||||
}
|
||||
if (ccx_options.ucla_settings)
|
||||
fdprintf(wbout1.fh, "TLT|%.3u|", bcd_page_to_int (tlt_config.page));
|
||||
|
||||
if (wbout1.fh!=-1) fdprintf(wbout1.fh, "%s",page_buffer_prev);
|
||||
fdprintf(wbout1.fh,"%s",encoded_crlf);
|
||||
|
Loading…
Reference in New Issue
Block a user