CN109040765B - Video data playing method and device - Google Patents

Video data playing method and device Download PDF

Info

Publication number
CN109040765B
CN109040765B CN201810832091.3A CN201810832091A CN109040765B CN 109040765 B CN109040765 B CN 109040765B CN 201810832091 A CN201810832091 A CN 201810832091A CN 109040765 B CN109040765 B CN 109040765B
Authority
CN
China
Prior art keywords
video
type
video stream
stream
player
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
Application number
CN201810832091.3A
Other languages
Chinese (zh)
Other versions
CN109040765A (en
Inventor
李敬来
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu TD Tech Ltd
Original Assignee
Chengdu TD Tech Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chengdu TD Tech Ltd filed Critical Chengdu TD Tech Ltd
Priority to CN201810832091.3A priority Critical patent/CN109040765B/en
Publication of CN109040765A publication Critical patent/CN109040765A/en
Application granted granted Critical
Publication of CN109040765B publication Critical patent/CN109040765B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/21805Source of audio or video content, e.g. local disk arrays enabling multiple viewpoints, e.g. using a plurality of cameras
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2407Monitoring of transmitted content, e.g. distribution time, number of downloads
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists

Abstract

The application discloses a method and a device for playing video data, wherein the method comprises the following steps: determining a video encoding type U of a video stream when a server first receives the video stream from a video capture devicetype‑first(ii) a Triggering a player to play the video stream by using a decoder corresponding to the video coding type; after the first time, the server receives a video stream from the video acquisition device each time according to the currently received video stream and the Utype‑firstAnd determining whether to trigger the player to play the currently received video stream. By adopting the method and the device, the problem of abnormal playing caused by mis-configuration of the coding parameters of the video acquisition equipment can be solved.

Description

Video data playing method and device
Technical Field
The present invention relates to computer application technologies, and in particular, to a method and an apparatus for playing video data.
Background
At present, video acquisition equipment (such as a camera) and the like are more and more widely applied in life, particularly in the field of security protection. Fig. 1 shows a data transmission model of a camera commonly used at present. As shown in fig. 1, the camera is connected to the server, the server obtains the SDK media stream from the camera through the SDK interface provided by the camera, and then forwards the SDK media stream to the player, and the player plays the corresponding image by decoding the SDK media stream.
With the development of the technology, the H265 coding technology is applied to many new cameras, that is, many cameras support two video coding modes, one is H264 video coding, and the other is H265 video coding, and the cameras can only start one video coding mode at the same time.
The current camera usually provides a way for logging in the camera through a webpage, and after a user logs in successfully, the user can modify the parameters of the camera on a webpage interface, such as modifying an IP address, but if the user modifies the encoding parameter configuration of the camera carelessly, for example, the encoding mode is switched from an H264 encoding mode to an H265 encoding mode, the camera sends H265 data to a playing end, and under such a condition, the playing end often cannot decode normally due to the change of the encoding mode, so that the problem of black screen or system crash occurs.
For the above problem of abnormal playing, no corresponding solution is proposed at present.
Disclosure of Invention
In view of the above, the main objective of the present invention is to provide a method and an apparatus for playing video data, which can solve the problem of abnormal playing caused by mis-configuration of encoding parameters of a video capture device.
In order to achieve the purpose, the technical scheme provided by the invention is as follows:
a method for playing video data, comprising:
when a server receives a video stream from video acquisition equipment for the first time, determining a video coding type Utype-first of the video stream; triggering a player to play the video stream by using a decoder corresponding to the video coding type;
after the first time, the server receives a video stream from the video acquisition device each time according to the currently received video stream and the Utype-firstAnd determining whether to trigger the player to play the currently received video stream.
Preferably, the video stream is encapsulated by a PS protocol.
Preferably, the determining the video coding type U of the video streamtype-firstThe method comprises the following steps:
acquiring a parameter stream _ type from a PS system map header of the video stream, and determining the coding type indicated by the parameter stream _ type as the video coding type Utype-first
Preferably, the determining whether to trigger the player to play the currently received video stream includes:
the server analyzes the current received video stream and acquires the coding type U corresponding to the video stream from the PS system map headertype-again
The server judges the Utype-againAnd said Utype-firstIf yes, triggering the player to play the video stream, otherwise, discarding the currently received video stream, andand informing the player to stop playing the video stream of the video acquisition equipment.
Preferably, the video acquisition device is a camera.
A playback apparatus of video data, comprising:
a first receiving processing unit for determining a video encoding type U of a video stream when a server receives the video stream from a video capture device for the first timetype-first(ii) a Triggering a player to play the video stream by using a decoder corresponding to the video coding type;
a control unit for, after the first time, every time the server receives a video stream from the video capture device, receiving the video stream according to the currently received video stream and the Utype-firstAnd determining whether to trigger the player to play the currently received video stream.
And the video stream is encapsulated by adopting a PS protocol.
Preferably, the first-time reception processing unit is configured to obtain a parameter stream _ type from a PS system map header of the video stream, and determine an encoding type indicated by the parameter stream _ type as the video encoding type Utype-first
Preferably, the control unit is configured to parse a currently received video stream, and obtain an encoding type U corresponding to the video stream from a PS system map headertype-again(ii) a Judging the Utype-againAnd said Utype-firstAnd if so, triggering the player to play the video stream, otherwise, discarding the currently received video stream, and informing the player to stop playing the video stream of the video acquisition device.
Preferably, the video acquisition device is a camera.
In summary, according to the method and apparatus for playing video data provided by the present invention, after receiving a video stream from a video capture device, a server needs to further determine a coding type used by the video stream, and then controls a player to play the video stream by monitoring whether the coding type of the video stream sent by the same video capture device changes, so that the problem of abnormal playing caused by mis-configuration of coding parameters of the video capture device can be effectively avoided.
Drawings
Fig. 1 is a schematic diagram of a data transmission model of a conventional camera;
FIG. 2 is a schematic flow chart of a method of an embodiment of the present invention;
FIG. 3 is a schematic diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
The core idea of the invention is as follows: aiming at a video stream acquired from a Software Development Kit (SDK) interface, a server needs to detect whether the video coding type of the video stream changes, and controls whether the video stream is sent to a player according to the detection result so as to avoid the problem of abnormal playing of the player.
Fig. 2 is a schematic flow chart of a method according to an embodiment of the present invention, and as shown in fig. 1, the method for playing video data implemented by the embodiment mainly includes:
step 201, when a server receives a video stream from a video acquisition device for the first time, determining a video coding type Utype-first of the video stream; and triggering a player to play the video stream by using a decoder corresponding to the video coding type.
The difference between this step and the existing scheme is that for each video acquisition device connected to the server, when the server receives a video stream from the video acquisition device for the first time, the video stream needs to be analyzed to obtain the video coding type carried by the video acquisition device, so that whether the coding parameter mis-configuration condition of the video acquisition device occurs or not is monitored based on the video coding type, and then the playing of the player is controlled to avoid the abnormal playing problem caused by the mis-configuration condition.
Specifically, the video capture device may be a camera, but is not limited thereto, and may also be other types of video capture devices such as a video camera.
Considering that most of the video data of the camera is encapsulated by the PS protocol at present, the video stream may be preferably a video stream encapsulated by the PS protocol.
For the packaging format of the PS video stream, the video coding type U of the video stream can be determined by the following methodtype-first
Acquiring a parameter stream _ type from a PS system map header of the video stream, and determining the coding type indicated by the parameter stream _ type as the video coding type Utype-first
Here, PS is an encapsulation format, and is an encapsulation format of a standard packet specified in GB 28181.
For video data I-frames, the encapsulation format:
PSheader|PS system header|PS system Map|PES header|raw data
for non-video I-frames, the encapsulation format:
PS header|PES header|raw dat
in the above packing format, an important parameter in the PS system map header is stream _ type, which represents the coding type of the packed data format:
stream _ type of 0x1b represents H264
Stream-type of 0x24 represents H265
Therefore, stream _ type can be acquired by parsing the PS system map header. And then whether the error configuration condition of the coding parameters of the video acquisition equipment occurs can be known by detecting whether the stream _ type carried by the received data stream changes in the subsequent process.
Step 202, after the first time, when the server receives a video stream from the video capture device each time, according to the currently received video stream and the Utype-firstAnd determining whether to trigger the player to play the currently received video stream.
In this step, when the server receives the video stream from the video capture device again, the server needs to analyze and obtain the video coding type therein first, so that the baseIn the currently acquired video coding type and the video coding type U of the video stream received from the video acquisition device for the first timetype-firstWhether the video coding type of the video stream of the corresponding video acquisition equipment is changed or not can be judged, and then the problem of abnormal playing caused by the mis-configuration of the coding parameters of the video acquisition equipment can be avoided by controlling the player to play the video stream.
Preferably, the determining whether to trigger the player to play the currently received video stream includes:
the server analyzes the current received video stream and acquires the coding type U corresponding to the video stream from the PS system map headertype-again
The server judges the Utype-againAnd said Utype-firstAnd if so, triggering the player to play the video stream, otherwise, discarding the currently received video stream, and informing the player to stop playing the video stream of the video acquisition device.
In the above method, when said U istype-againAnd said Utype-firstWhen the video stream is different from the video stream, it is indicated that the video encoding type of the video stream of the corresponding video acquisition device changes, which means that a situation of mis-configuration of the encoding parameter of the video acquisition device can occur, at this time, the server needs to discard the currently received video stream, and does not send the video stream to the player, and notifies the player to stop playing the video stream of the video acquisition device, so as to remind the user of the possible mis-configuration of the encoding parameter of the video acquisition device.
When the U is intype-againAnd said Utype-firstIf the video stream is the same as the video stream of the corresponding video acquisition device, it indicates that the video encoding type of the video stream of the corresponding video acquisition device has not changed, and at this time, the normal video stream playing is executed, that is, the player is triggered to play the currently received video stream.
Fig. 3 is a schematic structural diagram of a playing apparatus for video data corresponding to the above method, as shown in fig. 3, the apparatus includes:
first-time reception processing unit forDetermining a video encoding type U of a video stream when a server first receives the video stream from a video capture devicetype-first(ii) a Triggering a player to play the video stream by using a decoder corresponding to the video coding type;
a control unit for, after the first time, every time the server receives a video stream from the video capture device, receiving the video stream according to the currently received video stream and the Utype-firstAnd determining whether to trigger the player to play the currently received video stream.
Preferably, the video stream is encapsulated by a PS protocol.
Preferably, the first-time reception processing unit is configured to obtain a parameter stream _ type from a PS system map header of the video stream, and determine an encoding type indicated by the parameter stream _ type as the video encoding type Utype-first
Preferably, the control unit is configured to parse a currently received video stream, and obtain an encoding type U corresponding to the video stream from a PS system map headertype-again(ii) a Judging the Utype-againAnd said Utype-firstAnd if so, triggering the player to play the video stream, otherwise, discarding the currently received video stream, and informing the player to stop playing the video stream of the video acquisition device.
Preferably, the video acquisition device is a camera.
In summary, the above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (6)

1. A method for playing video data, comprising:
determining a video encoding type U of a video stream when a server first receives the video stream from a video capture devicetype-first(ii) a Trigger player utilization with the video encodingPlaying the video stream by a decoder corresponding to the code type; the video stream is encapsulated by adopting a PS protocol;
after the first time, the server receives a video stream from the video acquisition device each time according to the currently received video stream and the Utype-firstDetermining whether to trigger the player to play the currently received video stream;
the determining whether to trigger the player to play the currently received video stream comprises:
the server analyzes the current received video stream and acquires the coding type U corresponding to the video stream from the PS system map headertype-again
The server judges the Utype-againAnd said Utype-firstAnd if so, triggering the player to play the video stream, otherwise, discarding the currently received video stream, and informing the player to stop playing the video stream of the video acquisition device.
2. The method of claim 1, wherein the determining the video encoding type U of the video streamtype-firstThe method comprises the following steps:
acquiring a parameter stream _ type from a PS system map header of the video stream, and determining the coding type indicated by the parameter stream _ type as the video coding type Utype-first
3. The method of claim 1, wherein the video capture device is a camera.
4. A playback apparatus for video data, comprising:
a first receiving processing unit for determining a video encoding type U of a video stream when a server receives the video stream from a video capture device for the first timetype-first(ii) a Triggering a player to play the video stream by using a decoder corresponding to the video coding type; the video stream is encapsulated by adopting a PS protocol;
a control unit for, after the first time, every time the server receives a video stream from the video capture device, receiving the video stream according to the currently received video stream and the Utype-firstDetermining whether to trigger the player to play the currently received video stream, including: analyzing the current received video stream, and acquiring the coding type U corresponding to the video stream from the PS system map headertype-again(ii) a Judging the Utype-againAnd said Utype-firstAnd if so, triggering the player to play the video stream, otherwise, discarding the currently received video stream, and informing the player to stop playing the video stream of the video acquisition device.
5. The apparatus of claim 4, wherein the first receiving processing unit is configured to obtain a parameter stream _ type from a PS system map header of the video stream, and determine a coding type indicated by the parameter stream _ type as the video coding type Utype-first
6. The apparatus of claim 4, wherein the video capture device is a camera.
CN201810832091.3A 2018-07-25 2018-07-25 Video data playing method and device Active CN109040765B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810832091.3A CN109040765B (en) 2018-07-25 2018-07-25 Video data playing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810832091.3A CN109040765B (en) 2018-07-25 2018-07-25 Video data playing method and device

Publications (2)

Publication Number Publication Date
CN109040765A CN109040765A (en) 2018-12-18
CN109040765B true CN109040765B (en) 2021-03-23

Family

ID=64645528

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810832091.3A Active CN109040765B (en) 2018-07-25 2018-07-25 Video data playing method and device

Country Status (1)

Country Link
CN (1) CN109040765B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621342A (en) * 2008-06-30 2010-01-06 中兴通讯股份有限公司 Method for realizing network TV program carousel based on real-time transport protocol
CN101778295A (en) * 2009-12-25 2010-07-14 中兴通讯股份有限公司 Video monitor system and method for forward correcting thereof
CN102523416A (en) * 2011-11-21 2012-06-27 苏州希图视鼎微电子有限公司 Seamless playing method for multiple segments of media streams

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8582646B2 (en) * 2011-01-14 2013-11-12 Sony Corporation Methods for delta-QP signaling for decoder parallelization in HEVC
US9432694B2 (en) * 2012-03-06 2016-08-30 Apple Inc. Signal shaping techniques for video data that is susceptible to banding artifacts

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621342A (en) * 2008-06-30 2010-01-06 中兴通讯股份有限公司 Method for realizing network TV program carousel based on real-time transport protocol
CN101778295A (en) * 2009-12-25 2010-07-14 中兴通讯股份有限公司 Video monitor system and method for forward correcting thereof
CN102523416A (en) * 2011-11-21 2012-06-27 苏州希图视鼎微电子有限公司 Seamless playing method for multiple segments of media streams

Also Published As

Publication number Publication date
CN109040765A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
CN111135569B (en) Cloud game processing method and device, storage medium and electronic equipment
CN110519177B (en) Network traffic identification method and related equipment
KR102188222B1 (en) Video service quality evaluation method and device
EP2868107B1 (en) System and method for encoding video content using virtual intra-frames
KR100651486B1 (en) Apparatus and Method for transporting MPEG contents through Internet Protocol Network
CN108989854B (en) Playlist error labeling for delivery and rendering of streaming media
WO2016027174A1 (en) Device switching for a streaming service
CN105915842B (en) A kind of password amending method, device and video monitoring system
CN104703053A (en) Packet loss processing method, device and system of video transmission process
WO2019196158A1 (en) Transcoding task processing method and system, and task management server
US20190312922A1 (en) Method for processing transcoding task, system and task management server
CN109040765B (en) Video data playing method and device
US10841621B2 (en) Fault recovery of video bitstream in remote sessions
KR20140070896A (en) Method for video streaming and an electronic device thereof
US11792432B2 (en) Techniques for signaling and identifying access unit boundaries
CN111314654B (en) Implementation method of high-definition playing technology based on android vehicle-mounted monitoring
CN108989767B (en) Network self-adaptive multi-channel H264 video stream storage and retransmission method and system
US9276985B2 (en) Transmission apparatus and transmission method
CN110602507A (en) Frame loss processing method, device and system
CN111131814A (en) Data feedback method and device and set top box
US20160217822A1 (en) Video management system and method for event recording using the same
KR101331079B1 (en) Method and Device for Active Controling Buffer Control And Method and Device for Changing Decoder
CN116546269A (en) Network traffic cleaning method, system and equipment for media stream frame insertion
KR101700370B1 (en) Method and apparatus for correcting interarrival jitter
KR100623017B1 (en) Mobile Terminal Client and Method of Sensing and Recovery of Abnormality of Decorder

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