Methods, devices, video acquisition equipment, and computer program products for acquiring video.
By retrieving the target video from the video capture device when the backend device's streaming channel reaches its limit, the problem of video acquisition failure is solved, the success rate and efficiency are improved, and the user experience is enhanced.
Patent Information
- Application Number
- CN202211215349.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-09-30
AI Technical Summary
Due to network bandwidth limitations of backend devices, video acquisition devices are prone to video acquisition failures after reaching the maximum number of streaming channels that can be opened, which affects user experience and product sales.
By reading the number of occupied streaming channels and the upper limit of streaming channels of the backend device, if the sum of the number of new streaming channels and the number of occupied streaming channels is greater than the upper limit, the target video is obtained from the video capture device connected to the backend device, or the preview video in the occupied streaming channel is changed to be obtained from the video capture device.
It improves the success rate and efficiency of target video acquisition, enhances the user experience, and avoids acquisition failures caused by insufficient streaming channels.
Smart Images

Figure CN115550727B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data transmission technology, and in particular to a method, apparatus and device for acquiring video. Background Technology
[0002] When a user views a video, the video acquisition device needs to connect to the backend device via the network, and the backend device management connects to the frontend camera to preview or play back the video stream captured by the camera on the backend device.
[0003] However, due to limitations in network bandwidth and other performance of backend devices, the number of streaming channels that can be used to acquire video from backend devices is limited. If the number of streaming channels opened by the backend devices reaches the preset upper limit, video acquisition may fail. Summary of the Invention
[0004] This application provides a video acquisition method, apparatus, and video acquisition device. When the number of streaming channels of the backend device reaches the upper limit of streaming channels, the video in the target video can be directly obtained from at least one video acquisition device connected to the backend device, and / or, the preview video corresponding to at least one preview streaming channel that is already occupied can be changed to be obtained from at least one video acquisition device connected to the backend device and the video in the target video can be obtained from the backend device, thereby improving the success rate of acquiring the target video.
[0005] The first aspect of this application provides a method for acquiring video, the method comprising:
[0006] When it is necessary to open a new streaming channel on the backend device to obtain the target video, read the number of streaming channels already occupied and the upper limit of streaming channels on the backend device. The number of streaming channels already occupied is the number of streaming channels currently occupied by the backend device, and the upper limit of streaming channels is the maximum number of streaming channels that the backend device can support being occupied at the same time.
[0007] If the sum of the number of new streaming channels and the number of already occupied streaming channels is greater than the upper limit of streaming channels, then the video in the target video is obtained from at least one video capture device connected to the backend device, and / or the preview video corresponding to at least one preview streaming channel in the already occupied streaming channels is changed to be obtained from at least one video capture device connected to the backend device and the video in the target video is obtained from the backend device.
[0008] A second aspect of this application provides a video acquisition device, the acquisition device comprising:
[0009] The reading module is used to read the number of currently occupied streaming channels and the upper limit of streaming channels of the backend device when it is necessary to open a new streaming channel of the backend device to obtain the target video. The number of currently occupied streaming channels is the number of streaming channels currently occupied by the backend device, and the upper limit of streaming channels is the maximum number of streaming channels that the backend device can support being occupied at the same time.
[0010] The acquisition module is configured to, when the sum of the number of new acquisition channels and the number of occupied acquisition channels is greater than the upper limit of the acquisition channels, acquire the video in the target video from at least one video acquisition device connected to the backend device, and / or, change the preview video corresponding to at least one preview acquisition channel in the occupied acquisition channels to the video in the target video acquired from at least one video acquisition device connected to the backend device and acquired from the backend device.
[0011] A third aspect of this application provides a video acquisition device, which includes a processor and a memory for storing executable instructions of the processor. The processor is configured to read the executable instructions from the memory and execute the instructions to implement the video acquisition method provided in the first aspect of this application.
[0012] A fourth aspect of this application provides a computer-readable storage medium storing a computer program for executing the video acquisition method provided in the first aspect of this application.
[0013] The fifth aspect of this application provides a computer program product, including a computer program for executing the video acquisition method provided in the first aspect of this application.
[0014] The technical solution provided in this application can achieve at least the following beneficial effects:
[0015] The video acquisition method, apparatus, video acquisition device, computer-readable storage medium, and computer program product provided in this application embodiment, when the video acquisition device needs to open a new streaming channel of the backend device to acquire the target video, reads the number of streaming channels already occupied by the backend device and the upper limit of streaming channels of the backend device from the corresponding storage address, and determines whether the sum of the number of new streaming channels and the number of occupied streaming channels is greater than the upper limit of streaming channels of the backend device. If it is determined that the sum of the number of new streaming channels and the number of occupied streaming channels is greater than the upper limit of streaming channels, the video in the target video is acquired from at least one video capture device connected to the backend device, and / or the preview video in the preview streaming channel of the occupied streaming channel in the backend device is changed to be acquired from at least one video capture device connected to the backend device, and the video in the target video is acquired from the backend device. The video acquisition method provided in this application can improve or avoid the situation where the number of streaming channels of the backend device cannot meet the requirements for the video acquisition device to acquire the target video. It allows for flexible selection of a direct connection to the video acquisition device for acquisition, and / or changing the preview video corresponding to at least one of the occupied streaming channels to be acquired from the direct connection to the video acquisition device and the video in the target video acquired from the backend device. This improves the success rate and efficiency of target video acquisition and enhances the user experience. Attached Figure Description
[0016] Figure 1 This is an application scenario diagram illustrating an exemplary embodiment of the present application of a video acquisition method;
[0017] Figure 2 This is a schematic flowchart illustrating a video acquisition method according to an exemplary embodiment of this application;
[0018] Figure 3 This is a schematic flowchart illustrating another video acquisition method according to an exemplary embodiment of this application;
[0019] Figure 4 This is a schematic flowchart illustrating another video acquisition method according to an exemplary embodiment of this application;
[0020] Figure 5 This is a schematic flowchart illustrating another video acquisition method according to an exemplary embodiment of this application;
[0021] Figure 6 This is a schematic flowchart illustrating another video acquisition method according to an exemplary embodiment of this application;
[0022] Figure 7 This is a schematic flowchart illustrating another video acquisition method according to an exemplary embodiment of this application;
[0023] Figure 8This is a schematic flowchart illustrating another method for acquiring video, as shown in an exemplary embodiment of this application.
[0024] Figure 9 This is a structural block diagram of a video acquisition device illustrated in an exemplary embodiment of this application;
[0025] Figure 10 This is an exemplary embodiment of the present application illustrating the internal structure of a server;
[0026] Figure 11 This is an internal structural diagram of a terminal device illustrated in an exemplary embodiment of this application. Detailed Implementation
[0027] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0028] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0029] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0030] The embodiments disclosed herein can be applied to electronic devices such as terminal devices, computer systems, and servers, and can operate together with a wide range of other general-purpose or special-purpose computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, and servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments that include any of the above systems.
[0031] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in distributed cloud computing environments, where tasks are executed by remote processing devices linked through communication networks. In distributed cloud computing environments, program modules can reside on local or remote computing system storage media, including storage devices.
[0032] Currently, users can access and watch videos captured by video capture devices (cameras, cameras, etc.) through terminals or a terminal and server, stored in backend devices (such as network video recorders, supercomputer network video recorders, etc.). The videos users access can be playback videos stored in the backend devices. For example, if a user needs to access a video from June 1, 2022, on August 1, 2022, then the June 1 video is a playback video stored in the backend device. Alternatively, users can access preview videos stored in both the video capture device and the backend device. For instance, if a user needs to access the video from video capture device 1 from 8:00 AM to 12:00 PM on August 1, 2022, the video captured from 8:00 AM to 12:00 PM on August 1, 2022, can be temporarily stored in video capture device 1. Since the video capture device transmits the video to the backend device in real time after capture, the backend device will also store the video from video capture device 1 from 8:00 AM to 12:00 PM on August 1, 2022. We call such videos preview videos. Therefore, playback videos can only be obtained from backend devices, while preview videos can be obtained from both backend devices and video capture devices connected to the backend devices.
[0033] A backend device is a device that can connect to multiple video capture devices, but its performance is affected by its bandwidth. Assuming the maximum bandwidth allowed for a backend device is 700Mbps, and the backend device includes multiple streaming channels, each capturing device acquires video through one of these channels. Alternatively, if each streaming channel on the backend device allows a maximum bandwidth of 4Mbps for video transmission, and the combined bandwidth used by the video capture devices using the backend device's streaming channels reaches or approaches 700Mbps, then opening new streaming channels on the backend device to capture video will likely result in capture failures.
[0034] Another scenario exists where the backend device can perform intelligent analyses on the video captured by the video acquisition device, either spontaneously or triggered, such as facial recognition, object detection, and pixelation. In this application scenario, the intelligent analysis performed by the backend device itself consumes its own performance. If the video acquisition device then sends a request to the backend device to open a new channel to acquire video, video acquisition will also fail.
[0035] If users frequently encounter the aforementioned acquisition failures while acquiring video from backend devices, it will negatively impact their user experience, thereby affecting product sales and causing economic losses to manufacturers.
[0036] To address this issue, this application provides a video acquisition method, apparatus, video acquisition device, computer-readable storage medium, and computer program product. When the video acquisition device needs to open a new streaming channel on a backend device to acquire the target video, it reads the number of already occupied streaming channels on the backend device and the maximum number of streaming channels on the backend device, determines whether the sum of the new streaming channels and the already occupied streaming channels is greater than the maximum number of streaming channels on the backend device, and if it is determined that the sum of the new streaming channels and the already occupied streaming channels is greater than the maximum number of streaming channels, it acquires the video from the target video from at least one video capture device connected to the backend device, and / or changes the preview video in the preview streaming channel of the already occupied streaming channel on the backend device to be acquired from at least one video capture device connected to the backend device, and then acquires the video from the target video from the backend device. The video acquisition method provided by this application can improve or avoid the situation where the number of streaming channels on the backend device is insufficient for the video acquisition device to acquire the target video. It allows for flexible selection of either directly connected video capture devices or acquisition from the preview streaming channel of the backend device, improving the success rate and efficiency of target video acquisition and enhancing the user experience.
[0037] The technical solution of this application will now be described in conjunction with the accompanying drawings.
[0038] First, the application scenarios of the video acquisition method provided in this application will be introduced, such as... Figure 1 As shown, this scenario includes a video acquisition device 102, a backend device 104, and at least one video capture device 106. The video acquisition device 102 communicates with the backend device 104 via a network, and the backend device 104 communicates with at least one video capture device 106 via a network. The video acquisition device 102 can be, for example, a terminal device or a server. When the video acquisition device 102 is a terminal device, it can be, for example, a smartphone, smartwatch, tablet, desktop computer, or laptop. When the video acquisition device 102 is a server, it can be, for example, a standalone server or a server cluster. The backend device 104 can be, for example, a network video recorder or a super-brain network video recorder. The video capture device 106 can be, for example, a camera or webcam.
[0039] Users can trigger a request to open a new streaming channel on the backend device 104 to obtain the target video through the video acquisition device 102. If the sum of the number of new streaming channels to be opened on the backend device 104 and the number of streaming channels already occupied on the backend device 104 is greater than the upper limit of streaming channels on the backend device 104, then the video in the target video is obtained from at least one video acquisition device 106 connected to the backend device 104, and / or the preview video corresponding to at least one preview streaming channel in the occupied streaming channel is changed to be obtained from at least one video acquisition device 106 connected to the backend device 104 and the video in the target video is obtained from the backend device 104.
[0040] Next, the specific process of obtaining the video provided in this application will be explained with reference to the accompanying drawings.
[0041] Figure 2 This is a schematic flowchart illustrating a video acquisition method according to an exemplary embodiment of this application. (Refer to...) Figure 2 As shown, the specific steps include the following:
[0042] Step S100: When it is necessary to open a new streaming channel of the backend device to obtain the target video, read the number of streaming channels already occupied and the upper limit of streaming channels of the backend device. The number of streaming channels already occupied is the number of streaming channels currently occupied by the backend device, and the upper limit of streaming channels is the maximum number of streaming channels that the backend device can support being occupied at the same time.
[0043] The video acquisition device includes a processor and a memory for storing processor-executable instructions. The video acquisition device may also pre-store records in the memory indicating the usage of streaming channels of the backend device. The streaming channels of the backend device can be recorded in the form of an information table stored in a corresponding memory address of the video acquisition device; or they can be recorded using a counter internal to the video acquisition device; this application does not limit this. The usage of streaming channels can be indicated by recording the number of occupied streaming channels of the backend device; it can be indicated by recording the number of remaining streaming channels of the backend device; or it can be indicated by recording the number of streaming channels to be activated of the backend device, etc., this application also does not limit this.
[0044] The video acquisition device can also send a corresponding acquisition command to the backend device after establishing a communication connection. This command causes the backend device to send at least one of the following information to the video acquisition device: its IP address, port number, login information, number of occupied streaming channels, number of remaining streaming channels, maximum bandwidth, and maximum streaming channel limit. Upon receiving this information, the video acquisition device can store it in different storage addresses for later use. For example, when it is necessary to open a playback streaming channel on the backend device to acquire playback video, the video acquisition device can read the number of occupied streaming channels and the maximum streaming channel limit from the first storage address.
[0045] It's important to note that the maximum bandwidth limit for the streaming channels on a backend device can be determined based on the device's maximum bandwidth and the bandwidth occupied by a single channel. For example, if the backend device has a maximum bandwidth of 700Mbps and a single channel bandwidth of 4Mbps, then the maximum bandwidth limit for the streaming channels on the backend device would be 175. Different backend devices will have different maximum bandwidth and single channel bandwidth limits, resulting in different maximum bandwidth limits.
[0046] The video acquisition device needs to open a new streaming channel on the backend device to acquire the target video. This could be to open the preview streaming channel on the backend device to acquire the preview video; it could be to open the playback streaming channel on the backend device to acquire the playback video; or it could be to open both the preview and playback streaming channels on the backend device. Furthermore, the video acquisition device can open new streaming channels on the backend device one by one or multiple channels simultaneously; this application does not limit this. The preview streaming channel refers to the streaming channel in the backend device used for transmitting the preview video; the playback streaming channel refers to the streaming channel in the backend device used for transmitting the playback video.
[0047] The video acquisition device may be equipped with a trigger control for user touch operation. The user can trigger the video acquisition device to generate a demand to open a new streaming channel of the backend device to acquire the target video by operating the corresponding trigger control on the video acquisition device. The video acquisition device is then triggered to read the number of occupied streaming channels and the upper limit of streaming channels of the backend device from the corresponding storage address, so as to determine whether the target video can be successfully acquired based on the read data.
[0048] Step S200: If the sum of the number of new streaming channels and the number of occupied streaming channels is greater than the upper limit of streaming channels, then the video in the target video is obtained from at least one video capture device connected to the backend device, and / or the preview video corresponding to at least one preview streaming channel in the occupied streaming channels is changed to the video obtained from at least one video capture device connected to the backend device and the video in the target video obtained from the backend device.
[0049] The number of new streaming channels refers to the number of new streaming channels that the video acquisition device needs to activate on the backend devices (i.e., the number of streaming channels required by the target video), such as 4, 9, 10, 15, etc. The video acquisition device is used to acquire video of the target environment. There can be only one video acquisition device or multiple devices (e.g., 4, 100, 256, etc.). When there are multiple video acquisition devices, they can be used to acquire video of the same target environment or to acquire video of different target environments. These multiple video acquisition devices can be the same device or different devices; this application does not limit this. For example, multiple video acquisition devices can all be cameras of the same model.
[0050] Video capture devices can be connected to backend devices via wired or wireless connections to enable communication. This allows the video capture device to transmit captured video to the backend device according to a preset transmission strategy, where it is then stored. After establishing a communication connection with the video capture device, the backend device can send instructions to the video capture device to instruct it to send its own configuration information (such as IP address, port information, login information, and storage information) to the backend device. The backend device then forwards this information to the video capture device. Therefore, the storage address of the video capture device may also store configuration information of at least one video capture device.
[0051] Furthermore, the video acquisition device can log in to the video acquisition device based on the login information in the stored configuration information of the video acquisition device, and establish a direct connection with the video acquisition device, thereby enabling the video acquisition device to obtain preview videos from the video acquisition device.
[0052] It's important to note that the streaming channels of the backend device can be used to transmit playback video to the video acquisition device; to transmit preview video to the video acquisition device; and to receive preview video transmitted by the video capture device. Therefore, both transmitting and receiving video will occupy streaming channels on the backend device. If the number of streaming channels already occupied by the backend device has reached its maximum limit, or if the sum of the number of new streaming channels and the number of occupied streaming channels exceeds the maximum limit, then the probability of the video acquisition device successfully acquiring the target video by opening a new streaming channel on the backend device will be very low, and acquisition may even fail.
[0053] To address the aforementioned issues and improve the success rate of video acquisition, video acquisition devices can, when a user triggers the need to open a new streaming channel on the backend device to acquire the target video, further trigger the video acquisition device to read the number of already occupied streaming channels and the upper limit of streaming channels on the backend device from the corresponding storage address. The sum of the new streaming channel number and the number of already occupied streaming channels on the backend device is then compared with the upper limit of streaming channels on the backend device. Based on the comparison result, a more suitable streaming channel is selected to acquire the target video, thereby achieving the technical effect of improving the success rate of acquiring the target video.
[0054] The comparison results include the following two types:
[0055] The first scenario involves a sum of the number of new streaming channels and the number of already occupied streaming channels on the backend device that does not exceed the maximum number of streaming channels on the backend device. In other words, the backend device currently has unoccupied streaming channels that can be used to transmit the target video required by the video acquisition device. In this case, the video acquisition device can directly obtain the target video from the backend device without needing to further determine the path based on the type of the new streaming channel. Of course, if the new streaming channel is a preview streaming channel, the target video can also be obtained directly from the corresponding video capture device; this application does not impose any limitations on this.
[0056] The second scenario is when the sum of the number of new streaming channels and the number of already occupied streaming channels on the backend device exceeds the maximum number of streaming channels on the backend device. This means the backend device currently has no unoccupied streaming channels and cannot transmit the target video required by the video acquisition device; or, the backend device currently only has a portion of the unoccupied streaming channels and can only transmit a portion of the target video required by the video acquisition device. In other words, the video acquisition device cannot obtain the target video from the backend device, or can only obtain a portion of the target video. Therefore, in this case, it is necessary to further determine the acquisition path of the target video based on whether the new streaming channels include preview or playback streaming channels. It should be noted that this can be determined by comparing whether the current number of occupied streaming channels has reached the maximum number of streaming channels. If the current number of occupied streaming channels has reached the maximum number of streaming channels, then the sum of the new streaming channels and the number of occupied streaming channels is greater than the maximum number of streaming channels.
[0057] Furthermore, the new streaming channel that the video acquisition device needs to open may be a preview streaming channel, the purpose of which is to acquire preview video; the new streaming channel may be a playback streaming channel, the purpose of which is to acquire playback video; or the new streaming channel may be both a preview streaming channel and a playback streaming channel, the purpose of which is to acquire both preview video and playback video. Since both the backend device and at least one video acquisition device connected to the backend device store preview video, while only the backend device stores playback video, the path to acquire the target video will differ depending on the type of new streaming channel opened by the video acquisition device on the backend device. The following will explain how the target video is acquired in each of the three scenarios mentioned above:
[0058] For the first scenario: all new streaming channels that the video acquisition device needs to open are preview streaming channels, meaning that all target videos acquired by the video acquisition device are preview videos. See also Figure 3 See details Figure 3 Step S301 in the process:
[0059] Step S301: If the new streaming channel includes a preview streaming channel, then obtain the preview video from the target video from at least one video capture device connected to the backend device.
[0060] When all new channels that the video acquisition device needs to open are preview channels, the acquisition of the target video by the video acquisition device is relatively simple. It mainly relies on the communication connection established between the video acquisition device and the video capture device to acquire the target video from at least one video capture device. This method can quickly acquire the target video, which can not only improve the success rate of acquiring the target video, but also improve the efficiency of acquiring the target video, and is less likely to fail to acquire the video.
[0061] The specific implementation method may include the following steps, such as Figure 4 As shown:
[0062] Step S401: Determine at least one target video acquisition device from among the video acquisition devices to acquire the video in the target video.
[0063] First, the video acquisition device needs to determine which video capture device the target video is stored on. This can be done by identifying the video capture device's identifier carried on the target video. It's important to note that various user actions via trigger controls on the video acquisition device include adding the video capture device's identifier to the target video. Therefore, when the video acquisition device receives a user's target video acquisition command, it parses the command to obtain the identifier of the corresponding video capture device. This allows for the rapid identification of at least one target video capture device from multiple devices connected to the backend. The identifier for the video capture device can be represented by numbers, characters, letters, images, etc., to distinguish different video capture devices.
[0064] For example, if the video acquisition device parses the acquisition command transmitted by the user and obtains that the video acquisition device identifier carried in the target video is 1, 2, or 3, it means that the target video was acquired by the video acquisition device identified by identifier 1, the video acquisition device identified by identifier 2, and the video acquisition device identified by identifier 3.
[0065] Step S402: Obtain the login information of the target video acquisition device from the target storage address, and log in to the target video acquisition device based on the login information.
[0066] In this process, after determining that at least one target video acquisition device has been identified using the method described above, the video acquisition device retrieves the login information of the target video acquisition device from the corresponding storage address and logs into the target video acquisition device based on the login information. The login information may include, for example, the port number, username, and password required to log in to the target video acquisition device. The video acquisition device can access the login interface via the port number and enter the username and password in the corresponding fields on the login interface to log in to the target video acquisition device. If there are multiple target video acquisition devices, the video acquisition device can log in to multiple target video acquisition devices sequentially to acquire target videos, or it can log in to multiple target video acquisition devices simultaneously to acquire target videos; this application does not limit this.
[0067] Step S403: Obtain the video from the target video through the logged-in target video capture device.
[0068] Based on the login process described above, after the video acquisition device successfully logs into the target video acquisition device, it can acquire the target video by sending an acquisition command to the target video acquisition device, which then returns video data packets, video links, video URLs, etc.; or it can acquire the target video by finding and downloading the target video from the address corresponding to the video acquisition device. This application does not limit this to any particular method, as long as it can successfully acquire all the target videos from the target video acquisition device.
[0069] In the second scenario: all new streaming channels that the video acquisition device needs to open are playback streaming channels, meaning that all target videos acquired by the video acquisition device are playback videos. See also... Figure 3 See details Figure 3 Step S302 in the process:
[0070] Step S302: If the new streaming channel includes a playback streaming channel, then determine whether the occupied streaming channels of the backend device include a preview streaming channel.
[0071] In this situation, since the playback streaming channel is used to acquire playback videos, and the playback videos are only stored in the backend device, when the new streaming channel is a playback streaming channel, the target video can only be acquired from the backend device.
[0072] However, at this point, the number of streaming channels already occupied by the backend device has reached its maximum limit, or the sum of the new streaming channels and the number of streaming channels already occupied by the backend device exceeds its maximum limit (meaning the backend device doesn't have enough streaming channels). Therefore, it's impossible to obtain the complete target video from the backend device. In this situation, to obtain the complete target video as quickly as possible, the video acquisition device needs to find an alternative approach by examining the occupied streaming channels of the backend device to determine if a preview streaming channel is included. Based on the strategy that the preview video can be obtained through at least one video capture device directly connected to the backend device, a further strategy can be developed to obtain the entire or part of the target video through the preview streaming channel within the occupied streaming channels. See step S303 below for details.
[0073] Step S303: If the streaming channel already occupied includes the preview streaming channel, then the playback video in the target video is obtained through the preview streaming channel, and the preview video corresponding to the preview streaming channel is changed to be obtained from at least one video acquisition device connected to the backend device.
[0074] In this process, the video acquisition device can acquire the target video through the preview acquisition channel of the backend device after confirming that the backend device's occupied acquisition channels include the preview acquisition channel. Furthermore, to avoid delaying the video acquisition device's acquisition of the preview video through the preview acquisition channel, the video acquisition device can, according to the aforementioned method for acquiring preview videos, identify at least one target video acquisition device for capturing preview videos, log in to the target video acquisition device, and acquire the preview video from the target video acquisition device. This allows for the acquisition of both preview and playback videos, significantly reducing the failure rate of video acquisition and improving the user experience.
[0075] For specific acquisition methods, please refer to Figure 5 :
[0076] Step S501: If the streaming channel, including the preview streaming channel, is already occupied, a shutdown command is sent to the backend device. The shutdown command is used to instruct the backend device to shut down the preview streaming channel.
[0077] Because video acquisition devices can acquire video from the backend device's streaming channel multiple times at different times, there will be situations where the video acquired by the acquisition device in one attempt has not yet been fully transmitted, and the acquisition device needs to initiate another request to acquire video from the backend device. Since the video acquisition device's video acquisition history inevitably includes records of acquiring preview videos, the backend device's occupied streaming channels will also include preview streaming channels. Furthermore, based on the strategy that preview videos can be acquired through at least one video capture device directly connected to the backend device, and to ensure successful acquisition of the target video every time, the video acquisition device will send a shutdown command to the backend device, instructing the backend device to stop transmitting preview videos to the acquisition device through the preview streaming channel. This changes the backend device's preview streaming channel from occupied to unoccupied, leaving an unoccupied streaming channel on the backend device, which the video acquisition device can then use to acquire playback video. It should be noted here that if the occupied streaming channels of the backend device include multiple preview streaming channels, the backend device can either close all multiple preview streaming channels at once or close multiple preview streaming channels one by one. This application does not limit this.
[0078] Step S502: Obtain the playback video from the target video through the preview streaming channel closed by the backend device.
[0079] Specifically, after the video acquisition device instructs the backend device to close the preview streaming channel in the occupied streaming channel, the closed preview streaming channel can be reopened to acquire the playback video through the closed preview streaming channel. Specifically, an acquisition command can be sent to the backend device, which then transmits the corresponding playback video to the video acquisition device through the closed preview streaming channel according to the acquisition command.
[0080] However, due to two possible scenarios between the number of preview streaming channels and the number of new streaming channels on the backend device: the number of preview streaming channels is not less than the number of new streaming channels, and the number of preview streaming channels is less than the number of new streaming channels, obtaining playback videos can also include the following steps, see [link to relevant documentation]. Figure 6 As shown:
[0081] Step S601: If the number of new streaming channels is not greater than the number of preview streaming channels closed by the backend device, then the playback video in the target video is obtained through the preview streaming channels closed by the backend device.
[0082] The number of new streaming channels is no greater than the number of preview streaming channels closed by the backend device, meaning the closed preview streaming channels of the backend device are sufficient to transmit all playback videos. Therefore, the video acquisition device can send an acquisition command to the backend device, instructing the backend device to simultaneously transmit playback videos to the video acquisition device through the same number of closed preview streaming channels as the number of new streaming channels; alternatively, the backend device can open only one closed preview streaming channel and transmit playback videos sequentially through this closed preview streaming channel, etc. This application does not limit this approach.
[0083] Step S602: If the number of new streaming channels is greater than the number of preview streaming channels closed by the backend device, then a portion of the playback video in the target video is obtained through the preview streaming channels closed by the backend device.
[0084] In some cases, the number of new streaming channels may exceed the number of preview streaming channels closed by the backend device. In such cases, the backend device may first transmit part of the playback video through the closed preview streaming channels, or it may open only one closed preview streaming channel and transmit the playback video sequentially through this closed preview streaming channel.
[0085] Step S603: If it is determined that there are other closed streaming channels on the backend device, then the remaining playback video in the target video is obtained through the other streaming channels.
[0086] Furthermore, during the transmission of a portion of the playback video by the backend device through a closed preview streaming channel, or after the transmission is complete, if there are other closed streaming channels in the backend device (the backend device can actively close them or close them according to the closing command of the video acquisition device), the backend device can continue to transmit the remaining playback video from the target video that has not yet been transmitted through other streaming channels. This allows the video acquisition device to continuously acquire the required target video, avoiding situations where the video acquisition device's video acquisition action is unresponsive for extended periods.
[0087] Furthermore, it may also include step S304, if the occupied streaming channel does not include the preview streaming channel, then a prompt message is generated and displayed, the prompt message is used to indicate that the probability of successfully obtaining the target video through the backend device is less than a preset probability threshold.
[0088] The occupied streaming channels of the backend devices can include preview streaming channels or all playback streaming channels. This means that the backend devices are transmitting playback video in their occupied streaming channels. In this case, the video acquisition device also needs to acquire playback video, which increases the probability of acquisition failure. Therefore, the video acquisition device can generate a corresponding prompt message in this situation to inform the user that the probability of acquiring the target video is high, allowing the user to be prepared and choose to acquire it at another time, or to do other things first and try again later. This avoids long waiting times that lead to inefficient resource utilization and a poor user experience.
[0089] For the third scenario: the new streaming channel that the video acquisition device needs to open includes both a preview streaming channel and a playback streaming channel, meaning that the target video acquired by the video acquisition device includes both preview and playback videos.
[0090] The above descriptions detail how to acquire the target video when opening a new streaming channel—whether it's a preview streaming channel or a playback streaming channel. The third scenario differs from the first two in that the video acquisition device needs to acquire two types of video. Therefore, different methods can be used to acquire preview and playback videos. When the video acquisition device needs to open a preview streaming channel to acquire preview videos, it still first determines the target video acquisition device for capturing the preview video, and then acquires the preview video from the target video acquisition device through a direct connection.
[0091] In addition, when the video acquisition device needs to open the playback streaming channel, it is also necessary to first determine whether the preview streaming channel is included in the already opened streaming channels of the backend device. If it is, the preview streaming channel is closed and used for playback video transmission. The video acquisition device is then directly connected to the corresponding target video capture device to obtain the preview video in the occupied streaming channel.
[0092] If not, then it is necessary to wait for the video in the occupied streaming channel of the backend device to finish transmitting, meaning that an unoccupied streaming channel appears in the backend device. The video acquisition device can then acquire the playback video through the unoccupied streaming channel. At the same time, corresponding prompts need to be generated to inform the user that there may be an acquisition failure or that it is necessary to wait.
[0093] In addition, when the video acquisition device acquires playback video through the unoccupied streaming channels of the backend device, it also needs to determine the relationship between the number of unoccupied streaming channels and the number of streaming channels occupied by the playback video. Depending on the relationship, the acquisition method will also be different. Please refer to the acquisition method mentioned above for details, which will not be elaborated here.
[0094] In another embodiment, as described above, the video acquisition device can record the usage of the streaming channels of the backend device in real time to understand the usage status of the streaming channels of the backend device, thereby comprehensively selecting the optimal path when acquiring the target video and ensuring the success rate of acquiring the target video. Therefore, the video acquisition device can record any changes in the usage of the streaming channels of the backend device; for specific recording steps, see [link to documentation]. Figure 7 :
[0095] Step S701: After sending a shutdown command to the backend device, the number of recorded occupied streaming channels is reduced by a first value, where the first value is the number of preview streaming channels that the backend device has shut down.
[0096] The video acquisition device can reduce the number of streaming channels occupied by the backend device by a value, for example, 1, after each streaming channel is closed by the backend device. Then, when the backend device closes multiple streaming channels at once, or closes multiple streaming channels sequentially, it continuously reduces the number of occupied streaming channels by 1 until the total reduction is equal to the number of preview streaming channels closed by the backend device; or it can reduce the number of occupied streaming channels by the backend device to the first value at once.
[0097] For example, the current video acquisition device records that the number of streaming channels occupied by the backend device is 100. When the backend device closes 10 preview streaming channels at once, the video acquisition device will reduce the number of streaming channels occupied by the backend device to 90.
[0098] Step S702: After obtaining the playback video in the target video through the preview streaming channel closed by the backend device, the number of recorded occupied streaming channels is increased by a second value, which is the number of streaming channels newly opened by the backend device.
[0099] For the same reasons mentioned above, the video acquisition device may, each time it opens a streaming channel of the backend device to acquire video, increase the number of streaming channels already occupied by the backend device by the same number as the number of streaming channels newly opened by the backend device.
[0100] For example, the current video acquisition device records 100 streaming channels occupied by backend devices. When the video acquisition device opens 10 playback streaming channels of the backend devices, the current video acquisition device will increase the number of streaming channels occupied by the backend devices to 110.
[0101] This method allows for real-time monitoring of the streaming channel usage of backend devices, enabling video acquisition devices to determine the optimal path for acquiring the target video before each acquisition, thus ensuring smooth and rapid acquisition of the target video.
[0102] The following is in conjunction with the appendix Figure 8 The following is a general description of a video acquisition method provided in this application:
[0103] Step S801: Based on the user's touch operation, a new streaming channel of the backend device needs to be opened to obtain the target video.
[0104] Step S802: Read the number of occupied streaming channels and the upper limit of streaming channels of the backend device;
[0105] Step S803: Determine whether the sum of the number of new flow-taking channels and the number of occupied flow-taking channels is greater than the upper limit of the flow-taking channels.
[0106] Step S804: If the sum of the number of new streaming channels and the number of already occupied streaming channels is less than the upper limit of streaming channels, obtain the target video from the backend device;
[0107] Step S805: If the sum of the number of new stream acquisition channels and the number of occupied stream acquisition channels is greater than the upper limit of stream acquisition channels, determine whether the new stream acquisition channels include the preview stream acquisition channels;
[0108] Step S806: If the new streaming channel includes a preview streaming channel, obtain the preview video from the target video from at least one video capture device connected to the backend device;
[0109] Step S807: If the new streaming channel includes a playback streaming channel, determine whether the already occupied streaming channels of the backend device include a preview streaming channel.
[0110] Step S808: If the streaming channel already occupied includes the preview streaming channel, send a shutdown command to the backend device to instruct the backend device to shut down the preview streaming channel;
[0111] For the preview videos corresponding to the closed preview streaming channels, change them to be obtained from at least one video capture device connected to the backend device;
[0112] Step S809: If the preview channel is not included in the occupied stream acquisition channels, generate a prompt message and display it.
[0113] Step S810: After S808, reduce the number of recorded occupied streaming channels by the number of preview streaming channels closed by the backend device.
[0114] Step S811: Determine whether the number of new stream acquisition channels is less than the number of preview stream acquisition channels closed by the backend device.
[0115] Step S812: If the number of new streaming channels is not greater than the number of preview streaming channels closed by the backend device, obtain the playback video in the target video through the preview streaming channels closed by the backend device, and increase the number of recorded occupied streaming channels by the number of newly opened streaming channels by the backend device.
[0116] Step S813: If the number of new streaming channels is greater than the number of preview streaming channels closed by the backend device, obtain a portion of the playback video from the target video through the preview streaming channels closed by the backend device.
[0117] Step S814: Determine if there are other closed traffic intake channels on the backend device.
[0118] Step S815: If the backend device has other closed streaming channels, obtain the remaining playback video in the target video through the other streaming channels;
[0119] Step S816: If the backend device does not have any other closed streaming channels, continue to determine if the backend device has any other closed streaming channels until it is determined that the backend device has other closed streaming channels. Then, obtain the remaining playback video in the target video through the other streaming channels.
[0120] Step S817: After step S815, the number of recorded occupied flow channels is increased by the number of newly opened flow channels by the backend device.
[0121] Step S818: After step S816, the number of recorded occupied flow channels will be increased by the number of newly opened flow channels by the backend device.
[0122] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0123] Based on the same inventive concept, this application also provides a video acquisition device for implementing the video acquisition method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more real-time video acquisition device embodiments provided below can be found in the limitations of the video acquisition method described above, and will not be repeated here.
[0124] In one embodiment, such as Figure 9 As shown, a video acquisition device 900 is provided, which includes a reading module 901 and an acquisition module 902.
[0125] The reading module is used to read the number of currently occupied streaming channels and the maximum number of streaming channels on the backend device when it is necessary to open a new streaming channel on the backend device to obtain the target video. The number of currently occupied streaming channels is the number of streaming channels currently occupied on the backend device, and the maximum number of streaming channels is the maximum number of streaming channels that the backend device can be occupied at the same time.
[0126] The acquisition module is used to acquire video from at least one video capture device connected to the backend device when the sum of the number of new acquisition channels and the number of occupied acquisition channels is greater than the upper limit of acquisition channels, and / or to change the preview video corresponding to at least one preview acquisition channel in the occupied acquisition channels to the video acquired from at least one video capture device connected to the backend device and acquire video from the target video from the backend device.
[0127] In one embodiment, the acquisition module is specifically configured to: if the new acquisition channel includes a preview acquisition channel, acquire a preview video from at least one video capture device connected to the backend device; and / or if the new acquisition channel includes a playback acquisition channel, determine whether the occupied acquisition channels of the backend device include a preview acquisition channel; if the occupied acquisition channels include a preview acquisition channel, acquire the playback video from the target video through the preview acquisition channel, and change the preview video corresponding to the preview acquisition channel to be acquired from at least one video capture device connected to the backend device.
[0128] In one embodiment, the acquisition module is further configured to send a shutdown command to the backend device if the streaming channel already occupied includes the preview streaming channel, the shutdown command being used to instruct the backend device to shut down the preview streaming channel; and to acquire the playback video in the target video through the preview streaming channel shut down by the backend device.
[0129] In one embodiment, the acquisition device further includes a generation module.
[0130] The generation module is specifically used to generate and display a prompt message if the preview streaming channel is not included in the already occupied streaming channel. The prompt message indicates that the probability of successfully acquiring the target video through the backend device is less than a preset probability threshold.
[0131] In one embodiment, the acquisition module is further configured to: determine at least one target video acquisition device from among the video acquisition devices for acquiring the video in the target video; obtain the login information of the target video acquisition device from the target storage address; log in to the target video acquisition device based on the login information; and acquire the video in the target video through the logged-in target video acquisition device.
[0132] In one embodiment, the acquisition module is further configured to: if the number of new streaming channels is not greater than the number of preview streaming channels closed by the backend device, then acquire the playback video in the target video through the preview streaming channels closed by the backend device; if the number of new streaming channels is greater than the number of preview streaming channels closed by the backend device, then acquire a portion of the playback video in the target video through the preview streaming channels closed by the backend device; if it is determined that there are other closed streaming channels on the backend device, then acquire the remaining playback video in the target video through the other streaming channels.
[0133] In one embodiment, the acquisition device further includes a recording module.
[0134] The recording module is specifically used to, after sending a shutdown command to the backend device, reduce the number of recorded occupied streaming channels by a first value, the first value being the number of preview streaming channels closed by the backend device; and, after obtaining the playback video in the target video through the preview streaming channels closed by the backend device, increase the number of recorded occupied streaming channels by a second value, the second value being the number of streaming channels newly opened by the backend device.
[0135] Each module in the aforementioned real-time video acquisition device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0136] In one embodiment, a video acquisition device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10As shown, this video acquisition device, in addition to the processor and memory mentioned above, also includes a transmitter, receiver, and network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores configuration information for backend devices and each video acquisition device. The network interface, receiver, and transmitter of the video acquisition device are used for communication with external terminal devices via a network connection. When the computer program is executed by the processor, it implements a video acquisition method.
[0137] In one embodiment, a video acquisition device is provided. This video acquisition device may be a terminal device, and its internal structure diagram may be as follows: Figure 11 As shown. In addition to the processor and memory mentioned above, the video acquisition device also includes a communication interface, display screen, receiver, transmitter, and input device connected via a system bus. The processor of the video acquisition device provides computing and control capabilities. The memory of the video acquisition device includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface, transmitter, and receiver of the video acquisition device are used for wired or wireless communication with an external server. Wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a video acquisition method. The display screen of the video acquisition device can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, buttons, a trackball, or a touchpad located on the computer device casing, or an external keyboard, touchpad, or mouse, etc.
[0138] Those skilled in the art will understand that Figure 10 and Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0139] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the video acquisition method provided in the first aspect.
[0140] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the video acquisition method provided in the first aspect.
[0141] It is readily understood that, based on the several embodiments provided in this application, those skilled in the art can combine, split, or reorganize the embodiments of this application to obtain other embodiments, none of which exceed the protection scope of this application.
[0142] The above detailed embodiments further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above are merely specific embodiments of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.
Claims
1. A method for acquiring video, characterized in that, The method is applied to a video acquisition device, and the method includes: When it is necessary to open a new streaming channel on the backend device to obtain the target video, read the number of streaming channels already occupied and the upper limit of streaming channels on the backend device. The number of streaming channels already occupied is the number of streaming channels currently occupied by the backend device, and the upper limit of streaming channels is the maximum number of streaming channels that the backend device can support being occupied at the same time. If the sum of the number of new streaming channels and the number of already occupied streaming channels is greater than the upper limit of streaming channels, and the new streaming channels include playback streaming channels, then it is determined whether the already occupied streaming channels of the backend device include preview streaming channels. Here, the playback streaming channel refers to the streaming channel in the backend device used to transmit playback video, and the playback video is a video that can only be obtained from the backend device. The preview streaming channel refers to the streaming channel in the backend device used to transmit preview video, and the preview video is a video that can be obtained from both the backend device and the video acquisition device connected to the backend device. If the occupied streaming channels include a preview streaming channel, a shutdown command is sent to the backend device. The shutdown command instructs the backend device to shut down the preview streaming channel, acquire the playback video from the target video through the closed preview streaming channel, and change the preview video corresponding to the preview streaming channel to be acquired from at least one video acquisition device connected to the backend device. If the occupied streaming channels do not include a preview streaming channel, a prompt message is generated and displayed. The prompt message indicates that the probability of successfully acquiring the target video through the backend device is less than a preset probability threshold.
2. The acquisition method according to claim 1, characterized in that, The step of acquiring video from the target video from at least one video acquisition device connected to the backend device includes: At least one target video acquisition device is determined from among the video acquisition devices to acquire the video in the target video; Obtain the login information of the target video acquisition device from the target storage address, and log in to the target video acquisition device based on the login information of the target video acquisition device; The video in the target video is acquired by logging into the target video acquisition device.
3. The acquisition method according to claim 1, characterized in that, The step of obtaining the playback video from the target video through the preview streaming channel closed by the backend device includes: If the number of new streaming channels is not greater than the number of preview streaming channels closed by the backend device, then the playback video in the target video is obtained through the preview streaming channels closed by the backend device; If the number of new streaming channels is greater than the number of preview streaming channels closed by the backend device, then a portion of the playback video in the target video is obtained through the preview streaming channels closed by the backend device; If it is determined that there are other closed streaming channels on the backend device, the remaining playback video in the target video is obtained through the other streaming channels.
4. The method according to claim 1, characterized in that, The method further includes: After sending a shutdown command to the backend device, the number of recorded occupied streaming channels is reduced by a first value, where the first value is the number of preview streaming channels that the backend device has shut down. After obtaining the playback video from the target video through the preview streaming channel closed by the backend device, the number of the recorded occupied streaming channels is increased by a second value, which is the number of streaming channels newly opened by the backend device.
5. A video acquisition device, characterized in that, The device is used in a video acquisition device, and the acquisition device includes: The reading module is used to read the number of currently occupied streaming channels and the upper limit of streaming channels of the backend device when it is necessary to open a new streaming channel of the backend device to obtain the target video. The number of currently occupied streaming channels is the number of streaming channels currently occupied by the backend device, and the upper limit of streaming channels is the maximum number of streaming channels that the backend device can support being occupied at the same time. The acquisition module is configured to determine whether the occupied streaming channels of the backend device include a preview streaming channel when the sum of the number of newly acquired streaming channels and the number of occupied streaming channels is greater than the upper limit of the streaming channels, and the newly acquired streaming channels include a playback streaming channel. Here, the playback streaming channel refers to the streaming channel in the backend device used for transmitting playback video, and the playback video is a video that can only be obtained from the backend device. The preview streaming channel refers to the streaming channel in the backend device used for transmitting preview video, and the preview video can be obtained from either the backend device or the video acquisition device connected to the backend device. The video is captured; if the occupied streaming channels include a preview streaming channel, a shutdown command is sent to the backend device, which instructs the backend device to shut down the preview streaming channel. The playback video in the target video is then acquired through the closed preview streaming channel, and the preview video corresponding to the preview streaming channel is changed to be acquired from at least one video capture device connected to the backend device; if the occupied streaming channels do not include a preview streaming channel, a prompt message is generated and displayed, which indicates that the probability of successfully acquiring the target video through the backend device is less than a preset probability threshold.
6. A video acquisition device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the video acquisition method according to any one of claims 1 to 4.
7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the video acquisition method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Public network video transmission method and system
CN112584090A
Video playing method and device, storage medium and electronic device
CN115037968A