Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add movieFragmentInterval option #67

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Sources/Aperture/Aperture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public final class Aperture: NSObject {
highlightClicks: Bool,
screenId: CGDirectDisplayID = .main,
audioDevice: AVCaptureDevice? = .default(for: .audio),
movieFragmentInterval: Int64? = nil,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a doc comment about what this does and what it's useful for?

videoCodec: String? = nil
) throws {
self.destination = destination
Expand All @@ -60,7 +61,7 @@ public final class Aperture: NSObject {

// Needed because otherwise there is no audio on videos longer than 10 seconds
// http://stackoverflow.com/a/26769529/64949
output.movieFragmentInterval = .invalid
output.movieFragmentInterval = movieFragmentInterval != nil ? CMTimeMake(value: movieFragmentInterval!, timescale: 1) : .invalid
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMTimeMake is legacy. Use the more modern initializer.


if let audioDevice = audioDevice {
if !audioDevice.hasMediaType(.audio) {
Expand Down