CN109218839A - Video broadcasting method and device - Google Patents
Video broadcasting method and device Download PDFInfo
- Publication number
- CN109218839A CN109218839A CN201710552518.XA CN201710552518A CN109218839A CN 109218839 A CN109218839 A CN 109218839A CN 201710552518 A CN201710552518 A CN 201710552518A CN 109218839 A CN109218839 A CN 109218839A
- Authority
- CN
- China
- Prior art keywords
- video
- data packet
- video data
- request
- browser
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/478—Supplemental services, e.g. displaying phone caller identification, shopping application
- H04N21/4782—Web browsing, e.g. WebTV
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/238—Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
- H04N21/2387—Stream processing in response to a playback request from an end-user, e.g. for trick-play
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/472—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/858—Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
Abstract
The invention discloses a kind of video broadcasting method and devices, are applied to video capture device, belong to field of video monitoring.This method comprises: receiving the video playing request that browser is sent, video identifier is carried in video playing request;The video data packet of corresponding video is obtained based on the video identifier, which includes multiple video data packets, and multiple video data packets are to divide to obtain according to preset strategy;When often getting a video data packet, which is sent to browser by websocket interface, the video data packet is decoded and is rendered by default decoder by the browser, to play the video.The video data packet that the present invention can be will acquire by websocket interface is sent to browser, browser is set to carry out video playing, it realizes in the case where browser disables plug-in unit, video capture device sends the operation of video data packet to browser, to improve the scope of application of video capture device.
Description
Technical field
The present invention relates to field of video monitoring, in particular to a kind of video broadcasting method and device.
Background technique
With the development of technology, the function of browser is more next enriches, and then the application range of video is played by browser
It is increasingly wider.For example, in the field of security video surveillance the collected prison in video capture device end can be played by browser
Video is controlled, or the monitor video in some collected period of video capture device is played by browser.
Currently, browser can pass through the page when browser needs to play video capture device institute collected video
Scripting language javascript sends video playing request to video capture device;It is broadcast when video capture device receives the video
When putting request, plug-in download notice can be sent to browser;Browser can notify to set from video acquisition according to plug-in download
The plug-in units such as standby middle downloading NPAPI or ActiveX, and send downloading to video capture device after the download is complete and complete to lead to
Know, so that collected video data can be sent to browser by plug-in unit by video capture device, and then is led to by browser
The plug-in units reading video data such as NPAPI or ActiveX is crossed, data is carried out later and decodes and renders, by the video data
It plays out.
However, with browser development and secure context the considerations of, major browsers disable such as NPAPI or
The plug-in units such as ActiveX, that is to say, forbid browser download plug-in, but browser carry out video playing operation be based on it is slotting
Part is completed, when disabling plug-in unit, it will causes video capture device that video data can not be sent to browser, browser is by nothing
Method plays out video, to reduce the scope of application of video capture device and browser.
Summary of the invention
In order to enable video capture device that video data packet is sent to browsing in the case where browser disables plug-in unit
Device carries out video playing, and to increase the scope of application of video capture device and browser, the embodiment of the invention provides a kind of views
Frequency playback method and device.The technical solution is as follows:
On the one hand, a kind of video broadcasting method is provided, video capture device is applied to, which comprises
The video playing request that browser is sent is received, carries video identifier in the video playing request;
The video data packet of corresponding video is obtained based on the video identifier, the video includes multiple video data packets,
And the multiple video data packet is to divide to obtain according to preset strategy;
When often getting a video data packet, the video data packet is passed through into websocket (webpage socket)
Interface is sent to the browser, is decoded by default decoder to the video data packet by the browser and wash with watercolours
Dye, to play the video.
Optionally, starting and end time is also carried in the video playing request;
The video data packet that corresponding video is obtained based on the video identifier, comprising:
Determine the corresponding video of the video identifier;
The corresponding video of the video identifier is traversed, to obtain the view of the video since the time started
Frequency data packet, until reaching the end time.
Optionally, it is described the video data packet is sent to the browser by websocket interface after, also wrap
It includes:
It detects whether to receive the request of the control to the video every specified time interval;
When detecting control request, it is based on the control request type, the transmission of video data packet is controlled
System.
Optionally, described to be based on the control request type, the transmission of video data packet is controlled, comprising:
When control request is requested for pause, stop the video data packet for sending the video;
When control request is puts request or slow play request fastly, based in F.F. request or slow play request
The accelerated factor of carrying, control send the time interval of video data packet, to reduce or increase the time for sending video data packet
Interval.
Optionally, described based on the accelerated factor carried in F.F. request or slow play request, control sends view
The time interval of frequency data packet, to reduce or increase the time interval for sending video data packet, comprising:
Based on the accelerated factor carried in F.F. request or slow play request, is controlled by following formula and send view
The time interval of frequency data packet, to reduce or increase the time interval for sending video data packet:
Wherein, the TAFor the time interval for sending video data packet, the T1With the T2It is in the video adjacent two
The corresponding sending time point of a video data packet, the rate are the accelerated factor.
Optionally, the default decoder is page script language decoders.
On the other hand, a kind of video play device is provided, video capture device is applied to, described device includes:
Receiving module carries video in the video playing request for receiving the video playing request of browser transmission
Mark;
Module is obtained, for obtaining the video data packet of corresponding video based on the video identifier, the video includes more
A video data packet, and the multiple video data packet is to divide to obtain according to preset strategy;
Sending module, for when often getting a video data packet, the video data packet to be passed through websocket
Interface is sent to the browser, is decoded by default decoder to the video data packet by the browser and wash with watercolours
Dye, to play the video.
Optionally, starting and end time is also carried in the video playing request;
The acquisition module is also used to:
Determine the corresponding video of the video identifier;
The corresponding video of the video identifier is traversed, to obtain the view of the video since the time started
Frequency data packet, until reaching the end time.
Optionally, described device further include:
Detection module receives the request of the control to the video for detecting whether every specified time interval;
Control module, for the control request type being based on, to video data packet when detecting control request
Transmission controlled.
Optionally, the control module is also used to:
When control request is requested for pause, stop the video data packet for sending the video;
When control request is puts request or slow play request fastly, based in F.F. request or slow play request
The accelerated factor of carrying, control send the time interval of video data packet, to reduce or increase the time for sending video data packet
Interval.
Optionally, the control module is also used to:
Based on the accelerated factor carried in F.F. request or slow play request, is controlled by following formula and send view
The time interval of frequency data packet, to reduce or increase the time interval for sending video data packet:
Wherein, the TAFor the time interval for sending video data packet, the T1With the T2It is in the video adjacent two
The corresponding sending time point of a video data packet, the rate are the accelerated factor.
Optionally, the default decoder is page script language decoders.
Technical solution provided in an embodiment of the present invention has the benefit that in embodiments of the present invention, can obtain
When getting video data packet, which is sent to by browser by websocket interface, so that browser is regarded
Frequency plays, without browser from video capture device download plug-in, without video capture device by plug-in unit to clear
Device of looking at sends video data packet, realizes in the case where browser disables plug-in unit, and browser, which plays, comes from video capture device
Video operation, to improve the scope of application of video capture device and browser.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for
For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other
Attached drawing.
Figure 1A is a kind of audio/video player system configuration diagram provided in an embodiment of the present invention;
Figure 1B is a kind of structural schematic diagram of websocket service module provided in an embodiment of the present invention;
Fig. 2 is a kind of video broadcasting method flow chart provided in an embodiment of the present invention;
Fig. 3 is a kind of method flow diagram that control video data packet is sent provided in an embodiment of the present invention;
Fig. 4 A is a kind of block diagram of video play device provided in an embodiment of the present invention;
Fig. 4 B is the block diagram of another video play device provided in an embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of video capture device provided in an embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention
Formula is described in further detail.
Before carrying out detailed explanation to the embodiment of the present invention, first to the name being related in the embodiment of the present invention
Word, application scenarios and system architecture are explained respectively.
Firstly, the noun being related in the embodiment of the present invention is introduced.
javascript
Javascript abbreviation js is a kind of based on object and event-driven, and the literal translation formula foot with relative safety
This language.Simultaneously it is also the scripting language that one kind is widely used in client Web (webpage) exploitation, is commonly used to HTML
(HyperTextMarkup Language, hypertext markup language) webpage adds dynamic function, for example, response user's is various
Operation.
websocket
Websocket is a kind of for realizing efficient bi-directional communication mechanism, Neng Goushi between server and client side
Present one connects freely bidirectional transmit-receive message, is the new features of HTML5.
SSL (SecureSocketsLayer, Secure Socket Layer)
SSL is that network communication provides a kind of security protocol of safety and data integrity, transport layer to be connected to the network into
Row encryption, so as to ensure the safety of data transmission, it is ensured that data will not be intercepted and be stolen in the transmission process on network
It listens.
Secondly, to the present embodiments relate to application scenarios be introduced.
Currently, browser is in order to play the video from video capture device, it usually needs under in video capture device
Carry corresponding plug-in unit, still, with browser development and secure context the considerations of, major browsers forbid downloading insert
Part causes video capture device that can not send video data to browser by plug-in unit, can not play view so as to cause browser
The frequency acquisition collected video of equipment, reduces the scope of application of video capture device and browser.Therefore, the embodiment of the present invention
A kind of video broadcasting method is provided, this method can make video capture device that will collect in the case where not needing plug-in unit
Video be sent to browser and play out, to improve the scope of application of video capture device and browser, while also mentioning
The high efficiency of video playing.
It should be noted that video broadcasting method provided by the embodiment of the present invention can be applied to plurality of application scenes
In, for example, in the field of security video surveillance such as public security, traffic.It wherein, is usually to pass through prison in security video monitoring field
The acquisition that camera carries out video is controlled, it, can be by browser when user needs the collected video of checking monitoring camera
Video playing request is sent to monitoring camera;It, can be by storage when monitoring camera receives video playing request
The video data packet of video is sent to browser by websocket interface, and browser, can when receiving the video data packet
The video data packet is decoded and be rendered, to play the video, make user to the collected video of monitoring camera
It is watched.
It should be noted that being only illustrated by taking above-mentioned application scenarios as an example in embodiments of the present invention, not to this hair
Bright embodiment, which is constituted, to be limited.
Finally, to the present embodiments relate to system architecture be introduced.
Figure 1A is a kind of audio/video player system configuration diagram provided in an embodiment of the present invention, referring to Figure 1A, the system packet
Browser 1 and video capture device 2 are included, browser 1 can be communicated with video capture device 2 by network.Wherein, this is clear
Device of looking at can be the browser installed in any appliance in the equipment such as mobile terminal, tablet computer, for ease of description,
It is illustrated for browser 1 is installed in terminal 1 in the attached drawing 1A of the embodiment of the present invention.The browser 1 can be adopted to video
Collect equipment 2 and sends video playing request, it, can be by video counts when the video capture device 2 receives video playing request
It is sent to browser 1 according to packet, to make browser 1 be decoded and render the video data packet, to play the video.
In addition, in the case where browser disables plug-in unit, in order to enable video capture device to send video data packet
It can integrate websocket service module in the video capture device to browser to carry out video playing.It, should referring to Figure 1B
Websocket service module uses hierarchical design, wherein the bottom of the websocket service module includes open source library
Libwebsocket, SSL, socket (socket) and pthread (POSIXthread, POSIX thread), to realize
The parsing and encapsulation of websocket protocol data;It include software platform function tool set inside websocket service module
(function tool), websocket session management of application layer etc.;The upper layer of websocket service module can externally mention
API (Application Programming Interface, application programming interface) is read and write for a set of websocket, depending on
Frequency acquisition equipment can carry out data exchange with other equipment by read-write API;It further include simultaneously privately owned SDK
(SoftwareDevelopmentKit, Software Development Kit) agreement can be asked by the privately owned SDK agreement to what is received
It asks and is handled.
It should be noted that in embodiments of the present invention, video capture device 2 can be monitoring camera or processing
Other higher video capture devices of ability.
In embodiments of the present invention, when video capture device collects video, collected video can be deposited
Storage, while the video of storage is divided into multiple video data packets according to preset strategy, following pairs of video capture devices are according to pre-
If the operation that collected video is divided into multiple video data packets is illustrated by strategy.
It should be noted that the preset strategy can be arranged in advance, for example, the preset strategy can be the view sent every time
The size of frequency data packet be designated bit, for example, the size of the video data packet sent every time be 50bit (bit), 60bit,
100bit etc..Alternatively, preset strategy may be to divide video into a specified several video data packets, which can be with
100,200 etc..
Wherein, seen from the above description, video capture device can be in the video playing request for receiving browser transmission
When, to browser send video data packet, therefore, video capture device can receive video playing request before, according to
Collected video is divided into multiple video data packets by preset strategy, can also be when receiving video playing request, by pre-
If collected video is divided into multiple video data packets by strategy.But when video capture device is receiving video playing
Before request, when collected video being divided into multiple video data packets according to preset strategy, due in advance by the video
It is divided into multiple video data packets, it is subsequent when video capture device is when obtaining video data packet, corresponding view can be directly acquired
The video data packet of frequency without carrying out the operation of video data packet division, and then improves the effect for obtaining video data packet
Rate.Therefore, it is generally the case that the video capture device can be before receiving video playing request, will according to preset strategy
Collected video is divided into multiple video data packets.
In addition, when video capture device is before receiving video playing request, according to preset strategy by collected view
When frequency is divided into multiple video data packets, if the size that preset strategy is the video data packet sent every time is designated bit,
Then the video can be divided into multiple video data packets according to preset strategy during acquiring video by video capture device,
It that is to say, which can divide a video data packet when often collecting the video of designated bit, alternatively,
When often collecting a video frame, which is divided according to preset strategy, for example, when preset strategy is to send every time
Video data packet size be 100bit, and the size of the collected video frame of the video capture device be 1000bit when, will
The video frame is divided into 10 100bit size video data packets.Certainly, in practical applications, which can be with
When video acquisition is completed, the video is divided into multiple video data packets according to preset strategy.For example, when preset strategy is every
The size of the video data packet of secondary transmission is 100bit, and the size of the collected video of the video capture device is 10000bit
When, which is divided into 100 100bit size video data packets by video capture device.And when preset strategy is by video
When being divided into specified several video data packet, which needs after the completion of video acquisition, according to preset strategy
The video is divided.
It should be noted that may include the video data packet institute for each video data packet, in the video data packet
The information such as indicate at the beginning of the video playing duration of video, the video.For example, the video data packet instruction time started is
It may include video playing duration 10s (second) and beginning when the video of 20 points of 10 seconds 08 minute 10s durations, in the video data packet
20 points of time 08 minute and 10 seconds.
In embodiments of the present invention, since collected video is divided into according to preset strategy by video capture device in advance
Multiple video data packets can directly acquire the view of corresponding video when video capture device is when needing to obtain video data packet
Frequency data packet, without carrying out the operation of video data packet division, to improve the efficiency for obtaining video data packet.
Seen from the above description, when user needs to play the video in video capture device by browser, Ke Yixiang
Video capture device sends video playing request, to obtain the video in video capture device, to carry out video playing.Below
In conjunction with attached drawing 2, the operation for playing the video in video capture device to browser is illustrated, specifically comprises the following steps.
Step 201: video capture device receives the video playing request that browser is sent, and carries in video playing request
Video identifier.
It may include multiple and different classes in a video capture device since the type of video capture device is varied
The video of type.For example, when video capture device is spherical camera, since spherical camera can change the angle of acquisition video
Therefore degree when carrying out video acquisition by spherical camera, may obtain the video of multiple and different angles, and for convenience
The subsequent video for distinguishing each shooting angle, it is generally the case that can divide respectively for the video of multiple and different shooting angle shooting
With a video identifier.Therefore, it when user needs to watch the shooting video of some angle, is needed to quickly and accurately obtain
The video to be played, the browser send video playing request in can carry video identifier.
It should be noted that the video identifier be used for the unique identification video, the video identifier can for video title,
Number etc..Certainly, in practical applications, video identifier can be not only carried in video playing request, can also carried open
Begin time, end time etc..
Step 202: video capture device obtains the video data packet of corresponding video based on the video identifier.
Seen from the above description, which can be before receiving video playing request, according to default plan
Collected video is slightly divided into multiple video data packets, therefore, which can be directly based upon the video mark
Know the video data packet for directly acquiring corresponding video.
In addition, time started and end can also be carried due to can not only carry video identifier in video playing request
Time, therefore, when carrying starting and end time in video playing request, which can determine view
Frequency marking knows corresponding video;The corresponding video of video identifier is traversed, to start between from the outset to obtain the video of video
Data packet, until reaching the end time.
When wherein, as that can include the video playing of video indicated by the video data packet in each video data packet
The information such as at the beginning of the long, video, therefore, when video capture device traverses the corresponding video of video identifier,
When identical as at the beginning of carrying in video playing request at the beginning of detecting the video for including in video data packet,
Video data packet is obtained since including the video data packet of the time started, when detecting the video indicated in video data packet
At the beginning of it is identical as end time for carrying in video playing request when, stop obtaining video data packet.
In addition, the time started can also be carried in video playing request, without carrying the end time.When the video playing
The time started is carried in request when not carrying the end time, the video capture device can from the outset between start to obtain video
Video data packet, until all video data packet acquisitions after the time started in the video are finished, alternatively, being regarded obtaining
When receiving end playing request during frequency data packet, stop obtaining video data packet.
It is worth noting that due to being integrated with websocket service module in video capture device, the websocket
Service module includes privately owned SDK agreement, can be handled the request received by privately owned SDK agreement, therefore, the present invention
In embodiment, video capture device can execute the operation of step 202 by privately owned SDK agreement.
Step 203: when video capture device often gets a video data packet, which being passed through
Websocket interface is sent to browser.
It can be seen from the above, websocket service module externally provides read-write API (websocket interface), by this
The data interaction between video capture device and other equipment may be implemented in API, therefore, when video capture device often gets one
When a video data packet, which can be sent to by browser by websocket interface.
It should be noted that the websocket interface can be embodied by websocket function, for example, websocket_
Write_data function may be other websocket functions in practical applications certainly.Therefore, work as video capture device
When sending video data packet by websocket interface, video counts are as sent by websocket_write_data function
According to packet.
Step 204, when browser receives the video data, video data packet is decoded by default decoder
And rendering, to play the video.
It should be noted that the default decoder can be page script language decoders (JS decoder).Certainly exist
It may be the relevant decoder of other JS in practical application.
In addition, the video data packet is decoded and is rendered by browser, phase can be referred to play the operation of the video
Pass technology, the embodiment of the present invention no longer carry out one to this and repeat.
In embodiments of the present invention, video capture device can be connect when getting video data packet by websocket
Browser is sent to mouthful by the video data packet, so that browser carries out video playing, without browser from video acquisition
Download plug-in in equipment sends video data packet to browser by plug-in unit without video capture device, realizes and browsing
In the case that device disables plug-in unit, browser plays the operation of the video from video capture device, to improve video acquisition
The scope of application of equipment and browser.Simultaneously as browser, which is not necessarily to the download plug-in from video capture device, to be played
Video into video capture device, to improve the efficiency that browser plays video.
In embodiments of the present invention, due to user by browser play video during, it is likely that can because
Some reasons need to suspend video, perhaps put video or slow play video fastly, and user can trigger phase by specified operation at this time
The control instruction answered, browser can send to video capture device according to the control instruction and control when receiving control instruction
System request, video capture device can control the transmission of video data packet according to control request.Below in conjunction with attached drawing 3,
The operation for controlling transmission video data packet to video capture device is illustrated, and is specifically comprised the following steps.
Step 301: detecting whether to receive the request of the control to the video every specified time interval.
It should be noted that control request is browser when receiving control instruction of the user by specified operation triggering
It sends, which can be clicking operation, slide, voice operating etc..
Step 302: the transmission when detecting control request, based on the type of control request, to video data packet
It is controlled.
Specifically, when control request is requested for pause, stop the video data packet for sending the video;When the control is asked
When asking to put request or slow play request fastly, based on the accelerated factor carried in the F.F. request or slow play request, control sends view
The time interval of frequency data packet, to reduce or increase the time interval for sending video data packet.
Wherein, since the playing duration of video (duration of video indicated by video data packet) is equal to video capture device
Send the time interval and practical the sum of the duration for sending video data packet of two adjacent video data packets, therefore, Ke Yitong
The speed for changing the time interval for sending two adjacent video data packets to adjust video playing is crossed, therefore, when the control is asked
Ask when being requested to put request or slow play fastly, video capture device can based on the acceleration carried in F.F. request or slow play request because
Son controls the time interval for sending video data packet by following formula, to reduce or increase the time for sending video data packet
Interval:
Wherein, in above-mentioned formula (1), TAFor the time interval for sending video data packet, T1And T2It is adjacent in the video
The corresponding sending time point of two video data packets, rate are the accelerated factor.
It should be noted that in embodiments of the present invention, when the sum of time interval and sending time are greater than the broadcasting of video
When duration, video capture device sends slowing for video data packet, and browser when time interval and sends slow play video
When the sum of time is less than the playing duration of video, the speed that video capture device sends video data packet becomes faster, and browser will be fast
Put video.
It is worth noting that 45 indicate the clock frequency of 45KHz in above-mentioned formula (1), certainly in practical applications,
It can be the clock frequency of other frequencies, for example, 50KHz, 60KHz etc..
Furthermore after video capture device stops sending the video data packet of the video, if continuing to restore to broadcast
Request is put, then the video capture device can continue to send video data to browser since the video data packet that pause is sent
Packet.
It is worth noting that due to being integrated with websocket service module in video capture device, the websocket
Service module includes privately owned SDK agreement, can be handled the request received by privately owned SDK agreement, therefore, the present invention
In embodiment, video capture device can execute the operation of step 302 by privately owned SDK agreement.
In embodiments of the present invention, video capture device by privately owned SDK agreement the control received can be requested into
Row processing improves the flexibility of video playing to realize the flexible control to video playing.
Fig. 4 A is a kind of block diagram of video play device provided in an embodiment of the present invention, referring to fig. 4 A, video playing dress
Setting being implemented in combination with by software, hardware or both.The device includes: receiving module 401, obtains module 402 and send
Module 403.
Receiving module 401 carries view in the video playing request for receiving the video playing request of browser transmission
Frequency marking is known;
Module 402 is obtained, for obtaining the video data packet of corresponding video based on the video identifier, the video includes
Multiple video data packets, and the multiple video data packet is to divide to obtain according to preset strategy;
Sending module 403, for when often getting a video data packet, the video data packet to be passed through
Websocket interface is sent to the browser, is carried out by default decoder to the video data packet by the browser
It decodes and renders, to play the video.
Optionally, starting and end time is also carried in video playing request;
Module 401 is obtained to be also used to:
Determine the corresponding video of the video identifier;
The corresponding video of the video identifier is traversed, to obtain the view of the video since the time started
Frequency data packet, until reaching the end time.
Optionally, B referring to fig. 4, described device further include:
Detection module 404 receives the request of the control to the video for detecting whether every specified time interval;
Control module 405, for the control request type being based on, to video counts when detecting control request
It is controlled according to the transmission of packet.
Optionally, the control module 405 is also used to:
When control request is requested for pause, stop the video data packet for sending the video;
When control request is puts request or slow play request fastly, based in F.F. request or slow play request
The accelerated factor of carrying, control send the time interval of video data packet, to reduce or increase the time for sending video data packet
Interval.
Optionally, the control module 405 is also used to:
Based on the accelerated factor carried in F.F. request or slow play request, is controlled by following formula and send view
The time interval of frequency data packet, to reduce or increase the time interval for sending video data packet:
Wherein, the TAFor the time interval for sending video data packet, the T1With the T2It is in the video adjacent two
The corresponding sending time point of a video data packet, the rate are the accelerated factor.
Optionally, the default decoder is page script language decoders.
In conclusion in embodiments of the present invention, video capture device can pass through when getting video data packet
The video data packet is sent to browser by websocket interface, so that browser carries out video playing, without browser
The download plug-in from video capture device sends video data packet to browser by plug-in unit without video capture device, real
Show in the case where browser disables plug-in unit, browser plays the operation of the video from video capture device, to improve
The scope of application of video capture device and browser.Simultaneously as browser is not necessarily to the download plug-in from video capture device
The video that can be played in video capture device, to improve the efficiency that browser plays video.
It should be understood that video playing provided by the above embodiment is when carrying out video playing, only with above-mentioned each function
The division progress of module can according to need and for example, in practical application by above-mentioned function distribution by different function moulds
Block is completed, i.e., the internal structure of device is divided into different functional modules, to complete all or part of function described above
Energy.In addition, video play device provided by the above embodiment and video broadcasting method embodiment belong to same design, it is specific real
Existing process is detailed in embodiment of the method, and which is not described herein again.
Fig. 5 is a kind of block diagram of video capture device 500 shown according to an exemplary embodiment.For example, video acquisition
Equipment 500 can be monitoring camera head etc..
Referring to Fig. 5, video capture device 500 may include following one or more components: processing component 502, memory
504, power supply module 506, multimedia component 508, audio component 510, the interface 512 of input/output (I/O), sensor module
514 and communication component 516.
Processing component 502 usually control video capture device 500 integrated operation, such as with display, data communication, camera
Operation and record operate associated operation.Processing component 502 may include one or more processors 520 to execute instruction,
To perform all or part of the steps of the methods described above.In addition, processing component 502 may include one or more modules, it is convenient for
Interaction between processing component 502 and other assemblies.For example, processing component 502 may include multi-media module, to facilitate more matchmakers
Interaction between body component 508 and processing component 502.
Memory 504 is configured as storing various types of data to support the operation in video capture device 500.These
The example of data includes the instruction of any application or method for operating on video capture device 500, message, figure
Piece, video etc..Memory 504 can be real by any kind of volatibility or non-volatile memory device or their combination
Existing, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable is only
It reads memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic
Disk or CD.
Power supply module 506 provides power supply for the various assemblies of video capture device 500.Power supply module 506 may include electricity
Management system, one or more power supplys and other are associated with power supply is generated, managed, and distributed for video capture device 500
Component.
Multimedia component 508 includes one output interface of offer between the video capture device 500 and user
Screen.In some embodiments, screen may include liquid crystal display (LCD) and touch panel (TP).If screen includes touching
Panel is touched, screen may be implemented as touch screen, to receive input signal from the user.Touch panel includes one or more
Touch sensor is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or
The boundary of sliding action, but also detect duration and pressure associated with the touch or slide operation.In some implementations
In example, multimedia component 508 includes a front camera and/or rear camera.When video capture device 500 is in operation
Mode, such as in a shooting mode or a video mode, front camera and/or rear camera can receive external multimedia number
According to.Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom
Ability.
Audio component 510 is configured as output and/or input audio signal.For example, audio component 510 includes a Mike
Wind (MIC), when video capture device 500 is in operation mode, when such as logging mode, microphone is configured as receiving external audio
Signal.The received audio signal can be further stored in memory 504 or send via communication component 516.Some
In embodiment, audio component 510 further includes a loudspeaker, is used for output audio signal.
I/O interface 512 provides interface between processing component 502 and peripheral interface module, and above-mentioned peripheral interface module can
To be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and lock
Determine button.
Sensor module 514 includes one or more sensors, for providing various aspects for video capture device 500
Status assessment.For example, sensor module 514 can detecte the state that opens/closes of video capture device 500, the phase of component
To positioning, such as the component is the display and keypad of video capture device 500, and sensor module 514 can also detect
The position change of 500 1 components of video capture device 500 or video capture device, user contact with video capture device 500
Existence or non-existence, the temperature change in 500 orientation of video capture device or acceleration/deceleration and video capture device 500.Sensing
Device assembly 514 may include proximity sensor, be configured to detect depositing for neighbouring object without any physical contact
?.Sensor module 514 can also include optical sensor, such as CMOS or ccd image sensor, for making in imaging applications
With.In some embodiments, which can also include acceleration transducer, gyro sensor, magnetic sensing
Device, pressure sensor or temperature sensor.
Communication component 516 is configured to facilitate wired or wireless way between video capture device 500 and other equipment
Communication.Video capture device 500 can access the wireless network based on communication standard, such as WiFi, 2G or 3G or their group
It closes.In one exemplary embodiment, communication component 516 receives the broadcast from external broadcasting management system via broadcast channel
Signal or broadcast related information.In one exemplary embodiment, the communication component 516 further includes near-field communication (NFC) mould
Block, to promote short range communication.For example, radio frequency identification (RFID) technology, Infrared Data Association (IrDA) skill can be based in NFC module
Art, ultra wide band (UWB) technology, bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, video capture device 500 can be by one or more application specific integrated circuit
(ASIC), digital signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), scene can
Program gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for execute above-mentioned Fig. 2 or
The method that embodiment illustrated in fig. 3 provides.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided
It such as include the memory 504 of instruction, above-metioned instruction can be executed by the processor 520 of video capture device 500 to complete above-mentioned side
Method.For example, the non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, magnetic
Band, floppy disk and optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by video capture device
When processor executes, so that video capture device enough executes above-mentioned Fig. 2 or method shown in Fig. 3.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware
It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and
Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.
Claims (12)
1. a kind of video broadcasting method is applied to video capture device, which is characterized in that the described method includes:
The video playing request that browser is sent is received, carries video identifier in the video playing request;
Obtain the video data packet of corresponding video based on the video identifier, the video includes multiple video data packets, and institute
Stating multiple video data packets is to divide to obtain according to preset strategy;
When often getting a video data packet, the video data packet is sent out by webpage socket websocket interface
It send to the browser, the video data packet is decoded and is rendered by default decoder by the browser, to broadcast
Put the video.
2. the method as described in claim 1, which is characterized in that also carry time started and end in the video playing request
Time;
The video data packet that corresponding video is obtained based on the video identifier, comprising:
Determine the corresponding video of the video identifier;
The corresponding video of the video identifier is traversed, to obtain the video counts of the video since the time started
According to packet, until reaching the end time.
3. the method as described in claim 1, which is characterized in that described that the video data packet is passed through webpage socket
Websocket interface is sent to after the browser, further includes:
It detects whether to receive the request of the control to the video every specified time interval;
When detecting control request, based on the type of the control request, the transmission of video data packet is controlled.
4. method as claimed in claim 3, which is characterized in that the type based on the control request, to video data
The transmission of packet is controlled, comprising:
When control request is requested for pause, stop the video data packet for sending the video;
When control request is fastly to put request or when slow play is requested, based on being carried in F.F. request or slow play request
Accelerated factor, control send video data packet time interval, with reduce or increase send video data packet time interval.
5. method as claimed in claim 4, which is characterized in that described to be based on taking in F.F. request or slow play request
The accelerated factor of band, control send the time interval of video data packet, between the time to reduce or increase transmission video data packet
Every, comprising:
Based on the accelerated factor carried in F.F. request or slow play request, is controlled by following formula and send video counts
According to the time interval of packet, to reduce or increase the time interval for sending video data packet:
Wherein, the TAFor the time interval for sending video data packet, the T1With the T2For two neighboring view in the video
The corresponding sending time point of frequency data packet, the rate are the accelerated factor.
6. method a method as claimed in any one of claims 1 to 5, which is characterized in that the default decoder is page script language decoder
Device.
7. a kind of video play device, it is applied in video capture device, which is characterized in that described device includes:
Receiving module carries video identifier in the video playing request for receiving the video playing request of browser transmission;
Module is obtained, for obtaining the video data packet of corresponding video based on the video identifier, the video includes multiple views
Frequency data packet, and the multiple video data packet is to divide to obtain according to preset strategy;
Sending module, for when often getting a video data packet, the video data packet to be passed through webpage socket
Websocket interface is sent to the browser, is carried out by default decoder to the video data packet by the browser
It decodes and renders, to play the video.
8. device as claimed in claim 7, which is characterized in that also carry time started and end in the video playing request
Time;
The acquisition module is also used to:
Determine the corresponding video of the video identifier;
The corresponding video of the video identifier is traversed, to obtain the video counts of the video since the time started
According to packet, until reaching the end time.
9. device as claimed in claim 7, which is characterized in that described device further include:
Detection module receives the request of the control to the video for detecting whether every specified time interval;
Control module, for when detect the control request when, based on it is described control request type, to video data packet
Transmission is controlled.
10. device as claimed in claim 9, which is characterized in that the control module is also used to:
When control request is requested for pause, stop the video data packet for sending the video;
When control request is fastly to put request or when slow play is requested, based on being carried in F.F. request or slow play request
Accelerated factor, control send video data packet time interval, with reduce or increase send video data packet time interval.
11. device as claimed in claim 10, which is characterized in that the control module is also used to:
Based on the accelerated factor carried in F.F. request or slow play request, is controlled by following formula and send video counts
According to the time interval of packet, to reduce or increase the time interval for sending video data packet:
Wherein, the TAFor the time interval for sending video data packet, the T1With the T2For two neighboring view in the video
The corresponding sending time point of frequency data packet, the rate are the accelerated factor.
12. the device as described in claim 7-10 is any, which is characterized in that the default decoder is page script language solution
Code device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710552518.XA CN109218839B (en) | 2017-07-07 | 2017-07-07 | Video playing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710552518.XA CN109218839B (en) | 2017-07-07 | 2017-07-07 | Video playing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109218839A true CN109218839A (en) | 2019-01-15 |
CN109218839B CN109218839B (en) | 2021-09-03 |
Family
ID=64991402
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710552518.XA Active CN109218839B (en) | 2017-07-07 | 2017-07-07 | Video playing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109218839B (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109819315A (en) * | 2019-03-21 | 2019-05-28 | 广州华多网络科技有限公司 | Playback method, device, terminal and the storage medium of HEVC video |
CN110121112A (en) * | 2019-05-14 | 2019-08-13 | 重庆商勤科技有限公司 | A kind of video playing control method based on browser, system and device |
CN110460618A (en) * | 2019-08-26 | 2019-11-15 | 南京国电南自轨道交通工程有限公司 | Safe communication means in a kind of comprehensive monitoring system based on EN50159 standard |
CN110708609A (en) * | 2019-08-05 | 2020-01-17 | 青岛海信传媒网络技术有限公司 | Video playing method and device |
CN111428080A (en) * | 2019-04-25 | 2020-07-17 | 杭州海康威视数字技术股份有限公司 | Storage method, search method and device for video files |
CN112437076A (en) * | 2020-11-18 | 2021-03-02 | 广州供电局有限公司 | Power grid video live broadcast platform and power grid video live broadcast method |
CN113810767A (en) * | 2021-09-13 | 2021-12-17 | 南京国电南自电网自动化有限公司 | Websocket-based video real-time monitoring method and system |
CN117041500A (en) * | 2023-10-08 | 2023-11-10 | 四川省公路规划勘察设计研究院有限公司 | Video access method applied to field highway engineering |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104080014A (en) * | 2013-03-28 | 2014-10-01 | 浙江大华技术股份有限公司 | Real-time video processing method and device |
CN104243520A (en) * | 2013-06-18 | 2014-12-24 | 华为终端有限公司 | Remote monitoring method, device and system |
US20150095956A1 (en) * | 2013-09-30 | 2015-04-02 | Kabushiki Kaisha Toshiba | Electronic device, computer program product, and information control method |
CN105915394A (en) * | 2016-06-20 | 2016-08-31 | 河南派亚尼尔自动化设备有限公司 | Visual monitoring platform based on HTML5 and application method |
CN106060674A (en) * | 2016-06-27 | 2016-10-26 | 武汉斗鱼网络科技有限公司 | System and method for achieving intelligent video live broadcast on front end |
CN106162062A (en) * | 2015-04-10 | 2016-11-23 | 深圳市视高电子技术有限公司 | Obtain the method and system of monitor video |
CN106506525A (en) * | 2016-11-29 | 2017-03-15 | 北京旷视科技有限公司 | For playing the method and device of video flowing on a web browser |
CN106506632A (en) * | 2016-10-27 | 2017-03-15 | 上海幻电信息科技有限公司 | A kind of audio frequency and video live broadcasting method based on HTML5 browsers |
CN106899872A (en) * | 2017-03-10 | 2017-06-27 | 深圳市合互联技术有限责任公司 | A kind of information displaying method of real-time interactive |
-
2017
- 2017-07-07 CN CN201710552518.XA patent/CN109218839B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104080014A (en) * | 2013-03-28 | 2014-10-01 | 浙江大华技术股份有限公司 | Real-time video processing method and device |
CN104243520A (en) * | 2013-06-18 | 2014-12-24 | 华为终端有限公司 | Remote monitoring method, device and system |
US20150095956A1 (en) * | 2013-09-30 | 2015-04-02 | Kabushiki Kaisha Toshiba | Electronic device, computer program product, and information control method |
CN106162062A (en) * | 2015-04-10 | 2016-11-23 | 深圳市视高电子技术有限公司 | Obtain the method and system of monitor video |
CN105915394A (en) * | 2016-06-20 | 2016-08-31 | 河南派亚尼尔自动化设备有限公司 | Visual monitoring platform based on HTML5 and application method |
CN106060674A (en) * | 2016-06-27 | 2016-10-26 | 武汉斗鱼网络科技有限公司 | System and method for achieving intelligent video live broadcast on front end |
CN106506632A (en) * | 2016-10-27 | 2017-03-15 | 上海幻电信息科技有限公司 | A kind of audio frequency and video live broadcasting method based on HTML5 browsers |
CN106506525A (en) * | 2016-11-29 | 2017-03-15 | 北京旷视科技有限公司 | For playing the method and device of video flowing on a web browser |
CN106899872A (en) * | 2017-03-10 | 2017-06-27 | 深圳市合互联技术有限责任公司 | A kind of information displaying method of real-time interactive |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109819315A (en) * | 2019-03-21 | 2019-05-28 | 广州华多网络科技有限公司 | Playback method, device, terminal and the storage medium of HEVC video |
CN111428080A (en) * | 2019-04-25 | 2020-07-17 | 杭州海康威视数字技术股份有限公司 | Storage method, search method and device for video files |
CN110121112A (en) * | 2019-05-14 | 2019-08-13 | 重庆商勤科技有限公司 | A kind of video playing control method based on browser, system and device |
CN110708609A (en) * | 2019-08-05 | 2020-01-17 | 青岛海信传媒网络技术有限公司 | Video playing method and device |
CN110460618A (en) * | 2019-08-26 | 2019-11-15 | 南京国电南自轨道交通工程有限公司 | Safe communication means in a kind of comprehensive monitoring system based on EN50159 standard |
CN110460618B (en) * | 2019-08-26 | 2022-06-07 | 南京国电南自轨道交通工程有限公司 | Safe communication method in integrated monitoring system based on EN50159 standard |
CN112437076A (en) * | 2020-11-18 | 2021-03-02 | 广州供电局有限公司 | Power grid video live broadcast platform and power grid video live broadcast method |
CN113810767A (en) * | 2021-09-13 | 2021-12-17 | 南京国电南自电网自动化有限公司 | Websocket-based video real-time monitoring method and system |
CN113810767B (en) * | 2021-09-13 | 2024-02-13 | 南京国电南自电网自动化有限公司 | Video real-time monitoring method and system based on websocket |
CN117041500A (en) * | 2023-10-08 | 2023-11-10 | 四川省公路规划勘察设计研究院有限公司 | Video access method applied to field highway engineering |
CN117041500B (en) * | 2023-10-08 | 2024-01-02 | 四川省公路规划勘察设计研究院有限公司 | Video access method applied to field highway engineering |
Also Published As
Publication number | Publication date |
---|---|
CN109218839B (en) | 2021-09-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109218839A (en) | Video broadcasting method and device | |
RU2617683C2 (en) | Method and device for processing terminal anomaly and electronic device | |
CN106231259B (en) | Display methods, video player and the server of monitored picture | |
JP6143966B2 (en) | Imaging control method, apparatus, program, and recording medium | |
CN104932816B (en) | Mobile terminal and its control method | |
CN105163366B (en) | Wireless network connecting method and device | |
JP6626440B2 (en) | Method and apparatus for playing multimedia files | |
CN105208110B (en) | Resource control method and device | |
CN104050266B (en) | User behavior recording method, device and web browser | |
CN109905743A (en) | Media device is controlled using mobile device | |
CN108153647B (en) | Log processing method and device, terminal equipment and storage medium | |
CN108123945B (en) | Distribution method, system and the intelligent terminal of random data | |
CN106162369A (en) | A kind of realize in virtual scene interactive method, Apparatus and system | |
CN107333162B (en) | Method and device for playing live video | |
JP6149163B2 (en) | WI-FI network connection method, apparatus, program, and recording medium | |
CN106095999A (en) | Obtain the method and device of content of pages | |
CN109521935A (en) | It is a kind of to record screen, the reproducing method based on record screen, terminal | |
CN104618218A (en) | Information reminding method and device | |
CN106231433B (en) | A kind of methods, devices and systems playing network video | |
CN104616241A (en) | Video screen-shot method and device | |
CN105872952A (en) | Information sending method and device based on wearable equipment | |
CN104159140A (en) | Video processing method, apparatus and system | |
CN106993265A (en) | Communication means, terminal, wearable device based on wearable device | |
CN108804244A (en) | Data transmission method for uplink, device and storage medium | |
CN105183493A (en) | Display method and device of network information |
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 |