简体   繁体   English

DJI Windows 10 SDK FFMPEG视频缓冲

[英]DJI Windows 10 SDK FFMPEG Video buffering

Does anyone know how to reduce the buffering latency of the DJI FFMPEG implementation? 有谁知道如何减少DJI FFMPEG实现的缓冲延迟? It seems as though the longer an application runs using this API, the worse the latency becomes. 似乎应用程序使用此API运行的时间越长,延迟就越糟。 Are there specific options other than CODEC_FLAG_LOW_DELAY or CODEC_FLAG2_FAST which might help reduce the latency? 除了CODEC_FLAG_LOW_DELAY或CODEC_FLAG2_FAST之外,是否还有其他特定选项可以帮助减少延迟? Is there something that I should be setting in the av_parser_parse2 to reduce the delay? 我应该在av_parser_parse2中进行设置以减少延迟吗? I am of course presuming the latency is in the API rather that the aircraft itself - it just doesn't seem likely that the UAV has the storage to buffer large amounts of video. 我当然认为延迟是在API中,而不是在飞机本身中-无人机似乎不太可能具有存储大量视频的存储空间。

After some experimentation, I discovered that the pts/dts values of the av_parser_parse2 method will impact frame buffering. 经过一些试验,我发现av_parser_parse2方法的pts / dts值会影响帧缓冲。 DJI's sample code uses AV_NOPTS_VALUE for both pts and dts; DJI的示例代码对pts和dts使用AV_NOPTS_VALUE; this leads to ever-increasing latency in the video stream. 这导致视频流的延迟不断增加。 Rather than calculate these values, I simply increment pts by 1000 for every time got_picture == true and set dts = pts. 而不是计算这些值,我只是在每次got_picture == true时将pts递增1000,并设置dts = pts。 Yep, it's a hack but it works. 是的,这是一个hack,但可以。 Hopefully this will help others who encounter this issue as well. 希望这也会对遇到此问题的其他人有所帮助。 If you're using the DJIVideoParser project, this change can easily be made to the h264_Decoder.cpp's DecoderThread method. 如果您使用的是DJIVideoParser项目,则可以轻松地对h264_Decoder.cpp的DecoderThread方法进行此更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM