We will develop a program that generates a video output file, by mixing an audio and a video track. Think about what change we will need to incorporate when compared to the audio/video track separation utility developed earlier. In that application, two filesink
elements were required as two output files were created. Here, we need the opposite. We require two filesrc
elements containing the audio and video data and a single filesink
element that will contain both the audio and the video track.
Download the file
AudioVideoMixing.py
from the Packt website. We will review some of the important methods of classAudioVideoMixer
.The
constructPipeline
method, as usual, builds the GStreamer pipeline with all necessary elements.1 def constructPipeline(self): 2 self.pipeline = gst.Pipeline("pipeline") 3 4 self.audiosrc = gst.element_factory_make("filesrc") 5 self.audiosrc.set_property("location", 6 self.audioInLocation...