# Mp4 to wav

**URL:** <https://www.ruby-forum.com/t/mp4-to-wav/237501>\
**Category:** Ruby-Gnome 2\
**Created:** [November 16, 2013, 7:44am UTC](https://www.ruby-forum.com/t/mp4-to-wav/237501 "2013-11-16T07:44:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [November 16, 2013, 7:44am UTC](https://www.ruby-forum.com/t/mp4-to-wav/237501/1 "2013-11-16T07:44:26Z")

</div>

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”

…

---

<div class="post-metadata">

**Author:** ![Ding](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/97f17d/32.png) [@Ding](https://www.ruby-forum.com/u/Ding)\
**Post date:** [November 16, 2013, 7:49am UTC](https://www.ruby-forum.com/t/mp4-to-wav/237501/2 "2013-11-16T07:49:06Z")

</div>

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  
…

---

<div class="post-metadata">

**Author:** ![Ding](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/97f17d/32.png) [@Ding](https://www.ruby-forum.com/u/Ding)\
**Post date:** [November 16, 2013, 8:55am UTC](https://www.ruby-forum.com/t/mp4-to-wav/237501/3 "2013-11-16T08:55:41Z")

</div>

Subject: Re: [ruby-gnome2-devel-en] mp4 to wav  
Date: Fri 15 Nov 13 10:48:35PM -0800  
Sorry for the delay!

Quoting Ding ([removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)):

> ./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 - [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) che bisogno ci  
sarebbe
  - 

```
          di parlare tanto di amore e di rettitudine? 

```

(Chuang-Tzu)
