

Your browser does not support the video tag. To avoid the name conflict, I just renamed it as "yosemite_with_fades2.mp4". Then, it will generate "yosemite_with_fades.mp4" In this case, we use current directory for the path and the input file is another mp4 file, yosemiteB.mp4. To run it, we need the path and input video name. So, we don't need to take any preparation step and we just throw the input video file name. Unlike the concat.py, this updated version takes an input video file name and generates i-frames for us. The concat2.py file is a modified version of concat.py. Slideshow_name = 'yosemite_with_fades.mp4' # concatenate the slides in the list file M.make_slideshow_list(fade_slides, listname) S = m.add_fade_effect(slide, outfile_name) If item.startswith('yi') and item.endswith('.png'): # concat all slides in the slideshow listĭef concat_slides(self, slideshow_name = 'my_slideshow.mp4' ): With open(self.slideshow_list_filename, mode='wb') as f: Slide_name = outfilename+str(unt)+'.mp4'ĭef make_slideshow_list(self, slides, fname='mylist.txt'): #ffmpeg -i slide_fade_in.mp4 -y -vf fade=out:120:30 slide_fade_in_out.mp4 # add fade-out effect to the slide that has fade-in effect already : 30 frames starting from 120th #ffmpeg -i slide.mp4 -y -vf fade=in:0:30 slide_fade_in.mp4Ĭmd = # add fade-in effect - from 0th to 30th frame # This is done by copying one I-Frame for a slideĬmd = map(lambda x: '%s' %x, ) # Makes two frames : at the beginning and at the end Self.slideshow_list_filename = 'mytext.txt'ĭef add_fade_effect(self, infilename, outfilename = 'final'): By default it doesn't take any parameters, so we can just run the file: "python concat.py" : It makes a slide list, and then use it to concatenate all the slides to create "yosemite_with_fades.mp4" file.It puts fade effect into each frame as we've done in Transitions : python script for fade-in & fade-out with two slides.

The following code will make a slideshow from 116 I-frames we made earlier.
