v4l2 to h264
sdyarnell at gmail.com
Tue Nov 22 10:21:03 PST 2011
I am going to create an app that streams video over Bluetooth. I was trying
to figure out gstreamer, and have the following code. It just creates a
pipeline that saves the file into an mp4 file. This does save a file, but
the application techniquelly never exits. It just says "Running..."
Either way, my intention is to somehow throw in an appsink for the source
so that I can take the encoded stream and send it over Bluetooth from the
application. I have not found a good example to do this. I can hand all the
Bluetooth programming, I am just new to gstreamer.
Any help is appreciated on getting the appsink concept rolling.
main (int argc,
/* Initialisation */
gst_init (&argc, &argv);
loop = g_main_loop_new (NULL, FALSE);
GstElement * pipeline = GST_PIPELINE(gst_parse_launch("v4l2src
num-buffers=50 ! queue ! "
"x264enc ! mp4mux ! filesink location=fromFile.mp4",
gst_element_set_state (pipeline, GST_STATE_PLAYING);
/* Iterate */
/* Out of the main loop, clean up nicely */
g_print ("Returned, stopping playback\n");
gst_element_set_state (pipeline, GST_STATE_NULL);
g_print ("Deleting pipeline\n");
gst_object_unref (GST_OBJECT (pipeline));
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gstreamer-devel