teltek / gst-plugin-ndi

GStreamer NDI Plugin for Linux
GNU Lesser General Public License v2.1
155 stars 27 forks source link

Latency query failed #23

Closed o-reo closed 5 years ago

o-reo commented 5 years ago

In the case where the NDI receiver does not return the expected frame type or does not get any frame the latency query fails.

example pipeline, note that the NDI stream only sends video frame :

gst-launch-1.0 flvmux name=mux ! filesink location=test.flv ndivideosrc stream-name='HARDWARE (Video)'  ! videoconvert ! x264enc ! queue ! mux. ndiaudiosrc stream-name='HARDWARE (Video)'  ! audioconvert ! audioresample ! queue ! mux.

As the latency is not calculated, the muxer does not process the video frames as it waits indefinitely for the audio frames.

when setting debug env with export GST_DEBUG=flvmux:6,aggregator:6 you get the following line:

0:00:03.041833501 25540 0x55f53f270b70 WARN aggregator gstaggregator.c:1715:gst_aggregator_query_latency_unlocked:<mux> Latency query failed

I assume setting a default latency other than none should solve the problem ? It may also be due to the infinite loop in fixate functions.

dpeite commented 5 years ago

I think that the problem as you said, is caused by the infinite loop rather than latency not being calculated. For example if one of the sources is blocked or has an elevated timeout when receiving frames, all the pipeline will be blocked like in #18.

A solution could be exit the loop after some time, and fixate a default caps. But I'm not sure it will not fail again when fixating the caps or when not receiving frames in the create function.

o-reo commented 5 years ago

Adding a timeout parameter and sending gap events could do the trick. I will do some testing.

o-reo commented 5 years ago

I see it's possible to use NDI in pull mode with framesync. It would probably solve our problem.

sdroege commented 5 years ago

This should be fixed by https://github.com/teltek/gst-plugin-ndi/pull/34

sdroege commented 5 years ago

@rubenrua this can be closed