views:

30

answers:

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  A: 

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().

elmarco
Okay, but how can I actually combine the two into one file? Example code?
Joel Auterson
elmarco
No error messages, but the .mp4 file shows up empty. :/
Joel Auterson