[FFmpeg-devel] [PATCH] lavd: implement threaded NewTek NDI output

Marton Balint cus at passwd.hu
Tue Sep 5 23:50:40 EEST 2017


On Tue, 5 Sep 2017, Maksym Veremeyenko wrote:

> 04.09.2017 17:10, Maksym Veremeyenko пише:
>> Hi,
>> 
>> attached patch implemented threaded NDI output - separate output thread for 
>> each stream. it makes audio preview in my case more smooth.
>
> updated patch allows running audio/video threads separately

If I get this correctly, this patch is needed because you can only 
schedule 1 frame to the NDI API, therefore especially for shorter audio 
frames the buffer may underrun, right?. If that is the case, then I'd 
describe this in a bit more detail in the docs and/or the commit message.

Also, decklink uses a concept called preroll for a similar purpose, it is 
specified in time, and the video buffer is capable of storing preroll*2 
amount of video. (Also, at the start of the stream the code only 
starts draining the buffer after preroll amount of video is received, 
there comes the name, preroll. This way the buffer won't underrun even at 
the start of the stream).

I just mentioned this because you may want to support a similar concept, 
or specify buffer sizes in time, instead of in frames. But if not, that 
is fine as well.

As for the actual code - I see a lot of code duplications :), maybe you 
can factorize audio_thread and video_thread to use the same function, and 
also the code which creates these threads.

But in general the code looks fine.

Regards,
Marton


More information about the ffmpeg-devel mailing list