1

I'm having trouble combining audio and video into one file. The Python code looks like this;

            filmPipe = gst.Pipeline("filmPipe")
            filmSrc = gst.element_factory_make("multifilesrc", "filmSrc")
            filmSrc.set_property("location", "pictures/%d.png")
            filmFilt1 = gst.element_factory_make("capsfilter", "filmFilt1")
            filmCap1 = gst.Caps("image/png,framerate=5/1,pixel-aspect-ratio=1/1")
            filmFilt1.set_property("caps", filmCap1)
            filmPngDec = gst.element_factory_make("pngdec", "filmPngDec")
            filmff = gst.element_factory_make("ffmpegcolorspace", "filmff")
            filmFilt2 = gst.element_factory_make("capsfilter", "filmFilt2")
            filmCap2 = gst.Caps("video/x-raw-yuv")
            filmFilt2.set_property("caps", filmCap2)
            filmTheora = gst.element_factory_make("xvidenc", "filmTheora")
            filmQue = gst.element_factory_make("queue", "filmQue")
            filmOggmux = gst.element_factory_make("ffmux_mp4", "filmOggmux")
            filmFilesink = gst.element_factory_make("filesink", "filmFilesink")
            filmFilesink.set_property("location", self.movPath)
            musicSrc = gst.element_factory_make("filesrc", "musicSrc")
            musicSrc.set_property("location", self.musicPath)
            musicDec = gst.element_factory_make("ffdec_mp3", "musicDec")
            musicEnc = gst.element_factory_make("lame", "musicEnc")
            musicQue = gst.element_factory_make("queue", "musicQue")

            filmPipe.add(filmSrc, filmFilt1, filmPngDec, filmff, filmFilt2, filmTheora, filmQue, filmOggmux, filmFilesink)
            filmPipe.add(musicSrc, musicDec, musicEnc, musicQue)
            gst.element_link_many(filmSrc, filmFilt1, filmPngDec, filmff, filmFilt2, filmTheora, filmQue, filmOggmux, filmFilesink)
            gst.element_link_many(musicSrc, musicDec, musicEnc, musicQue, filmOggmux, filmFilesink)
            filmPipe.set_state(gst.STATE_PLAYING)

This returns the following error:

Traceback (most recent call last):
 File "app.py", line 100, in movGen
gst.element_link_many(musicSrc, musicDec, musicEnc, musicQue, filmOggmux, filmFilesink)
gst.LinkError: failed to link filmOggmux with filmFilesink

Does anybody know where I'm going wrong, or how to fix this?

1 Answer 1

1

You are linking 2 times filmOggmux to filmFilesink: this is not allowed, only one link is possible.

Try removing filmFilesink in the second gst.element_link_many().

2
  • Okay, but how can I actually combine the two into one file? Example code? Sep 11, 2010 at 9:37
  • You are already combining audio & video at the muxer level. You just need to drop the filmFilesink in the second gst.element_link_many() imho. The muxer will mux them, and output the combined stream to the filesink you specified in the first link_many()
    – elmarco
    Sep 12, 2010 at 0:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.