ASR
This commit is contained in:
parent
d36af0d372
commit
483f6acef6
@ -215,3 +215,12 @@ ConnectionType=USBOnly
|
|||||||
bUseManualIPAddress=False
|
bUseManualIPAddress=False
|
||||||
ManualIPAddress=
|
ManualIPAddress=
|
||||||
|
|
||||||
|
[Voice]
|
||||||
|
bEnabled=true
|
||||||
|
|
||||||
|
[SystemSettings]
|
||||||
|
voice.SilenceDetectionThreshold=0.01
|
||||||
|
voice.MicNoiseGateThreshold=0.01
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
@ -24,7 +24,7 @@ uint32 FVideoThread::Run()
|
|||||||
{
|
{
|
||||||
if (CurrentSeekingFrame != -1)
|
if (CurrentSeekingFrame != -1)
|
||||||
{
|
{
|
||||||
int32 VideoFPS = NewPropertyData.VideoCodecContext->frame_number;
|
int32 VideoFPS = NewPropertyData.VideoCodecContext->time_base.den;
|
||||||
if (VideoFPS < FGlobalData::GlobalFPS)
|
if (VideoFPS < FGlobalData::GlobalFPS)
|
||||||
{
|
{
|
||||||
const double Interval = FGlobalData::GlobalFPS / VideoFPS;
|
const double Interval = FGlobalData::GlobalFPS / VideoFPS;
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
#include "Cut5/Utils/FFMPEGUtils.h"
|
#include "Cut5/Utils/FFMPEGUtils.h"
|
||||||
#include "Cut5/Utils/Utils.h"
|
#include "Cut5/Utils/Utils.h"
|
||||||
|
|
||||||
FVideoThumbnailThread::FVideoThumbnailThread(const FString& MoviePath, TFunction<void(FString)> OnFinished, int32 BrushCount, const FClipData ClipData)
|
FVideoThumbnailThread::FVideoThumbnailThread(const FString& MoviePath, TFunction<void(FString)> OnFinished, int32 BrushCount, FClipData* ClipData)
|
||||||
{
|
{
|
||||||
this->MoviePath = MoviePath;
|
this->MoviePath = MoviePath;
|
||||||
this->OnFinished = OnFinished;
|
this->OnFinished = OnFinished;
|
||||||
this->BrushCount = BrushCount;
|
this->BrushCount = BrushCount;
|
||||||
this->ClipData = ClipData;
|
this->ClipData = ClipData;
|
||||||
|
|
||||||
if (ClipData.MovieBrushesPath.Num() == 0)
|
if (ClipData->MovieBrushesPath.Num() == 0)
|
||||||
{
|
{
|
||||||
bMissionStart = true;
|
bMissionStart = true;
|
||||||
}
|
}
|
||||||
@ -30,7 +30,7 @@ uint32 FVideoThumbnailThread::Run()
|
|||||||
int32 i = 0;
|
int32 i = 0;
|
||||||
while (bMissionStart)
|
while (bMissionStart)
|
||||||
{
|
{
|
||||||
if (i < BrushCount && ClipData.ResourcePropertyDataPtr && ClipData.ResourcePropertyDataPtr->Context && ClipData.ResourcePropertyDataPtr->VideoStream != -1)
|
if (i < BrushCount && ClipData->ResourcePropertyDataPtr && ClipData->ResourcePropertyDataPtr->Context && ClipData->ResourcePropertyDataPtr->VideoStream != -1)
|
||||||
{
|
{
|
||||||
const int32 CurrentFrame = BrushCount - (BrushCount - i);
|
const int32 CurrentFrame = BrushCount - (BrushCount - i);
|
||||||
const int64 Timestamp = av_rescale_q(CurrentFrame / FGlobalData::GlobalFPS * AV_TIME_BASE, AVRational{1, AV_TIME_BASE}, Info.Context->streams[Info.VideoStream]->time_base);
|
const int64 Timestamp = av_rescale_q(CurrentFrame / FGlobalData::GlobalFPS * AV_TIME_BASE, AVRational{1, AV_TIME_BASE}, Info.Context->streams[Info.VideoStream]->time_base);
|
||||||
@ -94,11 +94,18 @@ uint32 FVideoThumbnailThread::Run()
|
|||||||
Texture->UpdateResource();
|
Texture->UpdateResource();
|
||||||
|
|
||||||
FGuid Guid = FGuid::NewGuid();
|
FGuid Guid = FGuid::NewGuid();
|
||||||
FFFMPEGUtils::ExportImage(Texture, ToFullPath(FUtils::GetProjectTempPath() / ClipData.ClipGuid.ToString() / Guid.ToString() + ".png"));
|
if (Texture->IsValidLowLevel())
|
||||||
OnFinished(FUtils::GetProjectTempPath() / ClipData.ClipGuid.ToString() / Guid.ToString() + ".png");
|
{
|
||||||
|
FFFMPEGUtils::ExportImage(Texture, ToFullPath(FUtils::GetProjectTempPath() / ClipData->ClipGuid.ToString() / Guid.ToString() + ".png"));
|
||||||
|
FString PicPath = FUtils::GetProjectTempPath() / ClipData->ClipGuid.ToString() / Guid.ToString() + ".png";
|
||||||
|
|
||||||
|
ClipData->MovieBrushesPath.Add(PicPath);
|
||||||
|
const FSlateDynamicImageBrush Brush = FSlateDynamicImageBrush(*ToFullPath(PicPath), FVector2f(0, 0));
|
||||||
|
ClipData->MovieBrushes.Add(Brush);
|
||||||
|
|
||||||
|
Texture->MarkAsGarbage();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Texture->MarkAsGarbage();
|
|
||||||
delete RawData;
|
delete RawData;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -5,16 +5,16 @@ class FVideoThumbnailThread : public FRunnable
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FVideoThumbnailThread(const FString& MoviePath, TFunction<void(FString)> OnFinished, int32 BrushCount, const FClipData ClipData);
|
FVideoThumbnailThread(const FString& MoviePath, TFunction<void(FString)> OnFinished, int32 BrushCount, FClipData* ClipData);
|
||||||
|
|
||||||
virtual bool Init() override { return true; }
|
virtual bool Init() override { return true; }
|
||||||
virtual uint32 Run() override;
|
virtual uint32 Run() override;
|
||||||
virtual void Stop() override {};
|
virtual void Stop() override { bMissionStart = false; };
|
||||||
virtual void Exit() override {};
|
virtual void Exit() override {};
|
||||||
|
|
||||||
FString MoviePath;
|
FString MoviePath;
|
||||||
TFunction<void(FString)> OnFinished;
|
TFunction<void(FString)> OnFinished;
|
||||||
int32 BrushCount;
|
int32 BrushCount;
|
||||||
FClipData ClipData;
|
FClipData* ClipData;
|
||||||
bool bMissionStart = false;
|
bool bMissionStart = false;
|
||||||
};
|
};
|
||||||
|
@ -181,7 +181,7 @@ struct CUT5_API FTrackData
|
|||||||
Ar << TrackData.ClipData;
|
Ar << TrackData.ClipData;
|
||||||
Ar << TrackData.DeviceTrack;
|
Ar << TrackData.DeviceTrack;
|
||||||
Ar << TrackData.IsMute;
|
Ar << TrackData.IsMute;
|
||||||
Ar << TrackData.bIsEdit;
|
// Ar << TrackData.bIsEdit;
|
||||||
return Ar;
|
return Ar;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ struct CUT5_API FTrackData
|
|||||||
FDeviceTrack DeviceTrack = FDeviceTrack("None", ETrackType::VideoTrack);
|
FDeviceTrack DeviceTrack = FDeviceTrack("None", ETrackType::VideoTrack);
|
||||||
TArray<FClipData> ClipData;
|
TArray<FClipData> ClipData;
|
||||||
|
|
||||||
bool bIsEdit = false;
|
// bool bIsEdit = false;
|
||||||
|
|
||||||
bool IsMute = false;
|
bool IsMute = false;
|
||||||
};
|
};
|
||||||
|
@ -125,7 +125,7 @@ void DragDropOperator::OnUpdateVideoTrack(const FClipData& VideoClipData)
|
|||||||
SCutTimeline* Timeline = SavedMainInterface->GetCutTimeline();
|
SCutTimeline* Timeline = SavedMainInterface->GetCutTimeline();
|
||||||
FTrackData* ProjectorTrack = Timeline->GetTrackDataByType(ETrackType::ProjectorTrack);
|
FTrackData* ProjectorTrack = Timeline->GetTrackDataByType(ETrackType::ProjectorTrack);
|
||||||
|
|
||||||
if (ProjectorTrack->bIsEdit == false)
|
if (true)
|
||||||
{
|
{
|
||||||
ProjectorTrack->ClipData.Empty();
|
ProjectorTrack->ClipData.Empty();
|
||||||
FClipData NewClipData;
|
FClipData NewClipData;
|
||||||
@ -152,7 +152,7 @@ void DragDropOperator::OnUpdateProjectorTrack(const FClipData& ProjectorClipData
|
|||||||
{
|
{
|
||||||
SCutTimeline* Timeline = SavedMainInterface->GetCutTimeline();
|
SCutTimeline* Timeline = SavedMainInterface->GetCutTimeline();
|
||||||
FTrackData* ProjectorTrack = Timeline->GetTrackDataByType(ETrackType::ProjectorTrack);
|
FTrackData* ProjectorTrack = Timeline->GetTrackDataByType(ETrackType::ProjectorTrack);
|
||||||
ProjectorTrack->bIsEdit = true;
|
// ProjectorTrack->bIsEdit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "Engine/Engine.h"
|
#include "Engine/Engine.h"
|
||||||
#include "Engine/Texture2D.h"
|
#include "Engine/Texture2D.h"
|
||||||
#include "HAL/ThreadManager.h"
|
#include "HAL/ThreadManager.h"
|
||||||
|
#include "Kismet/KismetMathLibrary.h"
|
||||||
#include "MicroWidgets/SNewProjectTips.h"
|
#include "MicroWidgets/SNewProjectTips.h"
|
||||||
#include "Presets/SClipCursor.h"
|
#include "Presets/SClipCursor.h"
|
||||||
#include "Presets/SClipVolumeCursor.h"
|
#include "Presets/SClipVolumeCursor.h"
|
||||||
@ -272,19 +273,12 @@ void STimelineClip::Construct(const FArguments& InArgs)
|
|||||||
{
|
{
|
||||||
if (!MainWidgetInterface->GetSelf()->GetThread(FUtils::GetVideoThumbnailThreadGuid(ClipData->ClipGuid)))
|
if (!MainWidgetInterface->GetSelf()->GetThread(FUtils::GetVideoThumbnailThreadGuid(ClipData->ClipGuid)))
|
||||||
{
|
{
|
||||||
FClipData& Clip = *ClipData;
|
|
||||||
FVideoThumbnailThread* ThumbnailThread = new FVideoThumbnailThread(ClipData->MoviePath, [this, &Clip](const FString& PicPath)
|
FVideoThumbnailThread* ThumbnailThread = new FVideoThumbnailThread(ClipData->MoviePath, [this](const FString& PicPath)
|
||||||
{
|
{
|
||||||
if (this == nullptr)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Clip.MovieBrushesPath.Add(PicPath);
|
|
||||||
const FSlateDynamicImageBrush Brush = FSlateDynamicImageBrush(*ToFullPath(PicPath), FVector2f(0, 0));
|
|
||||||
Clip.MovieBrushes.Add(Brush);
|
|
||||||
|
|
||||||
|
|
||||||
}, ClipData->MovieBrushNum, *ClipData);
|
}, ClipData->MovieBrushNum, ClipData);
|
||||||
|
|
||||||
FRunnableThread::Create(ThumbnailThread, TEXT("VideoThumbnailThread"));
|
FRunnableThread::Create(ThumbnailThread, TEXT("VideoThumbnailThread"));
|
||||||
MainWidgetInterface->GetSelf()->AddThread(FUtils::GetVideoThumbnailThreadGuid(ClipData->ClipGuid), ThumbnailThread);
|
MainWidgetInterface->GetSelf()->AddThread(FUtils::GetVideoThumbnailThreadGuid(ClipData->ClipGuid), ThumbnailThread);
|
||||||
@ -342,6 +336,10 @@ void STimelineClip::Construct(const FArguments& InArgs)
|
|||||||
|
|
||||||
STimelineClip::~STimelineClip()
|
STimelineClip::~STimelineClip()
|
||||||
{
|
{
|
||||||
|
// if (MainWidgetInterface->GetSelf()->Threads.Contains(FUtils::GetVideoThumbnailThreadGuid(ClipData->ClipGuid)))
|
||||||
|
// {
|
||||||
|
// MainWidgetInterface->GetSelf()->GetThread(FUtils::GetVideoThumbnailThreadGuid(ClipData->ClipGuid))->Stop();
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -736,15 +734,16 @@ int32 STimelineClip::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGe
|
|||||||
CropEndFrameOffset = CropStartFrameOffset * FGlobalData::DefaultTimeTickSpace + (RangeEnd - RangeStart);
|
CropEndFrameOffset = CropStartFrameOffset * FGlobalData::DefaultTimeTickSpace + (RangeEnd - RangeStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 NeedDrawCount = (CropEndFrameOffset - CropStartFrameOffset) * FGlobalData::DefaultTimeTickSpace * 2;
|
int32 NeedDrawCount = ClipData->GetLength() * FGlobalData::DefaultTimeTickSpace;
|
||||||
|
|
||||||
const int32 StartOffset = (ClipData->ResourcePropertyDataPtr->AudioSample / FGlobalData::GlobalFPS)
|
const int32 StartOffset = (ClipData->ResourcePropertyDataPtr->AudioSample / FGlobalData::GlobalFPS)
|
||||||
* ClipData->VideoStartFrame
|
* ClipData->VideoStartFrame
|
||||||
* FUtils::GetFormatSampleBytesNum(ClipData->ResourcePropertyDataPtr->SampleFormat) * 2 / DownSample;
|
* FUtils::GetFormatSampleBytesNum(ClipData->ResourcePropertyDataPtr->SampleFormat) * 2 / DownSample;
|
||||||
const int32 EndOffset = (ClipData->ResourcePropertyDataPtr->AudioSample / FGlobalData::GlobalFPS)
|
|
||||||
|
const int32 EndOffset = (ClipData->ResourcePropertyDataPtr->AudioSample / FGlobalData::GlobalFPS)
|
||||||
* ClipData->VideoEndFrame
|
* ClipData->VideoEndFrame
|
||||||
* FUtils::GetFormatSampleBytesNum(ClipData->ResourcePropertyDataPtr->SampleFormat) * 2 / DownSample;
|
* FUtils::GetFormatSampleBytesNum(ClipData->ResourcePropertyDataPtr->SampleFormat) * 2 / DownSample;
|
||||||
|
|
||||||
const int32 CropStartDataOffset = (ClipData->ResourcePropertyDataPtr->AudioSample / FGlobalData::GlobalFPS)
|
const int32 CropStartDataOffset = (ClipData->ResourcePropertyDataPtr->AudioSample / FGlobalData::GlobalFPS)
|
||||||
* CropStartFrameOffset * FUtils::GetFormatSampleBytesNum(ClipData->ResourcePropertyDataPtr->SampleFormat) * 2 / DownSample;
|
* CropStartFrameOffset * FUtils::GetFormatSampleBytesNum(ClipData->ResourcePropertyDataPtr->SampleFormat) * 2 / DownSample;
|
||||||
|
|
||||||
@ -756,36 +755,34 @@ int32 STimelineClip::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGe
|
|||||||
NeedDrawCount = -1;
|
NeedDrawCount = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int32 Interval = (CropEndDataOffset - CropStartDataOffset) / NeedDrawCount;
|
// const int32 Interval = (CropEndDataOffset - CropStartDataOffset) / NeedDrawCount;
|
||||||
|
|
||||||
|
|
||||||
if (CropStartFrameOffset != -1 || NeedDrawCount != -1)
|
if (CropStartFrameOffset != -1 || NeedDrawCount != -1)
|
||||||
{
|
{
|
||||||
const float StartRange = CurrentStartRange - RangeStart;
|
//
|
||||||
const float EndRange = CurrentEndRange;
|
// const float RangeStart = MainWidgetInterface->GetCutTimeline()->TrackBodyHScrollBox->GetCachedGeometry().LocalToAbsolute(FVector2D(0, 0)).X;
|
||||||
|
// const float RangeEnd = MainWidgetInterface->GetCutTimeline()->TrackBodyHScrollBox->GetCachedGeometry().LocalToAbsolute(FVector2D(MainWidgetInterface->GetCutTimeline()->TrackBodyHScrollBox->GetCachedGeometry().GetLocalSize().X, 0)).X;
|
||||||
|
// const float CurrentStartRange = AllottedGeometry.LocalToAbsolute(FVector2D(0, 0)).X;
|
||||||
|
// const float CurrentEndRange = AllottedGeometry.LocalToAbsolute(FVector2D(AllottedGeometry.GetLocalSize().X, 0)).X;
|
||||||
|
//
|
||||||
|
|
||||||
|
const int32 Interval = (EndOffset - StartOffset) / NeedDrawCount;
|
||||||
for (int32 i = 0; i < NeedDrawCount / DownSample; i++)
|
for (int32 i = 0; i < NeedDrawCount / DownSample; i++)
|
||||||
{
|
{
|
||||||
const int32 CurrentIndex = (CropStartDataOffset * DownSample) + (i * (Interval * DownSample * 4));
|
const int32 CurrentIndex = (StartOffset * DownSample) + (i * (Interval * DownSample * 4));
|
||||||
if (CurrentIndex >= ClipData->ResourcePropertyDataPtr->AudioData.Num())
|
if (CurrentIndex >= ClipData->ResourcePropertyDataPtr->AudioData.Num())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
float NewFloat = *reinterpret_cast<float*>(&ClipData->ResourcePropertyDataPtr->AudioData[CurrentIndex]);
|
float NewFloat = *reinterpret_cast<float*>(&ClipData->ResourcePropertyDataPtr->AudioData[CurrentIndex]);
|
||||||
float Y = FMath::GetMappedRangeValueClamped(FVector2D(1.0, 0.0), FVector2D(0.0, AllottedGeometry.GetLocalSize().Y),
|
float Y = FMath::GetMappedRangeValueClamped(FVector2D(1.0, 0.0), FVector2D(0.0, AllottedGeometry.GetLocalSize().Y),
|
||||||
FMath::Abs(NewFloat));
|
FMath::Abs(NewFloat));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TArray<FVector2D> NewLoc;
|
TArray<FVector2D> NewLoc;
|
||||||
NewLoc.Add(FVector2D((CropStartFrameOffset * FGlobalData::DefaultTimeTickSpace + i * DownSample) , AllottedGeometry.GetLocalSize().Y));
|
NewLoc.Add(FVector2D(i * DownSample, AllottedGeometry.GetLocalSize().Y));
|
||||||
NewLoc.Add(FVector2D((CropStartFrameOffset * FGlobalData::DefaultTimeTickSpace + i * DownSample) , Y));
|
NewLoc.Add(FVector2D(i * DownSample, Y));
|
||||||
|
|
||||||
FSlateDrawElement::MakeLines(OutDrawElements, LayerId + 6, AllottedGeometry.ToPaintGeometry(), NewLoc, ESlateDrawEffect::None,
|
FSlateDrawElement::MakeLines(OutDrawElements, LayerId + 6, AllottedGeometry.ToPaintGeometry(), NewLoc, ESlateDrawEffect::None,
|
||||||
FColor(45, 214, 153, 255), true, DownSample * 1.2);
|
FColor(45, 214, 153, 255), true, DownSample * 1.2);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GEngine->AddOnScreenDebugMessage(-1, 0.1f, FColor::Red, FString::SanitizeFloat(StartRange));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user