blocking the audio and video?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

blocking the audio and video?

killerrats
Administrator
This post was updated on .
rtspsrc 
! video depay ! video parse ! video tee ! video queue ! fakesink ! video teename ! video queue ! mp4mux ! filesink
! audio depay ! audio parse ! audio tee ! audio queue ! fakesink ! audio teename ! audio queue ! mux name

GstPadProbeType BlockType = GST_PAD_PROBE_TYPE_BLOCK;
using block pads gst_pad_add_probe();

when I go to block the audio or video pad on the queue to the mp4mux it will not let me for some reason sometimes either both or one. It will work for sometime then will not be able to and have to restart the pipeline. is there a way to check and see if you can block the pad or not? 

sometimes the changing state to an element either the pipeline or element will make the hangup and freeze. 

sometimes will hangup on the null state on elements.I notice that if I am make a thread by using 
 beginthreadex in the windows will happen more often. 

If i use the method 	g_timeout_add_seconds(2, (GSourceFunc)stop_encoding, NULL); will not happen often. but it still happens after sometime. All i'm doing is blocking the video and audio queue to the mp4mux.

1. sending eos through the remain elements pass the block.
2. put null on the elements which is queue's, mp4mux, filesink.
3. unlink the elements and remove from bin.
4. re assign new elements and put in pipeline.
5. link the elements.6. re-play the elements created.

----- ------------------------------ Gstreamer 1.14.3 ------------------------------ Windows -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list gstreamer-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------
Gstreamer 1.16.2
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: blocking the audio and video?

killerrats
Administrator

found out that if i use async in sending the eos through the pipeline it will work. making the filesink property async to FALSE.

1. unset flag so filesink will not send eos down the pipeline.
GST_OBJECT_FLAG_UNSET(filesink, GST_ELEMENT_FLAG_SINK);
2. gst_element_call_async([ELEMENT],(GstElementCallAsyncFunc)send_eos_async, [source pad], NULL);
3.
static void
send_eos_async(GstElement* element, gpointer user_data)
{
	GstEvent *eos;
	GstPad *pad;
	GstPad* srcPad = (GstPad*)user_data;
	eos = gst_event_new_eos();
	
	if (!pad)
		pad = gst_pad_get_peer(srcPad);
	
	gst_pad_send_event(pad, eos);

	gst_object_unref(pad);
}
4. gst_pad_add_probe(vteePad, GST_PAD_PROBE_TYPE_BLOCK,video_block_cb, pPipe, nullptr);
5. do {}while() to make sure block is finished
6. while() for seeing flag if eos got caught. within gst_pad_add_probe(sinkPad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,RtspEventProbe, pPipe, nullptr);
7. Unlink record elements
8. link record elements again
9. set GST_STATE_PLAYING on record elements
10. unblock pads

------------------------------
Gstreamer 1.14.3
------------------------------
Windows


Sent from the GStreamer-devel mailing list archive at Nabble.com.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------
Gstreamer 1.16.2
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: blocking the audio and video?

Vinod Kesti
>> found out that if i use async in sending the eos through the pipeline it
will work. making the filesink property async to FALSE.


One of the branch has high latency. If async=false then pipeline goes to
playing state even if one of the sink havent received the data. Try to
adjusting buffer in the other branches to avoid the async setting




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: blocking the audio and video?

killerrats
Administrator
what do you mean adjust the buffer? are you saying to
gst_element_set_clock()?



-----
------------------------------
Gstreamer 1.14.3
------------------------------
Windows
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------
Gstreamer 1.16.2
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: blocking the audio and video?

Vinod Kesti
Size of the queue element



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: blocking the audio and video?

killerrats
Administrator
This post was updated on .
well the file records fine when blocking the audio and video side. I unlink
the video and audio side and then attach the video and audio side to then
record again. the only thing that stops me right now is the continue on with
the position that was last seen. i need to set the position to get filesink
to write the correct buffers. I have set the queues at 0 for unlimited
buffers.

take into account, this is a live feed not reading a file.

can you seek on the filesink only to then record from last position in time?



-----
------------------------------
Gstreamer 1.14.3
------------------------------
Windows
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------
Gstreamer 1.16.2
------------------------------
Windows