mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Fix for generate transparent subtitle duration
This commit is contained in:
parent
c28ffceb3a
commit
cbcf3f8f94
@ -457,12 +457,17 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private Process GetFfmpegProcess(string outputVideoFileName, string assaTempFileName)
|
||||
{
|
||||
var totalMs = _assaSubtitle.Paragraphs.Max(p => p.EndTime.TotalMilliseconds);
|
||||
var ts = TimeSpan.FromMilliseconds(totalMs + 2000);
|
||||
var timeCode = string.Format($"{ts.Hours:00}\\\\:{ts.Minutes:00}\\\\:{ts.Seconds:00}");
|
||||
|
||||
return VideoPreviewGenerator.GenerateTransparentVideoFile(
|
||||
assaTempFileName,
|
||||
outputVideoFileName,
|
||||
(int)numericUpDownWidth.Value,
|
||||
(int)numericUpDownHeight.Value,
|
||||
comboBoxFrameRate.Text,
|
||||
timeCode,
|
||||
OutputHandler);
|
||||
}
|
||||
|
||||
|
@ -683,7 +683,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
return processMakeVideo;
|
||||
}
|
||||
|
||||
public static Process GenerateTransparentVideoFile(string assaSubtitleFileName, string outputVideoFileName, int width, int height, string frameRate, DataReceivedEventHandler dataReceivedHandler)
|
||||
public static Process GenerateTransparentVideoFile(string assaSubtitleFileName, string outputVideoFileName, int width, int height, string frameRate, string timeCode, DataReceivedEventHandler dataReceivedHandler)
|
||||
{
|
||||
if (width % 2 == 1)
|
||||
{
|
||||
@ -702,7 +702,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
StartInfo =
|
||||
{
|
||||
FileName = GetFfmpegLocation(),
|
||||
Arguments = $" -y -f lavfi -i \"color=c=black@0.0:s={width}x{height}:r={frameRate}:d=00\\\\:00\\\\:30,format=rgba,subtitles=f={Path.GetFileName(assaSubtitleFileName)}:alpha=1\" -c:v png {outputVideoFileName}".TrimStart(),
|
||||
Arguments = $" -y -f lavfi -i \"color=c=black@0.0:s={width}x{height}:r={frameRate}:d={timeCode},format=rgba,subtitles=f={Path.GetFileName(assaSubtitleFileName)}:alpha=1\" -c:v png {outputVideoFileName}".TrimStart(),
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true,
|
||||
WorkingDirectory = Path.GetDirectoryName(assaSubtitleFileName) ?? string.Empty,
|
||||
|
Loading…
Reference in New Issue
Block a user