我正在尝试编写视频/音频配音编辑器。尝试在 vala/genie 中混合多个音频文件。使用加法器或交错。
我需要将此 gst-launch 命令转换为 Genie 或 Vala 代码,但使用:1.- Gst.Element.link 2.- Gst.ElementFactory.make 3.- request_pad和其他...请不要使用parse_launch()
gst-launch-0.10 interleave name=i ! audioconvert ! wavenc ! filesink location=file.wav filesrc location=file1.wav ! decodebin ! audioconvert ! "audio/x-raw-int,channels=1" ! queue ! i. filesrc location=file2.wav ! decodebin ! audioconvert ! "audio/x-raw-int,channels=1" ! queue ! i.
我有这个精灵代码:
[indent=4]
uses
Gst
pipeline: private Pipeline
interleave: private Element
audioconvert: private Element
audioconvert2: private Element
audioconvert3: private Element
wavenc: private Element
decodebin2: private Element
decodebin3: private Element
capsfilter2: private Element
capsfilter3: private Element
filesink: private Element
src3:private Element
src2:private Element
queue2:private Element
queue3:private Element
capsfilter2a:private Element
capsfilter3a:private Element
init
Gst.init (ref args)
pipeline = new Pipeline ("mypipeline")
interleave=ElementFactory.make ("interleave","inter")
interleave.set ("name","i")
audioconvert=ElementFactory.make ("audioconvert","audioconvert")
wavenc=ElementFactory.make ("wavenc","wavenc")
filesink=ElementFactory.make ("filesink","filesink")
filesink.set("location","totalfinal.wav")
// primer archivo
src2= ElementFactory.make ("filesrc", "filesrc2")
src2.set ("location","file1.wav")
decodebin2= ElementFactory.make ("decodebin", "decodebin2")
audioconvert2= ElementFactory.make ("audioconvert", "audioconvert2")
capsfilter2= ElementFactory.make ("capsfilter","capsfileter2")
capsfilter2.set("caps", Gst.Caps.from_string("audio/x-raw-int,channels=1"))
queue2= ElementFactory.make ("queue","queue2")
capsfilter2a= ElementFactory.make ("capsfilter","capsfileter2a")
capsfilter2a.set("caps", Gst.Caps.from_string("i.sink_0"))
// segundo archivo
src3= ElementFactory.make ("filesrc", "filesrc3")
src3.set ("location","file2.wav")
decodebin3= ElementFactory.make ("decodebin", "decodebin3")
audioconvert3= ElementFactory.make ("audioconvert", "audioconvert3")
capsfilter3= ElementFactory.make ("capsfilter","capsfileter3")
capsfilter3.set("caps", Gst.Caps.from_string("audio/x-raw-int,channels=1"))
queue3= ElementFactory.make ("queue","queue3")
capsfilter3a= ElementFactory.make ("capsfilter","capsfileter3a")
capsfilter3a.set("caps", Gst.Caps.from_string("i.sink_1"))
pipeline.add_many(interleave,wavenc,filesink,audioconvert);
pipeline.add_many(src2,src3,decodebin2,decodebin3,audioconvert2,audioconvert3,capsfilter2,capsfilter2a,capsfilter3,capsfilter3a);
pipeline.add_many(queue2,queue3);
// basic line
interleave.link(audioconvert)
audioconvert.link(wavenc)
wavenc.link(filesink)
// first src
src2.link(decodebin2)
decodebin2.link(audioconvert2)
audioconvert2.link(capsfilter2)
capsfilter2.link(queue2)
queue2.link(capsfilter2a)
// second src
src3.link(decodebin3)
decodebin3.link(audioconvert3)
audioconvert3.link(capsfilter3)
capsfilter3.link(queue3)
queue3.link(capsfilter3a)
pipeline.set_state(Gst.State.PLAYING)
new MainLoop().run();
我不知道出了什么问题。