Skip to content

Commit

Permalink
DitheringEngine 1.8.2
Browse files Browse the repository at this point in the history
Merge pull request #11 from Eskils/develop
  • Loading branch information
Eskils authored Oct 30, 2024
2 parents d97c13c + 3c1fb11 commit f10beb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ let package = Package(
dependencies: [
.package(
url: "https://github.com/Eskils/DitheringEngine",
.upToNextMinor(from: "1.8.1") // or `.upToNextMajor
.upToNextMinor(from: "1.8.2") // or `.upToNextMajor
)
],
targets: [
Expand Down
11 changes: 5 additions & 6 deletions Sources/DitheringEngine/Video/VideoAssembler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ class VideoAssembler {
AVVideoHeightKey: height
] as [String : Any]

let audioSettings = [
AVFormatIDKey: kAudioFormatMPEG4AAC,
AVSampleRateKey: sampleRate,
AVNumberOfChannelsKey: 2,
AVEncoderBitRateKey: 160_000
] as [String : Any]
let assistant = AVOutputSettingsAssistant(preset: .preset1920x1080)
guard let audioSettings = assistant?.audioSettings else {
throw VideoAssemblerError.cannotMakeAudioSettingsForPreset
}

self.videoInput = AVAssetWriterInput(mediaType: .video, outputSettings: videoSettings)
if let transform {
Expand Down Expand Up @@ -128,6 +126,7 @@ class VideoAssembler {
enum VideoAssemblerError: Error {
case cannotAddVideoAssetWriterInput
case cannotAddAudioAssetWriterInput
case cannotMakeAudioSettingsForPreset
}

}

0 comments on commit f10beb8

Please sign in to comment.