Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to repair the memory leak caused by the audio and video extraction function component EasyStreamingServer reading local files

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you how to fix the memory leak caused by the audio and video extraction function component EasyStreamingServer reading local files, the content is concise and easy to understand, it can definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

EasyStreamingServer is an audio and video extraction function component that supports various streaming media protocols such as file and RTSP,RTMP,HTTP, and supports various audio and video coding formats such as H.264, H.265, PCM, AAC, Windows,Linux, Android,iOS,ARM and other platforms.

When TSINGSEE blue rhinoceros video developers read local files through EasyStreamingServer, there was a memory leak.

Analysis of problems

When we use EasyStreamingServer to read local files, we see that memory is growing all the time. Compared to pulling network streams, such as RTSP streams, memory consumption is relatively stable and there is no memory leak.

When pulling local files, the memory is as follows

As you can see from above, memory consumption has been growing. However, the pull RTSP stream has not seen such an increase.

In terms of code logic, the file differs from the RTSP stream in that it uses av_bitstream_filter_filter, and that's where the problem occurs. Av_bitstream_filter_filter reallocates memory and needs to be released in time after use, otherwise there will be a memory leak.

From the above analysis, we can infer that the memory leak is caused by not releasing memory in time after using av_bitstream_filter_filter in EasyStreamingClient.

We can solve the memory leak problem by adding the following code:

If (m_vbsf_h364_toannexb! = NULL) {av_free (packet.data); packet.data = NULL;}

After testing again, we did not find any memory leaks, so we can remind you that if you use av_bitstream_filter_filter, you must release memory in time.

The above is the audio and video extraction function component EasyStreamingServer to read local files how to fix the memory leak, have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report