CN112954392B - Platform for automatically realizing video format conversion processing - Google Patents
Platform for automatically realizing video format conversion processing Download PDFInfo
- Publication number
- CN112954392B CN112954392B CN202110371811.2A CN202110371811A CN112954392B CN 112954392 B CN112954392 B CN 112954392B CN 202110371811 A CN202110371811 A CN 202110371811A CN 112954392 B CN112954392 B CN 112954392B
- Authority
- CN
- China
- Prior art keywords
- data
- platform
- thread
- server
- video
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000006243 chemical reaction Methods 0.000 title claims abstract description 16
- 238000012545 processing Methods 0.000 title claims abstract description 12
- 238000000034 method Methods 0.000 claims abstract description 23
- 230000008569 process Effects 0.000 claims abstract description 9
- 230000000903 blocking effect Effects 0.000 claims abstract description 8
- 238000012544 monitoring process Methods 0.000 claims description 18
- 230000005540 biological transmission Effects 0.000 claims description 10
- 230000006870 function Effects 0.000 claims description 10
- 230000003993 interaction Effects 0.000 claims description 7
- 230000007717 exclusion Effects 0.000 claims description 5
- 239000012634 fragment Substances 0.000 claims description 3
- 230000009467 reduction Effects 0.000 claims description 3
- 230000001960 triggered effect Effects 0.000 claims description 3
- 238000011161 development Methods 0.000 description 2
- 230000004927 fusion Effects 0.000 description 2
- VYZAMTAEIAYCRO-UHFFFAOYSA-N Chromium Chemical compound [Cr] VYZAMTAEIAYCRO-UHFFFAOYSA-N 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013467 fragmentation Methods 0.000 description 1
- 238000006062 fragmentation reaction Methods 0.000 description 1
- 239000003550 marker Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
- H04N21/23418—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/18—Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
- H04N21/2343—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
- H04N21/234309—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The invention discloses a platform for automatically realizing video format conversion processing, which is characterized in that a set of high-performance streaming media service framework is constructed and a plurality of streaming media protocols of rtmp/rtsp/hls/http-flv are supported. Support linux, macos, windows, ios, android platform, the coding format supported includes H264, AAC, H265; the adopted model is multithreaded IO multiplexing non-blocking programming (epoll is adopted under linux, and select is adopted by other platforms); the framework is developed based on C++11, so that bare pointers are avoided, memory copies are reduced, codes are simplified and reliable, concurrency performance is excellent, and the advantages of a multi-core CPU can be fully utilized by a single process under a linux platform; the CPU and network card performances are squeezed to the maximum extent; the performance limit of the ten-thousand-megabyte network card is easily reached. And meanwhile, the method can realize extremely low delay and second opening of pictures at the same time of high performance.
Description
Technical Field
The invention belongs to the field of electronic information technology software video, relates to a method for rapidly converting a video format, and particularly relates to a platform for automatically realizing video format conversion processing.
Background
In recent years, the progress of safe urban projects is gradually advanced in various domestic large cities, and the video monitoring market scale is growing in the fields of security, traffic and the like. With the popularization of indoor home cameras and vehicle-mounted recorders, video monitoring can be said to be ubiquitous in the life of people. However, due to the segmented construction of various industries and departments, the current video monitoring system has various heterogeneity of information sources, channels, terminals and the like, and the efficient fusion of video monitoring resources provides a serious challenge. Therefore, how to break through the technical bottlenecks of interconnection, intercommunication and collaborative work caused by differences among information sources, channels and terminals in heterogeneous network environments, and to realize the fusion of mass audio and video resources of various monitoring alarm systems becomes a key problem to be solved in the current video monitoring system.
For historical reasons, the conventional technical stacks of the video monitoring industry mostly adopt protocol stacks such as proprietary protocols SDK, onvif/rtsp and the like. These protocols are not friendly to the browser at present, and in the period that the IE browser is popular in the past, the protocols can be docked by means of an ocx plug-in, but with the falling of the IE and the increasing unfriendly of the chrome and firefox browser which are popular in the prior art, the manner of accessing the monitoring video by means of the plug-in is more difficult.
Disclosure of Invention
The invention aims to solve the technical problem of providing a platform for supporting the exchange of coding formats and automatically realizing the conversion processing of video formats with low delay.
The technical scheme of the invention is as follows: a platform for automatically realizing video format conversion processing, constructing a streaming media service framework, wherein the framework consists of a service layer, a service end and an HTTP interface, and supports a plurality of media protocols, a plurality of platforms and a plurality of coding formats;
the specific steps of the process for automatically realizing the video format conversion are as follows:
step 1: after receiving video streams of various protocols (rtsp, rtmp, gb28181, hls, mp4 and the like), the server platform analyzes the video streams to acquire information such as protocol types, host addresses, application names, video stream ids and the like;
step 2: setting an event monitor for the acquired video stream, adding an audio or video track, writing frame data and analyzing the frame data; step 3: when a user plays a video by using a player, the server platform encapsulates frame data into a corresponding protocol according to a video streaming protocol for playing;
when the method is started, a plurality of epoll examples are automatically created according to the CPU core number; these epoll instances will have one thread to run the epoll_wait function to wait for the triggering of an event; if the server receives a new play request, a plurality of epoll examples automatically select a thread with lighter load to trigger an accept event under the dispatching of the kernel; after receiving the accept event, the server creates a TcpSess object and binds to the epoll instance; each Tcp connection corresponds to a TcpSession object, in the data interaction between the client and the server, the Tcession object processes all related business data, and all events in the life cycle of the object are triggered by the epoll thread, so that each epoll thread of the server can be uniformly distributed to reasonable client quantity; the platform software framework adopts a single-process multithreading model, the intelligent pointer of C++11 is adopted for memory management, the memory sharing under multithreading and the life cycle thereof can be perfectly managed during thread switching, and meanwhile, the granularity of the mutual exclusion lock is reduced to the greatest extent and is almost negligible, so that the performance loss of the multithreading model is extremely low, the performance of each thread can be almost comparable to that of a single-thread model, and simultaneously, the performance of each core of a CPU can be fully squeezed.
Specifically, under the holding of C++11, when the media data is forwarded, the problem of managing the life cycle of the multithreading memory is skillfully solved by utilizing the reference count; the core principle of implementing reference counts is that the same data object pointer and the same reference counter pointer together, when a reference object is created or copied, the reference count is incremented by 1; when the referencing object is destroyed or overwritten, the reference count is decremented by 1; when the reference count is 0, the data object is destroyed. It is noted in detail that when a reference object is overwritten, the current reference count is decremented by 1.
Specifically, the object circulation pool is used to avoid the reduction of the program performance and the generation of memory fragments;
when the player is processed, the TCP_NODELAY is opened and the MSG_MORE is closed during the handshake, so that the delay of data interaction during the handshake is improved, the time consumption for establishing a link is reduced, and the video opening speed is improved; after successful handshake we will turn off tcp_nodelay and turn on msg_more; the number of the data messages is reduced, and the network utilization rate is improved;
specifically, the sendmsg function is adopted to transmit batch data, so that when a network is not good or a server load is high, the number of times of system call can be obviously reduced, and the program performance is improved; the realization step of data batch transmission comprises the following steps: 1. dividing the data to be transmitted into a plurality of sections according to the designated size, transmitting the data with the designated size through a circular statement, simultaneously recording whether the data transmission state is successful or not, and retransmitting the data which is not transmitted successfully; finally, recording the successful times of transmission;
specifically, under the multithreading model, when the streaming media server distributes media data, the multithreading data distribution is realized by using thread switching;
when the user end sends a request and the equipment end is required to start pushing flow:
step 1: and when receiving the playing request, immediately checking whether the existing media source exists, if yes, returning to successful playing, otherwise, entering the step 2.
Step 2: monitor for a corresponding media source registration event while adding a play timeout timer and not reply to the player and then return. The logic will go to either step 3 or step 4.
Step 3: and if the media source is successfully registered, immediately responding to the successful playing of the player, deleting the playing timeout timer, and removing the media registration event monitoring.
Step 4: triggering the timeout timer, responding to the playing failure of the player, deleting the playing timeout timer, and removing the media registration event monitoring.
In particular, the platform for automatically implementing video format conversion processing according to claim 1 is characterized in that: the single-process multithreading model is a multithreading IO multiplexing non-blocking model.
Compared with the prior art, the invention has the beneficial effects that:
1. the system supports linux, macos, ios, android, windows full platform, can be deployed in a cross-platform manner, can be used as a streaming media server, and can be transplanted into embedded equipment to be used as a basic streaming media service component.
2. Multiple protocols (RTSP/RTMP/HLS/HTTP-FLV/WebSocket-FLV/GB 28181/HTTP-TS/WebSocket-TS/HTTP-fMP 4/WebSocket-fMP/MP 4) are supported, and protocol inter-conversion is supported.
3. And the multiplexing/multithreading/asynchronous network IO mode development is used, the concurrency performance is excellent, and the connection of massive clients is supported.
4. The video monitoring protocol stack and the live broadcast protocol stack are opened, and the second opening and extremely low delay of pictures are supported; support the interconversion of H265/H264 coding formats.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described in the following in conjunction with the embodiments of the present invention, and it is obvious that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
A platform for automatically realizing video format conversion processing, constructing a streaming media service framework, wherein the framework consists of a service layer, a service end and an HTTP interface, and supports a plurality of media protocols, a plurality of platforms and a plurality of coding formats;
the specific steps of the process for automatically realizing the video format conversion are as follows:
step 1: after receiving video streams of various protocols (rtsp, rtmp, gb28181, hls, mp4 and the like), the server platform analyzes the video streams to acquire information such as protocol types, host addresses, application names, video stream ids and the like;
step 2: setting an event monitor for the acquired video stream, adding an audio or video track, writing frame data and analyzing the frame data; step 3: when a user plays a video by using a player, the server platform encapsulates frame data into a corresponding protocol according to a video streaming protocol for playing;
when the method is started, a plurality of epoll examples are automatically created according to the CPU core number; these epoll instances will have one thread to run the epoll_wait function to wait for the triggering of an event; if the server receives a new play request, a plurality of epoll examples automatically select a thread with lighter load to trigger an accept event under the dispatching of the kernel; after receiving the accept event, the server creates a TcpSess object and binds to the epoll instance; each Tcp connection corresponds to a TcpSession object, in the data interaction between the client and the server, the Tcession object processes all related business data, and all events in the life cycle of the object are triggered by the epoll thread, so that each epoll thread of the server can be uniformly distributed to reasonable client quantity; adopting a single-process multithreading model, wherein the single-process multithreading model is a multithreading IO multiplexing non-blocking model; the platform software framework adopts the intelligent pointer of C++11 to perform memory management, can perfectly manage the memory sharing under multithreading and the life cycle thereof during thread switching, and meanwhile, the granularity of the mutual exclusion lock is reduced to the greatest extent and can be almost ignored, so that the performance loss of the multithreading model is extremely low, the performance of each thread can be almost comparable to that of a single-threaded model, and simultaneously, the performance of each core of the CPU can be fully squeezed.
Under the holding of C++11, when the media data is forwarded, the problem of managing the life cycle of the multithreading memory is skillfully solved by utilizing the reference count; the core principle of implementing reference counts is that the same data object pointer and the same reference counter pointer together, when a reference object is created or copied, the reference count is incremented by 1; when the referencing object is destroyed or overwritten, the reference count is decremented by 1; when the reference count is 0, the data object is destroyed. It is noted in detail that when a reference object is overwritten, the current reference count is decremented by 1.
Using an object circulation pool to avoid the reduction of the program performance and the generation of memory fragments;
when the player is processed, the TCP_NODELAY is opened and the MSG_MORE is closed during the handshake, so that the delay of data interaction during the handshake is improved, the time consumption for establishing a link is reduced, and the video opening speed is improved; after successful handshake we will turn off tcp_nodelay and turn on msg_more; the number of the data messages is reduced, and the network utilization rate is improved;
the sendmsg function is adopted to transmit batch data, when the network is not good or the load of a server is high, the number of times of system call can be obviously reduced, and the program performance is improved; the realization step of data batch transmission comprises the following steps: 1. dividing the data to be transmitted into a plurality of sections according to the designated size, transmitting the data with the designated size through a circular statement, simultaneously recording whether the data transmission state is successful or not, and retransmitting the data which is not transmitted successfully; finally, recording the successful times of transmission;
under a multithreading model, when the streaming media server distributes media data, the multithreading data distribution is realized by using thread switching;
when the user end sends a request and the equipment end is required to start pushing flow:
step 1: and when receiving the playing request, immediately checking whether the existing media source exists, if yes, returning to successful playing, otherwise, entering the step 2.
Step 2: monitor for a corresponding media source registration event while adding a play timeout timer and not reply to the player and then return. The logic will go to either step 3 or step 4.
Step 3: and if the media source is successfully registered, immediately responding to the successful playing of the player, deleting the playing timeout timer, and removing the media registration event monitoring.
Step 4: triggering the timeout timer, responding to the playing failure of the player, deleting the playing timeout timer, and removing the media registration event monitoring.
The core of the invention is to construct a set of high-performance streaming media service framework to support
rtmp/rtsp/hls/http-flv. Support linux, macos, windows, ios, android platform, the coding format supported includes H264, AAC, H265; the model used is multithreaded IO multiplexing non-blocking programming (epoll for linux and select for other platforms).
The framework is developed based on C++11, so that bare pointers are avoided, memory copies are reduced, codes are simplified and reliable, concurrency performance is excellent, and the advantages of a multi-core CPU can be fully utilized by a single process under a linux platform; the CPU and network card performances are squeezed to the maximum extent; the performance limit of the ten-thousand-megabyte network card is easily reached. And meanwhile, the method can realize extremely low delay and second opening of pictures at the same time of high performance.
Network model comparison:
different from single-thread, single-thread multi-cooperative-thread and multi-process models; the software framework adopts a single-process multithreading model.
The single-thread model has the advantages that the server is simple and reliable, and the problem of resource competition mutual exclusion is not considered, so that high stability can be realized easily; but the disadvantage is also obvious because of the single-thread model; that is, the computing power of the multi-core CPU cannot be fully utilized on the multi-core CPU, and the performance bottleneck is mainly the CPU.
The single-thread + co-thread approach is essentially indistinguishable from a pure single-thread model, with their differences being primarily in programming style. The pure single thread model uses a non-blocking type everywhere callback mode to achieve high concurrency, and the model has the problem of called callback prisons, and programming is troublesome. The single thread + coroutine scheme is a simplified programming mode, adopts a natural blocking programming style, manages task scheduling in the coroutine library, and is non-blocking in nature. However, the bottom layer of the protocol library is closely related to the system, so that cross-platform operation is not very good, and a protocol library threshold is designed and realized to be higher.
Unlike the other programming models above, the present set of software framework employs a multi-threaded development model; unlike conventional multithreading models; the set of software framework adopts the intelligent pointer of C++11 to perform memory management, and can perfectly manage the memory sharing under multithreading and the life cycle thereof during thread switching. And meanwhile, the granularity of the mutual exclusion lock is reduced to the greatest extent and can be almost ignored. Therefore, the performance loss is extremely low by adopting the multi-thread model, the performance of each thread can be almost comparable to that of a single-thread model, and each core performance of the CPU can be fully squeezed.
Avoiding memory copying:
under the traditional multithreading model, the problem of thread switching exists in data forwarding, and in order to ensure thread safety, memory copy is generally used for avoiding the problem; and it is also difficult to packetize the data without using memory copies. However, streaming media, which is a business logic, may be massive to watch for the same live user, and if a copy of the memory is made every time it is distributed, the overhead is quite considerable, which seriously compromises the server performance.
The software framework does not make memory copy when the media data is forwarded, and conventional C++ multithread programming is difficult to achieve, but the problem of multithread memory life cycle management is skillfully solved by utilizing reference counting under the holding of C++ 11.
Using an object circulation pool:
the memory open destroy is globally mutually exclusive, and excessive new/delete not only reduces the program performance, but also causes memory fragmentation. We try to avoid these problems using a circulation tank.
Setting a Socket related flag:
the response speed of the server can be improved after the TCP_NODELAY is started, and for some services (such as ssh service) which are sensitive to delay requirements, the starting of the TCP_NODELAY mark is important. However, for streaming media services, since data is continuous and the amount is relatively large, closing tcp_nodelay can reduce the number of ACK packets, and fully utilize bandwidth resources.
MSG_MORE is another marker to improve network throughput; the function of the mark is that when data is transmitted, the server caches certain data and then packages the data for one time to be transmitted; the MSG_MORE mark is especially suitable for the service scene like RTSP; because RTP packets are typically very small (less than MTU), the number of packets can be greatly reduced by MSG_MORE marking.
When processing the player, the TCP_NODELAY is started and the MSG_MORE is closed during the handshake, so that the time delay of data interaction during the handshake is improved, the time consumption of link establishment is reduced, and the video opening speed is improved. After successful handshake we will turn off tcp_nodelay and turn on msg_more; therefore, the number of data messages can be reduced, and the network utilization rate is improved.
And (5) batch data transmission:
in network programming, one should use the send/sendto/write function but the write/sendmsg function should use little. The sendmsg function is adopted to send batch data, so that when the network is not good or the load of a server is high, the number of times of system call (the cost of the system call is high) can be obviously reduced, and the program performance is improved.
Batch thread switching:
under the multithreading model, the streaming media server must switch threads when distributing the media data. The purpose of thread switching is to ensure thread safety and prevent multiple threads from operating a certain object or resource at the same time; and secondly, the multi-accounting force can be fully utilized, and single threads are prevented from becoming forwarding performance bottlenecks. When forwarding media, the thread switch is also used for realizing the multi-thread data distribution. However, the thread switching overhead is also relatively high, and if the number of thread switching times is too large, the server performance will be seriously affected. When dealing with such problems, batch thread switching is employed to minimize the number of thread switches. If we say that the 10K users are distributed on 32 cpu cores, we do the thread switching at most 32 times, so that the number of thread switching times is greatly reduced, and meanwhile, the multithreading can be used for distributing data, so that the network throughput is greatly improved.
Optimizing the timely plug flow opening rate:
some application scenes require the equipment end to start pushing, and then the APP immediately views the application scene. The traditional rtmp server does not optimize the application scene, if the APP playing request arrives before the push stream is not established, the APP playing is failed, so that the video opening success rate is reduced, and the user experience is poor.
When aiming at the application scene, special optimization is carried out; the implementation principle is as follows:
1. and when receiving the playing request, immediately checking whether the existing media source exists, if yes, returning to successful playing, otherwise, entering the step 2.
2. Monitor for a corresponding media source registration event while adding a play timeout timer and not reply to the player and then return. The logic will go to either step 3 or step 4.
3. And if the media source is successfully registered, immediately responding to the successful playing of the player, deleting the playing timeout timer, and removing the media registration event monitoring.
4. Triggering the timeout timer, responding to the playing failure of the player, deleting the playing timeout timer, and removing the media registration event monitoring.
The preferred embodiments of the invention disclosed above are intended only to assist in the explanation of the invention. The preferred embodiments are not exhaustive or to limit the invention to the precise form disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best understand and utilize the invention.
Claims (4)
1. A platform for automatically implementing video format conversion processing, characterized in that: building streaming services
The frame consists of a service layer, a server and an HTTP interface, and supports various media protocols, various platforms and various coding formats;
the specific steps of the process for automatically realizing the video format conversion are as follows:
step 1: after receiving video streams of various protocols (rtsp, rtmp, gb28181, hls, mp4 and the like), the server platform analyzes the video streams to acquire information such as protocol types, host addresses, application names, video stream ids and the like;
step 2: setting an event monitor for the acquired video stream, adding an audio or video track, writing frame data and analyzing the frame data; step 3: when a user plays a video by using a player, the server platform encapsulates frame data into a corresponding protocol according to a video streaming protocol for playing;
when the method is started, a plurality of epoll examples are automatically created according to the CPU core number; these epoll instances will have one thread to run the epoll_wait function to wait for the triggering of an event; if the server receives a new play request, a plurality of epoll examples automatically select a thread with lighter load to trigger an accept event under the dispatching of the kernel; after receiving the accept event, the server creates a TcpSess object and binds to the epoll instance; each Tcp connection corresponds to a TcpSession object, in the data interaction between the client and the server, the Tcession object processes all related business data, and all events in the life cycle of the object are triggered by the epoll thread, so that each epoll thread of the server can be uniformly distributed to reasonable client quantity; the single-process multithreading model is adopted, the intelligent pointer of C++11 is adopted by the platform software framework to perform memory management, the memory sharing under multithreading and the life cycle thereof can be perfectly managed during thread switching, meanwhile, the granularity of the mutual exclusion lock is reduced to the greatest extent and can be almost ignored, so that the performance loss of the multithreading model is extremely low, the performance of each thread can be almost comparable to that of the single-thread model, and simultaneously, the performance of each core of the CPU can be fully squeezed;
the sendmsg function is adopted to transmit batch data, when the network is not good or the load of a server is high, the number of times of system call can be obviously reduced, and the program performance is improved; the realization step of data batch transmission comprises the following steps: dividing the data to be transmitted into a plurality of sections according to the designated size, transmitting the data with the designated size through a circular statement, simultaneously recording whether the data transmission state is successful or not, and retransmitting the data which is not transmitted successfully; finally, recording the successful times of transmission;
under a multithreading model, when the streaming media server distributes media data, the multithreading data distribution is realized by using thread switching;
when the user end sends a request and the equipment end is required to start pushing flow:
step 1: when receiving a playing request, immediately checking whether a media source exists, if yes, returning to successful playing, otherwise, entering the step 2;
step 2: monitoring a corresponding media source registration event, adding a play timeout timer at the same time, returning without replying to the player, and entering a step 3 or a step 4 by logic;
step 3: if the media source is successfully registered, immediately responding to the successful playing of the player, deleting the playing timeout timer, and removing the media registration event monitoring;
step 4: triggering the timeout timer, responding to the playing failure of the player, deleting the playing timeout timer, and removing the media registration event monitoring.
2. The platform for automatically implementing video format conversion processing of claim 1, wherein: under the holding of C++11, when the media data is forwarded, the problem of managing the life cycle of the multithreading memory is skillfully solved by utilizing the reference count; the core principle of implementing reference counts is that the same data object pointer and the same reference counter pointer together, when a reference object is created or copied, the reference count is incremented by 1; when the referencing object is destroyed or overwritten, the reference count is decremented by 1; when the reference count is 0, the data object is destroyed; it is noted in detail that when a reference object is overwritten, the current reference count is decremented by 1.
3. A platform for automatically implementing video format conversion processes according to claim 1, wherein: the object circulation pool is used for avoiding the reduction of the program performance and the generation of memory fragments; when the player is processed, the TCP_NODELAY is opened and the MSG_MORE is closed during the handshake, so that the delay of data interaction during the handshake is improved, the time consumption for establishing a link is reduced, and the video opening speed is improved; after successful handshake we will turn off tcp_nodelay and turn on msg_more; the number of the data messages is reduced, and the network utilization rate is improved.
4. The platform for automatically implementing video format conversion processing of claim 1, wherein: the single-process multithreading model is a multithreading IO multiplexing non-blocking model.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110371811.2A CN112954392B (en) | 2021-04-07 | 2021-04-07 | Platform for automatically realizing video format conversion processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110371811.2A CN112954392B (en) | 2021-04-07 | 2021-04-07 | Platform for automatically realizing video format conversion processing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112954392A CN112954392A (en) | 2021-06-11 |
CN112954392B true CN112954392B (en) | 2024-01-26 |
Family
ID=76232371
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110371811.2A Active CN112954392B (en) | 2021-04-07 | 2021-04-07 | Platform for automatically realizing video format conversion processing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112954392B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113938470B (en) * | 2021-10-18 | 2023-09-12 | 成都小步创想慧联科技有限公司 | Method and device for playing RTSP data source by browser and streaming media server |
CN115914659A (en) * | 2022-03-24 | 2023-04-04 | 北京有限元科技有限公司 | Plug flow method, device, equipment, system and computer readable storage medium |
CN114827670A (en) * | 2022-06-30 | 2022-07-29 | 椭圆方程(深圳)信息技术有限公司 | Video playing method and device and electronic equipment |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2012003662A1 (en) * | 2010-07-09 | 2012-01-12 | 中兴通讯股份有限公司 | Media server and method for audio/video transmission |
CN102724561A (en) * | 2012-05-16 | 2012-10-10 | 昆山日通电脑科技办公设备有限公司 | Embedded real time streaming media network transmission method and implementation system thereof |
CN103002274A (en) * | 2011-09-16 | 2013-03-27 | 腾讯科技(深圳)有限公司 | Mobile multimedia real-time transcoding play system and method based on offline download |
CN103513990A (en) * | 2013-10-11 | 2014-01-15 | 安徽科大讯飞信息科技股份有限公司 | Method for designing high-performance generally-used network framework for distributed processing |
CN105912402A (en) * | 2016-04-11 | 2016-08-31 | 深圳益邦阳光有限公司 | Scheduling method and apparatus based on Actor model |
KR20170114218A (en) * | 2016-04-04 | 2017-10-13 | 한화테크윈 주식회사 | Method and apparatus for playing media stream on web-browser |
CN107277004A (en) * | 2017-06-13 | 2017-10-20 | 重庆扬讯软件技术股份有限公司 | A kind of browser is without plug-in unit net cast method |
CN110661752A (en) * | 2018-06-29 | 2020-01-07 | 广州弘度信息科技有限公司 | Plug-in-free real-time video playing system and method |
CN111787399A (en) * | 2020-07-23 | 2020-10-16 | 成都云盯科技有限公司 | Video playing method, device and system |
CN112422508A (en) * | 2020-10-19 | 2021-02-26 | 武汉烽火众智数字技术有限责任公司 | Method and system for playing video in browser webpage |
-
2021
- 2021-04-07 CN CN202110371811.2A patent/CN112954392B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2012003662A1 (en) * | 2010-07-09 | 2012-01-12 | 中兴通讯股份有限公司 | Media server and method for audio/video transmission |
CN103002274A (en) * | 2011-09-16 | 2013-03-27 | 腾讯科技(深圳)有限公司 | Mobile multimedia real-time transcoding play system and method based on offline download |
CN102724561A (en) * | 2012-05-16 | 2012-10-10 | 昆山日通电脑科技办公设备有限公司 | Embedded real time streaming media network transmission method and implementation system thereof |
CN103513990A (en) * | 2013-10-11 | 2014-01-15 | 安徽科大讯飞信息科技股份有限公司 | Method for designing high-performance generally-used network framework for distributed processing |
KR20170114218A (en) * | 2016-04-04 | 2017-10-13 | 한화테크윈 주식회사 | Method and apparatus for playing media stream on web-browser |
CN105912402A (en) * | 2016-04-11 | 2016-08-31 | 深圳益邦阳光有限公司 | Scheduling method and apparatus based on Actor model |
CN107277004A (en) * | 2017-06-13 | 2017-10-20 | 重庆扬讯软件技术股份有限公司 | A kind of browser is without plug-in unit net cast method |
CN110661752A (en) * | 2018-06-29 | 2020-01-07 | 广州弘度信息科技有限公司 | Plug-in-free real-time video playing system and method |
CN111787399A (en) * | 2020-07-23 | 2020-10-16 | 成都云盯科技有限公司 | Video playing method, device and system |
CN112422508A (en) * | 2020-10-19 | 2021-02-26 | 武汉烽火众智数字技术有限责任公司 | Method and system for playing video in browser webpage |
Also Published As
Publication number | Publication date |
---|---|
CN112954392A (en) | 2021-06-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112954392B (en) | Platform for automatically realizing video format conversion processing | |
WO2023024834A9 (en) | Game data processing method and apparatus, and storage medium | |
CN109525460B (en) | Method and device for monitoring number resources of video network | |
CN110855610A (en) | Data packet processing method and device and storage medium | |
CN105072507B (en) | A kind of transmission method and system of multi-medium data | |
CN108306852B (en) | Message middleware system and method based on simple binary coding | |
CN111787349B (en) | Data caching method, device, equipment and medium | |
CN109660753B (en) | Resource synchronization method and device | |
CN102377792A (en) | Home network monitoring system based on WEB | |
CN113676750A (en) | Stream media server cluster management system | |
CN111556346B (en) | Method and device for remotely controlling video networking terminal and computer readable storage medium | |
Wang et al. | Ndnlive and ndntube: Live and prerecorded video streaming over ndn | |
CN102355604B (en) | Media message transmission method and device | |
CN110049280B (en) | Method and device for processing monitoring data | |
WO2023231723A1 (en) | Streaming media data processing method and system | |
CN112543374A (en) | Transcoding control method and device and electronic equipment | |
CN101162974B (en) | Multicast video storing method, system and equipment | |
CN111897496B (en) | Method for improving network IO read-write performance in distributed system | |
CN110557669B (en) | Video data display method and device | |
CN110660205B (en) | Alarm information processing method and device, electronic equipment and readable storage medium | |
CN110166840B (en) | Service processing method, system and device | |
CN113613038A (en) | Intelligent streaming media service system and video stream scheduling method thereof | |
CN110474934B (en) | Data processing method and video networking monitoring platform | |
Gao et al. | The Design and Implementation of an Augmented Reality Scheme Based on Netty Communication | |
WO2024060134A1 (en) | Information processing method and apparatus, electronic device, and computer-readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |