Fix image sequence import, fix JPEG export args, include img ext in frame output dir name

This commit is contained in:
N00MKRAD
2024-11-08 11:54:26 +01:00
parent 71da171156
commit 70e17dcabc
9 changed files with 85 additions and 55 deletions

View File

@@ -74,11 +74,12 @@ namespace Flowframes.Data
Size = GetSize();
}
public async Task InitializeSequence()
public void InitializeSequence()
{
try
{
if (SequenceInitialized) return;
if (SequenceInitialized)
return;
string seqPath = Path.Combine(Paths.GetFrameSeqPath(), CreationTime.ToString(), "frames.concat");
string chosenExt = IoUtils.GetUniqueExtensions(SourcePath).FirstOrDefault();
@@ -101,7 +102,7 @@ namespace Flowframes.Data
try
{
if (IsDirectory && !SequenceInitialized)
await InitializeSequence();
InitializeSequence();
await LoadFormatInfo(ImportPath);
AllStreams = await FfmpegUtils.GetStreams(ImportPath, progressBar, StreamCount, InputRate, countFrames, this);
@@ -122,11 +123,19 @@ namespace Flowframes.Data
private async Task LoadFormatInfo(string path)
{
StreamCount = await FfmpegUtils.GetStreamCount(path);
// If input is a sequence, there's not much metadata to check
if (path.IsConcatFile())
{
DurationMs = (long)(FileCount * 1000 / ((Fraction)InputRate).Float); // Estimate duration using specified FPS and frame count
return;
}
Title = await GetVideoInfo.GetFfprobeInfoAsync(path, GetVideoInfo.FfprobeMode.ShowFormat, "TAG:title");
Language = await GetVideoInfo.GetFfprobeInfoAsync(path, GetVideoInfo.FfprobeMode.ShowFormat, "TAG:language");
DurationMs = await FfmpegCommands.GetDurationMs(path, this);
FfmpegCommands.CheckVfr(path, this);
StreamCount = await FfmpegUtils.GetStreamCount(path);
TotalKbits = (await GetVideoInfo.GetFfprobeInfoAsync(path, GetVideoInfo.FfprobeMode.ShowFormat, "bit_rate")).GetInt() / 1000;
}