Concatenating video files in gstreamer (in python) -


I am trying to take a series of video segment files (in .flv format, all the same audio / video encoding ) And insert them in a new file (in MP3 format). My encoding pipeline works fine for normal single volume files, but once I add another segment, I have no end to it working properly.

With my current implementation, I have a message handler for eos messages like:

  def on_eos (self, bus, message): stay = lane (self Metadata ['Local Signage']) Logger. Warning ("Hit EOS probe:% d block left"% are gone) == 0: self.abort = true self.mainloop.quit () Return Period = self.pipeline.query_duration (Gst.Format (Gst.Format) .time). [1] Self offset + = period logger.info ("Duration:% s, new offset:% s"% (GSTMAMAAGS (period), GSTMAMAS (auto offset)) self.pipeline.set_state (Gst .tate.READY) Self.localInFile = self.metadata ['localSegments']. Pop (0) logger.info ("start new file:% s"% self.localInFile) itself .elem_src.set_property ('location', self.localInFile) self.elem_src_src.set_offset (self.offset) self.pipeline. Set_state (Gst.State.PLAYING)  

This period indicates the end of the previous section, and the attempt to set offset of the next section to the end of the previous section transcends it precisely, but It always asks back at the beginning of the output file and overwrites the previous content. Obviously this is not giving me the production that I want!

Am I missing something here? I have tried it as a pad probe, but then it will not let me stop and restart the pipeline from my thread, and unfortunately crashes (telling me to do the message in handler, which now I have) .

Filesync is always overwriting the existing file. Do you really want the existing MP4 file here? (And you do not want to add an existing MPI file to the end of the current version).

To do this, you have to catch EOS event (message) on the SOSPD in front of Moscor through pad check. You can re-unlock with the pad checkbackback that you can dynamically link in a new input of srcpad and muxer and link it to link, while you already do while setting up a pad offset Do not change the position of the pipeline, and for the last segment, let you go through the EOS event and wait for the EOS message (incident not!) Posted on the bus. After that the pipeline stopped.

Now the hard part with all of this is that you probably want to clear the old segment. You can not do this with pad probe callback because eOS is sent from the streaming thread. What you need to do here (after unlinking the pad check callback!) You will remove the elements from the old thread from the second thread, from the pipeline, set their position to GST_STATE_NULL and then do not do them.


Comments