Skip to content

Instantly share code, notes, and snippets.

@yuvipanda
Created April 16, 2010 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuvipanda/368101 to your computer and use it in GitHub Desktop.
Save yuvipanda/368101 to your computer and use it in GitHub Desktop.
using Gst;
using GLib;
MainLoop loop;
private bool bus_callback(Bus bus, Message message)
{
switch(message.type)
{
case MessageType.ERROR:
GLib.Error err;
string debug;
message.parse_error(out err, out debug);
stdout.printf("Error: %s\n, Debug: %s", err.message, debug);
loop.quit();
break;
case MessageType.EOS:
stdout.printf("End of Stream\n");
break;
default:
break;
}
return true;
}
static int main(string[] argv)
{
Gst.init(ref argv);
loop = new MainLoop(null, false);
Bin b = Gst.parse_bin_from_description("filesrc location=tada.ogg ! decodebin ! ffmpegcolorspace ! warptv ! ffmpegcolorspace ! theoraenc ! oggmux ! filesink location=best.ogg", true) as Bin;
Pipeline p = new Pipeline("pipe");
p.add(b);
Bus bus = p.get_bus();
bus.add_watch(bus_callback);
p.set_state(State.PLAYING);
loop.run();
p.set_state(State.NULL);
return 0;
}
//Error: A Ogg demuxer plugin is required to play this stream, but not installed.
//, Debug: gstdecodebin.c(986): close_pad_link (): /GstPipeline:pipe/GstBin:bin0/GstDecodeBin:decodebin0:
//No decoder to handle media type 'application/ogg'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment