mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 19:22:53 +01:00
Update change log
+ work on cmd line ocr
This commit is contained in:
parent
55b9af30f0
commit
ba9d7bd988
@ -28,6 +28,8 @@
|
||||
* Update Romanian translation - thx Mircea
|
||||
* Update Chinese translation - thx LeonCheung
|
||||
* Update Polish translation - thx admas
|
||||
* Update Portuguese translation - thx moob
|
||||
* Update Greek translation - thx Lero91
|
||||
* Init no-break-after-list with language
|
||||
* Make quick-char-list in "OCR Char" window dynamic
|
||||
* Remember settings for "column paste"
|
||||
@ -45,6 +47,7 @@
|
||||
* FIXED:
|
||||
* Fix spell check dictionary download - thx bluesea1401/ksoll4
|
||||
* Fix freeze after using Win key
|
||||
* Fix auto-br issue with dialog - thx Kevin
|
||||
* Fix for sometimes missing last sub in teletext - thx borifax/xylographe
|
||||
* Fix for sometimes missing images in bdsup - thx Devin
|
||||
* Fix OCR window after minimize - thx Janusz
|
||||
@ -60,10 +63,10 @@
|
||||
* Fix list view Ctrl+v/selection bug - thx gleaming
|
||||
* Fixes for Bing translate token endpoint - thx obliver27
|
||||
* Fix auto br for 3+ lines dialog - thx thejester77
|
||||
* Fix auto-br issue with dialog - thx Kevin
|
||||
* Don't remove spaces in auto-br - thx thehulk
|
||||
* Fix crash in compare report - thx Janusz
|
||||
* Fix "Extend to previous/next" shortcuts w original - thx OmrSi
|
||||
* Fix for overlap in "adjust durations" - thx JD
|
||||
|
||||
|
||||
3.5.15 (1st May 2020)
|
||||
|
@ -1152,7 +1152,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
item.SubItems[3].Text = Configuration.Settings.Language.BatchConvert.Ocr + " " + progress;
|
||||
listViewInputFiles.Refresh();
|
||||
};
|
||||
vobSubOcr.InitializeBatch(fileName, Configuration.Settings.VobSubOcr, false);
|
||||
vobSubOcr.InitializeBatch(fileName, Configuration.Settings.VobSubOcr, false, "Tesseract");
|
||||
sub = vobSubOcr.SubtitleFromOcr;
|
||||
}
|
||||
}
|
||||
|
@ -615,13 +615,23 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
comboBoxDictionaries.SelectedIndexChanged += comboBoxDictionaries_SelectedIndexChanged;
|
||||
}
|
||||
|
||||
internal void InitializeBatch(string vobSubFileName, VobSubOcrSettings vobSubOcrSettings, bool forcedOnly, string language = null)
|
||||
internal void InitializeBatch(string vobSubFileName, VobSubOcrSettings vobSubOcrSettings, bool forcedOnly, string ocrEngine, string language = null)
|
||||
{
|
||||
Initialize(vobSubFileName, vobSubOcrSettings, null, true);
|
||||
FormVobSubOcr_Shown(null, null);
|
||||
checkBoxShowOnlyForced.Checked = forcedOnly;
|
||||
checkBoxPromptForUnknownWords.Checked = false;
|
||||
|
||||
if (ocrEngine?.ToLowerInvariant() == "nocr")
|
||||
{
|
||||
var oldNOcrDrawText = checkBoxNOcrDrawUnknownLetters.Checked;
|
||||
InitializeNOcrForBatch(language);
|
||||
checkBoxShowOnlyForced.Checked = forcedOnly;
|
||||
DoBatch();
|
||||
checkBoxNOcrDrawUnknownLetters.Checked = oldNOcrDrawText;
|
||||
return;
|
||||
}
|
||||
|
||||
_ocrMethodIndex = Configuration.Settings.VobSubOcr.LastOcrMethod == "Tesseract4" ? _ocrMethodTesseract4 : _ocrMethodTesseract302;
|
||||
if (language == null)
|
||||
{
|
||||
@ -6383,6 +6393,11 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
if (string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
fileName = Configuration.Settings.VobSubOcr.LineOcrLastLanguages;
|
||||
if (string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
fileName = "Latin";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
fileName = Path.Combine(Configuration.OcrDirectory, Configuration.Settings.VobSubOcr.LineOcrLastLanguages + ".nocr");
|
||||
|
@ -597,7 +597,7 @@ namespace Nikse.SubtitleEdit.Logic.CommandLineConvert
|
||||
else if (!done && FileUtil.IsVobSub(fileName))
|
||||
{
|
||||
_stdOutWriter.WriteLine("Found VobSub subtitle format");
|
||||
ConvertVobSubSubtitle(fileName, targetFormat, offset, targetEncoding, outputFolder, count, ref converted, ref errors, formats, overwrite, pacCodePage, targetFrameRate, multipleReplaceImportFiles, actions, forcedOnly);
|
||||
ConvertVobSubSubtitle(fileName, targetFormat, offset, targetEncoding, outputFolder, count, ref converted, ref errors, formats, overwrite, pacCodePage, targetFrameRate, multipleReplaceImportFiles, actions, forcedOnly, ocrEngine);
|
||||
done = true;
|
||||
}
|
||||
|
||||
@ -807,7 +807,7 @@ namespace Nikse.SubtitleEdit.Logic.CommandLineConvert
|
||||
}
|
||||
}
|
||||
|
||||
private static void ConvertVobSubSubtitle(string fileName, string targetFormat, TimeSpan offset, TextEncoding targetEncoding, string outputFolder, int count, ref int converted, ref int errors, IEnumerable<SubtitleFormat> formats, bool overwrite, int pacCodePage, double? targetFrameRate, ICollection<string> multipleReplaceImportFiles, IEnumerable<BatchAction> actions, bool forcedOnly)
|
||||
private static void ConvertVobSubSubtitle(string fileName, string targetFormat, TimeSpan offset, TextEncoding targetEncoding, string outputFolder, int count, ref int converted, ref int errors, IEnumerable<SubtitleFormat> formats, bool overwrite, int pacCodePage, double? targetFrameRate, ICollection<string> multipleReplaceImportFiles, IEnumerable<BatchAction> actions, bool forcedOnly, string ocrEngine)
|
||||
{
|
||||
var format = Utilities.GetSubtitleFormatByFriendlyName(targetFormat) ?? new SubRip();
|
||||
|
||||
@ -815,12 +815,12 @@ namespace Nikse.SubtitleEdit.Logic.CommandLineConvert
|
||||
Subtitle sub;
|
||||
using (var vobSubOcr = new VobSubOcr())
|
||||
{
|
||||
_stdOutWriter?.WriteLine("Using OCR to extract subtitles");
|
||||
_stdOutWriter?.WriteLine($"Using OCR via {ocrEngine} to extract subtitles");
|
||||
vobSubOcr.ProgressCallback = progress =>
|
||||
{
|
||||
_stdOutWriter?.Write($"\r{Configuration.Settings.Language.BatchConvert.Ocr} : {progress}");
|
||||
};
|
||||
vobSubOcr.InitializeBatch(fileName, Configuration.Settings.VobSubOcr, forcedOnly);
|
||||
vobSubOcr.InitializeBatch(fileName, Configuration.Settings.VobSubOcr, forcedOnly, ocrEngine);
|
||||
_stdOutWriter?.WriteLine();
|
||||
sub = vobSubOcr.SubtitleFromOcr;
|
||||
_stdOutWriter?.WriteLine($"Extracted subtitles from file \"{fileName}\"");
|
||||
|
Loading…
Reference in New Issue
Block a user