CN109729318B - Video data playback processing method, video data playback processing device, computer equipment and storage medium - Google Patents
Video data playback processing method, video data playback processing device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN109729318B CN109729318B CN201910011469.8A CN201910011469A CN109729318B CN 109729318 B CN109729318 B CN 109729318B CN 201910011469 A CN201910011469 A CN 201910011469A CN 109729318 B CN109729318 B CN 109729318B
- Authority
- CN
- China
- Prior art keywords
- video data
- playback
- request
- rtp
- stream
- 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
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The application relates to a video data playback processing method, a video data playback processing device, a computer device and a storage medium, wherein the method comprises the following steps: acquiring a video data playback processing request, wherein the video data playback processing request comprises playback time information; transmitting an RTSP playback request according to the playback time information to receive the returned decoding information, and initializing a decoder according to the returned decoding information; sending an RTSP playing request to receive the returned RTP data stream, and analyzing an extended field in the RTP data stream to obtain an analysis result of the extended field; judging whether the coding mode of the RTP data stream changes or not according to the analysis result of the extension field; and if the encoding mode of the RTP data stream is changed, taking the time information in the analysis result of the extension field as the new playing time request to initiate a new RTSP playback request. The invention realizes the data playback problem of the mixing of various video formats, ensures the continuity of the whole playback process and improves the convenience of the use of users.
Description
Technical Field
The present invention relates to the field of video data processing technologies, and in particular, to a video data playback processing method and apparatus, a computer device, and a storage medium.
Background
At present, video monitoring is an important technical means of modern city management, a video monitoring camera is a key device in video monitoring application, and the monitoring camera generally has an SD card storage function and is used for locally storing front-end video data. In a set of perfect monitoring application system, a camera can be connected with a special storage server and is used for storing high-definition video data, and the local storage of an SD card has the significance that the SD card is used as a standby channel for storing the video data when the storage server fails, the power is cut off, a transmission channel network is abnormal and the like; or in some small application systems, due to cost, no special storage server exists, and the local storage of the SD card of the front-end camera is used as a key means for recording video data; for some cases or critical events, the playback data of the SD card is usually called directly to serve the management of modern cities.
With the development of chip technology, in the traditional technology, the mainstream cameras support independent encoding of H264 and H265 video encoding types, and are opened for users to freely configure and use, and the users can freely change the video encoding types of the cameras through management platform software or a private configuration channel; after the video coding format of the camera is changed, the video recording format stored in the SD card is also changed, so that the SD card can store data of various video formats to be mixed; decoding of different video formats corresponds to different decoding modes, and the decoding library of H264 is used for analyzing the video data of H265, so that the decoding fails, and the video cannot be normally decoded and displayed; if the time slot range requested to be played by the user contains multiple video format data, only the first video data can be normally played, and if different video format data are encountered, the decoding is abnormal, so that the subsequent playback process fails.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a video data playback processing method, apparatus, computer device, and storage medium that can achieve continuous playback of mixed video type encoded data, in view of the above technical problems.
A video data playback processing method, the method comprising:
acquiring a video data playback processing request, wherein the video data playback processing request comprises playback time information;
sending an RTSP playback request according to the playback time information, receiving returned decoding information, and initializing a decoder according to the returned decoding information;
sending RTSP playing request, receiving returned RTP data stream, and analyzing the extended field in the RTP data stream to obtain the analysis result of the extended field;
judging whether the coding mode of the RTP data stream is changed or not according to the analysis result of the extension field;
and if the coding mode of the RTP data stream is changed, taking the time information in the analysis result of the extension field as new playing time to initiate a new RTSP playback request.
In one embodiment, the method further comprises the step of video data acquisition and storage:
collecting video data;
adding header information to the collected video data and performing local storage to obtain video data, wherein the header information comprises: coding type, frame rate, and recording time information.
In one embodiment, the method further comprises the step of video data assembly:
acquiring a video data playback processing request;
analyzing the URL in the video data playback processing request to obtain playback time information;
acquiring video data corresponding to the playback time information from a local storage, and replying corresponding decoding information through an SDP protocol;
and reading video data and packaging an RTP data packet, and obtaining an RTP data stream for the video data through the RTP packet.
In one embodiment, the step of obtaining an RTP data stream from the video data by RTP packetization includes:
when the coding type of the video data is detected to be changed, inserting an RTP packet only containing header information into the middle of a changed data segment;
adding an extension field to the header information of the RTP packet to obtain an RTP data stream; the extension field includes: c field, T field, and NTP time;
wherein the C field is used for indicating the coding type change of the video data, the T field is used for indicating the end of the video data playback request, and the NTP time represents the time point of the interruption of the video data in the format.
In one embodiment, after the step of parsing the extension field in the RTP data stream to obtain a parsing result of the extension field, the method further includes:
judging whether a T field in the extension field is set; if so, stopping taking the stream;
if not, judging whether the C field in the extension field is set; if yes, stopping decoding;
if not, acquiring the NTP time in the extension field as an interrupt time point;
and initiating a new RTSP playback request by taking the interruption time point as a new request playing time.
In one embodiment, the method further comprises the step of transmitting the video data:
judging whether the coding type of the video data changes;
if the coding type of the video data changes, inserting a NALU frame with a stream ending character, and sending a stream ending frame;
and if the coding type of the video data is not changed, transmitting an RTP data stream.
In one embodiment, the method further comprises the step of recording video data for playback and decoding:
receiving the video data;
judging whether the stream ending frame is received or not;
if yes, destroying the current decoding parameter and waiting for a new decoding parameter;
and if not, decoding and playing the received video data.
A video data playback processing apparatus, the apparatus comprising:
the acquisition module is used for acquiring a video data playback processing request, and the video data playback processing request comprises playback time information;
the initialization module is used for sending an RTSP playback request according to the playback time information, receiving returned decoding information and initializing a decoder according to the returned decoding information;
the analysis module is used for sending an RTSP playing request, receiving a returned RTP data stream, and analyzing an extended field in the RTP data stream to obtain an analysis result of the extended field;
the judging module is used for judging whether the coding mode of the RTP data stream changes or not according to the analysis result of the extension field;
and the request module is used for initiating a new RTSP playback request by taking the time information in the analysis result of the extension field as new playing time request if the coding mode of the RTP data stream is changed.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of any of the above methods when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of any of the methods described above.
According to the video data playback processing method, the video data playback processing device, the computer equipment and the storage medium, the video data playback processing request is obtained, and the video data playback processing request comprises playback time information; sending an RTSP playback request according to the playback time information to receive returned decoding information, and initializing a decoder according to the returned decoding information; sending an RTSP playing request to receive a returned RTP data stream, and analyzing an extended field in the RTP data stream to obtain an analysis result of the extended field; judging whether the coding mode of the RTP data stream is changed or not according to the analysis result of the extension field; and if the coding mode of the RTP data stream is changed, taking the time information in the analysis result of the extension field as new playing time to initiate a new RTSP playback request. The invention realizes the data playback problem of the mixing of various video formats, ensures the continuity of the whole playback process and improves the convenience of the use of users.
Drawings
Fig. 1 is a diagram illustrating an application scenario of a video data playback processing method according to an embodiment;
FIG. 2 is a flow chart illustrating a video data playback processing method according to an embodiment;
FIG. 3 is a schematic flow chart illustrating the steps of video data acquisition and storage according to one embodiment;
FIG. 4 is a flowchart illustrating the steps of video data assembly in one embodiment;
FIG. 5 is a flowchart illustrating the steps of obtaining RTP data streams for video data via RTP packets according to an embodiment;
FIG. 6 is a flowchart illustrating steps followed by a step of parsing an extension field in an RTP data stream to obtain a parsing result of the extension field in accordance with an embodiment;
FIG. 7 is a flowchart illustrating the steps of sending video data in one embodiment;
FIG. 8 is a flowchart illustrating the steps of playback decoding of recorded video data in one embodiment;
FIG. 9 is a diagram of an embodiment of RTSP playback signaling control;
FIG. 10 is a schematic diagram of an RTP header and extensions in one embodiment;
FIG. 11 is a diagram illustrating insertion of a null frame representing an end of a flow in one embodiment;
FIG. 12 is a flow diagram of a video capture local storage process in one embodiment;
FIG. 13 is a flow diagram of a video data assembly transmission process in one embodiment;
FIG. 14 is a flow diagram of a playback request and automatic reconnect process in one embodiment
FIG. 15 is a flowchart of a playback decoding display process in one embodiment;
FIG. 16 is a block diagram showing the construction of a video data playback processing apparatus according to an embodiment;
fig. 17 is a block diagram showing the construction of a video data playback processing apparatus in another embodiment;
fig. 18 is a block diagram showing the construction of a video data playback processing apparatus in still another embodiment;
fig. 19 is a block diagram showing the construction of a video data playback processing apparatus in still another embodiment;
fig. 20 is a block diagram showing the construction of a video data playback processing apparatus in still another embodiment;
FIG. 21 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The video data playback processing method provided by the embodiment of the invention can be applied to a front-end camera playback system as shown in fig. 1. The front-end camera playback system includes: the device comprises a video acquisition module, an SD card storage module, a transmission module, a data receiving module, a playback management module and a decoding display module. The method mainly solves the problem that mixed coding type data in the video causes decoding abnormity. As shown in fig. 1, the front-end camera playback system can enable data to be played back completely and smoothly by the method provided by the invention, and relates to a quick disconnection and reconnection mechanism when a data format changes.
In one embodiment, as shown in fig. 2, a video data playback processing method is provided, which is described by taking the method as an example of being applied to the front-end camera playback system in fig. 1, and the method includes:
step 202, acquiring a video data playback processing request, wherein the video data playback processing request comprises playback time information;
step 204, sending RTSP playback request according to the playback time information, receiving the returned decoding information, and initializing a decoder according to the returned decoding information;
step 206, sending an RTSP play request, receiving the returned RTP data stream, and analyzing the extension field in the RTP data stream to obtain an analysis result of the extension field;
step 208, judging whether the coding mode of the RTP data stream changes according to the analysis result of the extension field;
step 210, if the encoding mode of the RTP data stream changes, the time information in the parsing result of the extension field is used as a new playing time request to initiate a new RTSP playback request.
Specifically, referring to fig. 12 to 15, the video data playback processing method includes: the method comprises the steps of acquiring data through a video acquisition module, assembling the video data through a transmission module, sending the video data through the transmission module, analyzing the data through a data receiving module, playing back and automatically reconnecting the data according to an analysis result through a playback management module, and playing back and decoding the displayed data through a decoding display module.
Firstly, a video acquisition module acquires video data, adds header information to the video data, and records information such as coding type, frame rate, video recording time and the like. The video transmission module reads the data of the SD card storage module, packages the video data through an RTP, expands an RTP head and increases the wall time of the video data.
In a specific embodiment, after detecting the change of the video recording coding type, inserting a new RTP packet containing only header information in the middle of the changed data segment, where the RTP header information is extended, a field C is added to indicate the change of the video recording coding type, a field T is added to indicate the end of the entire playback request, and the NTP time in the extension field represents the end of the video data in the format, which is the time point of the interruption, i.e., the start time of the video data in the new format.
The transmission module adds data content into the newly inserted RTP packet, inserts the NALU frame with the stream terminator, and takes a value according to the encoding format of the front-end camera data, specifically, in combination with the RFC standard, the value of H264 is 11, and the value of H265 is 37.
After detecting the NALU frame with the stream terminator, the data receiving module analyzes NTP time information in the RTP extension head, analyzes the C field to acquire whether the video coding format changes, actively informs a playback management module of the client when the video coding format changes, and transmits the NTP time information to the playback management module.
The playback management module receives the notification message of the data receiving module, and quickly initiates a new RTSP request according to the transmitted NTP time as a new request playing time, the RTSP interaction process can re-interact the decoding information, the subsequent playback is continuously completed, and the playing continuity is ensured.
And if the data receiving module analyzes that the RTP extension T field is 1, the data receiving module informs the playback management module to send RTSP (real time streaming protocol) Teardown message to stop the whole playback process, which represents the end of the whole playback.
In this embodiment, by obtaining a video data playback processing request, the video data playback processing request includes playback time information; transmitting an RTSP playback request according to the playback time information to receive the returned decoding information, and initializing a decoder according to the returned decoding information; sending an RTSP playing request to receive the returned RTP data stream, and analyzing an extended field in the RTP data stream to obtain an analysis result of the extended field; judging whether the coding mode of the RTP data stream changes or not according to the analysis result of the extension field; and if the encoding mode of the RTP data stream is changed, taking the time information in the analysis result of the extension field as the new playing time request to initiate a new RTSP playback request. The embodiment solves the problem of data playback of mixing of multiple video formats, ensures the continuity of the whole playback process and improves the convenience of use of users.
In one embodiment, a video data playback processing method is provided, as shown in fig. 3, in the method, the method further includes the steps of:
step 302, collecting video data;
step 304, adding header information to the collected video data and performing local storage to obtain video data, wherein the header information includes: coding type, frame rate, and recording time information.
Specifically, referring to fig. 12, first, the video capture module captures video data through the camera. And packaging the video data, storing the information such as time, coding format and the like, and locally storing the packaged video data in the SD card.
In the embodiment, the video data is acquired, and information such as corresponding coding types and recording time is added to the acquired video data, so that data preparation is well made for the subsequent flows of video playback and reconnection.
In one embodiment, a video data playback processing method is provided, as shown in fig. 4, the method further includes the steps of assembling video data:
step 402, acquiring a video data playback processing request;
step 404, analyzing the URL in the video data playback processing request to obtain playback time information;
step 406, obtaining video data corresponding to the playback time information from a local storage, and replying corresponding decoding information through an SDP protocol;
and step 408, reading the video data and packaging the RTP data packet, and obtaining an RTP data stream for the video data through the RTP packet.
In one embodiment, referring to fig. 5, the step of obtaining the RTP data stream by RTP packetization for the video data includes:
step 502, when detecting the coding type change of the video data, inserting an RTP packet only containing header information in the middle of a changed data segment;
step 504, adding an extension field to the header information of the RTP packet to obtain an RTP data stream; the extension field includes: c field, T field, and NTP time;
wherein, the C field is used for indicating the coding type change of the video data, the T field is used for indicating the end of the video data playback request, and the NTP time represents the time point of the interruption of the video data in the format.
In one embodiment, referring to fig. 6, after the step of parsing the extension field in the RTP data stream to obtain a parsing result of the extension field, the method further includes:
step 602, judging whether a T field in an extension field is set; if yes, go to step 604, otherwise go to step 606;
step 604, stopping fetching the stream;
step 606, judging whether the C field in the extension field is set; if yes, go to step 608, otherwise go to step 610;
step 608, stop decoding;
step 610, acquiring NTP time in the extension field as an interrupt time point, and initiating a new RTSP playback request by using the interrupt time point as a new request play time.
Specifically, referring to fig. 13 and 14, in the present embodiment, the RTSP protocol is adopted as the signaling control for playback, the playback signaling control process based on RTSP is as shown in fig. 9, and the related commands include in detail:
and an Option command requesting to acquire the RTSP command type supported by the equipment, wherein the reply message comprises Descripte, setup, play, teardown and the like.
A Describe command requesting to acquire media description information of the device, SDP (session description protocol) being used to Describe the media information, and the server side replying video decoding information through the SDP protocol, including information related to decoding, such as encoding type, frame rate, sps, pps, and the like.
Setup command, establishment of transmission channel and port negotiation.
Play command, video playback request.
The Teardown command, video playback stops.
In this embodiment, the URL of the RTSP interactive signaling carries playback request time to control a playback request range, and a user may request corresponding video playback data according to a requested playback time period, where the playback request URL represents an example as follows, where a range is followed by a video recording time period range to be played:
rtsp://admin:admin@10.82.16.29:554/ch1/stream1method=playbackrange=20181119T143244.300Z-20181119T184023.300Z。
in this embodiment, the RTP protocol is adopted for transmission, and is extended so that the playback client can quickly respond to the change of the playback video data format, and a specific extension method is shown in fig. 10.
When the video data format changes, the current connection needs to be temporarily disconnected and a new connection needs to be reestablished so as to adapt to the requirements of decoding data in different video formats; therefore, an RTP extension function is introduced as a notification mechanism, so that the playback can be ensured not to be really interrupted, and the playback effect is ensured. As shown in fig. 10, an RTP extension function is introduced, wherein the extension position X is set to 1; NTP timestamp is absolute UTC time, and the video self wall clock time; the C field represents a change in video data format; the T field represents the end of the entire playback; padding is filling content, and has no practical significance.
When the video data format changes, the video sending end inserts a new RTP data packet, the C field is set, the data receiving module analyzes the RTP extension field, the video format change state can be quickly obtained in the data transmission layer, the playback management module is informed to send RTSP (real time streaming protocol) Teardown messages, and the current playback is temporarily stopped.
In this embodiment, the RTSP protocol is used to transport signaling, the RTP protocol is used to transport data streams, and video decoding information is exchanged based on the SDP protocol. In the embodiment, the time information of the playback request is transmitted by using the signaling of the RTSP, and the playback client can be actively informed by detecting the change of the video format of the video data, so that the current playback is temporarily interrupted, and the rapid reconnection is started after the interruption to ensure the continuity of the whole playback process, thereby realizing the purpose of solving the playback problem of the mixed data of various video formats.
In one embodiment, a video data playback processing method is provided, as shown in fig. 7, the method further includes the step of transmitting the video data:
step 702, judging whether the coding type of the video data changes; if yes, go to step 704, otherwise go to step 706;
step 704, inserting NALU frame with stream end symbol, and sending stream end frame;
Specifically, referring to fig. 13, in the present embodiment, in a data segment where the video coding format is changed, data is segmented by inserting NALU frames with stream terminators so that the decoder can respond to the data change quickly.
For a video data decoding module, when data in different video formats are encountered, if the data stream is not interrupted, decoding is continuously carried out by using decoding information replied by the SDP protocol before, so that decoding is disordered, and a playback picture is abnormal; for the decoding module, the current decoding must be stopped immediately and the decoder re-initialized with the new parameters.
For this reason, in the data plane, this embodiment re-processes NALU units of H264 or H265 video recording data. Specifically, referring to fig. 11, NALU frames with stream terminators are inserted when the data encoding type is changed. Wherein, the end of stream frame is an empty data frame, only the head information, and the data content is empty; the type is taken as a value according to the RFC standard, H264 is taken as a value 11, and H265 is taken as a value 37; when the video data decoding module receives the NALU frame of the end of the stream, the video data decoding module can quickly stop the current data decoding, wait for the new connection parameters which are quickly established subsequently, and can maintain the continuity of the picture.
In this embodiment, by processing the playback video data, inserting NALU unit containing stream terminator into the data, performing data transmission in combination with RTP, and expanding the RTP header, it is possible to quickly switch between decoding and displaying of videos of different formats, and adapt to continuous playback of coded data of mixed video types.
In one embodiment, a video data playback processing method is provided, as shown in fig. 8, the method further includes the step of recording video data playback decoding:
step 802, receiving video data;
step 804, judging whether a flow end frame is received; if yes, go to step 806, otherwise go to step 808;
step 806, destroying the current decoding parameters and waiting for new decoding parameters;
and 808, decoding and playing the received video data.
Specifically, referring to fig. 15, in this embodiment, the decoding playing module receives H264/H265 video data, determines whether a stream end frame is received, performs decoding display if the stream end frame is not received, and destroys a current decoding wait new parameter if the stream end frame is received.
In the embodiment, the analysis and the playback of the video data mixed by various video formats are realized, the continuity of the whole playback process is ensured, and the satisfaction degree of the user is improved.
It should be understood that although the various steps in the flow charts of fig. 2-15 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-15 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 16, there is provided a video data playback processing apparatus 1600, comprising:
an obtaining module 1601, configured to obtain a video data playback processing request, where the video data playback processing request includes playback time information;
an initialization module 1602, configured to send an RTSP playback request according to the playback time information, receive the returned decoding information, and initialize a decoder according to the returned decoding information;
the parsing module 1603 is configured to send an RTSP play request, receive a returned RTP data stream, and parse an extension field in the RTP data stream to obtain a parsing result of the extension field;
a determining module 1604, configured to determine whether a coding mode of the RTP data stream changes according to an analysis result of the extension field;
a request module 1605, configured to initiate a new RTSP playback request by using the time information in the parsing result of the extension field as a new playing time request if the encoding mode of the RTP data stream changes.
In one embodiment, as shown in fig. 17, there is provided a video data playback processing apparatus 1600, further comprising an acquisition storage module 1606 for: collecting video data; adding header information to the collected video data and performing local storage to obtain video data, wherein the header information comprises: coding type, frame rate, and recording time information.
In one embodiment, as shown in fig. 18, there is provided a video data playback processing apparatus 1600, further comprising a data assembling module 1607 for: acquiring a video data playback processing request; analyzing the URL in the video data playback processing request to obtain playback time information; acquiring video data corresponding to the playback time information from a local storage, and replying corresponding decoding information through an SDP protocol; and reading the video data and packaging an RTP data packet, and obtaining an RTP data stream for the video data through the RTP packet.
In one embodiment, the data assembly module 1607 is further configured to: when the change of the coding type of the video data is detected, inserting an RTP packet only containing header information in the middle of a changed data segment; adding an extension field to the header information of the RTP packet to obtain an RTP data stream; the extension field includes: c field, T field, and NTP time; wherein, the C field is used for indicating the coding type change of the video data, the T field is used for indicating the end of the video data playback request, and the NTP time represents the time point of the interruption of the video data in the format.
In one embodiment, the determining module 1604 is further configured to: judging whether a T field in the extension field is set; if so, stopping taking the stream; if not, judging whether the C field in the extension field is set; if yes, stopping decoding; if not, acquiring the NTP time in the extension field as an interrupt time point; and initiating a new RTSP playback request by taking the interruption time point as a new request playing time.
In one embodiment, as shown in fig. 19, there is provided a video data playback processing apparatus 1600, further comprising a data transmission module 1608 for: judging whether the coding type of the video data changes; if the coding type of the video data changes, inserting a NALU frame with a stream ending character, and sending a stream ending frame; and if the coding type of the video data is not changed, transmitting the RTP data stream.
In one embodiment, as shown in fig. 20, there is provided a video data playback processing apparatus 1600, further comprising a decoding play module 1609 for: receiving video data; judging whether a flow end frame is received or not; if yes, destroying the current decoding parameter and waiting for a new decoding parameter; if not, decoding and playing the received video data.
For specific limitations of the video data playback processing apparatus, reference may be made to the above limitations of the video data playback processing method, which are not described herein again.
In one embodiment, a computer device is provided, the internal structure of which may be as shown in FIG. 21. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a video data playback processing method.
Those skilled in the art will appreciate that the architecture shown in fig. 21 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the above method embodiments when executing the computer program.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the above respective method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by specifying the relevant hardware via a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. A video data playback processing method, the method comprising:
acquiring a video data playback processing request, wherein the video data playback processing request comprises playback time information;
sending an RTSP playback request according to the playback time information, receiving returned decoding information, and initializing a decoder according to the returned decoding information;
sending RTSP playing request, receiving returned RTP data stream, and analyzing the extended field in the RTP data stream to obtain the analysis result of the extended field;
judging whether the coding mode of the RTP data stream is changed or not according to the analysis result of the extension field;
if the coding mode of the RTP data stream is changed, the time information in the analysis result of the extension field is used as new playing time to initiate a new RTSP playback request;
the method also comprises the following steps of video data assembly: acquiring a video data playback processing request; analyzing the URL in the video data playback processing request to obtain playback time information; acquiring video data corresponding to the playback time information from a local storage, and replying corresponding decoding information through an SDP protocol; reading video data, and obtaining an RTP data stream from the video data through an RTP packet;
the step of obtaining an RTP data stream for the video data by an RTP packet includes: when the coding type of the video data is detected to be changed, inserting an RTP packet only containing header information into the middle of a changed data segment; adding an extension field to the header information of the RTP packet to obtain an RTP data stream; the extension field includes: c field, T field, and NTP time; wherein, the C field is used for indicating the coding type change of the video data, the T field is used for indicating the end of the video data playback request, and the NTP time represents the time point of the interruption of the video data in the format;
after the step of parsing the extension field in the RTP data stream to obtain a parsing result of the extension field, the method further includes: judging whether a T field in the extension field is set; if so, stopping taking the stream; if not, judging whether the C field in the extension field is set; if yes, stopping decoding; if not, acquiring the NTP time in the extension field as an interrupt time point; and taking the interruption time point as a new request playing time to initiate a new RTSP playback request.
2. The video data playback processing method of claim 1, further comprising the step of video data acquisition storage:
collecting video data;
adding header information to the collected video data and performing local storage to obtain video data, wherein the header information comprises: coding type, frame rate, and recording time information.
3. The video data playback processing method according to claim 1 or 2, characterized in that the method further comprises a step of transmitting the video data by:
judging whether the coding type of the video data changes;
if the coding type of the video data changes, inserting a NALU frame with a stream ending symbol, and sending a stream ending frame;
and if the coding type of the video data is not changed, transmitting an RTP data stream.
4. The video data playback processing method according to claim 3, characterized in that the method further comprises a step of recording video data playback decoding:
receiving the video data;
judging whether the stream ending frame is received or not;
if yes, destroying the current decoding parameter and waiting for a new decoding parameter;
and if not, decoding and playing the received video data.
5. A video data playback processing apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring a video data playback processing request, and the video data playback processing request comprises playback time information;
the initialization module is used for sending an RTSP playback request according to the playback time information, receiving returned decoding information and initializing a decoder according to the returned decoding information;
the analysis module is used for sending an RTSP playing request, receiving a returned RTP data stream, and analyzing an extended field in the RTP data stream to obtain an analysis result of the extended field;
the judging module is used for judging whether the coding mode of the RTP data stream changes or not according to the analysis result of the extension field;
a request module, configured to initiate a new RTSP playback request by using time information in an analysis result of the extension field as a new playing request time if an encoding mode of the RTP data stream changes;
the apparatus further comprises a data assembly module to: acquiring a video data playback processing request; analyzing the URL in the video data playback processing request to obtain playback time information; acquiring video data corresponding to the playback time information from a local storage, and replying corresponding decoding information through an SDP protocol; reading video data, and obtaining an RTP data stream by RTP (real-time transport protocol) packaging the video data;
the data assembly module is further to: when the change of the coding type of the video data is detected, inserting an RTP packet only containing header information in the middle of a changed data segment; adding an extension field to the header information of the RTP packet to obtain an RTP data stream; the extension field includes: c field, T field, and NTP time; the video data playback method comprises the following steps that C fields are used for representing the change of the coding type of video data, T fields are used for representing the end of a video data playback request, and NTP time represents the time point of interruption of the video data in the format;
the judging module is further configured to: judging whether a T field in the extension field is set; if so, stopping taking the stream; if not, judging whether the C field in the extension field is set; if yes, stopping decoding; if not, acquiring the NTP time in the extension field as an interrupt time point; and taking the interruption time point as a new request playing time to initiate a new RTSP playback request.
6. The video data playback processing apparatus according to claim 5, characterized in that the apparatus further comprises:
the acquisition and storage module is used for acquiring video data; adding header information to the collected video data and performing local storage to obtain video data, wherein the header information comprises: coding type, frame rate, and recording time information.
7. The video data playback processing apparatus according to claim 5 or 6, characterized in that the apparatus further comprises:
the data sending module is used for judging whether the coding type of the video data changes; if the coding type of the video data changes, inserting a NALU frame with a stream ending symbol, and sending a stream ending frame; and if the coding type of the video data is not changed, transmitting an RTP data stream.
8. The video data playback processing apparatus according to claim 7, characterized in that the apparatus further comprises:
a decoding playing module, configured to receive the video data; judging whether the stream ending frame is received or not; if yes, destroying the current decoding parameter and waiting for a new decoding parameter; and if not, decoding and playing the received video data.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 4 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910011469.8A CN109729318B (en) | 2019-01-07 | 2019-01-07 | Video data playback processing method, video data playback processing device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910011469.8A CN109729318B (en) | 2019-01-07 | 2019-01-07 | Video data playback processing method, video data playback processing device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109729318A CN109729318A (en) | 2019-05-07 |
CN109729318B true CN109729318B (en) | 2021-01-08 |
Family
ID=66299631
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910011469.8A Active CN109729318B (en) | 2019-01-07 | 2019-01-07 | Video data playback processing method, video data playback processing device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109729318B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112423135B (en) * | 2020-09-18 | 2023-06-30 | 苏宁云计算有限公司 | Information processing method, apparatus, computer device and storage medium for video playback |
CN112422514B (en) * | 2020-10-26 | 2024-06-07 | 深圳Tcl新技术有限公司 | Multimedia data transmission method and device, intelligent household equipment and storage medium |
CN113099149B (en) * | 2021-04-02 | 2022-08-05 | 杭州海康威视数字技术股份有限公司 | Data processing method, system and storage medium |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020163908A1 (en) * | 2001-05-07 | 2002-11-07 | Ari Lakaniemi | Apparatus, and associated method, for synchronizing operation of codecs operable pursuant to a communicaton session |
CN100544439C (en) * | 2006-11-21 | 2009-09-23 | 华为技术有限公司 | A kind of method and system of supporting the media data of multiple coded format |
CN102075769B (en) * | 2011-01-10 | 2012-11-07 | 苏州博联科技有限公司 | Method for optimizing video QoS of video wireless transmission monitoring system |
EP2718783A4 (en) * | 2011-06-08 | 2015-01-14 | Recent Memory Inc | Webcasting method and apparatus |
CN102394993A (en) * | 2011-11-02 | 2012-03-28 | 上海市共进通信技术有限公司 | Method for automatically adjusting and improving RTP (Realtime Transport Protocol) flow quality based on voice coding in VoIP (Voice over Internet Portocol) network |
CN107358160A (en) * | 2017-06-08 | 2017-11-17 | 小草数语(北京)科技有限公司 | Terminal monitoring method for processing video frequency, monitor terminal and server |
-
2019
- 2019-01-07 CN CN201910011469.8A patent/CN109729318B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN109729318A (en) | 2019-05-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10972519B2 (en) | Real-time video streaming to client video element | |
KR102387161B1 (en) | Video screen projection method and apparatus, computer equipment, and storage medium | |
US10021318B2 (en) | Method and apparatus in a motion video capturing system | |
CN109729318B (en) | Video data playback processing method, video data playback processing device, computer equipment and storage medium | |
US11412021B2 (en) | Method and device for media streaming between server and client using RTP/RTSP standard protocol | |
CN108989854B (en) | Playlist error labeling for delivery and rendering of streaming media | |
JP6743192B2 (en) | Video service quality evaluation method and apparatus | |
KR101712102B1 (en) | Method and apparatus for transmitting/receiving streaming data based on RTSP session | |
CN111770390B (en) | Data processing method, device, server and storage medium | |
CN115243074A (en) | Video stream processing method and device, storage medium and electronic equipment | |
CN109756744B (en) | Data processing method, electronic device and computer storage medium | |
KR101022078B1 (en) | Method and apparatus for facilitating streaming of video information, computer readable medium and method and apparatus for processing a file containing video information | |
CN113242437A (en) | RTSP (real time streaming protocol) video plug-in-free playing method, system, device and storage medium | |
US7984205B2 (en) | Method and devices for the transfer of a data flow from a data source to a data sink | |
CN112866745B (en) | Streaming video data processing method, device, computer equipment and storage medium | |
US20180034885A1 (en) | System for transferring real-time audio/video stream | |
CN116781973A (en) | Video encoding and decoding method and device, storage medium and electronic equipment | |
CN114051150A (en) | Live broadcast method and device, electronic equipment and computer readable storage medium | |
CN111131814A (en) | Data feedback method and device and set top box | |
CN112532719A (en) | Information flow pushing method, device, equipment and computer readable storage medium | |
CN111314378B (en) | Code stream data processing method | |
CN115695918B (en) | Multi-camera broadcast guide control method and device, readable storage medium and terminal equipment | |
CN116260996A (en) | Data transmission method, device and system | |
RU2366103C2 (en) | Storage of advanced video coding (avc) set of parametres in avc file format | |
CN116266858A (en) | Audio and video recording method, device, equipment and 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 |