Skip to content

Commit

Permalink
Merge pull request #13 from vimondev/feat/disable-fadeout
Browse files Browse the repository at this point in the history
[이우섭] 0108 자동편집 fadeout 효과 비활성화
  • Loading branch information
LeeUSeob authored Jan 10, 2024
2 parents 1186247 + d0270a5 commit 9eccb34
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion lib/vm_sdk/impl/ffmpeg_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ ERatio _ratio = ERatio.ratio11;

double _scaleFactor = 2 / 3.0;
double _minDurationFactor = 1 / _framerate;
const int _fadeDuration = 3;
// const int _fadeDuration = 3;
const int _fadeDuration = 0;

class RenderedData {
String absolutePath;
Expand Down
32 changes: 16 additions & 16 deletions lib/vm_sdk/vm_sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -516,23 +516,23 @@ class VMSDKWidget extends StatelessWidget {
}
}

if (isAutoEdit && editedMediaList.length > 1 && totalDuration >= 10) {
double curDuration = 0;
List<RenderedData> fadeOutClips = [];
for (int i = xfadeAppliedList.length - 1; i >= 0; i--) {
RenderedData lastClip = xfadeAppliedList.removeLast();
fadeOutClips.add(lastClip);
// if (isAutoEdit && editedMediaList.length > 1 && totalDuration >= 10) {
// double curDuration = 0;
// List<RenderedData> fadeOutClips = [];
// for (int i = xfadeAppliedList.length - 1; i >= 0; i--) {
// RenderedData lastClip = xfadeAppliedList.removeLast();
// fadeOutClips.add(lastClip);

curDuration += lastClip.duration;
if (curDuration >= 2) {
final RenderedData fadeOutApplied =
await applyFadeOut(fadeOutClips.reversed.toList());

xfadeAppliedList.add(fadeOutApplied);
break;
}
}
}
// curDuration += lastClip.duration;
// if (curDuration >= 2) {
// final RenderedData fadeOutApplied =
// await applyFadeOut(fadeOutClips.reversed.toList());

// xfadeAppliedList.add(fadeOutApplied);
// break;
// }
// }
// }

_currentStatus = EGenerateStatus.finishing;
_currentRenderedFrame = _allFrame;
Expand Down

0 comments on commit 9eccb34

Please sign in to comment.