Video playing and control method and device of train display device, equipment and medium
By employing independent video acquisition and decoding threads in the train display device, protocol parsing and encapsulation of RTP format video data are performed. Combined with GStreamer pipeline processing, the complexity of GB/T28181 protocol parsing is solved, thereby improving the reliability and efficiency of video data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CRRC ZHUZHOU ELECTRIC LOCOMOTIVE RESEARCH INSTITUTE CO LTD
- Filing Date
- 2024-10-22
- Publication Date
- 2026-04-24
AI Technical Summary
The existing GStreamer video framework lacks a mature method for parsing the GB/T28181 protocol, resulting in low reliability and efficiency in video data parsing and playback, complex system integration and compatibility, and increased development costs and time.
It employs independent video capture and video decoding threads to perform protocol parsing and encapsulation of RTP format video data, decodes, renders, and displays the data through the GStreamer pipeline, and obtains error information through callback acquisition to achieve reliable detection and recovery of video data.
This improved the reliability of video acquisition and decoding on the train display device, enhanced the efficiency of video application debugging, and ensured the normal display of video data and system stability.
Smart Images

Figure CN121924286A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer video data processing technology, and in particular to a video playback and control method, device, equipment and medium for a train display device. Background Technology
[0002] With the rapid development of video surveillance technology, the market demand for video surveillance is also increasing. Before the advent of the GB / T28181 protocol, video surveillance systems typically used some internationally accepted protocols and standards, or proprietary protocols developed by various manufacturers. These protocols and standards provided basic communication and data processing capabilities for video surveillance systems, but they lacked unified interfaces and security requirements, leading to numerous problems in system integration and compatibility. This increased the complexity of system deployment and maintenance, and significantly increased development costs and time in achieving compatibility with different protocols and manufacturers.
[0003] The GB / T28181 protocol provides a unified technical specification for achieving interoperability between video devices. By standardizing data transmission and control between access devices and platforms, video devices from different manufacturers can achieve interoperability, improving the overall efficiency and scalability of monitoring systems and enhancing the overall efficiency and security of the entire industry. Its application is crucial for achieving efficient monitoring and management. However, the current GStreamer video framework lacks a mature method for parsing the GB / T28181 protocol. Implementing the parsing and playback of GB / T28181 protocol video data based on the GStreamer video framework is relatively complex, resulting in low reliability and inefficiency. Summary of the Invention
[0004] The main objective of this invention is to provide a video playback and control method, device, equipment, and medium for a train display device, which improves the reliability of video acquisition and video decoding of the train display device and enhances the efficiency of video application debugging.
[0005] One aspect of the present invention provides a video playback and control method for a train display device, comprising:
[0006] Monitor the video port of the target train's display device and acquire RTP format video data through the video acquisition thread.
[0007] The RTP format video data is parsed using both RTP and PS protocols, and then encapsulated to obtain H264 / H265 format video data.
[0008] The video decoding thread sequentially pushes each frame of H264 / H265 format video data into the GStreamer acquisition element, and the video decoding thread performs decoding, rendering and display processing in GStreamer.
[0009] The error message is obtained by recalling and collecting the displayed video data from the target train's display device.
[0010] Based on the error message, the video acquisition thread and the video decoding thread are detected and restored until the video data displayed on the target train display device is normal.
[0011] According to the video playback and control method for the train display device, the video port of the target train display device is monitored, and RTP format video data is acquired from the video port through a video acquisition thread, including:
[0012] A corresponding video acquisition thread is established for each video port of the target train display device, and the raw network data in UDP format is obtained by listening to the video port through the video acquisition thread;
[0013] The raw network data in UDP format is parsed by the video acquisition thread to obtain the RTP format video data.
[0014] According to the video playback and control method of the train display device, the RTP format video data is parsed using both RTP and PS protocols to encapsulate it into H.264 / H.265 format video data, including:
[0015] The video acquisition thread parses the RTP format video data using the RTP and PS protocols to obtain the RTP and PS packets. Based on the composition of the RTP and PS packets, the H264 / H265 format video data of each frame is determined.
[0016] According to the video playback and control method of the train display device, the video decoding thread performs decoding, rendering, and display processing in the GStreamer acquisition element, including:
[0017] A GStreamer pipeline is created in the GStreamer acquisition element through a video decoding thread, wherein the GStreamer pipeline includes an acquisition element, a decoding element, a rendering element, and a display element;
[0018] Based on the display settings of the target train display device, the attributes are configured through decoding elements, rendering elements, and display elements, and decoding, rendering, and display processing are performed.
[0019] According to the video playback and control method of the train display device, the displayed video data of the target train display device is collected via callback to obtain error information, including:
[0020] The acquisition unit of the GStreamer pipeline uses a callback function to listen to the GStreamer pipeline and obtain the error information.
[0021] According to the video playback and control method of the train display device, the detection of the video acquisition thread and the video decoding thread based on the error information includes:
[0022] Based on the error message, abnormal status information is obtained from the video acquisition thread and the video decoding thread through the status feedback interface. The abnormal status information includes one of the following: duplicate data stream, frequent packet loss, failure to receive data normally, pipeline abnormality, and decoding thread exit.
[0023] Based on the abnormal status information, preliminary analysis and abnormal data filtering are performed using the sequence number and keyframe flag of the input data from the video acquisition thread and the video decoding thread.
[0024] According to the video playback and control method of the train display device, restoring the video acquisition thread and the video decoding thread based on the error information includes:
[0025] The GStreamer pipeline is monitored, and if the abnormal status information is obtained, the video acquisition thread and the video decoding thread are restarted.
[0026] After restarting, record the first time when the first frame of input data arrives at the video acquisition thread and the video decoding thread, and record the second time when the pause command is received;
[0027] Based on the first time, the second time, and the preset time, the video acquisition thread and the video decoding thread are subjected to either delayed pause or direct pause processing.
[0028] Another aspect of the present invention provides a video playback and control device for a train display device, comprising:
[0029] The first module is used to monitor the video port of the target train display device and acquire RTP format video data from the video port through the video acquisition thread.
[0030] The second module is used to perform RTP protocol parsing and PS protocol parsing on the RTP format video data and encapsulate it to obtain H264 / H265 format video data.
[0031] The third module is used to sequentially push each frame of H264 / H265 format video data into the GStreamer acquisition element through the video decoding thread, and perform decoding, rendering and display processing in GStreamer through the video decoding thread.
[0032] The fourth module is used to collect the video data displayed on the target train's display device and obtain error information.
[0033] The fifth module is used to detect and restore the video acquisition thread and the video decoding thread based on the error information until the video data displayed on the target train display device is normal.
[0034] Another aspect of the present invention provides an electronic device, including a processor and a memory;
[0035] The memory is used to store programs;
[0036] The processor executes the program to implement the method as described above.
[0037] This invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the methods described above.
[0038] The beneficial effects of this invention are as follows: It uses independent video acquisition and video decoding threads to push raw video data into a custom acquisition element of GStreamer, completing the parsing, playback, and control of GB / T28181 protocol data; it obtains error information through callback acquisition, and performs pre-analysis and abnormal data filtering using the sequence number and keyframe flag of the input data from the video acquisition and video decoding threads, thus completing anomaly protection and improving the reliability of the video decoding process; it improves the efficiency of video application debugging by restoring the video acquisition and video decoding threads, including restarting and pausing them. Attached Figure Description
[0039] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0040] Figure 1 This is a schematic diagram of the national standard HMI screen software framework according to an embodiment of the present invention.
[0041] Figure 2 This is a schematic flowchart of the video playback and control method of the train display device according to an embodiment of the present invention.
[0042] Figure 3 This is a schematic diagram of the video data acquisition process according to an embodiment of the present invention.
[0043] Figure 4 This is a schematic diagram of the video decoding process according to an embodiment of the present invention.
[0044] Figure 5 This is a schematic diagram of the abnormal data protection process according to an embodiment of the present invention.
[0045] Figure 6 This is a schematic diagram of the video decoding thread flow according to an embodiment of the present invention.
[0046] Figure 7 This is a schematic diagram of a video playback and control method device for a train display device according to an embodiment of the present invention. Detailed Implementation
[0047] The embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings. Throughout the description, the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions. In the following description, suffixes such as "module," "part," or "unit" used to denote elements are used only for the purpose of illustrative purposes and have no specific meaning in themselves. Therefore, "module," "part," or "unit" can be used interchangeably. Terms such as "first," "second," etc., are used only to distinguish technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the sequential relationship of the indicated technical features. In the following description, the consecutive reference numerals for method steps are for ease of review and understanding. Adjusting the implementation order of steps, in conjunction with the overall technical solution of the present invention and the logical relationship between the various steps, will not affect the technical effect achieved by the technical solution of the present invention. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0048] refer to Figure 1 , Figure 1This is a schematic diagram of the national standard HMI screen software framework according to an embodiment of the present invention. Since existing GStreamer components cannot directly support RTP+PS format parsing, but can perform custom processing of input data through their included acquisition components, the solution adopted in this paper for implementing video acquisition, playback, and control functions is to establish separate video acquisition and video decoding threads. In the video acquisition thread, RTP format video data sent by the NVR is acquired by listening to the video port, and RTP and PS protocols are parsed sequentially to acquire a complete frame of H264 / H265 format video data, which is then passed to the video decoding thread. In the video decoding thread, the obtained continuous frame video data is pushed into the GStreamer acquisition components, and decoding, rendering, and display functions are implemented in the pipeline.
[0049] refer to Figure 2 ,in Figure 2 This is a schematic flowchart of a video playback and control method for a train display device according to an embodiment of the present invention, which includes, but is not limited to, steps S100 to S500:
[0050] S100 monitors the video port of the target train display device and acquires RTP format video data from the video port through the video acquisition thread.
[0051] In some embodiments, a corresponding video acquisition thread is established for each video port of the target train display device. The video acquisition thread listens to the video port to obtain raw network data in UDP format. The raw network data in UDP format is parsed by the video acquisition thread to obtain video data in RTP format.
[0052] S200 performs RTP protocol parsing and PS protocol parsing on RTP format video data, and encapsulates it to obtain H264 / H265 format video data.
[0053] In some embodiments, the video acquisition thread parses the RTP format video data using the RTP and PS protocols to obtain the composition of RTP packets and PS packets. Based on the composition of the RTP packets and PS packets, the H264 / H265 format video data of each frame of video data is determined.
[0054] In some embodiments, reference Figure 3 The diagram shown illustrates the video data acquisition process, which includes:
[0055] H.264 / H.265 video data is first stored and encapsulated in PS format, then the PS packets are encapsulated into RTP packets as payloads, and finally transmitted over the network based on the UDP protocol. Therefore, during the data acquisition process, a corresponding data acquisition thread is created for each video stream, listening to the specified video stream transmission port to obtain the raw network data in UDP format. This data is then parsed for RTP packets and assembled and parsed for PS packets, ultimately yielding the H.264 / H.265 video data corresponding to each video frame, which is then fed into the decoding thread.
[0056] The S300 uses a video decoding thread to sequentially push each frame of H264 / H265 format video data into the GStreamer acquisition element, and then uses the video decoding thread to perform decoding, rendering, and display processing in GStreamer.
[0057] In some embodiments, a GStreamer pipeline is created in the GStreamer acquisition element through a video decoding thread, wherein the GStreamer pipeline includes an acquisition element, a decoding element, a rendering element, and a display element; according to the display settings of the target train display device, the attributes are configured through the decoding element, the rendering element, and the display element, and decoding, rendering, and display processing are performed.
[0058] For example, refer to Figure 4 The diagram illustrates the video decoding process of the decoding module. The video decoding thread establishes and runs the GStreamer pipeline, continuously receiving H264 / H265 video data from the acquisition thread, decoding it, and displaying it. Within the constructed video pipeline, four components are created and connected: an acquisition component, a decoding component, a rendering component, and a display component. These components are customized through property settings to configure important parameters such as screen display position and size, and data stream type (H264 / H265).
[0059] S400 performs callback collection of the display video data of the target train's display device and obtains error information.
[0060] In some embodiments, the acquisition unit of the GStreamer pipeline uses a callback function to listen to the GStreamer pipeline and obtain error information.
[0061] For example, refer to Figure 4 Once the pipeline enters the running state, the video data transmitted by the acquisition thread can be obtained and parsed through the callback function of the acquisition element, and the error messages of the pipeline can be obtained and processed through the callback function of the pipeline message listener.
[0062] S500 detects and restores the video acquisition thread and video decoding thread based on the error message until the video data displayed on the target train display device is normal.
[0063] In some embodiments, the detection of the video acquisition thread and the video decoding thread is achieved through an abnormal data protection mechanism. Based on the error information, it obtains abnormal status information from the video acquisition thread and the video decoding thread through the status feedback interface. The abnormal status information includes one of the following: duplicate data stream, frequent packet loss, failure to receive data normally, pipeline abnormality, and decoding thread exit.
[0064] refer to Figure 5 The diagram illustrating the abnormal data protection process demonstrates how, to improve debugging efficiency and facilitate obtaining current network or NVR data transmission status, this embodiment of the invention extracts the status of the video acquisition and decoding threads and provides this information to the application layer via a status feedback interface. By calling this interface in real time, the instantaneous data status can be obtained. Real-time calls to the status feedback interface allow for the identification of abnormal states in the acquisition and decoding threads, such as duplicate data streams received at the video port, frequent packet loss, failure to receive data normally, pipeline abnormalities, or decoding thread exits.
[0065] To improve the reliability of the video acquisition process and eliminate the impact of abnormal data such as duplicate streams, discontinuous sequence numbers, and missing keyframes on decoding performance, this embodiment of the invention implements an abnormal data protection mechanism for the data acquisition process. This embodiment utilizes an independent port mechanism to avoid the impact of abnormal data from NVR duplicate streams and performs pre-analysis and abnormal data filtering using sequence numbers and keyframe flags.
[0066] Based on the abnormal status information, preliminary analysis and abnormal data filtering are performed using the sequence number and keyframe flag of the input data from the video acquisition thread and the video decoding thread.
[0067] In some embodiments, by listening to the GStreamer pipeline, if abnormal status information is obtained, the video capture thread and the video decoding thread are restarted;
[0068] After restarting, record the first time when the first frame of input data arrives at the video acquisition thread and the video decoding thread, and record the second time when the pause command is received; based on the first time, the second time, and the preset time, perform delayed pause or direct pause processing on the video acquisition thread and the video decoding thread.
[0069] In some embodiments, reference Figure 6To improve the reliability of the video decoding process, promptly detect decoder anomalies, and minimize decoding module and video display malfunctions caused by network packet loss, NVR data transmission errors, insufficient data, and other anomalies, this invention implements a decoding module recovery mechanism for the data decoding process. This invention utilizes a restart mechanism to address the issue of complete image loss when the decoding module malfunctions, and reduces the probability of decoding module anomalies by controlling the shortest decoding time, effectively improving the system's stability and reliability in actual operation.
[0070] Figure 7 This is a schematic diagram of a video playback and control method device for a train display device according to an embodiment of the present invention. The device includes a first module 710, a second module 720, a third module 730, a fourth module 740, and a fifth module 750.
[0071] The system comprises five modules: First, a module that monitors the video port of the target train's display device and acquires RTP-formatted video data via a video acquisition thread; second, a module that performs RTP and PS protocol parsing on the RTP-formatted video data and encapsulates it into H264 / H265-formatted video data; third, a module that sequentially pushes each frame of H264 / H265-formatted video data into the GStreamer acquisition element via a video decoding thread, and performs decoding, rendering, and display processing in GStreamer; fourth, a module that performs callback acquisition of the display video data from the target train's display device and obtains error information; and fifth, a module that detects and restores the video acquisition and video decoding threads based on the error information until the display video data of the target train's display device is normal.
[0072] Exemplarily, with the cooperation of the first, second, third, fourth, and fifth modules in the device, the embodiment device can implement any of the aforementioned video playback and control methods for a train display device. Specifically, it monitors the video port of the target train display device, acquires RTP format video data from the video port via a video acquisition thread, performs RTP and PS protocol parsing on the RTP format video data, and encapsulates it into H264 / H265 format video data. A video decoding thread sequentially pushes each frame of H264 / H265 format video data into a GStreamer acquisition element, and the video decoding thread performs decoding, rendering, and display processing in GStreamer. A callback acquisition is performed on the display video data of the target train display device to obtain error information. Based on the error information, the video acquisition thread and video decoding thread are detected and restored until the display video data of the target train display device is normal. The beneficial effects of this invention are:
[0073] This invention also provides an electronic device, which includes a processor and a memory;
[0074] The memory stores the program;
[0075] The processor executes a program to perform the aforementioned video playback and control method for the train display device; the electronic device has the function of carrying and running a software system for video playback and control of the train display device provided in the embodiments of the present invention, such as a personal computer, minicomputer, main frame, workstation, network or distributed computing environment, standalone or integrated computer platform, or communicating with charged particle tools or other imaging devices, etc.
[0076] This invention also provides a computer-readable storage medium storing a program that is executed by a processor to implement the video playback and control method for the train display device as described above.
[0077] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is altered and sub-operations described as part of a larger operation are executed independently.
[0078] This invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the aforementioned video playback and control method for a train display device.
[0079] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the described functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.
[0080] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0081] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0082] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0083] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0084] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0085] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
[0086] The above is a detailed description of the preferred embodiments of the present invention, but the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.
Claims
1. A video playback and control method for a train display device, characterized in that, include: Monitor the video port of the target train's display device and acquire RTP format video data through the video acquisition thread. The RTP format video data is parsed using both RTP and PS protocols, and then encapsulated to obtain H264 / H265 format video data. The video decoding thread sequentially pushes each frame of H264 / H265 format video data into the GStreamer acquisition element, and the video decoding thread performs decoding, rendering and display processing in GStreamer. The error message is obtained by recalling and collecting the displayed video data from the target train's display device. Based on the error message, the video acquisition thread and the video decoding thread are detected and restored until the video data displayed on the target train display device is normal.
2. The video playback and control method for the train display device according to claim 1, characterized in that, The step of monitoring the video port of the target train display device and acquiring RTP format video data from the video port through a video acquisition thread includes: A corresponding video acquisition thread is established for each video port of the target train display device, and the raw network data in UDP format is obtained by listening to the video port through the video acquisition thread; The raw network data in UDP format is parsed by the video acquisition thread to obtain the RTP format video data.
3. The video playback and control method for the train display device according to claim 1, characterized in that, The process of parsing the RTP format video data using both RTP and PS protocols, and encapsulating it to obtain H.264 / H.265 format video data, includes: The video acquisition thread parses the RTP format video data using the RTP and PS protocols to obtain the RTP and PS packets. Based on the composition of the RTP and PS packets, the H264 / H265 format video data of each frame is determined.
4. The video playback and control method for the train display device according to claim 1, characterized in that, The process of decoding, rendering, and displaying the video through the video decoding thread in the GStreamer acquisition element includes: A GStreamer pipeline is created in the GStreamer acquisition element through a video decoding thread, wherein the GStreamer pipeline includes an acquisition element, a decoding element, a rendering element, and a display element; Based on the display settings of the target train display device, the attributes are configured through decoding elements, rendering elements, and display elements, and decoding, rendering, and display processing are performed.
5. The video playback and control method for the train display device according to claim 4, characterized in that, The process of collecting the displayed video data from the target train's display device and obtaining error information includes: The acquisition unit of the GStreamer pipeline uses a callback function to listen to the GStreamer pipeline and obtain the error information.
6. The video playback and control method for the train display device according to claim 5, characterized in that, The step of detecting the video acquisition thread and the video decoding thread based on the error information includes: Based on the error message, abnormal status information is obtained from the video acquisition thread and the video decoding thread through the status feedback interface. The abnormal status information includes one of the following: duplicate data stream, frequent packet loss, failure to receive data normally, pipeline abnormality, and decoding thread exit. Based on the abnormal status information, preliminary analysis and abnormal data filtering are performed using the sequence number and keyframe flag of the input data from the video acquisition thread and the video decoding thread.
7. The video playback and control method for the train display device according to claim 6, characterized in that, The step of restoring the video capture thread and the video decoding thread based on the error information includes: The GStreamer pipeline is monitored, and if the abnormal status information is obtained, the video acquisition thread and the video decoding thread are restarted. After restarting, record the first time when the first frame of input data arrives at the video acquisition thread and the video decoding thread, and record the second time when the pause command is received; Based on the first time, the second time, and the preset time, the video acquisition thread and the video decoding thread are subjected to either delayed pause or direct pause processing.
8. A video playback and control device for a train display device, characterized in that, include: The first module is used to monitor the video port of the target train display device and acquire RTP format video data from the video port through the video acquisition thread. The second module is used to perform RTP protocol parsing and PS protocol parsing on the RTP format video data and encapsulate it to obtain H264 / H265 format video data. The third module is used to sequentially push each frame of H264 / H265 format video data into the GStreamer acquisition element through the video decoding thread, and perform decoding, rendering and display processing in GStreamer through the video decoding thread. The fourth module is used to collect the video data displayed on the target train's display device and obtain error information. The fifth module is used to detect and restore the video acquisition thread and the video decoding thread based on the error information until the video data displayed on the target train display device is normal.
9. An electronic device, characterized in that, Including the processor and memory; The memory is used to store programs; The processor executes the program to implement the video playback and control method of the train display device as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a program, which is executed by a processor to implement the video playback and control method of the train display device as described in any one of claims 1-7.