Video synthesis, transparent channels are known to all
Transparent channel is a commitment to public welfare activities throughout the transparency of the Organization. In graphic imaging, a transparent channel is also called an alpha channel, which represents the transparent information of pixels in a digital image. White alpha pixels are used to define opaque color pixels, while black alpha is transparent, and grayscale between black and white is a translucent part of a color image. -----from Baidu Encyclopedia
So in merging snowflakes, lights, explosions ... There is a need for a transparent channel video.
Here I use gpuimage this tool, can talk about the combination of snowflakes without gaps, here, we would better use a little PS, in the Image filter processing, you can see through the PS parameters and effects
Through the PS experiment, it is found that the filter can do this. Gpuimagescreenblendfilter can end this thing.
Detailed Gpuimage header file click here----http://blog.csdn.net/think_ma/article/details/43093331
No, code _moviefile = [[Gpuimagemovie alloc] initwithurl:url];
_moviefile.runbenchmark = YES; _moviefile.playatactualspeed = NO; _moviefile2 = [[Gpuimagemovie alloc] initwithurl:url2]; _moviefile2.runbenchmark = YES; _moviefile2.playatactualspeed = NO; _filter = [[Gpuimagescreenblendfilter alloc] init]; Filter = [[Gpuimageunsharpmaskfilter alloc] init]; [_moviefile AddTarget:self.filter]; [_moviefile2 AddTarget:self.filter]; Only rotate the video for display, leave orientation the same for recording//In addition to displaying to the Scre En, write out a processed version of the movie to disk nsstring *pathtomovie = [Nshomedirectory () Stringbyappendingpath component:@ "Documents/last.mov"]; Unlink ([Pathtomovie utf8string]); If a file already exists, Avassetwriter won ' t let you record new frames, so delete the old movie NSLog (@ "file = %@ ", Pathtomovie); Nsurl *movieurl = [Nsurl Fileurlwithpath:pathtomovie]; Self.moviewriter = [[Gpuimagemoviewriter alloc] Initwithmovieurl:movieurl sizE:cgsizemake (640.0, 360.0)]; [Self.filter AddTarget:self.movieWriter]; Configure this for video from the movie file, where we want to preserve all video frames and audio samples Self.movi Ewriter.shouldpassthroughaudio = YES; Moviefile.audioencodingtarget = Self.moviewriter; [_moviefile EnableSynchronizedEncodingUsingMovieWriter:self.movieWriter]; [Self.moviewriter startrecording]; [_moviefile startprocessing]; [_moviefile2 startprocessing]; __block Mlkimovie * sself = self; [Self.moviewriter setcompletionblock:^{[Sself.filter RemoveTarget:sself.movieWriter]; [Sself.moviefile endprocessing]; [Sself.moviefile2 endprocessing]; [Sself.moviewriter finishrecording]; NSLog (@ "OK"); }];
Gpuimagescreenblendfilter equivalent to PS filter.
IOS merge videos with transparent channels-