Problem demuxing and decoding mpeg-ts packets

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Problem demuxing and decoding mpeg-ts packets

Tanaka
Hi everyone,

 First of all, sorry if the thread is repeated. I readed almost all the solutions that people suggested and they don't worked for me. Well, I will try to explain the situation:

 I'm working with the gst 0.10 libraries in a project with c++. The goal is to receive a video stream over udp and extract the frames to put in in an OpenCV mat.  cames in a 188 bytes packet (splited in 7 parts) and encoded in h264. To test it Im sending a video with VLC, here is an image of the packets.

Thr

Now I'm able to receive the packet, and get the content, but I can't do anymore. The pipeline that I'm using is:

///////////////////////////////////////////
GstElement *pipeline, *sink, *videosrc, *demux, *decoder, *converter, *queue;
                GMainLoop *main_loop;

                gst_init (0, NULL);
   
                /* Build the pipeline */
                gchar* pipelineStr = "udpsrc port=5000 ! mpegtsdemux ! appsink name=sink emit-signals=true";
               
                pipeline = gst_parse_launch(pipelineStr,NULL);

                if (pipeline == NULL)
                {
                        printf("\nError pipeline\n");
                }

                /* Start playing */
                gst_element_set_state(pipeline, GST_STATE_PLAYING);
                main_loop = g_main_loop_new (NULL, FALSE);
                       
                sink = gst_bin_get_by_name(GST_BIN(pipeline), "sink");
                /* Connect signals */
                g_signal_connect (sink, "new-buffer", G_CALLBACK (on_new_buffer_callback), NULL);
   
                /* Start GTK main loop. Exectuion will block here until main_loop quits */
                g_main_loop_run (main_loop);

///////////////////////////////////////////////////////