1

I am using Python bindings for Gstreamer and am using the following pipeline to convert a wav file to mp3. I used one of the suggestions in this question , with some modifications (as I was getting some errors when original syntax was used)

    gst.parse_launch("filesrc location=C:\\music.wav ! decodebin 
! audioconvert !  lame ! filesink location=C:\\music.mp3")

When I run this code in Python, I get no errors. However, it doesn't generate music.mp3 file.

What else do I need to do so that it creates a new file music.mp3

Community
  • 1
  • 1
cppb
  • 2,319
  • 8
  • 32
  • 37
  • The question you're referring to followed up their talk of parse_launch() with "[...], get the filesrc and filesink elements, and call setters to change the input and output filenames." The only other thing I can think of is you haven't set a bitrate for lame, but I don't really know GStreamer, so maybe you don't have to. –  Jan 31 '10 at 14:47
  • I tried setting the bitrate for lame (as given in that example) but there was no change. I don't know what he meant by call setters to change input and output filenames.. – cppb Jan 31 '10 at 14:50

2 Answers2

1

your pipeline is correct - or more specifically, your choice of elements and properties is correct.

the problem is most likely in another part of your code. have you set the pipeline to gst.STATE_PLAYING?

pipeline = gst.parse_launch("filesrc location=C:\\music.wav ! decodebin ! audioconvert !  lame ! filesink location=C:\\music.mp3")
pipeline.set_state(gst.STATE_PLAYING)

there are numerous other common mistakes that can be made- posting your entire source code would be a great help!

Jeremiah Rose
  • 3,865
  • 4
  • 27
  • 31
0

If you didn't get this working I suggest using ffmpeg to convert your files, it's very efficient and opensource, you can find a compiled windows version with WinFF which you can manipulate through the command line.

Nowayz
  • 1,882
  • 4
  • 21
  • 34