swift-video-generator | library provides an easy way | Video Utils library
kandi X-RAY | swift-video-generator Summary
kandi X-RAY | swift-video-generator Summary
This library provides an easy way to combine images and audio into a video or merge multiple videos into one.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of swift-video-generator
swift-video-generator Key Features
swift-video-generator Examples and Code Snippets
Community Discussions
Trending Discussions on swift-video-generator
QUESTION
I am using 2 pods to record (SwiftyCam) and then merge multiple clips recorded (Swift Video Generator).
However, I am encountering a problem which is starting to seriously bother me. I also opened an issue on this. If you would like to read it, here's the link: Last video in array of multiple videos dicatates whether previous videos are mirrored. Please note (before reading the summarized description of the problem) that all videos are recorded in portrait orientation and that those recorded using the front camera are supposed to be mirrored (as single clips but also in the merged video).
To summarize it: If I only record clips with one camera, the merged video looks alright (e.g. only with the front camera: every single clip is mirrored and this doesn't change when merging them). However, if I use multiple clips from both cameras, say I record one with the front camera, afterward another one with the back camera, then the first video (front camera) will be "unmirrored" in the merged video. The opposite occurs if the last clip was recorded using the front camera: All clips by the back camera are mirrored in the merged video in this case.
Now I tried looking into the code of the video generator and found this (at swift video generator, VideoGenerator.swift, l. 309):
...ANSWER
Answered 2019-Jul-23 at 09:14With some research and some help from raywanderlich.com I managed to find a solution to this problem and even discovered another deeper one which is caused by the other pod I mentioned (SwiftyCam). Due to this issue with SwiftyCam I had to tweak the solution I am presenting here a bit, i.e. I had to change the translations of the CGAffineTransform
which usually shouldn't occur (EDIT: I also put this code in the solution now, might need it, might not: you'll have to try and see, I currently cannot explain why it is sometimes needed and sometimes not).
Solution:
First of all, we need two helper functions from raywanderlich.com:
This one will give us information on the video's orientation and whether or not it's portrait. Actually, the [UIImage.Orientation]Mirrored
cases are missing in the original function but I needed rightMirrored
(first else if
), too:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install swift-video-generator
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page