khoavd-dev / mergevideos Goto Github PK
View Code? Open in Web Editor NEWA demo about merging videos & images in iOS
License: MIT License
A demo about merging videos & images in iOS
License: MIT License
i have used MergeVideos library making 15 to 20 images from video but issue come
Domain = AVFoundationErrorDomain Code=-11839 "Cannot Decode" UserInfo={NSLocalizedDescription=Cannot Decode, NSUnderlyingError=0x10e16d6c0 {Error Domain=NSOSStatusErrorDomain Code=-12913 "(null)"}, NSLocalizedRecoverySuggestion=Stop any other actions that decode media and try again., NSLocalizedFailureReason=The decoder required for this media is busy.}
Great job on incorporating video orientation! However, the output is not correctly adjusted when merging multiple videos. So when one video is portrait the size is adjusted, but the output is never adjusted again when the video is landscape. The result is correct orientation but the width is cut-off for landscape videos.
My change was simply to set outputSize
equal to videoSize
when the video is not portrait.
if assetInfo.isPortrait == true {
videoSize.width = videoTrack.naturalSize.height
videoSize.height = videoTrack.naturalSize.width
}
else
{
outputSize = videoSize
}
I really like this framework but I need help with extra functionality. I want videos to fill the desired size (for example: 1080x1920). Because now landscape videos are not being filled. It would be great to get tips how I could achieve that. (basically something similar like videoGravity - aspectFill).
Hi,
I am merging 2 3 videos, final merged video contains some background noise in it,
Please update, is there a way to remove noise?
I was thinking that there might be some issue with UIIMagePickerController.
But it's the final video that contains noise.
Video merge is not working if you set let duration = 0.5.toCMTime()
. It says Error:Operation Stopped. (although it's working if you're not exporting it to URL but use this video as PlayerItem).
Another problem is that it's also not working if you want to merge for example 20-30 videos or more.(not working in all scenarios).
Any thoughts why?
The extracted image is output in portrait mode.
How do I change this to landscape mode?
when I try to merge video on ios 13.0
show this on error log not process the operation
"AVFoundationErrorDomain" - code: 18446744073709539778
but when I uninstall and run it, merge process works fine
Hi,
While merging one or more landscape videos shows a black screen . its audio get merged but the video is just a black screen
Hi,
Whenever I try to merge a video with an image, There is a blank clip added at the start of the video. How I can get rid of it?
when i am merge portrait and landscape video then output video is only portrait mode.
I found that the audio would cut-off in the second merged video. I believe the issue is with the implementation of the audioCompositionTrack
. For that the startTime should be kCMTimeZero
in all cases. Here is the correction I made which fixed the issue:
// Add audio track to audio composition at specific time
if let audioTrack = audioTrack {
try audioCompositionTrack?.insertTimeRange(CMTimeRangeMake(startTime, duration),
of: audioTrack,
at: insertTime)
}
I am merging two videos with this code:
let urlVideo1 = Bundle.main.url(forResource: "gif2vid", withExtension: "mp4")
let urlVideo2 = Bundle.main.url(forResource: "mergedVideo", withExtension: "mp4")
let videoAsset1 = AVAsset(url: urlVideo1!)
let videoAsset2 = AVAsset(url: urlVideo2!)
KVVideoManager.shared.merge(arrayVideos: [videoAsset1, videoAsset2], completion: { (final_URL, error) in
print("final_URL:=",final_URL as Any)
print("Error:=",error?.localizedDescription ?? "")
})
It prints final_URL but video is not available there. It prints error: Cannot Open
i am merging image with video but i's not working.
It seems you haven't updated the source code with this gap. the problem remains. file date 19/10/21
Fix issue: merging videos shows black screen sometimes. (update videoCompositionInstructionForTrack function)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.