diff --git a/src/ccextractor.c b/src/ccextractor.c index 3148f044..4f0b0ef7 100644 --- a/src/ccextractor.c +++ b/src/ccextractor.c @@ -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? diff --git a/src/ccextractor.h b/src/ccextractor.h index 9dc0e011..fb2a78a7 100644 --- a/src/ccextractor.h +++ b/src/ccextractor.h @@ -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? diff --git a/src/params.c b/src/params.c index 0c927e31..efbe7d6f 100644 --- a/src/params.c +++ b/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