Forum: Ruby-Gnome 2 mp4 to wav

1d5dfba0929813d5a3d30609038a3319?d=identicon&s=25 Ding (Guest)
on 2013-11-16 07:44
(Received via mailing list)
Hi, Gurus,

I've
...

pipeline = Gst::Pipeline.new "audio-player"
source = Gst::ElementFactory.make "filesrc", "file-source"
decoder = Gst::ElementFactory.make "qtdemux", "mp4-decoder"
conv = Gst::ElementFactory.make "audioconvert", "converter"
encoder = Gst::ElementFactory.make "wavenc", "encoder"
sink = Gst::ElementFactory.make "filesink", "file-output"

...
1d5dfba0929813d5a3d30609038a3319?d=identicon&s=25 Ding (Guest)
on 2013-11-16 07:49
(Received via mailing list)
Hi, Gurus,

I'm trying to write a small program using ruby gstreamer to extract wav
file from mp4 video. The following is the snippet. I got an error
message at execution and not sure how to fix the error. Can anyone shed
some lights on this error? I really appreciate your help. thanks

./mp3towav1.rb:44:in `<main>': undefined method `>>' for nil:NilClass
(NoMethodError)

code snippet:

...

pipeline = Gst::Pipeline.new "audio-player"
source = Gst::ElementFactory.make "filesrc", "file-source"
decoder =
 Gst::ElementFactory.make "qtdemux", "mp4-decoder"
conv = Gst::ElementFactory.make "audioconvert", "converter"
encoder = Gst::ElementFactory.make "wavenc", "encoder"
sink = Gst::ElementFactory.make "filesink", "file-output"

...
pipeline.add source, decoder, conv, encoder, sink
source >> decoder >> conv >> encoder >> sink
...
3853dd5371ac1e094fc45d6c2aa0e459?d=identicon&s=25 Carlo E. Prelz (Guest)
on 2013-11-16 08:55
(Received via mailing list)
Subject: Re: [ruby-gnome2-devel-en] mp4 to wav
  Date: Fri 15 Nov 13 10:48:35PM -0800
Sorry for the delay!

Quoting Ding (lasallewashington@gmail.com):

> ./mp3towav1.rb:44:in `<main>': undefined method `>>' for nil:NilClass
(NoMethodError)

I presume that line 44 in your code is

source >> decoder >> conv >> encoder >> sink

It is ages since I had dabbled with gstreamer, and I remember how
difficult it had been to convince it to do what I wanted, so I do not
pretend to solve your problem. But I see that if I split the line,
"decoder >> conv" returns nil. This is why the whole line
fails. Apparently you cannot pipe your decoder to your converter.

Carlo

--
  *         Se la Strada e la sua Virtu' non fossero state messe da
parte,
* K * Carlo E. Prelz - fluido@fluido.as             che bisogno ci
sarebbe
  *               di parlare tanto di amore e di rettitudine?
(Chuang-Tzu)
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.