Skip to content

Commit

Permalink
fix video trimmer
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyun6 committed May 21, 2024
1 parent 0bbfad7 commit ecff279
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 15 deletions.
8 changes: 4 additions & 4 deletions QuickRecorder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
CODE_SIGN_ENTITLEMENTS = QuickRecorder/QuickRecorder.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 125;
CURRENT_PROJECT_VERSION = 126;
DEVELOPMENT_ASSET_PATHS = "\"QuickRecorder/Preview Content\"";
DEVELOPMENT_TEAM = L4T783637F;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -436,7 +436,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.3;
MARKETING_VERSION = 1.2.5;
MARKETING_VERSION = 1.2.6;
PRODUCT_BUNDLE_IDENTIFIER = com.lihaoyun6.QuickRecorder;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -452,7 +452,7 @@
CODE_SIGN_ENTITLEMENTS = QuickRecorder/QuickRecorder.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 125;
CURRENT_PROJECT_VERSION = 126;
DEVELOPMENT_ASSET_PATHS = "\"QuickRecorder/Preview Content\"";
DEVELOPMENT_TEAM = L4T783637F;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -468,7 +468,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.3;
MARKETING_VERSION = 1.2.5;
MARKETING_VERSION = 1.2.6;
PRODUCT_BUNDLE_IDENTIFIER = com.lihaoyun6.QuickRecorder;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
6 changes: 1 addition & 5 deletions QuickRecorder/ViewModel/VideoEditor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ class RecorderPlayerModel: NSObject, ObservableObject {
let endTime = playerItem.forwardPlaybackEndTime
let timeRange = CMTimeRangeFromTimeToTime(start: startTime, end: endTime)
guard let asset = self.asset else { return }
let assetTrack = asset.tracks(withMediaType: .video).first!
let composition = AVMutableComposition()
let compositionTrack = composition.addMutableTrack(withMediaType: .video, preferredTrackID: kCMPersistentTrackID_Invalid)
try! compositionTrack?.insertTimeRange(timeRange, of: assetTrack, at: .zero)
let exportSession = AVAssetExportSession(asset: composition, presetName: AVAssetExportPresetHighestQuality)
let exportSession = AVAssetExportSession(asset: asset, presetName: AVAssetExportPresetPassthrough)
let dateFormatter = DateFormatter()
let fileEnding = fileUrl.pathExtension.lowercased()
var fileType: AVFileType?
Expand Down
Binary file modified QuickRecorder/it.lproj/Localizable.strings
Binary file not shown.
4 changes: 2 additions & 2 deletions QuickRecorder/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
Localizable.strings
QuickRecorder

Created by apple on 2024/4/16.

Created by lihaoyun6 on 2024/4/16.
*/

"System Audio" = "录制系统声音";
Expand Down Expand Up @@ -143,6 +142,7 @@
"OK" = "好";
"Failed to save file" = "保存文件时出错";

// Please don't translate the following warning strings, it will make it difficult for me to read the logs
"failed to fetch file for size indicator: %@" = "获取文件大小失败: ";
"[err] failed to fetch available content:" = "[错误] 无法获取可用的上下文:";
"There needs to be at least one display connected" = "至少需要连接一台显示器";
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
## Screenshot
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./img/preview_dark.png">
<source media="(prefers-color-scheme: light)" srcset="./img/preview.png">
<img alt="QuickRecorder Screenshots" src="./img/preview.png" width="840"/>
<source media="(prefers-color-scheme: dark)" srcset="./img/preview_en_dark.png">
<source media="(prefers-color-scheme: light)" srcset="./img/preview_en.png">
<img alt="QuickRecorder Screenshots" src="./img/preview_en.png" width="840"/>
</picture>
</p>

Expand Down Expand Up @@ -47,7 +47,10 @@ brew install lihaoyun6/tap/quickrecorder
> The source of inspiration and part of the code of the screen recording engine comes from the Azayaka project, and I am also one of the code contributors to this project
[KeyboardShortcuts](https://github.com/sindresorhus/KeyboardShortcuts) @sindresorhus
> QuickRecorder uses this swift library to handle shortcut key events
> QuickRecorder uses this swift library to handle shortcut key events
[SwiftLAME](https://github.com/hidden-spectrum/SwiftLAME) @Hidden Spectrum
> QuickRecorder uses this swift library to handle MP3 output
[ChatGPT](https://chat.openai.com) @OpenAI
> Note: Part of the code in this project was generated or refactored using ChatGPT.
4 changes: 4 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,9 @@ brew install lihaoyun6/tap/quickrecorder
[KeyboardShortcuts](https://github.com/sindresorhus/KeyboardShortcuts) @sindresorhus
> QuickRecorder 使用此swift库来处理快捷键事件

[SwiftLAME](https://github.com/hidden-spectrum/SwiftLAME) @Hidden Spectrum
> QuickRecorder 使用此swift库来处理 MP3 输出
[ChatGPT](https://chat.openai.com) @OpenAI
> 注: 本项目部分代码使用 ChatGPT 生成或重构整理
Binary file added img/preview_en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/preview_en_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ecff279

Please sign in to comment.