karabuta
karabuta

Reputation: 31

Converting .mp4 to .ogg using GStreamer in vala

I'm trying to figure out how to convert a video file from one to format to another using GStreamer and Vala. I have checked valadoc for APIs to do this but I can't seem to find the solution. Could anyone please help me with a sample code, say from .mp4 to .ogg in Vala?

I'm really new to GStreamer but I think it involves using decodebin.

Upvotes: 0

Views: 296

Answers (1)

nayana
nayana

Reputation: 3932

Usually on Stack Overflow you will get question like this one closed.. but as you are new I will give you some infos.. but please write down some code first, then paste it here and tell us what is not working or where are you stuck.. questions like "give me the code so I can use it" are disliked and usually closed.

Here are some sample vala gstreamer examples ..

Basicaly you will decode the source format you can use uridecodebin which is very simple automatic element and then when you have raw decoded data you can encode to whatever you want.. unfortunately there is not such thing as encodebin so you have to do that manually..

You will have pipeline of the form:

gst-launch-1.0 uridecodebin name=u u. ! "audio/x-raw" !  audioconvert ! vorbisenc ! matroskamux ! filesink location=test.mka

First I would get familiar with gst-launch tool to quickly introduce yourself to how gstreamer works generaly. Usually you can ask nice question by providing gst-launch form of pipeline you have which other coders can test/understand and tell you what should be fixed etc..

Upvotes: 1

Related Questions