CN111432167B - Video preview method and device and electronic equipment - Google Patents

Video preview method and device and electronic equipment Download PDF

Info

Publication number
CN111432167B
CN111432167B CN201910681922.6A CN201910681922A CN111432167B CN 111432167 B CN111432167 B CN 111432167B CN 201910681922 A CN201910681922 A CN 201910681922A CN 111432167 B CN111432167 B CN 111432167B
Authority
CN
China
Prior art keywords
window
preset
video
target
determining
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
CN201910681922.6A
Other languages
Chinese (zh)
Other versions
CN111432167A (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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201910681922.6A priority Critical patent/CN111432167B/en
Publication of CN111432167A publication Critical patent/CN111432167A/en
Application granted granted Critical
Publication of CN111432167B publication Critical patent/CN111432167B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • H04N7/181Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast for receiving images from a plurality of remote sources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides a video preview method, a video preview device and electronic equipment. The method is applied to the client and comprises the following steps: obtaining the movement displacement between the current position and the initial position of a preset calibration object corresponding to a viewport region of a client; the viewport region is used for displaying a part of windows in a preset window list; determining each target window in a preset window list, which has an overlapping area with a viewport area, based on the movement displacement, and determining a video channel number corresponding to each target window based on the movement displacement; and previewing video data transmitted by the video channel corresponding to the video channel number corresponding to the target window in each target window. Compared with the prior art, the method and the device can reduce the memory consumed by the client during visual preview.

Description

Video preview method and device and electronic equipment
Technical Field
The invention relates to the technical field of client display, in particular to a video preview method, a video preview device and electronic equipment.
Background
With the continuous development of security technologies, video monitoring systems are widely applied to many occasions, such as public transportation hubs like stations and airports, and key departments of enterprises like storehouses and research and development laboratories, with the characteristics of intuition, convenience and rich information content.
Meanwhile, the performance of video acquisition equipment in the video monitoring system is rapidly developed. At present, a plurality of video channels can exist in one video acquisition device at the same time, and because a video channel is an abstract medium for video transmission and corresponds to one video picture, a plurality of paths of video data can be generated by one video acquisition device and visualized preview is carried out on the plurality of paths of video data through a client.
In the related art, a method for a client to visually preview multi-channel video data generated by video acquisition equipment comprises the following steps: a window list is arranged in a page of the client, the number of windows included in the window list is the same as the number of video channels of the video acquisition equipment, and each window is used for displaying a video picture corresponding to one path of video data; and then, the client acquires the video data generated by each video channel from the video acquisition equipment, decodes the video data to obtain a video picture, and displays the video picture through a corresponding window.
Obviously, in the related art, the client needs to acquire and load video data generated by all video channels in the video acquisition device at one time, thereby occupying more memory.
Disclosure of Invention
The embodiment of the invention aims to provide a video previewing method, a video previewing device and electronic equipment, so that memory consumed by a client for visually previewing multi-channel video data generated by video acquisition equipment is reduced. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a video preview method, which is applied to a client, and the method includes:
obtaining the movement displacement between the current position and the initial position of a preset calibration object corresponding to the client visual port area; the viewport region is used for displaying a part of windows in a preset window list;
determining each target window in the preset window list, which has an overlapping area with the viewport area, based on the movement displacement, and determining a video channel number corresponding to each target window based on the movement displacement;
and previewing video data transmitted by the video channel corresponding to the video channel number corresponding to the target window in each target window.
Optionally, in a specific implementation manner, the step of determining, based on the movement displacement, each target window in the preset window list, which has an overlapping area with the viewport area, includes:
determining position information of the reference window in a predetermined coordinate system based on the moving displacement; wherein the reference window is: starting target windows in all target windows in the preset window list, wherein the target windows and the viewport region have overlapping regions;
and determining each target window which has an overlapped area with the viewport area and is except for the reference window in the preset window list area based on the window size and the position information.
Optionally, in a specific implementation manner, the step of determining, based on the moving displacement, position information of the reference window in a predetermined coordinate system includes:
determining the position information of the reference window in a preset coordinate system based on the ratio of the moving displacement to the total displacement of the preset calibration object and the total number of preset video channels;
wherein the total displacement is: and the movement displacement between the starting position and the ending position of the preset calibration object.
Optionally, in a specific implementation, a scroll bar exists in the viewport region; a preset calibration object corresponding to the viewport region is a slider on the scroll bar; the movement displacement is: a scrolling step of the slider between a current position and a starting position on the scrollbar;
the step of determining the position information of the reference window in the predetermined coordinate system based on the ratio between the moving displacement and the total displacement of the preset calibration object and the total number of the preset video channels includes:
calculating the position information of the reference window in a preset coordinate system by using a preset position information calculation formula; wherein, the position information calculation formula is as follows:
S0=-((t/T)*(M*H2)%H2)
wherein S0 is the position information of the reference window in the predetermined coordinate system, T is the scrolling step, T is the total step between the starting position and the ending position of the slider on the scroll bar, M is the total number of video channels, H2 is the window size,% indicates that when (T/T) × (M × H2) cannot be divided by H2, the remainder is taken, T is N times of M, each window in the preset window list corresponds to the steps of N, and N is greater than or equal to 1.
Optionally, in a specific implementation manner, the step of determining, based on the window size and the position information, each target window, which has an overlapping region with the viewport region and is other than the reference window, in the preset window list region includes:
determining each candidate window arranged behind the reference window in the preset window list according to the ranking of each window in the preset window list;
for each candidate window, calculating a distance value between the candidate window and the reference window according to the ranking difference between the candidate window and the reference window and the window size, and calculating position information of the candidate window in the preset coordinate system based on the calculated distance value;
and for each candidate window, determining the candidate window as a target window when the position information of the candidate window in the predetermined coordinate system indicates that an overlapping area exists between the candidate window and the viewport area.
Optionally, in a specific implementation manner, the step of determining, based on the movement displacement, a video channel number corresponding to each target window includes:
determining a video channel number corresponding to the reference window based on the moving displacement; wherein the reference window is: starting target windows in all target windows in the preset window list, wherein the target windows and the viewport region have overlapping regions;
and aiming at each window except the reference window in each target window, determining the video channel number corresponding to the window based on the video channel number corresponding to the reference window and the sequence of the window in each target window.
Optionally, in a specific implementation, a scroll bar exists in the viewport region; a preset calibration object corresponding to the viewport region is a slider on the scroll bar; the movement displacement is: a scrolling step of the slider between a current position and a starting position on the scrollbar;
the step of determining the video channel number corresponding to the reference window based on the moving displacement includes:
calculating a video channel number corresponding to the reference window by using a preset channel calculation formula; wherein the channel calculation formula is:
C0=(t/T)*(M*H2)/H2+1
wherein C0 is the video channel number corresponding to the reference window, T is the scrolling step, T is the total step between the starting position and the ending position of the slider on the scroll bar, M is the total number of video channels, H2 is the window size,/indicates that when (T/T) × (M × H2) cannot be divided by H2, an integer part of a quotient is taken, T is N times of M, each window in the preset window list corresponds to the steps of N, and N is greater than or equal to 1.
Optionally, in a specific implementation manner, the step of determining the video channel number corresponding to the window based on the video channel number corresponding to the reference window and the sequence of the window in each target window includes:
calculating the video channel number corresponding to the window by using a preset number calculation formula; wherein, the number calculation formula is:
Ci=C0+(i-1)
wherein Ci is a video channel number corresponding to the ith window in each target window, C0 is a video channel number corresponding to the reference window, and i > 1.
In a second aspect, an embodiment of the present invention provides a video preview apparatus, which is applied to a client, where the apparatus includes:
a displacement obtaining module, configured to obtain a movement displacement between a current position and an initial position of a preset calibration object corresponding to the viewport region of the client; the viewport region is used for displaying a part of windows in a preset window list;
an information determining module, configured to determine, based on the movement displacement, each target window in the preset window list, where an overlapping region exists with the viewport region, and determine, based on the movement displacement, a video channel number corresponding to each target window;
and the video browsing module is used for previewing video data transmitted by the video channel corresponding to the video channel number corresponding to the target window in each target window.
Optionally, in a specific implementation manner, the information determining module includes:
the position information determining submodule is used for determining the position information of the reference window in a preset coordinate system based on the moving displacement; wherein the reference window is: starting target windows in all target windows in the preset window list, wherein the target windows and the viewport region have overlapping regions;
and the target window determining submodule is used for determining each target window which has an overlapping area with the viewport area and is except for the reference window in the preset window list area based on the window size and the position information.
Optionally, in a specific implementation manner, the location information determining submodule includes a location information determining unit;
the position information determining unit is used for determining the position information of the reference window in a preset coordinate system based on the ratio of the moving displacement to the total displacement of the preset calibration object and the total number of preset video channels; wherein the total displacement is: and the movement displacement between the starting position and the ending position of the preset calibration object.
Optionally, in a specific implementation, a scroll bar exists in the viewport region; a preset calibration object corresponding to the viewport region is a slider on the scroll bar; the movement displacement is: a scrolling step of the slider between a current position and a starting position on the scrollbar;
the position information determining unit is specifically used for calculating the position information of the reference window in a preset coordinate system by using a preset position information calculation formula; wherein, the position information calculation formula is as follows:
S0=-((t/T)*(M*H2)%H2)
wherein S0 is the position information of the reference window in the predetermined coordinate system, T is the scrolling step, T is the total step between the starting position and the ending position of the slider on the scroll bar, M is the total number of video channels, H2 is the window size,% indicates that when (T/T) × (M × H2) cannot be divided by H2, the remainder is taken, T is N times of M, each window in the preset window list corresponds to the steps of N, and N is greater than or equal to 1.
Optionally, in a specific implementation manner, the target window determining submodule is specifically configured to:
determining each candidate window arranged behind the reference window in the preset window list according to the ranking of each window in the preset window list; for each candidate window, calculating a distance value between the candidate window and the reference window according to the ranking difference between the candidate window and the reference window and the window size, and calculating position information of the candidate window in the preset coordinate system based on the calculated distance value; and for each candidate window, determining the candidate window as a target window when the position information of the candidate window in the predetermined coordinate system indicates that an overlapping area exists between the candidate window and the viewport area.
Optionally, in a specific implementation manner, the information determining module includes:
the first number determining submodule is used for determining the video channel number corresponding to the reference window based on the moving displacement; wherein the reference window is: starting target windows in all target windows in the preset window list, wherein the target windows and the viewport region have overlapping regions;
and the second number determining submodule is used for determining the video channel number corresponding to each window except the reference window in each target window based on the video channel number corresponding to the reference window and the sequence of the window in each target window.
Optionally, in a specific implementation, a scroll bar exists in the viewport region; a preset calibration object corresponding to the viewport region is a slider on the scroll bar; the movement displacement is: a scrolling step of the slider between a current position and a starting position on the scrollbar;
the first number determining submodule is specifically used for calculating a video channel number corresponding to the reference window by using a preset channel calculation formula; wherein the channel calculation formula is:
C0=(t/T)*(M*H2)/H2+1
wherein C0 is the video channel number corresponding to the reference window, T is the scrolling step, T is the total step between the starting position and the ending position of the slider on the scroll bar, M is the total number of video channels, H2 is the window size,/indicates that when (T/T) × (M × H2) cannot be divided by H2, an integer part of a quotient is taken, T is N times of M, each window in the preset window list corresponds to the steps of N, and N is greater than or equal to 1.
Optionally, in a specific implementation manner, the second number determining submodule is specifically configured to calculate, by using a preset number calculation formula, a video channel number corresponding to the window; wherein, the number calculation formula is:
Ci=C0+(i-1)
wherein Ci is a video channel number corresponding to the ith window in each target window, C0 is a video channel number corresponding to the reference window, and i > 1.
In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device is equipped with a client, and includes a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface are used, and the memory completes mutual communication through the communication bus;
a memory for storing a computer program;
a processor, configured to implement the steps of any of the video preview methods provided by the first aspect when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of any one of the video preview methods provided in the first aspect.
As can be seen from the above, by applying the scheme provided in the embodiment of the present invention, according to the movement displacement between the current position and the starting position of the preset calibration object corresponding to the viewport region, each target window in the preset window list, which has an overlapping region with the viewport region, and the video channel number corresponding to each target window can be determined, that is, according to the movement displacement, each target window which can be displayed by the viewport region and the video channel corresponding to each target window can be determined. Furthermore, the video data transmitted by the video channel corresponding to each target window can be previewed in each target window, so that the visual preview of the video data transmitted by the video channel is realized.
Therefore, when the embodiment of the invention is applied, when video data transmitted by each video channel is visually previewed, the video channel corresponding to each target window displayed in the viewport region is variable according to the movement of the preset calibration object corresponding to the viewport region, so that the video data transmitted by each video channel can be visually previewed by moving the preset calibration object. Furthermore, because the number of windows included in the viewport region is limited, when the video data transmitted through the corresponding video channel is visually previewed through each target window each time, the client only needs to acquire and load the video data transmitted through the video channel corresponding to each target window, and does not need to acquire the video data transmitted through all the video channels at one time, so that the memory consumed by the client in visually previewing the multiple paths of video data generated by the video acquisition device can be reduced.
Furthermore, the preset calibration object is moved to perform visual preview on the video data transmitted by each video channel, and when the preset calibration object is moved each time, the video pictures displayed in each target window are asynchronously refreshed, so that the video picture switching is free of time delay and jamming, and the user experience is improved. In addition, since each target window included in the viewport region is adjusted by moving the preset calibration object, and the video channel corresponding to each target window is adjusted according to the movement displacement of the preset calibration object, visual preview of video data transmitted by a large number of video channels can be realized through a small number of target windows displayed in the preset window list.
Of course, it is not necessary for any product or method of practicing the invention to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a viewport region of a client page according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a video preview method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a specific implementation manner of determining, in step S202 in fig. 2, each target window in the preset window list, which has an overlapping region with the viewport region, based on the movement displacement;
FIG. 4 is a flowchart illustrating an embodiment of step S302 in FIG. 3;
fig. 5 is a schematic flow chart of a specific implementation manner of determining video channel numbers corresponding to each target window based on the movement displacement in step S202 in fig. 2;
fig. 6 is a schematic structural diagram of a video previewing apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the related art, when a client performs visual preview on multiple paths of video data generated by video acquisition equipment, the client needs to acquire and load the video data generated by all video channels in the video acquisition equipment at one time, so that more memories are occupied. In order to solve the above technical problem, an embodiment of the present invention provides a video preview method.
The preview means: the client acquires video data from a certain video channel of the video acquisition equipment and decodes the acquired video data, so that a video picture corresponding to the video channel is played and displayed at a specified window position in the client.
First, a video preview method provided in an embodiment of the present invention is described below.
Fig. 2 is a flowchart illustrating a video preview method according to an embodiment of the present invention. The method can be applied to any client needing video preview, and the client can be a client with new functions obtained after a plug-in for video preview is added in other clients, or a client specially used for video preview, which is reasonable. In addition, the client can be installed in any electronic device that needs to perform video preview, such as a mobile phone, a notebook computer, a desktop computer, and the like, which is also reasonable. For simplicity and convenience of description, in the embodiment of the present invention, the following is referred to as a client.
Further, the electronic device at which the client resides may be communicatively connected to a video capture device having multiple video channels, for example, the electronic device may be communicatively connected to a monitoring device having multiple video channels. Therefore, the client can acquire the video data generated by one or more video channels in the video acquisition equipment and decode the video data to obtain a video picture, so that the video data generated by one or more video channels can be visually previewed through a preset window.
In addition, a preset window list including a plurality of windows may be set in the client, and each window in the preset window list is used for previewing video data transmitted by one video channel. The area formed by all windows in the preset window list may be referred to as a scene area.
Accordingly, a viewport region may be set in the client page, where the viewport region refers to a region in which a video picture displayed in at least one window included in the region is visible to a user. Specifically, a partial number of windows in the preset window list may be displayed in the viewport region, and each window is arranged in a column or a row. And each window in the view area can display a video picture corresponding to the video data transmitted by the video channel corresponding to the window, so that a user can see the video picture displayed by each window in the view area. Obviously, each window displayed in the viewport region is each target window in the preset window list, which has an overlapping region with the viewport region.
In addition, the viewport region corresponds to a preset calibration object, and when the preset calibration object moves, each window displayed in the viewport region can move in a direction opposite to or the same as the moving direction of the preset calibration object, so that each window in the preset window list can be circularly displayed in the viewport region. In this way, when the preset calibration object is moved, the user can see the video pictures displayed by different windows in the preset window list in the viewport region, where the video pictures displayed by each window are: and the video image corresponding to the video data transmitted by the video channel corresponding to the window.
For example, when a scroll bar can exist in the viewport region, a preset calibration object corresponding to the viewport region is a slider on the scroll bar; further, when the slider is scrolled, each window displayed in the viewing area moves in a direction opposite to the sliding direction of the slider.
When the preset calibration object is moved in a direction from the start position to the end position, the window that moves out of the viewport region first may be referred to as a reference window in the viewport region. Obviously, the reference window is the starting window in each window in the preset window list, which has an overlapping area with the viewport area.
For example, as shown in fig. 1, assuming that a window list set by the client includes 5 window lists, a viewport region in a client page may display 3 windows. Then 101 in fig. 1 represents the scene area of the client and 102 represents the viewport area in the client page. In addition, when the direction in which the starting position of the preset calibration object corresponding to the viewport region 102 points to the ending position is from top to bottom, the window 2 in fig. 1 is a reference window in the viewport region 102.
Further, the number of windows that can be displayed in the viewport region is determined based on the region size of the viewport region and the size of each window in the preset window list. Specifically, the method comprises the following steps: the number of windows that can be displayed in the viewport region is determined based on the length of the side of the viewport region parallel to the line of displacement of the preset calibration object and the length of the side of each window parallel to the line of displacement of the preset calibration object.
For example, when a scroll bar may exist in the viewport region, the preset calibration object corresponding to the viewport region is a slider on the scroll bar, and further, the number of windows that can be displayed by the viewport region is determined based on the length of the side of the viewport region parallel to the scroll bar and the length of the side of each window parallel to the scroll bar.
Further, when the windows displayed in the viewport region are arranged in a column, the number of windows that can be displayed in the viewport region is determined based on the height of the viewport region and the height of each window.
Specifically, assuming that the height of the viewport region is h1, the height of each window is h2, and the maximum number of windows that can be displayed in the viewport region is represented by h, the windows displayed in the viewport region may be incompletely displayed windows, so that h is h1/h2+ 1. Wherein, when h1 can not be divided by h2, the integer part of the calculation result of h1/h2 is taken.
For example, if h1 is 400px (pixel), h2 is 150px, and h 400/150+1 is 3.
When the windows displayed in the viewport region are arranged in a row, the number of windows that can be displayed by the viewport region is determined based on the width of the viewport region and the width of each window.
Specifically, assuming that the width of the viewport region is w1, the width of each window is w2, and the maximum number of windows that can be displayed in the viewport region is represented by h, h may be w1/w2+1 because the windows displayed in the viewport region may not be completely displayed. Wherein when w1 cannot be divided by w2, the integer part of the calculation result of w1/w2 is taken.
Furthermore, it can be understood that, in order to ensure fluency of window movement in the viewport region and avoid a blank region where no window is displayed in the viewport region when the preset calibration object is moved each time, the number of windows included in the preset window list should be not less than the maximum number of windows displayed in the determined viewport region.
Preferably, the number of windows included in the preset window list may be not less than h + 1.
As shown in fig. 2, a video preview method provided by an embodiment of the present invention may include the following steps:
s201: obtaining the movement displacement between the current position and the initial position of a preset calibration object corresponding to a viewport region of a client;
the viewport region is used for displaying a part of windows in a preset window list;
in the embodiment of the present invention, a corresponding preset calibration object is preset for the viewport region. When the preset object is located at the starting position, the viewport region is in an initial state. At this time, H windows set to be displayed in the viewport region at first in the preset window list may be displayed in the viewport region, and from a reference window in the viewport region, the H windows displayed in the viewport region may sequentially correspond to the preset M video channel numbers, and the video channel numbers ordered from bit 1 to bit H. Accordingly, when the preset object is located at the termination position, the viewport region is in a termination state. At this time, the H windows displayed in the window area may sequentially correspond to the video channel numbers from the M-H +1 th bit to the M-th bit among the preset M video channel numbers.
Furthermore, when the preset calibration object moves, each window displayed in the view area can move accordingly. Furthermore, after the movement of the preset calibration object is completed, before the preset calibration object is moved, a part of the windows displayed in the viewport region may be moved out of the viewport region, that is, the part of the windows can no longer be displayed in the viewport region, and correspondingly, a part of the windows not displayed in the viewport region in each window in the preset window list may be moved into the viewport region, that is, the part of the windows can be displayed in the viewport region.
The partial window may be at least one window including at least one complete window, or may be a partial window region in a reference window of the viewport region before the preset calibration object moves.
For example, it is assumed that when the preset calibration object is not moved, the reference window of the viewport region is the 1 st window in the window list, and when the preset calibration object is moved by a displacement corresponding to one window, the reference window of the viewport region will become the 2 nd window in the window list.
For another example, it is assumed that when the preset calibration object is not moved, the reference window of the viewport region is the 1 st window in the window list, and after the preset calibration object is moved by a displacement corresponding to 1/2 of the windows, the reference window of the viewport region is still the 1 st window in the window list, but only 1/2 of the 1 st window region is displayed in the viewport region.
For another example, assume that when the preset calibration object is not moved, the reference window of the viewport region is the 1 st window in the window list, and when the preset calibration object is moved by a displacement corresponding to 3/2 windows, the reference window of the viewport region will be changed into the 2 nd window in the window list, but only 1/2 window regions in the 2 nd window are displayed in the viewport region.
Obviously, the movement of the preset calibration object has a correlation with each window that can be displayed in the viewport region.
Based on this, in step S201, the client may obtain the movement displacement between the current position and the starting position of the preset calibration object when the preset calibration object is moved to the end or in the process of moving.
The client may execute the step S201 in various ways, and the embodiment of the present invention is not limited in detail. For clarity, a specific manner of executing the step S201 by the client will be illustrated in the following.
S202: determining each target window in a preset window list, which has an overlapping area with a viewport area, based on the movement displacement, and determining a video channel number corresponding to each target window based on the movement displacement;
according to the description of the step S201, when the preset calibration object moves, each window displayed in the viewport region may change, and accordingly, the video channel number corresponding to each displayed window may also change accordingly. That is to say, when the preset calibration object moves, a window in the preset window list, which has an overlapping area with the viewport area, may change, and accordingly, the video channel number corresponding to the window having the overlapping area may also change accordingly.
Based on this, the client may determine, based on the movement displacement obtained in step S201, each target window in the preset window list, which has an overlapping region with the viewport region, and then, after determining each target window, the client may further determine, based on the movement displacement, a video channel number corresponding to each target window.
The client may also perform the step S201 in a plurality of ways, and the embodiment of the present invention is not limited in this respect. For clarity, a specific manner of executing the step S202 by the client will be illustrated in the following.
S203: and previewing video data transmitted by the video channel corresponding to the video channel number corresponding to the target window in each target window.
After the video channel number corresponding to each target window in each target window is determined, for each target window in each target window, the client can acquire video data transmitted by a video channel corresponding to the video channel number corresponding to the target window and preview the acquired video data, that is, the client can decode the acquired video data and further display a video picture obtained by decoding in the target window. Thus, the user can view the video images displayed in the respective object windows.
That is, after the video channel number corresponding to each target window in each target window is determined, the video channel corresponding to the target window can be determined accordingly, and then the window starts a preview mode, so that the video data transmitted by the video channel corresponding to the window is displayed. In this way, the user can view the video pictures displayed by the target windows with the overlapped area with the viewport area. Correspondingly, in the preset window list, each window having no overlapping area with the viewport area may close the preview mode. In other words, in the preset window list, only the target window having the overlapping area with the viewport area may be in the preview mode, and a video picture may be displayed to the user. Therefore, the memory consumption can be further reduced, and the processing work of the electronic equipment where the client is located can be reduced.
Therefore, when the embodiment of the invention is applied, when video data transmitted by each video channel is visually previewed, the video channel corresponding to each target window displayed in the viewport region is variable according to the movement of the preset calibration object corresponding to the viewport region, so that the video data transmitted by each video channel can be visually previewed by moving the preset calibration object. Furthermore, because the number of windows included in the viewport region is limited, when the video data transmitted through the corresponding video channel is visually previewed through each target window each time, the client only needs to acquire and load the video data transmitted through the video channel corresponding to each target window, and does not need to acquire the video data transmitted through all the video channels at one time, so that the memory consumed by the client in visually previewing the multiple paths of video data generated by the video acquisition device can be reduced.
Furthermore, the preset calibration object is moved to perform visual preview on the video data transmitted by each video channel, and when the preset calibration object is moved each time, the video pictures displayed in each target window are asynchronously refreshed, so that the video picture switching is free of time delay and jamming, and the user experience is improved. In addition, since each target window included in the viewport region is adjusted by moving the preset calibration object, and the video channel corresponding to each target window is adjusted according to the movement displacement of the preset calibration object, visual preview of video data transmitted by a large number of video channels can be realized through a small number of target windows displayed in the preset window list.
Next, a specific manner of obtaining the movement displacement between the current position and the starting position of the preset calibration object corresponding to the viewport region of the client by the client executing the step S201 is illustrated.
Optionally, in a specific implementation manner, if a scroll bar exists in the viewport region, and a preset calibration object corresponding to the viewport region is a slider on the scroll bar, the client performs the manner of step S201, which may include the following steps:
obtaining the rolling step between the initial position and the current position of the sliding block on the scroll bar;
the total stepping of the scroll bar is N times of the total number of the video channels, and the stepping corresponding to one window is N steps.
Specifically, when the slider stops scrolling on the scroll bar, or during the scrolling process, the client may obtain a scrolling step between the starting position and the current position of the slider on the scroll bar.
For example, when the slider scrolls 5 steps from a start position to an end position on the scroll bar, the client obtains a scroll step of 5. Further, when the slider continues to scroll 5 steps toward the end position, the client obtains a scroll step of 10.
In this specific implementation, the total step of the scroll bar is N times of the total number of the video channels, and the step corresponding to one window is N steps, that is, when the slider on the scroll bar is scrolled N steps, the window displayed in the area of the viewport is moved by the distance of one window in the direction opposite to the scrolling direction of the slider.
For example, when N is 2, when the slider on the scroll bar scrolls one step, the window displayed in the viewport region is moved by a distance of half a window in the direction opposite to the direction in which the slider scrolls.
For another example, as shown in fig. 1, when N is 2 and the direction of the start position of the scroll bar of the viewport region 102 pointing to the end position is from top to bottom, when the slider scrolls down by two steps, the window 2 will move up and out of the viewport region 102, and the window 3 will move up to the position where the window 2 is located when the slider does not scroll down by two steps. At this point, the initial window of the viewport region 102 is window 3.
Next, a specific manner in which the client performs the above step S202, and determines each target window in the preset window list, which has an overlapping area with the viewport area, based on the movement displacement is described as an example.
Optionally, in a specific implementation manner, as shown in fig. 3, the determining, by the client, a manner of each target window in the preset window list, which has an overlapping area with the viewport area, based on the movement displacement may include the following steps:
s301: determining position information of the reference window in a predetermined coordinate system based on the moving displacement;
wherein, the reference window is: presetting a starting target window in each target window with an overlapping area with the viewport area in a window list;
according to the introduction of step S201, when the preset calibration object moves, a window of the reference window serving as the viewport region in the preset window list may change, and meanwhile, position information of the reference window in the viewport region may also change.
For example, it is assumed that when the preset calibration object is not moved, the reference window of the viewport region is the 1 st window in the window list, and when the preset calibration object is moved by a displacement corresponding to one window, the reference window of the viewport region will become the 2 nd window in the window list. The window in the window list that is the reference window of the viewport region changes, and the position information of the reference window in the viewport region does not change.
For another example, it is assumed that when the preset calibration object is not moved, the reference window of the viewport region is the 1 st window in the window list, and after the preset calibration object is moved by a displacement corresponding to 1/2 of the windows, the reference window of the viewport region is still the 1 st window in the window list, but only 1/2 of the 1 st window region is displayed in the viewport region. The position of the reference window in the viewport region is changed although the window in the window list, which is the reference window of the viewport region, is not changed.
For another example, assume that when the preset calibration object is not moved, the reference window of the viewport region is the 1 st window in the window list, and when the preset calibration object is moved by a displacement corresponding to 3/2 windows, the reference window of the viewport region will be changed into the 2 nd window in the window list, but only 1/2 window regions in the 2 nd window are displayed in the viewport region. The window of the reference window in the window list, which is the viewport region, is changed, and the position information of the reference window in the viewport region is also changed.
Based on this, when the preset calibration object moves, the client may determine the position information of the reference window in the view port region in the predetermined coordinate system according to the movement displacement between the current position and the starting position of the preset calibration object.
When the preset calibration object is moved in a direction from the starting position to the ending position, the reference window is the window which is moved out of the viewport region first, and therefore the reference window is the starting target window in each target window which has an overlapping region with the viewport region in the preset window list.
Further, the client may execute the step S301 in various ways, and the embodiment of the present invention is not limited in detail.
Preferably, in an embodiment, the manner in which the client executes the step S301 may include the following steps:
step 1: determining the position information of the reference window in a preset coordinate system based on the ratio of the moving displacement to the total displacement of a preset calibration object and the total number of preset video channels;
wherein the total displacement is: the moving displacement between the starting position and the ending position of the calibration object is preset.
S302: and determining each target window which has an overlapped area with the viewport area and is except for the reference window in the preset window list area based on the window size and the position information.
Since the reference window in the viewport region is the window that is moved out of the viewport region first when the preset calibration object is moved in the direction from the start position to the end position, and the windows displayed in the viewport region are arranged in a row or a column, after the step S301 is completed and the position information of the reference window in the predetermined coordinate system is determined, the client may continue to perform the step S302, and determine each target window, which is in the preset window list region and has an overlapping region with the viewport region and is other than the reference window, based on the window size and the position information.
The client may execute the step S302 in various ways, and the embodiment of the present invention is not limited in this respect.
Preferably, in an embodiment, as shown in fig. 4, the manner in which the client performs the step S302 may include the following steps:
s401: determining each candidate window arranged behind the reference window in the preset window list according to the ranking of each window in the preset window list;
s402: for each candidate window, calculating a distance value between the candidate window and a reference window according to a ranking difference value and a window size between the candidate window and the reference window, and calculating position information of the candidate window in a preset coordinate system based on the calculated distance value;
s403: and for each candidate window, determining the candidate window as a target window when the position information of the candidate window in the predetermined coordinate system indicates that the candidate window and the viewport region have an overlapping region.
Because the windows displayed in the viewport region are arranged in columns or rows, and when the preset calibration object is moved, each window in the preset window list can be cyclically displayed in the viewport region, and therefore, each window in the window list is also arranged in columns or rows. In this way, the client can determine the ranking of each window in the preset window list. Further, according to the ranking, the client may determine each candidate window arranged behind the reference window in the preset window list.
Based on this, for each candidate window, the client may determine the alignment difference and the window size between the candidate window and the reference window, calculate a distance value between the candidate window and the reference window, and calculate the position information of the candidate window in the predetermined coordinate system based on the calculated distance value.
Further, for each candidate window, the client may determine whether the calculated position information of the candidate window in the predetermined coordinate system indicates that there is an overlapping region between the candidate window and the viewport region, and when the result of the determination is yes, determine that the candidate window is the target window.
Specifically, after the position information of the window in the predetermined coordinate system is obtained through calculation, the client may determine the corresponding area of the candidate window in the client page by using the position information. Thus, for each candidate window, the client may further determine whether there is an overlapping region between the determined corresponding region of the candidate window in the client page and the viewport region. Obviously, when the determination result is yes, it indicates that the region corresponding to the candidate window in the client page and the viewport region have an overlapping region, that is, the position information of the candidate window in the predetermined coordinate system represents that the candidate window and the viewport region have an overlapping region, and further, the client may determine the candidate window as the target window.
Next, a specific manner of determining the video channel number corresponding to each target window based on the movement displacement when the client executes the step S202 is described as an example.
Optionally, in a specific implementation manner, as shown in fig. 5, the determining, by the client, the video channel number corresponding to each target window based on the movement displacement may include the following steps:
s501: determining a video channel number corresponding to the reference window based on the moving displacement;
wherein, the reference window is: presetting a starting target window in each target window with an overlapping area with the viewport area in a window list;
s502: and aiming at each window except the reference window in each target window, determining the video channel number corresponding to the window based on the video channel number corresponding to the reference window and the sequence of the window in each target window.
When the preset calibration object moves, each window displayed in the viewport region moves, so that each window in the preset window list can be cyclically displayed in the viewport region, and each window in the preset window list is used for previewing video data transmitted by one video channel.
That is to say, in the process that the preset calibration object corresponding to the viewport region moves from the starting position to the ending position, the video channels corresponding to the windows in the viewport region sequentially change according to the numbering sequence of the video channels, so that the user can sequentially view the video pictures corresponding to the video data transmitted by all the video channels.
For example, assume that the video channels are encoded by C1, C2, and C3 … … Cn in sequence, the window list includes 5 windows W1, W2, W3, W4, and W5, when the preset calibration object corresponding to the viewport region is located at the start position, a window W1, a window W2, and a window W3 are displayed in the viewport region, and the direction in which the start position of the preset calibration object points to the end position is pointed from top to bottom. At this time, the window W1 is a reference window of the viewport region, the coding of the corresponding video channel is C1, the coding of the video channel corresponding to the window W2 is C2, the coding of the video channel corresponding to the window W3 is C3, the coding of the video channel corresponding to the window W4 is C4, and the coding of the video channel corresponding to the window W5 is C5. At this time, the user can view video pictures corresponding to the video data transmitted by the video channels C1, C2, and C3.
Furthermore, when the preset calibration object moves downwards by a displacement corresponding to one window, the window W1 in the viewport region moves upwards to move out of the viewport region and move to the bottom of the window list, that is, after moving to the window W5, the window W2 moves upwards to become a reference window in the viewport region at the current time, and the subsequent windows move upwards in sequence, then the window W2, the window W3 and the window W4 are displayed in the viewport region at this time, and the user can view the video pictures corresponding to the video data transmitted by the video channels C2, C3 and C4.
Further, when the preset calibration object continues to move downward by the displacement corresponding to the two windows, the window W2 and the window W3 in the viewport region move upward and move out of the viewport region, and move to the bottom of the window list, that is, the ordering of each window in the current window list is: window W4, window W5, window W1, window W2, and window W3. Here, the window W4 moves upward to become a reference window in the current time view region, and subsequent windows move upward in sequence. Because the window list only includes 5 windows, and each window in the preset window list can be cyclically displayed in the viewport region by moving the preset calibration object corresponding to the viewport region, at this time, a window W4, a window W5, and a window W1 are displayed in the viewport region, and a user can view video pictures corresponding to video data transmitted by video channels C4, C5, and C6.
Based on the above, when the preset calibration object moves, according to the movement displacement between the current position of the preset calibration object and the initial position, the video channel number corresponding to the reference window in the view port area when the preset calibration object moves to the current position can be determined.
In this way, after the step S201 is completed, the moving displacement between the current position and the starting position of the preset calibration object is obtained, and after the reference window is determined, the client may continue to perform the step S501, and based on the moving displacement, determine the video channel number corresponding to the reference window. That is, the client may determine, based on the movement displacement, a video channel number corresponding to a starting target window in each target window in the preset window list, where the viewport region has an overlapping region.
Further, after determining the video channel number corresponding to the reference window in the view area, the client may continue to perform step S502 to determine the video channel number corresponding to each window except the reference window in each target window.
Specifically, the determined target windows are arranged in the viewport region in rows or columns, and the reference window is a starting target window in each target window in a preset window list having an overlapping region with the viewport region, so that the client can determine that the ranking of the reference window in each target window is 1, and further, the client can determine the ranking of each target window except the reference window in each target window.
In this way, for each of the respective target windows other than the reference window, the client may determine a ranking difference between the window and the reference window. Further, since the video channels are sequentially numbered according to a certain numbering rule, the client may determine that the ranking difference between the video channel number corresponding to the window and the video channel number corresponding to the reference window is the same as the determined ranking difference between the window and the reference window. Based on the above, the video channel number corresponding to the window can be determined according to the video channel number corresponding to the reference window and the determined ranking difference.
Optionally, in a specific implementation manner, if a scroll bar may exist in the viewport region, the preset calibration object corresponding to the viewport region is a slider on the scroll bar, and the movement displacement obtained by the client in step S201 is a scroll step between the current position and the starting position of the slider on the scroll bar.
Thus, in this specific implementation manner, the manner in which the client performs step 1 above and determines the position information of the reference window in the predetermined coordinate system based on the ratio between the moving displacement and the total displacement of the preset calibration object and the preset total number of video channels may include the following steps:
calculating the position information of the reference window in a preset coordinate system by using a preset position information calculation formula; the position information calculation formula is as follows:
S0=-((t/T)*(M*H2)%H2)
wherein, S0 is the position information of the reference window in the predetermined coordinate system, T is the scrolling step, T is the total step between the starting position and the ending position of the slider on the scroll bar, M is the total number of video channels, H2 is the window size,% indicates that when (T/T) × (M × H2) cannot be divided by H2, the remainder is taken, T is N times of M, each window in the preset window list corresponds to N steps, and N is greater than or equal to 1.
In this embodiment, the preset coordinate system is: and taking the side of the viewport region parallel to the scroll bar as a Y axis, the viewport region being vertical to the scroll bar, and the side closest to the initial position of the scroll bar as an X axis, the established coordinate system, and the positive direction of the Y axis being: a moving direction in which the slider rolls from a start position to an end position of the scroll bar; furthermore, the position information of any window displayed in the viewport region in the preset coordinate system is as follows: under a preset coordinate system, the vertical coordinate of the target vertex of the window is as follows: when the window is located in the viewport region, the vertex closest to the origin of the coordinate system;
furthermore, on the basis of the determination method of the position information of the preset coordinate system and the reference window in the preset coordinate system, preferably, in an implementation manner provided by an embodiment of the present invention, after the client performs the step S401, and determines each candidate window arranged behind the reference window in the preset window list, the position information of each candidate window in the preset coordinate system may be determined in the following manner:
for each candidate window, the client may calculate the position information of the candidate window in the coordinate system according to the following formula:
Si=S0+i*H2
wherein Si is the position information of the ith candidate window arranged behind the reference window in the preset window list in the preset coordinate system, S0 is the position information of the reference window, H2 is the size of the window in the Y-axis direction, and i is more than or equal to 1.
Furthermore, according to the preset coordinate system established in the present embodiment, the ordinate of the two vertexes of the side of the viewport region parallel to the scroll bar can be determined to be 0 and H1, respectively. Where H1 is the size of the viewport region in the Y-axis direction.
Based on this, for each candidate window, the client may determine whether there is an overlapping region between the candidate window and the viewport region by:
determining an edge parallel to the Y axis in the candidate window where the target vertex of the candidate window is located, and calculating the ordinate of the other vertex on the determined edge; further, it is determined whether or not at least one of the ordinate of the target vertex of the candidate window and the determined ordinate of the other vertex is located in the interval [0, H1], and if so, it is determined that there is an overlapping region between the candidate window and the viewport region.
Wherein the ordinate of the other vertex on the determined edge is calculated using the following formula:
Si’=Si+H2
wherein Si' is an edge parallel to the Y axis in the window where the target vertex of the ith candidate window arranged after the reference window is located in the preset window list, and a vertical coordinate of another vertex, Si is position information of the ith candidate window arranged after the reference window in the preset window list in the preset coordinate system, and H2 is a size of the window in the Y axis direction.
Specifically, in an embodiment, when windows included in the viewport region are arranged in a row, and a direction in which a start position of the scroll bar points to an end position is from top to bottom, for any window, a vertical coordinate of an upper-left vertex of the window in a preset coordinate system may be used as the position information of the window.
Furthermore, in this embodiment, the X axis of the preset coordinate system may be an upper boundary of the viewport region, the Y axis may be a left boundary of the viewport region, the origin may be an intersection of the upper boundary and the left boundary of the viewport region, and a positive direction of the Y axis is from top to bottom.
Obviously, in the present embodiment, H2 in the above position information calculation formula represents the height value of the window, and H1 represents the height value of the viewport region.
In another embodiment, when the windows included in the viewport region are arranged in rows and the direction from the start position to the end position of the scroll bar is from left to right, for any window, the ordinate of the lower left vertex of the window in the preset coordinate system may be used as the position information of the window.
Furthermore, in this embodiment, the X axis of the preset coordinate system may be a left boundary of the viewport region, the Y axis may be a lower boundary of the viewport region, the origin may be an intersection of the left boundary and the lower boundary of the viewport region, and a positive direction of the Y axis is from right to left.
Obviously, in this embodiment, H2 in the above position information calculation formula represents the width value of the window, and H1 represents the width value of the viewport region.
In another embodiment, when the windows included in the viewport region are arranged in a row, and the direction from the start position to the end position of the scroll bar is from left to right, then for any window, the abscissa of the lower left vertex of the window under the preset coordinate may be used as the position information of the window.
In this specific implementation manner, the X axis of the preset coordinate system may be a lower boundary of the viewport region, the Y axis may be a left boundary of the viewport region, the origin may be an intersection of a left boundary and the lower boundary of the viewport region, and a positive direction of the X axis is from left to right.
Obviously, in this embodiment, H2 in the above position information calculation formula represents the width value of the window, and H1 represents the width value of the viewport region.
Optionally, in a specific implementation manner, if a scroll bar may exist in the viewport region, the preset calibration object corresponding to the viewport region is a slider on the scroll bar, and the movement displacement obtained by the client in step S201 is a scroll step between the current position and the starting position of the slider on the scroll bar.
In this way, in this specific implementation manner, the method for the client to execute the step S501 and determine the video channel number corresponding to the reference window based on the movement displacement may include the following steps:
calculating a video channel number corresponding to the reference window by using a preset channel calculation formula; wherein, the channel calculation formula is:
C0=(t/T)*(M*H2)/H2+1
wherein, C0 is the video channel number corresponding to the reference window, T is the scrolling step, T is the total step between the starting position and the ending position of the slider on the scroll bar, M is the total number of video channels, H2 is the window size,/indicates that when (T/T) × (M × H2) cannot be divided by H2, the integer part of the quotient is taken, T is N times of M, each window in the preset window list corresponds to N steps, and N is greater than or equal to 1.
In this embodiment, the preset coordinate system is: and taking the side of the viewport region parallel to the scroll bar as a Y axis, the viewport region being vertical to the scroll bar, and the side closest to the initial position of the scroll bar as an X axis, the established coordinate system, and the positive direction of the Y axis being: the slider is rolled from the start position to the end position of the scroll bar.
Specifically, in an embodiment, when the windows included in the viewport region are arranged in a column, and the direction in which the starting position of the scroll bar points to the ending position is from top to bottom, the X axis of the established coordinate system may be an upper boundary of the viewport region, the Y axis may be a left boundary of the viewport region, the origin may be an intersection of the upper boundary and the left boundary of the viewport region, the positive direction of the X axis is from left to right, and the positive direction of the Y axis is from top to bottom. Wherein H2 in the above channel calculation formula represents the height value of the window.
In another embodiment, when the windows included in the viewport region are arranged in rows, and the direction in which the starting position of the scroll bar points to the ending position is from left to right, the X axis of the established coordinate system may be the upper boundary of the viewport region, the Y axis may be the left boundary of the viewport region, the origin may be the intersection point of the left boundary and the upper boundary of the viewport region, the positive direction of the X axis is from left to right, and the positive direction of the Y axis is from top to bottom. Wherein H2 in the above channel calculation formula represents the width value of the window.
Furthermore, on the basis of the preset coordinate system and the video channel number determination method corresponding to the reference window, preferably, in an implementation manner provided by the embodiment of the present invention, after determining the video channel number corresponding to the reference window, the client may determine the video channel number corresponding to the window based on the video channel number corresponding to the reference window and the sequence of the window in each target window in the following manner:
calculating the video channel number corresponding to the window by using a preset number calculation formula; wherein, the number calculation formula is as follows:
Ci=C0+(i-1)
wherein Ci is the video channel number corresponding to the ith window in each target window, C0 is the video channel number corresponding to the reference window, and i > 1.
In this embodiment, the video channel numbers are sequentially arranged from large to small, and the difference between two adjacent video channel numbers is 1.
Corresponding to the video previewing method provided by the embodiment of the invention, the embodiment of the invention also provides a video previewing device.
Fig. 6 is a schematic structural diagram of a video previewing apparatus according to an embodiment of the present invention. As shown in fig. 6, a video preview apparatus provided in an embodiment of the present invention may include the following modules:
a displacement obtaining module 610, configured to obtain a moving displacement between a current position and an initial position of a preset calibration object corresponding to a viewport region of a client; the viewport region is used for displaying a part of windows in a preset window list;
an information determining module 620, configured to determine, based on the mobile displacement, each target window in the preset window list, which has an overlapping region with the viewport region, and determine, based on the mobile displacement, a video channel number corresponding to each target window;
the video browsing module 630 is configured to preview, in each target window, video data transmitted by a video channel corresponding to the video channel number corresponding to the target window.
Therefore, when the embodiment of the invention is applied, when video data transmitted by each video channel is visually previewed, the video channel corresponding to each target window displayed in the viewport region is variable according to the movement of the preset calibration object corresponding to the viewport region, so that the video data transmitted by each video channel can be visually previewed by moving the preset calibration object. Furthermore, because the number of windows included in the viewport region is limited, when the video data transmitted through the corresponding video channel is visually previewed through each target window each time, the client only needs to acquire and load the video data transmitted through the video channel corresponding to each target window, and does not need to acquire the video data transmitted through all the video channels at one time, so that the memory consumed by the client in visually previewing the multiple paths of video data generated by the video acquisition device can be reduced.
Furthermore, the preset calibration object is moved to perform visual preview on the video data transmitted by each video channel, and when the preset calibration object is moved each time, the video pictures displayed in each target window are asynchronously refreshed, so that the video picture switching is free of time delay and jamming, and the user experience is improved. In addition, since each target window included in the viewport region is adjusted by moving the preset calibration object, and the video channel corresponding to each target window is adjusted according to the movement displacement of the preset calibration object, visual preview of video data transmitted by a large number of video channels can be realized through a small number of target windows displayed in the preset window list.
Optionally, in a specific implementation manner, the information determining module 620 includes:
the position information determining submodule is used for determining the position information of the reference window in a preset coordinate system based on the moving displacement; wherein, the reference window is: presetting a starting target window in each target window with an overlapping area with the viewport area in a window list;
and the target window determining submodule is used for determining each target window which has an overlapping area with the viewport area and is except for the reference window in the preset window list area based on the window size and the position information.
Optionally, in a specific implementation manner, the location information determining submodule includes a location information determining unit; in this specific implementation manner, the position information determining unit is configured to determine the position information of the reference window in the predetermined coordinate system based on a ratio between the moving displacement and a total displacement of a preset calibration object and a preset total number of video channels; wherein the total displacement is: the moving displacement between the starting position and the ending position of the calibration object is preset.
Optionally, in a specific implementation, a scroll bar exists in the viewport region; a preset calibration object corresponding to the viewport region is a slider on a scroll bar; the displacement is: the scrolling of the slider between the current position and the starting position on the scroll bar is stepped;
in this specific implementation manner, the location information determining unit is specifically configured to calculate the location information of the reference window in the predetermined coordinate system by using a preset location information calculation formula; the position information calculation formula is as follows:
S0=-((t/T)*(M*H2)%H2)
wherein, S0 is the position information of the reference window in the predetermined coordinate system, T is the scrolling step, T is the total step between the starting position and the ending position of the slider on the scroll bar, M is the total number of video channels, H2 is the window size,% indicates that when (T/T) × (M × H2) cannot be divided by H2, the remainder is taken, T is N times of M, each window in the preset window list corresponds to N steps, and N is greater than or equal to 1.
Optionally, in a specific implementation manner, the target window determining submodule is specifically configured to:
determining each candidate window arranged behind the reference window in the preset window list according to the ranking of each window in the preset window list; for each candidate window, calculating a distance value between the candidate window and a reference window according to a ranking difference value and a window size between the candidate window and the reference window, and calculating position information of the candidate window in a preset coordinate system based on the calculated distance value; and for each candidate window, determining the candidate window as a target window when the position information of the candidate window in the predetermined coordinate system indicates that the candidate window and the viewport region have an overlapping region.
Optionally, in a specific implementation manner, the information determining module 620 includes:
the first number determining submodule is used for determining the video channel number corresponding to the reference window based on the moving displacement; wherein, the reference window is: presetting a starting target window in each target window with an overlapping area with the viewport area in a window list;
and the second number determining submodule is used for determining the video channel number corresponding to each window except the reference window in each target window based on the video channel number corresponding to the reference window and the sequence of the window in each target window.
Optionally, in a specific implementation, a scroll bar exists in the viewport region; a preset calibration object corresponding to the viewport region is a slider on a scroll bar; the displacement is: the scrolling of the slider between the current position and the starting position on the scroll bar is stepped;
in this specific implementation manner, the first number determining submodule is specifically configured to calculate, by using a preset channel calculation formula, a video channel number corresponding to the reference window; wherein, the channel calculation formula is:
C0=(t/T)*(M*H2)/H2+1
wherein, C0 is the video channel number corresponding to the reference window, T is the scrolling step, T is the total step between the starting position and the ending position of the slider on the scroll bar, M is the total number of video channels, H2 is the window size,/indicates that when (T/T) × (M × H2) cannot be divided by H2, the integer part of the quotient is taken, T is N times of M, each window in the preset window list corresponds to N steps, and N is greater than or equal to 1.
Optionally, in a specific implementation manner, the second number determining submodule is specifically configured to calculate, by using a preset number calculation formula, a video channel number corresponding to the window; wherein, the number calculation formula is as follows:
Ci=C0+(i-1)
wherein Ci is the video channel number corresponding to the ith window in each target window, C0 is the video channel number corresponding to the reference window, and i > 1.
Corresponding to the video preview method provided by the embodiment of the invention, the embodiment of the invention also provides electronic equipment, and the electronic equipment is provided with a client. As shown in fig. 7, the electronic device includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702 and the memory 703 are communicated with each other via the communication bus 704,
a memory 703 for storing a computer program;
the processor 701 is configured to implement the video preview method according to the embodiment of the present invention when executing the program stored in the memory 703.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
Corresponding to the video previewing method provided by the embodiment of the present invention, an embodiment of the present invention further provides a computer readable storage medium, and the computer program is executed by a processor to implement the video previewing method provided by the embodiment of the present invention.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, the electronic device embodiment and the computer-readable storage medium embodiment, since they are substantially similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the partial description of the method embodiment.
The above description is only for the 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 shall fall within the protection scope of the present invention.

Claims (17)

1. A video previewing method is applied to a client side, and comprises the following steps:
obtaining the movement displacement between the current position and the initial position of a preset calibration object corresponding to the client visual port area; the viewport region is used for displaying a part of windows in a preset window list;
determining each target window in the preset window list, which has an overlapping area with the viewport area, based on the movement displacement, and determining a video channel number corresponding to each target window based on the movement displacement;
previewing video data transmitted by a video channel corresponding to the video channel number corresponding to the target window in each target window;
the previewing of the video data transmitted by the video channel corresponding to the video channel number corresponding to the target window in each target window comprises the following steps: and acquiring video data from the video channel corresponding to the video channel number corresponding to each target window, decoding the acquired video data, and playing and displaying a video picture obtained by decoding in the target window.
2. The method according to claim 1, wherein the step of determining, based on the movement displacement, each target window in the preset window list having an overlapping area with the viewport area comprises:
determining position information of the reference window in a predetermined coordinate system based on the moving displacement; wherein the reference window is: starting target windows in all target windows in the preset window list, wherein the target windows and the viewport region have overlapping regions;
and determining each target window which has an overlapped area with the viewport area and is except for the reference window in the preset window list area based on the window size and the position information.
3. The method of claim 2, wherein the step of determining the position information of the reference window in the predetermined coordinate system based on the moving displacement comprises:
determining the position information of the reference window in a preset coordinate system based on the ratio of the moving displacement to the total displacement of the preset calibration object and the total number of preset video channels;
wherein the total displacement is: and the movement displacement between the starting position and the ending position of the preset calibration object.
4. The method of claim 3, wherein a scroll bar is present in the viewport region; a preset calibration object corresponding to the viewport region is a slider on the scroll bar; the movement displacement is: a scrolling step of the slider between a current position and a starting position on the scrollbar;
the step of determining the position information of the reference window in the predetermined coordinate system based on the ratio between the moving displacement and the total displacement of the preset calibration object and the total number of the preset video channels includes:
calculating the position information of the reference window in a preset coordinate system by using a preset position information calculation formula; wherein, the position information calculation formula is as follows:
S0=-((t/T)*(M*H2)%H2)
wherein S0 is the position information of the reference window in the predetermined coordinate system, T is the scrolling step, T is the total step between the starting position and the ending position of the slider on the scroll bar, M is the total number of video channels, H2 is the window size,% indicates that when (T/T) × (M × H2) cannot be divided by H2, the remainder is taken, T is N times of M, each window in the preset window list corresponds to the steps of N, and N is greater than or equal to 1.
5. The method according to claim 2, wherein the step of determining each target window, other than the reference window, in the preset window list region, which has an overlapping region with the viewport region, based on the window size and the position information comprises:
determining each candidate window arranged behind the reference window in the preset window list according to the ranking of each window in the preset window list;
for each candidate window, calculating a distance value between the candidate window and the reference window according to the ranking difference between the candidate window and the reference window and the window size, and calculating position information of the candidate window in the preset coordinate system based on the calculated distance value;
and for each candidate window, determining the candidate window as a target window when the position information of the candidate window in the predetermined coordinate system indicates that an overlapping area exists between the candidate window and the viewport area.
6. The method according to claim 1, wherein the step of determining the video channel number corresponding to each target window based on the movement displacement comprises:
determining a video channel number corresponding to the reference window based on the moving displacement; wherein the reference window is: starting target windows in all target windows in the preset window list, wherein the target windows and the viewport region have overlapping regions;
and aiming at each window except the reference window in each target window, determining the video channel number corresponding to the window based on the video channel number corresponding to the reference window and the sequence of the window in each target window.
7. The method of claim 6, wherein a scroll bar is present in the viewport region; a preset calibration object corresponding to the viewport region is a slider on the scroll bar; the movement displacement is: a scrolling step of the slider between a current position and a starting position on the scrollbar;
the step of determining the video channel number corresponding to the reference window based on the moving displacement includes:
calculating a video channel number corresponding to the reference window by using a preset channel calculation formula; wherein the channel calculation formula is:
C0=(t/T)*(M*H2)/H2+1
wherein C0 is the video channel number corresponding to the reference window, T is the scrolling step, T is the total step between the starting position and the ending position of the slider on the scroll bar, M is the total number of video channels, H2 is the window size,/indicates that when (T/T) × (M × H2) cannot be divided by H2, an integer part of a quotient value is taken, T is N times of M, each window in the preset window list corresponds to the steps of N, and N is greater than or equal to 1.
8. The method according to claim 7, wherein the step of determining the video channel number corresponding to the window based on the video channel number corresponding to the reference window and the sequence of the window in each target window comprises:
calculating the video channel number corresponding to the window by using a preset number calculation formula; wherein, the number calculation formula is:
Ci=C0+(i-1)
wherein Ci is a video channel number corresponding to the ith window in each target window, C0 is a video channel number corresponding to the reference window, and i > 1.
9. A video preview device applied to a client, the device comprising:
a displacement obtaining module, configured to obtain a movement displacement between a current position and an initial position of a preset calibration object corresponding to the viewport region of the client; the viewport region is used for displaying a part of windows in a preset window list;
an information determining module, configured to determine, based on the movement displacement, each target window in the preset window list, where an overlapping region exists with the viewport region, and determine, based on the movement displacement, a video channel number corresponding to each target window;
the video browsing module is used for previewing video data transmitted by the video channel corresponding to the video channel number corresponding to the target window in each target window;
the video browsing module is specifically configured to acquire video data from a video channel corresponding to the video channel number corresponding to each target window, decode the acquired video data, and play and display a video picture obtained by decoding in the target window.
10. The apparatus of claim 9, wherein the information determining module comprises:
the position information determining submodule is used for determining the position information of the reference window in a preset coordinate system based on the moving displacement; wherein the reference window is: starting target windows in all target windows in the preset window list, wherein the target windows and the viewport region have overlapping regions;
and the target window determining submodule is used for determining each target window which has an overlapping area with the viewport area and is except for the reference window in the preset window list area based on the window size and the position information.
11. The apparatus of claim 10, wherein the location information determination submodule comprises a location information determination unit;
the position information determining unit is used for determining the position information of the reference window in a preset coordinate system based on the ratio of the moving displacement to the total displacement of the preset calibration object and the total number of preset video channels; wherein the total displacement is: and the movement displacement between the starting position and the ending position of the preset calibration object.
12. The apparatus of claim 11, wherein a scroll bar is present in the viewport region; a preset calibration object corresponding to the viewport region is a slider on the scroll bar; the movement displacement is: a scrolling step of the slider between a current position and a starting position on the scrollbar;
the position information determining unit is specifically used for calculating the position information of the reference window in a preset coordinate system by using a preset position information calculation formula; wherein, the position information calculation formula is as follows:
S0=-((t/T)*(M*H2)%H2)
wherein S0 is the position information of the reference window in the predetermined coordinate system, T is the scrolling step, T is the total step between the starting position and the ending position of the slider on the scroll bar, M is the total number of video channels, H2 is the window size,% indicates that when (T/T) × (M × H2) cannot be divided by H2, the remainder is taken, T is N times of M, each window in the preset window list corresponds to the steps of N, and N is greater than or equal to 1.
13. The apparatus of claim 10, wherein the target window determination submodule is specifically configured to:
determining each candidate window arranged behind the reference window in the preset window list according to the ranking of each window in the preset window list; for each candidate window, calculating a distance value between the candidate window and the reference window according to the ranking difference between the candidate window and the reference window and the window size, and calculating position information of the candidate window in the preset coordinate system based on the calculated distance value; and for each candidate window, determining the candidate window as a target window when the position information of the candidate window in the predetermined coordinate system indicates that an overlapping area exists between the candidate window and the viewport area.
14. The apparatus of claim 9, wherein the information determining module comprises:
the first number determining submodule is used for determining the video channel number corresponding to the reference window based on the moving displacement; wherein the reference window is: starting target windows in all target windows in the preset window list, wherein the target windows and the viewport region have overlapping regions;
and the second number determining submodule is used for determining the video channel number corresponding to each window except the reference window in each target window based on the video channel number corresponding to the reference window and the sequence of the window in each target window.
15. The apparatus of claim 14, wherein a scroll bar is present in the viewport region; a preset calibration object corresponding to the viewport region is a slider on the scroll bar; the movement displacement is: a scrolling step of the slider between a current position and a starting position on the scrollbar;
the first number determining submodule is specifically used for calculating a video channel number corresponding to the reference window by using a preset channel calculation formula; wherein the channel calculation formula is:
C0=(t/T)*(M*H2)/H2+1
wherein C0 is the video channel number corresponding to the reference window, T is the scrolling step, T is the total step between the starting position and the ending position of the slider on the scroll bar, M is the total number of video channels, H2 is the window size,/indicates that when (T/T) × (M × H2) cannot be divided by H2, an integer part of a quotient value is taken, T is N times of M, each window in the preset window list corresponds to the steps of N, and N is greater than or equal to 1.
16. The apparatus of claim 15,
the second number determining submodule is specifically configured to calculate, by using a preset number calculation formula, a video channel number corresponding to the window; wherein, the number calculation formula is:
Ci=C0+(i-1)
wherein Ci is a video channel number corresponding to the ith window in each target window, C0 is a video channel number corresponding to the reference window, and i > 1.
17. The electronic equipment is characterized in that the electronic equipment is provided with a client and comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 8 when executing a program stored in the memory.
CN201910681922.6A 2019-07-26 2019-07-26 Video preview method and device and electronic equipment Active CN111432167B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910681922.6A CN111432167B (en) 2019-07-26 2019-07-26 Video preview method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910681922.6A CN111432167B (en) 2019-07-26 2019-07-26 Video preview method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111432167A CN111432167A (en) 2020-07-17
CN111432167B true CN111432167B (en) 2022-05-03

Family

ID=71546777

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910681922.6A Active CN111432167B (en) 2019-07-26 2019-07-26 Video preview method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111432167B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113377310B (en) * 2021-06-04 2023-12-05 西安诺瓦星云科技股份有限公司 Input source display method, device and system and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009146208A (en) * 2007-12-14 2009-07-02 Hitachi Ltd Plant-monitoring and control system
CN103577087A (en) * 2012-08-09 2014-02-12 腾讯科技(深圳)有限公司 Page switching method and device based on touch screen
CN104571828A (en) * 2015-01-30 2015-04-29 湖南蚁坊软件有限公司 Method for positioning and switching multiple columns or windows
CN105045569A (en) * 2015-05-15 2015-11-11 广东小天才科技有限公司 Movement control method and apparatus in scene
CN109325090A (en) * 2018-10-12 2019-02-12 无锡天脉聚源传媒科技有限公司 A kind of tile map display methods, system, terminal and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009146208A (en) * 2007-12-14 2009-07-02 Hitachi Ltd Plant-monitoring and control system
CN103577087A (en) * 2012-08-09 2014-02-12 腾讯科技(深圳)有限公司 Page switching method and device based on touch screen
CN104571828A (en) * 2015-01-30 2015-04-29 湖南蚁坊软件有限公司 Method for positioning and switching multiple columns or windows
CN105045569A (en) * 2015-05-15 2015-11-11 广东小天才科技有限公司 Movement control method and apparatus in scene
CN109325090A (en) * 2018-10-12 2019-02-12 无锡天脉聚源传媒科技有限公司 A kind of tile map display methods, system, terminal and storage medium

Also Published As

Publication number Publication date
CN111432167A (en) 2020-07-17

Similar Documents

Publication Publication Date Title
CN106156066B (en) Page switching method, device and client
US8341543B2 (en) Method and apparatus of scrolling a document displayed in a browser window
US9275604B2 (en) Constant speed display method of mobile device
CN107783714B (en) Page display method and device, electronic equipment and storage medium
AU2014308633B2 (en) Swipe toolbar to switch tabs
US11825177B2 (en) Methods, systems, and media for presenting interactive elements within video content
CN105635848A (en) Bullet-screen display method and terminal
US20030218620A1 (en) Method for displaying an electronic document on a digital handheld device
TW201415347A (en) Method for zooming screen and electronic apparatus and computer program product using the same
US20090006938A1 (en) Method and apparatus for searching web browser using zoom
CN107870703B (en) Method, system and terminal equipment for full-screen display of picture
US20230161458A1 (en) Information Display Method, Electronic Device, And Non-Transitory Computer-Readable Storage Medium
CN111432167B (en) Video preview method and device and electronic equipment
US6337697B1 (en) Method for scrolling automatically on a display device and device therefor
CN111327842A (en) Method and device for displaying rolling captions
KR101810018B1 (en) Document presentation method and user terminal
US20140053067A1 (en) Method and Apparatus for Sequentially Displaying a Plurality of Images Including Selective Asynchronous Matching of a Subset of the Images
CN113259742B (en) Video bullet screen display method and device, readable storage medium and computer equipment
CN112463098A (en) Method and system for freezing specific application program update
CN111698548B (en) Video playing method and device
JP6339550B2 (en) Terminal program, terminal device, and terminal control method
CN111199136A (en) Document content display method, device and equipment
US10628629B2 (en) Method, device, and client terminal apparatus for displaying page
CN114490215A (en) Stuck detection method, detection device and computer readable storage medium
JP4094512B2 (en) Screen scroll control device

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