Disclosure of Invention
Based on the problems existing in the prior art, the embodiment of the invention provides a live broadcast screen recording method, a live broadcast screen recording device, electronic equipment and a storage medium.
In a first aspect, an embodiment of the present invention provides a live video recording method, which is applied to a cloud server, and includes:
receiving a mobile terminal identifier sent by a mobile terminal;
acquiring a playing terminal identifier which is pre-bound with the mobile terminal identifier, and acquiring a channel identifier of a playing terminal corresponding to the playing terminal identifier;
and recording the video corresponding to the channel identifier.
Further, the obtaining the playing terminal identifier pre-bound with the mobile terminal identifier, and obtaining the channel identifier of the playing terminal corresponding to the playing terminal identifier, includes:
searching a play terminal identifier which is pre-bound with the mobile terminal identifier;
and acquiring the channel identifier fed back by the playing terminal corresponding to the playing terminal identifier, or searching the channel identifier played by the playing terminal corresponding to the playing terminal identifier.
Further, before the video corresponding to the channel identifier is recorded, the method further includes:
the channel identifier and the playing terminal identifier are sent to the mobile terminal, so that the mobile terminal generates an instruction according to the channel identifier, the playing terminal identifier, the mobile terminal identifier and the recording parameter;
and receiving the instruction sent by the mobile terminal, and recording the video corresponding to the channel identifier according to the instruction.
Further, before the video corresponding to the channel identifier is recorded, the method further includes:
acquiring screen recording time and screen recording duration;
the recording of the video corresponding to the channel identifier comprises the following steps:
determining a screen recording time period according to the screen recording time length and the screen recording time;
judging whether the corresponding image frames of the starting time and the ending time of the time period are key frames or not;
if not, continuing the image frames of the screen to the first key image frame before the starting time and the first key frame after the ending time of the time period;
or,
obtaining a characteristic label of a user according to the mobile terminal identifier;
and calibrating the screen recording time according to the characteristic tag, and recording the video corresponding to the channel identifier according to the calibrated screen recording time.
Further, when the video corresponding to the channel identifier is recorded, the method further comprises:
and synchronizing the screen recording time of the cloud server with the time of the channel currently being played by the playing terminal based on a clock protocol SNTP or a time protocol PTP.
Further, after the screen recording is completed, the method further comprises the following steps:
performing code rate conversion on the recorded video so that the mobile terminal previews and edits the converted video;
and after the mobile terminal completes editing the video, generating a sharing link.
Further, before the playing terminal identifier pre-bound with the mobile terminal identifier is obtained, the method further comprises:
receiving a playing terminal binding instruction sent by a mobile terminal;
and binding the mobile terminal identifier and the playing terminal identifier based on the playing terminal binding instruction.
In a second aspect, an embodiment of the present invention further provides a live video recording device, including:
the receiving module is used for receiving the mobile terminal identification sent by the mobile terminal;
the acquisition module is used for acquiring the playing terminal identification which is pre-bound with the mobile terminal identification and acquiring the channel identification of the playing terminal corresponding to the playing terminal identification;
and the screen recording module is used for recording the video corresponding to the channel identifier.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the live video recording method according to the first aspect when executing the computer program.
In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the live video recording method according to the first aspect.
According to the live broadcast screen recording method, device, electronic equipment and storage medium provided by the embodiment of the invention, the mobile terminal is used for controlling the cloud server to record the live broadcast screen in the playing equipment, the playing terminal is not required to record the screen, the resources of the playing terminal are not occupied, and the sharing is more convenient to carry out through the mobile terminal after the screen recording. In addition, through the mode of controlling the cloud server to record, compare in prior art playback earlier, two operation record screen modes of recording again and simplify and to be one step of operation alright realize recording, and compare traditional in order the time record screen, the restriction that the live picture is recorded the screen in the past need not to play back earlier and record the screen again, can directly trace back the picture in the past and accomplish the record screen from the current time year reverse time, has simplified user's operation, and then, promotes the user experience of recording the screen.
Detailed Description
The following describes the embodiments of the present invention further with reference to the accompanying drawings. The following examples are only for more clearly illustrating the technical aspects of the present invention, and are not intended to limit the scope of the present invention.
The following describes a live broadcast screen recording method, a live broadcast screen recording device, an electronic device and a storage medium according to an embodiment of the invention with reference to the accompanying drawings.
Fig. 1 shows a flowchart of a live video recording method according to an embodiment of the present invention. As shown in fig. 1, the live video recording method provided by the embodiment of the invention is applied to a cloud server, and specifically includes the following steps:
s101: and receiving the mobile terminal identification sent by the mobile terminal.
The mobile terminal is, but not limited to, a smart phone, a tablet personal computer and the like of the user. In the following examples, the mobile terminal is also referred to as a source device.
The mobile terminal identification is, for example, a mobile terminal ID, also referred to as a source device ID, and the recording parameters include, but are not limited to, a current time and a recording duration.
S102: and acquiring a playing terminal identifier which is pre-bound with the mobile terminal identifier, and acquiring a channel identifier of the playing terminal corresponding to the playing terminal identifier.
The playing terminal is, for example, a smart television, a set top box and the like; the playback terminal identification is, for example, a playback terminal ID, which in the following examples is also referred to as target device, and accordingly, as target device ID.
In other examples of the invention, the recording time and the recording duration may also be obtained.
In one embodiment of the present invention, obtaining a playing terminal identifier pre-bound to a mobile terminal identifier, and obtaining a channel identifier corresponding to the playing terminal identifier, includes:
searching a play terminal identifier pre-bound with the mobile terminal identifier, wherein the play terminal identifier is used for identifying different play terminals, namely: the playing terminal identifiers and the playing terminals have a one-to-one correspondence, and further, a unique mobile terminal can be determined through the mobile terminal identifiers;
and acquiring the channel identifier fed back by the playing terminal corresponding to the playing terminal identifier, or searching the channel identifier played by the playing terminal corresponding to the playing terminal identifier.
In this example, the play terminal identity pre-bound to the mobile terminal identity is found; specific examples of the manner of obtaining the channel identifier fed back by the playing terminal corresponding to the playing terminal identifier are as follows:
the cloud server is provided with a multi-screen interaction cloud service and a cloud screen recording service, and the instruction sent by the mobile terminal and received by the multi-screen interaction cloud service comprises the following steps: the source equipment ID, the current time (i.e. the screen recording time) and the recording time (i.e. the screen recording time) are instructed as follows: the method comprises the steps that video record+sourceid (source device ID) +time) +long (recording duration), a multi-screen interaction cloud service searches a bound target device ID according to the source device ID, sends a GetContentId instruction (namely a channel identification acquisition instruction) to the target device ID, acquires a channel ID currently being played by the target device, returns the channel ID to the multi-screen interaction service, sends the instruction, a playing device identification and a live broadcast flat channel identification to the cloud recording service, and sends the instruction, the playing device identification and the live broadcast flat channel identification to the cloud recording service, wherein the method comprises the following steps of: video record+sourceid+DestinationId (Play device identifier) +ContentID (channel identifier) +Time+Long, and enters into the cloud recording flow.
Searching a play terminal identifier pre-bound with the mobile terminal identifier; specific examples of the manner of searching for the channel identifier played by the playing terminal corresponding to the playing terminal identifier are as follows:
when a broadcasting device (such as a set top box) is broadcasting live broadcast, a user presses a screen recording key through a mobile terminal, at this time, the mobile terminal sends an instruction to a multi-screen interaction cloud service, the multi-screen interaction cloud service verifies the bound broadcasting device ID according to a source device ID, then searches a channel ID currently being broadcast by the broadcasting device ID, then sends the instruction, the broadcasting terminal ID and the channel ID to a cloud screen recording service, and enters a cloud screen recording process.
Of course, in other embodiments of the present invention, before recording the video corresponding to the channel identifier, the cloud recording process may also be performed in the following manner. The method comprises the following steps: the channel identification and the playing terminal identification are sent to the mobile terminal, so that the mobile terminal generates an instruction according to the channel identification, the playing terminal identification, the mobile terminal identification and the recording parameter; receiving the instruction sent by the mobile terminal, and recording the video corresponding to the channel identifier according to the instruction, namely: and entering a cloud screen recording process.
Specific examples are as follows: when the playing device plays live broadcast, the user presses the screen recording key on the mobile terminal, and at this time, the mobile terminal firstly sends an instruction for acquiring the channel currently played by the binding large screen (namely, a channel identifier acquisition instruction) and carries the mobile terminal identifier, for example: getContention+source device ID to cloud multi-screen interaction service, cloud multi-screen interaction service verifies the bound target device ID according to the source device ID, the command is forwarded to the target device ID, after receiving the command, the target device returns to the currently playing channel ID, and the mobile terminal is returned to the mobile terminal through the multi-screen interaction cloud service. The mobile terminal sends an instruction to a cloud screen recording service, wherein the instruction comprises: the method comprises the steps of entering a cloud screen recording process, wherein the cloud screen recording process comprises the steps of source equipment ID, target equipment ID, channel ID, current time, screen recording duration and the like.
In the above description, the recording parameters include the recording time and the recording duration, and the recording duration and the recording time are determined by the mobile terminal. For example: the time period of the screen recording determined by the user on the mobile terminal starts to be counted by pressing a button (screen recording button) of a specific area of the screen with a finger, and the screen is cut off by releasing the pressing of the finger, or the time period is fixed for the user to select, for example, 15 seconds, 30 seconds, 60 seconds and the like. The mapping relation between the pressing time and the screen recording time length can be amplified step by step in an equal ratio according to the strength of the pressing screen by the fingers of the user. In a specific example, the screen can set a plurality of levels of pressing force, for example, 3 levels of pressing force are set, the pressing time corresponding to 1 level of pressing force under the default is in a 1:1 relation with the screen recording duration, 2 levels of pressing force pressing time is in a 1:1.5 relation with the screen recording duration, and 3 levels of pressing force pressing time is in a 1:1 relation with the screen recording duration: 2 relation. Of course, the relation between the pressing force and the pressing time and the screen recording time can be set as required. The recording time may be a transmission time of an instruction, for example: the time to start the recording.
In the above example, the mobile terminal identification and the playback device identification need to be pre-bound. Namely: before the playing terminal identification pre-bound with the mobile terminal identification is obtained, the method further comprises the following steps: receiving a playing terminal binding instruction sent by a mobile terminal; and binding the mobile terminal identifier and the playing terminal identifier based on the playing terminal binding instruction.
Take specific examples as examples: the mobile terminal establishes a binding relationship with the playing device. The playing device uploads the unique device identifier (including the playing device ID) to the cloud server to generate a binding two-dimensional code, the two-dimensional code contains the playing device ID, and the playing device displays the two-dimensional code. The mobile terminal accesses the cloud server in a code scanning mode, and carries a unique identifier (including the mobile terminal identifier) of the mobile terminal to send to the cloud server, and the cloud server establishes a binding relationship between the mobile terminal and the playing device.
S103: and recording the video corresponding to the channel identifier.
Of course, in the example of the present invention, the screen recording time length, the screen recording time, etc. may be acquired, and then, the video corresponding to the channel identifier is recorded based on the screen recording time length, the screen recording time, etc.
Specifically, acquiring a screen recording time and a screen recording duration; the recording of the video corresponding to the channel identifier comprises the following steps: determining a screen recording time period according to the screen recording time length and the screen recording time; judging whether the corresponding image frames of the starting time and the ending time of the time period are key frames or not; if not, continuing the image frames of the screen to the first key image frame before the starting time and the first key frame after the ending time of the time period; or obtaining a characteristic label of the user according to the mobile terminal identifier; and calibrating the screen recording time according to the characteristic tag, and recording the video corresponding to the channel identifier according to the calibrated screen recording time.
That is, the screen can be recorded by a cloud screen recording method based on the front-back compensation of the video key frames, and the screen can also be recorded by a screen recording method combining the image characteristics and the personalized characteristic labels of the users.
As a specific example, the cloud screen recording method based on the front-back compensation of the video key frame is as follows:
the cloud screen recording service intercepts according to the time of a certain period (namely screen recording duration) before the current time in the instruction, specifically intercepts a key frame interception mode of time reverse sequence, in order to ensure the integrity of intercepted video, as shown in fig. 2, adopts key frame delay compensation and advance compensation modes, for example, the current time point is a non-key frame, and intercepts the next key frame when intercepting; and if the target time point of the interception is also a non-key frame, intercepting the key frame before the interception target time point is ended.
Further, when the video corresponding to the channel identifier is recorded, the method further comprises the following steps: based on a clock protocol SNTP or a time protocol PTP, the screen recording time of the cloud server and the time of the channel currently being played by the playing terminal are synchronized. Specifically, as shown in fig. 3, the cloud screen recording service and the live broadcast source station are deployed in a centralized manner, and each live broadcast stream is separated from a single point of the live broadcast source station to perform the screen recording service independently of the normal CDN service. Because the live broadcast picture seen by the user at the large screen end is distributed through the CDN distribution network, the live broadcast stream of the CDN service and the live broadcast stream of the video recording service are in time synchronization, and the time synchronization of the live broadcast stream seen by the user and the video recording stream is ensured. The time synchronization adopts: simple network clock protocol (SNTP) approach. SNTP is the most common Internet time transmission protocol, is also the intra-station time synchronization specification selected from DL/T860, namely a transformer substation communication network and system, belongs to the TCP/IP protocol family, and is a synchronization mode based on a software protocol; IEC 615880 Precision Time Protocol (PTP). IEC 61588 integrates multiple technologies such as network communication, local computation and distributed objects, is applicable to all distributed systems communicating through a local area network supporting multicasting, and can realize sub-microsecond synchronization.
The method for recording the screen by combining the image features and the personalized feature labels of the users comprises the following steps:
as shown in fig. 4, after receiving the screen recording instruction, the cloud screen recording service verifies the personalized tags of the user according to the user center of the mobile terminal ID, the personalized tags of the user are classified into content type preference feature tags (such as movie a001, television drama a002, variety a03, child a004, sports a005, cartoon a006, fashion a007, etc.), character preference feature tags (such as star one b00001, star two b00005, star three b01001, star four b10001, etc.), plot preference feature tags (such as car c0001, fight c0002, laughter c1000, shooting c1001, swimming c 0003), and unified codes are performed for these feature tags, and the user center returns the user feature tags according to the mobile terminal ID: a001|a005: b00001|b10001: c0001|c0002, the cloud screen recording service extracts the characteristics of the video picture and uniformly uses the characteristic library characteristic label to carry out coding identification when recording the video, for example: the video of 10 seconds-20 seconds is a001: b00001: c0001 feature tag, after the cloud screen recording service receives the user personalized screen recording instruction, matching the feature tag of the video segment with the user personalized feature tag, in this example, when more than two tags are matched, the video segment is considered to accord with the feature attribute of the user, the cloud screen recording service intelligently recognizes the recording requirement of the user, and helps the user record the video segment and automatically calibrate the recording time interval. When the matching is less than two feature labels, the cloud system does not start intelligent matching automatic calibration, and recording is still carried out according to the screen recording time period of the user.
According to the live broadcast screen recording method, the mobile terminal is used for controlling the cloud server to record the live broadcast screen in the playing device, the playing terminal is not required to record the screen, resources of the playing terminal are not occupied, and sharing is facilitated through the mobile terminal after the screen recording. In addition, through the mode of controlling the cloud server to record, compare in prior art playback earlier, two operation record screen modes of recording again and simplify and to be one step of operation alright realize recording, and compare traditional in order the time record screen, the restriction that the live picture is recorded the screen in the past need not to play back earlier and record the screen again, can directly trace back the picture in the past and accomplish the record screen from the current time year reverse time, has simplified user's operation, and then, promotes the user experience of recording the screen.
In one embodiment of the present invention, after the screen recording of the cloud server is completed, the method further includes: performing code rate conversion on the recorded video so that the mobile terminal previews and edits the converted video; and after the mobile terminal completes editing the video, generating a sharing link.
Specifically, the cloud screen recording service transcodes the intercepted video clip into a code rate for previewing by the mobile terminal, so that the mobile terminal previews and edits. After the cloud screen recording service generates a screen recording video previewed by the mobile terminal, a preview editor is directly built on the cloud server, a user directly accesses the cloud video editor through the mobile terminal to edit the video again, the video is intercepted again, watermarked and specially-effective by dragging a progress bar, and finally the video with the final effect is generated again. And the video after the re-editing is regenerated into the video with the final effect for previewing, and the video is selected and released after the previewing is finished, and the cloud server generates a sharing link address for the final video. And after the user determines, downloading the video clipped by the cloud server to the local, and then storing or sharing again.
Fig. 5 shows a schematic structural diagram of a live video recording device according to an embodiment of the present invention, where, as shown in fig. 5, the live video recording device according to an embodiment of the present invention includes: a receiving module 510, an obtaining module 520 and a recording module 530. Wherein:
a receiving module 510, configured to receive a mobile terminal identifier sent by a mobile terminal;
the obtaining module 520 is configured to obtain a playing terminal identifier that is pre-bound to the mobile terminal identifier, and obtain a channel identifier of the playing terminal corresponding to the playing terminal identifier;
the recording module 530 is configured to record a video corresponding to the channel identifier.
According to the live broadcast screen recording device, the mobile terminal is used for controlling the cloud server to record live broadcast in the playing equipment, the playing terminal is not required to record the screen, resources of the playing terminal are not occupied, and sharing is facilitated through the mobile terminal after the screen recording. In addition, through the mode of controlling the cloud server to record, compare in prior art playback earlier, two operation record screen modes of recording again and simplify and to be one step of operation alright realize recording, and compare traditional in order the time record screen, the restriction that the live picture is recorded the screen in the past need not to play back earlier and record the screen again, can directly trace back the picture in the past and accomplish the record screen from the current time year reverse time, has simplified user's operation, and then, promotes the user experience of recording the screen.
It should be noted that, the specific implementation manner of the live broadcast screen recording device in the embodiment of the present invention is similar to the specific implementation manner of the live broadcast screen recording method in the embodiment of the present invention, please refer to the description of the method section specifically, and in order to reduce redundancy, details are not repeated here.
Based on the same inventive concept, a further embodiment of the present invention provides an electronic device, see fig. 6, comprising in particular: a processor 601, a memory 602, a communication interface 603 and a communication bus 604;
wherein the processor 601, the memory 602, and the communication interface 603 complete communication with each other through the communication bus 604; the communication interface 603 is used for implementing information transmission between devices;
the processor 601 is configured to invoke a computer program in the memory 602, where the processor executes the computer program to implement all the steps of the live video recording method, for example, the processor executes the computer program to implement the following steps: receiving a mobile terminal identifier sent by a mobile terminal; acquiring a playing terminal identifier which is pre-bound with the mobile terminal identifier, and acquiring a channel identifier of a playing terminal corresponding to the playing terminal identifier; and recording the video corresponding to the channel identifier.
Based on the same inventive concept, a further embodiment of the present invention provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements all the steps of the live video recording method described above, for example, the processor implementing the following steps when executing the computer program: receiving a mobile terminal identifier sent by a mobile terminal; acquiring a playing terminal identifier which is pre-bound with the mobile terminal identifier, and acquiring a channel identifier of a playing terminal corresponding to the playing terminal identifier; and recording the video corresponding to the channel identifier.
Further, the logic instructions in the memory described above may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment of the invention. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on such understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the index monitoring method described in the respective embodiments or some parts of the embodiments.
Furthermore, in the present disclosure, such as "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
Moreover, in the present invention, 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Furthermore, in the description herein, reference to the terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.