Skip to content

Commit

Permalink
fix black screen video with audio issue (issue rs#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
jungiebook committed Nov 3, 2022
1 parent af4728e commit 666a494
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SDAVAssetExportSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ - (AVMutableVideoComposition *)buildDefaultVideoComposition
CGSize targetSize = CGSizeMake([self.videoSettings[AVVideoWidthKey] floatValue], [self.videoSettings[AVVideoHeightKey] floatValue]);
CGSize naturalSize = [videoTrack naturalSize];
CGAffineTransform transform = videoTrack.preferredTransform;
CGRect rect = {{0, 0}, naturalSize};
CGRect transformedRect = CGRectApplyAffineTransform(rect, transform);
// transformedRect should have origin at 0 if correct; otherwise add offset to correct it
transform.tx -= transformedRect.origin.x;
transform.ty -= transformedRect.origin.y;

// Workaround radar 31928389, see https://github.com/rs/SDAVAssetExportSession/pull/70 for more info
if (transform.ty == -560) {
transform.ty = 0;
Expand Down

0 comments on commit 666a494

Please sign in to comment.