From 4497c2b6c4b1f4c462e51da365f855999bdd6cf3 Mon Sep 17 00:00:00 2001 From: Sch <3516520171@qq.com> Date: Sun, 20 Aug 2023 02:21:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E8=89=B2=E5=BD=A9=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E8=BD=A8=E9=81=93=E4=B8=8A=E6=9C=89=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E6=97=B6=E9=BB=98=E8=AE=A4=E5=BC=80=E5=90=AF=E6=8A=95?= =?UTF-8?q?=E5=BD=B1=E4=BB=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Cut5/Utils/FFMPEGUtils.cpp | 4 ++-- Source/Cut5/Widgets/SCutMainWindow.cpp | 14 ++++++++++++++ Source/Cut5/Widgets/STimelineClip.cpp | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Source/Cut5/Utils/FFMPEGUtils.cpp b/Source/Cut5/Utils/FFMPEGUtils.cpp index 07e7697..5e99b8d 100644 --- a/Source/Cut5/Utils/FFMPEGUtils.cpp +++ b/Source/Cut5/Utils/FFMPEGUtils.cpp @@ -67,7 +67,7 @@ FString FFFMPEGUtils::LoadMedia(const FString& Path, FTimelinePropertyData* Prop { struct SwsContext* swsCtx = sws_getContext( Frame->width, Frame->height, VideoCodecContext->pix_fmt, - Frame->width, Frame->height, AV_PIX_FMT_RGBA, + Frame->width, Frame->height, AV_PIX_FMT_BGRA, SWS_BILINEAR, NULL, NULL, NULL ); if (!swsCtx) @@ -286,7 +286,7 @@ TArray FFFMPEGUtils::GetMovieBrush(FClipData* ClipData) { struct SwsContext* swsCtx = sws_getContext( Frame->width, Frame->height, VideoCodecContext->pix_fmt, - Frame->width, Frame->height, AV_PIX_FMT_RGBA, + Frame->width, Frame->height, AV_PIX_FMT_BGRA, SWS_BILINEAR, NULL, NULL, NULL ); if (!swsCtx) diff --git a/Source/Cut5/Widgets/SCutMainWindow.cpp b/Source/Cut5/Widgets/SCutMainWindow.cpp index 2612ad1..10216df 100644 --- a/Source/Cut5/Widgets/SCutMainWindow.cpp +++ b/Source/Cut5/Widgets/SCutMainWindow.cpp @@ -1327,6 +1327,20 @@ tinyxml2::XMLElement* SCutMainWindow::GetVideoElement(tinyxml2::XMLElement* Pare tinyxml2::XMLElement* ProjectorEventList = Video->InsertNewChildElement("ProjectorEventList"); { + + tinyxml2::XMLElement* ProjectorEvent = ProjectorEventList->InsertNewChildElement("ProjectorEvent"); + { + + tinyxml2::XMLElement* ProjectorTimeCode = ProjectorEvent->InsertNewChildElement("TimeCode"); + { + ProjectorTimeCode->InsertNewText(TCHAR_TO_UTF8(*FUtils::GetMsFromString(FGlobalData::GetTimeData(EncodeVideoInfo.ClipStartFrame)))); + } + tinyxml2::XMLElement* Value = ProjectorEvent->InsertNewChildElement("Value"); + { + Value->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(1))); + } + } + for (int32 i = 0; i < CutTimeline->TrackGroupInstances.Num(); i++) { if (StaticCastSharedPtr(CutTimeline->TrackGroupInstances[i].Head)->TrackData.TrackType == ETrackType::ProjectorTrack) diff --git a/Source/Cut5/Widgets/STimelineClip.cpp b/Source/Cut5/Widgets/STimelineClip.cpp index a6e0db0..e466dc0 100644 --- a/Source/Cut5/Widgets/STimelineClip.cpp +++ b/Source/Cut5/Widgets/STimelineClip.cpp @@ -288,7 +288,7 @@ void STimelineClip::Seek(int32 Frame) struct SwsContext* swsCtx = sws_getContext( AllocatedFrame->width, AllocatedFrame->height, VideoCodecContext->pix_fmt, - AllocatedFrame->width, AllocatedFrame->height, AV_PIX_FMT_RGBA, + AllocatedFrame->width, AllocatedFrame->height, AV_PIX_FMT_BGRA, SWS_BILINEAR, NULL, NULL, NULL ); if (!swsCtx)