Created
April 16, 2010 06:41
-
-
Save yuvipanda/368101 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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