CN111954022B - Video playing method and device, electronic equipment and readable storage medium - Google Patents
Video playing method and device, electronic equipment and readable storage medium Download PDFInfo
- Publication number
- CN111954022B CN111954022B CN202010833560.0A CN202010833560A CN111954022B CN 111954022 B CN111954022 B CN 111954022B CN 202010833560 A CN202010833560 A CN 202010833560A CN 111954022 B CN111954022 B CN 111954022B
- Authority
- CN
- China
- Prior art keywords
- target
- video stream
- playing
- live
- player
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 238000009877 rendering Methods 0.000 claims abstract description 27
- 230000008569 process Effects 0.000 claims abstract description 26
- 238000012549 training Methods 0.000 claims description 10
- 238000004891 communication Methods 0.000 claims description 5
- 238000001514 detection method Methods 0.000 claims description 5
- 238000003062 neural network model Methods 0.000 claims description 5
- 239000012634 fragment Substances 0.000 claims description 3
- 230000000694 effects Effects 0.000 abstract description 9
- 238000010586 diagram Methods 0.000 description 5
- 230000002147 killing effect Effects 0.000 description 5
- 230000008859 change Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000004313 glare Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/21—Server components or server architectures
- H04N21/218—Source of audio or video content, e.g. local disk arrays
- H04N21/2187—Live feed
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/44012—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving rendering scenes according to scene graphs, e.g. MPEG-4 scene graphs
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/472—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
- H04N21/47202—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for requesting content on demand, e.g. video on demand
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/845—Structuring of content, e.g. decomposing content into time segments
- H04N21/8456—Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The application provides a video playing method, a video playing device, an electronic device and a readable storage medium, wherein in the process of playing a current video stream in a current playing mode through a current player, if a switching operation of switching the current playing mode to a target playing mode is detected, an operation of acquiring the target video stream is executed through the target player. And after the video frame of the previous preset frame of the target video stream is obtained, closing the current player, and rendering and playing the target video stream in a target playing mode through the target player. Therefore, the two players can be utilized, after the first few frames of video frames of the target video stream are successfully obtained, the current player is converted into the target player to play, switching traces between pictures in two play modes can be avoided, and the effect of smoothly switching the play modes is achieved.
Description
Technical Field
The invention relates to the technical field of network live broadcast, in particular to a video playing method and device, electronic equipment and a readable storage medium.
Background
In the application of live network, such as live game, live entertainment program, live news, etc., a user may need to play back live content while watching live content, and accordingly may have a need to switch back from the playback mode to the live mode after watching the played back content. Therefore, in this process, switching operation between the live mode and the playback mode is often involved many times. At present, when switching between a live mode and a playback mode is carried out, obvious switching traces often exist, and seamless and smooth switching under different play modes is difficult to realize.
Disclosure of Invention
The invention provides a video playing method, a video playing device, an electronic device and a readable storage medium, which can realize smooth switching between different playing modes.
Embodiments of the invention may be implemented as follows:
in a first aspect, an embodiment of the present invention provides a video playing method, where the method includes:
in the process of playing the current video stream in the current playing mode through the current player, if the switching operation of switching the current playing mode to the target playing mode is detected, executing the operation of acquiring the target video stream through the target player;
and after the video frame of the previous preset frame of the target video stream is obtained, closing the current player, and rendering and playing the obtained target video stream in the target playing mode through the target player.
In an optional embodiment, the current video stream is a live video stream, and the current player is a live player;
the method further comprises the following steps:
and after the target playing mode is switched, when the preset updating condition is detected to be met, acquiring a live video stream corresponding to the updating condition through the live player.
In an optional embodiment, the step of acquiring, by the live player, a live video stream corresponding to a preset update condition when it is detected that the preset update condition is satisfied includes:
and after the obtained target video stream is detected to be played, obtaining the playing time interval of the target video stream, and obtaining the live video stream generated in the playing time interval through the live player.
In an alternative embodiment, the method further comprises:
and after the obtained target video stream is detected to be played, rendering and playing the obtained live video stream in the target playing mode through the target player.
In an optional embodiment, the step of acquiring, by the live player, a live video stream corresponding to a preset update condition when it is detected that the preset update condition is satisfied includes:
detecting whether an internal switching operation is generated in the playing process of the target video stream, wherein the internal switching operation is a switching operation of switching playing points executed in the same target playing mode;
and if the internal switching operation is detected, acquiring a live broadcast video stream generated in a time interval corresponding to the internal switching operation through the live broadcast player.
In an optional implementation manner, the step of obtaining, by the live player, a live video stream generated in a time interval corresponding to the internal switching operation if the internal switching operation is detected includes:
if the detected number of times of the internal switching operation is one, obtaining a time interval between the internal switching operation and the switching operation for switching the current playing mode to the target playing mode;
if the detected number of times of the internal switching operation is more than or equal to two times, obtaining a time interval between two adjacent internal switching operations;
and acquiring the live video stream generated in the time interval through the live player.
In an alternative embodiment, the step of rendering and playing the obtained target video stream in the target play mode by the target player includes:
obtaining a switching position pointed by the switching operation, and obtaining a target video clip corresponding to the switching position in the target video stream;
obtaining a target video frame corresponding to the switching position in the target video clip;
and decoding the target video fragment in the target playing mode through the target player, and starting to perform rendering and playing operations when the target video frame is decoded.
In an optional embodiment, the live video stream comprises a plurality of frames of video, and the method further comprises:
obtaining a target video frame with a target object in the live video stream;
importing each target video frame into a dotting model obtained by pre-training, and outputting description information of each target video frame;
and aiming at each target video frame, acquiring the position information of the target video frame in the live video stream, and identifying a dotting label at a position corresponding to the position information on a playing interface, wherein the dotting label is used for expanding the description information of the target video frame.
In an alternative embodiment, the method further comprises:
and when the trigger operation aiming at any one of the dotting labels is detected, displaying the description information corresponding to the dotting label.
In an alternative embodiment, the target objects include character objects and scene objects;
the dotting model is obtained by utilizing a plurality of sample templates to train the constructed neural network model in advance, and the sample templates are a plurality of images formed by the same character object under different scene objects.
In a second aspect, an embodiment of the present invention provides a video playing apparatus, where the apparatus includes:
the detection module is used for executing the operation of acquiring the target video stream through the target player if the switching operation of switching the current playing mode to the target playing mode is detected in the process of playing the current video stream in the current playing mode through the current player;
and the playing module is used for closing the current player after the video frame of the previous preset frame of the target video stream is obtained, and rendering and playing the obtained target video stream in the target playing mode through the target player.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes one or more storage media and one or more processors in communication with the storage media, where the one or more storage media store machine-executable instructions executable by the processors, and when the electronic device runs, the processors execute the machine-executable instructions to perform the video playing method described in any one of the foregoing embodiments.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores machine-executable instructions, and the machine-executable instructions, when executed, implement the video playing method described in any one of the foregoing embodiments.
The beneficial effects of the embodiment of the invention include, for example:
according to the video playing method, the video playing device, the electronic equipment and the readable storage medium, in the process of playing the current video stream through the current player in the current playing mode, if the switching operation of switching the current playing mode to the target playing mode is detected, the operation of acquiring the target video stream is executed through the target player. And after the video frame of the previous preset frame of the target video stream is obtained, closing the current player, and rendering and playing the target video stream in a target playing mode through the target player. Therefore, the two players can be utilized, after the first few frames of video frames of the target video stream are successfully obtained, the current player is converted into the target player to play, switching traces between pictures in two play modes can be avoided, and the effect of smoothly switching the play modes is achieved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is an application scene diagram of a video playing method provided in an embodiment of the present application;
fig. 2 is a flowchart of a video playing method according to an embodiment of the present application;
fig. 3 is a flowchart of a dotting and marking method in the video playing method provided in the embodiment of the present application;
FIG. 4 is a schematic illustration of a dotting mark provided by an embodiment of the present application;
fig. 5 is a schematic diagram of dotting mark display information provided in the embodiment of the present application;
fig. 6 is a flowchart of a rendering playing method in a video playing method provided in the embodiment of the present application;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present disclosure;
fig. 8 is a functional block diagram of a video playback device according to an embodiment of the present application.
Icon: 100-live broadcast providing terminal; 200-a live broadcast server; 300-a live broadcast receiving terminal; 110-a storage medium; 120-a processor; 130-video playing means; 131-a detection module; 132-a play module; 140-communication interface.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Referring to fig. 1, a schematic view of a possible application scenario of the video playing method according to the embodiment of the present application is shown, where the scenario includes a live broadcast providing terminal 100, a live broadcast server 200, and a live broadcast receiving terminal 300. The live broadcast server 200 is in communication connection with the live broadcast providing terminal 100 and the live broadcast receiving terminal 300, respectively, and is configured to provide live broadcast services for the live broadcast providing terminal 100 and the live broadcast receiving terminal 300. For example, the live broadcast providing terminal 100 may transmit a live video stream to the live broadcast server 200, and the viewer may access the live broadcast server 200 through the live broadcast receiving terminal 300 to view the live video.
The live video stream pushed by the live server 200 may be a video stream currently live in a live platform or a complete video stream formed after the live broadcast is completed.
It is understood that the scenario shown in fig. 1 is only one possible example, and in other possible embodiments, the scenario may include only a part of the components shown in fig. 1 or may also include other components.
In this embodiment, the live broadcast providing terminal 100 and the live broadcast receiving terminal 300 may be, but are not limited to, a smart phone, a personal digital assistant, a tablet computer, a personal computer, a notebook computer, a virtual reality terminal device, an augmented reality terminal device, and the like.
The live broadcast providing terminal 100 and the live broadcast receiving terminal 300 may have internet products installed therein for providing live broadcast services of the internet, for example, the internet products may be applications APP, Web pages, applets, etc. related to live broadcast services of the internet used in a computer or a smart phone.
In this embodiment, a video capture device for capturing the anchor video frame may be further included in the scene, and the video capture device may be, but is not limited to, a camera, a lens of a digital camera, a monitoring camera, a webcam, or the like.
The video capture device may be directly installed or integrated in the live broadcast providing terminal 100. For example, the video capture device may be a camera configured on the live broadcast providing terminal 100, and other modules or components in the live broadcast providing terminal 100 may receive videos and images transmitted from the video capture device via the internal bus. Alternatively, the video capture device may be independent of the live broadcast providing terminal 100, and the two may communicate with each other in a wired or wireless manner.
Fig. 2 is a flowchart illustrating a video playing method provided in an embodiment of the present application, where the video playing method can be executed by the live broadcast receiving terminal 300 shown in fig. 1. It should be understood that, in other embodiments, the order of some steps in the video playing method of this embodiment may be interchanged according to actual needs, or some steps may be omitted or deleted. The detailed steps of the video playing method are described as follows.
Step S210, in the process of playing the current video stream in the current playing mode through the current player, if a switching operation of switching the current playing mode to the target playing mode is detected, an operation of acquiring the target video stream is executed through the target player.
Step S220, after obtaining the video frame of the previous preset frame of the target video stream, closing the current player, and rendering and playing the obtained target video stream in the target playing mode through the target player.
In this embodiment, taking an application scenario in which a main broadcast performs live broadcast as an example, such as main broadcast video live broadcast, main broadcast game live broadcast, and the like, the live broadcast providing terminal 100 sends a live broadcast video stream to the live broadcast server 200, and the live broadcast receiving terminal 300 can obtain the live broadcast video stream from the live broadcast server 200, thereby implementing watching of the main broadcast live broadcast.
During the process of watching the live video, the viewer may be interested in the live content that has been finished before, and needs to return to play back the content, so that at this time, the live mode needs to be switched to the playback mode. After the viewing of the played back content is finished, if the live content needs to be viewed continuously, the playback mode needs to be switched to the live mode.
In this embodiment, two players are used in the live platform to respectively control operations such as video stream acquisition and play control in different modes.
In a possible implementation manner, the current player may be a live player, the current play mode may be a live play mode, the current video stream may be a live video stream, the target player may be a playback player, the target play mode is a playback play mode, and the target video stream may be a playback video stream.
In the process of playing a live video stream in a live play mode, it is detected whether a switching operation for switching the live play mode to a playback play mode exists, for example, a play progress bar is provided on a play interface, and a user can trigger the playback switching operation by dragging the progress bar back. And if the switching operation that the live broadcast mode needs to be switched to the playback mode is detected, executing the operation of acquiring the playback video stream through the playback player.
After the playback player successfully obtains the first preset frame video frame of the playback video stream, for example, the first frame video frame, or the first two frames video frame, the live broadcast player may be turned off, and the obtained playback video stream is rendered and played in the playback play mode through the playback player.
It should be noted that the playback video stream depends on the live video stream, that is, the obtained live video stream can become a video source of the playback video stream after the playback is completed. For example, after three hours of live broadcast, the video stream acquired from the live broadcast server 200 within the three hours is a live video stream. If the switching operation is detected at this time, and the playback needs to be switched to the time one hour before the current time for playback, the video stream one hour after the three hours obtained before is the playback video stream needing to be obtained. The video stream within the latter hour is acquired by the playback player as the playback video stream.
As another possible implementation manner, the current player may be a playback player, the current play mode may be a playback play mode, the current video stream may be a playback video stream, and the target player may be a live player, the target play mode may be a live play mode, and the target video stream may be a live video stream.
When playing of a playback video stream is performed in a playback play mode, whether a switching operation is required to switch the playback play mode to a live play mode is detected. For example, the user may trigger the switching operation by pushing the progress bar on the play interface to the far right. And if the switching operation is detected, executing the operation of acquiring the live video stream through the live player.
And after the live broadcast player successfully obtains the video frame of the previous preset frame of the live broadcast video stream, closing the playback player, and rendering and playing the obtained live broadcast video stream in a live broadcast mode through the live broadcast player.
In this embodiment, in the above manner, the two players are used to respectively perform acquisition and play control of video streams in different play modes, so that when switching between different modes, after a video frame of a previous preset frame of a target video stream is successfully acquired, the current player is closed, and the target player performs rendering play of the target video stream. Switching traces existing in the switching of different playing modes can be effectively avoided, and smooth switching among different playing modes is realized.
In this embodiment, the user often has a requirement for playing back historical highlight content in live broadcast, for example, taking live game as an example, the user often is interested in content such as killing and breaking through of game characters, and needs to play back the part of the content. Therefore, in order to facilitate the user to quickly identify the content, in this embodiment, dotting marks may be further performed on the highlight live content, and optionally, in the process of performing live video stream playing in the live play mode through the live player, description information of a corresponding video frame may be obtained by identifying each video frame of the live video stream, and a dotting label used for displaying the description information is marked at a corresponding position of the video frame in the live video stream on the play interface. Referring to fig. 3, in the present embodiment, the process can be implemented by the following steps:
step S310, obtaining a target video frame with a target object in the live video stream.
Step S320, importing each target video frame into a pre-trained dotting model, and outputting description information of each target video frame.
Step S330, aiming at each target video frame, obtaining the position information of the target video frame in the live video stream, and marking a dotting label at a position corresponding to the position information on a playing interface, wherein the dotting label is used for expanding the description information of the target video frame.
In this embodiment, the live video stream includes a plurality of video frames, wherein some of the video frames include, for example, click images between game characters, and some of the video frames only include scene images. The content which is interesting to the user and may need to be played back is often a video segment with a game character, so in this embodiment, a target video frame with a target object can be determined from a plurality of video frames of a live video stream in an image recognition manner. The target object may include, for example, a game character, a killing scene image, and the like.
In order to facilitate the user to know the content in each target video frame at a glance, in this embodiment, the target video frame may be further identified to obtain description information that may be used to describe the information content mainly characterized in the target video frame.
In this embodiment, the description information of the target video frame is obtained by importing the target video frame into a dotting model obtained by pre-training. For example, when the target video frame includes the game character a, the game character B, and the image of the killing action therebetween, the obtained description information of the target video frame may be, for example, the text description information of "the game character a kills the game character B", or may be described in the form of a brief avatar or symbol, for example, the description information includes the avatar of the game character a, the avatar of the game character B, and a mark between the two avatars that can represent the killing action. Of course, besides the above description, other description may be adopted, and it is sufficient to briefly describe the main content of the target video frame.
On the basis, the position of each target video frame in the live video stream can be obtained, and the position can be the target video frame which is the number-th video frame in the live video stream. For example, for a certain target video frame, if the target video frame is the 100 th video frame in the live video stream, the position of the target video frame in the live video stream is characterized by the 100 th video frame.
In this embodiment, a play progress bar may be included in the play interface, and based on the position of each target video frame in the live video stream, a position that can point to each target video frame may be determined on the play progress bar. For example, the current live video stream contains 200 video frames in total, and for a target video frame of the 100 th video frame in the live video stream, the middle position in the play progress bar corresponds to the target video frame. A dotting tag corresponding to the target video frame may be marked at the intermediate position, and the dotting tag may be used to expand the description information of the target video frame.
Optionally, the dotting label is marked on the progress bar on the playing interface in the form of a marked point (e.g. a circular point, a square point, etc.) without being triggered, as shown in fig. 4. Taking the live broadcast receiving terminal 300 as a personal computer as an example, when the user clicks the dotting tag with a mouse (or the mouse stays at the dotting tag), that is, when a trigger operation for any one of the plurality of dotting tags is detected, the description information corresponding to the dotting tag may be displayed, for example, a word of "game character a kills game character B" is displayed, as shown in fig. 5. Therefore, the user can conveniently know that the content mainly displayed by the target video frame is the killing between the game character A and the game character B.
In this embodiment, the target video frame in the live video stream is identified, the description information of the target video is obtained, and then the mark of the dotting label is performed at the corresponding position of the live interface according to the position of the target video frame in the live video stream, so that when the user clicks the dotting label, the corresponding description information can be displayed, and thus, the main content of the target video frame is described and displayed. Therefore, the problem that the existing video frames are only displayed and described in a thumbnail mode or a screenshot mode, the display effect is not direct, and the user cannot know the scene content conveniently can be solved.
In this embodiment, the dotting model is a model that is trained in advance to obtain description information describing a motion of the target object in the image. In an actual application scene, a target object may be in a plurality of different scenes, and the existing plurality of different scenes may affect the recognition effect, for example, scenes such as character ID occlusion, size change, incomplete fixation of character position, glare special effect, occlusion special effect, and the like.
Therefore, in order to be able to further accurately recognize the specific human object and the motion thereof on the basis of recognizing the target object, in the present embodiment, the above-mentioned different situations may be taken as different scene objects. The dotting model can be obtained by utilizing a plurality of sample templates to train the constructed neural network model in advance, and the sample templates can be a plurality of images formed by the same character object under different scene objects. For example, taking person object a as an example, person object a may appear under scene object a (glare effect), under scene object B (occlusion effect), under scene object C (abrupt size change), and so on. When training the dotting model, an image of the person object a under the scene object a, an image of the person object a under the scene object B, and multiple images of the person object a under the scene object C may be obtained respectively. And then training the dotting model by using the obtained multiple images. And further, the recognition accuracy of the dotting model obtained by training under different scenes is improved.
In this embodiment, when the obtained image is used to train the dotting model, image data enhancement processing may be performed in advance in manners such as image cropping, random contrast, and brightness change, and then training of the dotting model may be performed using the enhanced image.
In addition, in this embodiment, when the dotting model is trained by using samples in advance, if the accuracy of the output result obtained by the samples is low due to image blur, scene ambiguity, and the like, a video frame adjacent to the sample in the video stream may be used as the sample for training, because in this case, the scene in the adjacent video frame generally has a better recognition condition. Therefore, the recognition accuracy of the trained dotting model can be improved.
In this embodiment, in the process of obtaining a target video frame with a target object in a live video stream, the target video frame can be obtained by using a recognition model obtained based on neural network model training. The recognition model can be mainly used for recognizing whether a person avatar exists in the video frame or not, and if the person avatar exists, the target object can be determined to exist.
In this embodiment, in consideration of the fact that there are many character objects to be recognized in an actual application scene, a general model structure of a dotting model for obtaining description information such as specific character object information and motion information thereof is complicated. In order to avoid performing recognition processing on each frame of video frames in the live video stream by using the more complex dotting model, in this embodiment, the recognition model is first used to screen out video frames in which a target object exists among a plurality of video frames. After the identification model screens out the video frames with the target object, the dotting model obtains the description information about the target object.
Therefore, the identification model only needs to identify whether the target object exists in the video frames, the network structure of the identification model can be simpler, and only people like head portraits need to be identified, so that the operation amount overhead when the video frames with the target object are screened out from a large number of video frames of the live video stream can be reduced.
In this embodiment, in a live broadcast mode, a user may obtain description information of a plurality of target video frames based on the obtained dotting label of the progress bar on the play interface, and if it is required to switch to a playback mode, the progress bar may be dragged back to trigger playback switching.
In order to facilitate normal switching to the live mode after the playback of the obtained playback video stream is finished, the live player can acquire and store the live video stream after the playback is finished or during the playback. Therefore, after the live broadcast mode is switched to the target broadcast mode (playback broadcast mode), when the preset update condition is detected to be met, the live broadcast player acquires the live broadcast video stream corresponding to the update condition.
As a possible implementation manner, the preset update condition may be that, after it is detected that the obtained target video stream is played, in this case, a playing period of the target video stream is obtained, and the live video stream generated in the playing period is obtained by the live player. In this embodiment, the format of the live video stream may be m3u8 list format, in which a plurality of video clips (e.g., TS media clips) are composed. The process of acquiring a live video stream is the process of updating its m3u8 list.
On the basis, after the obtained target video stream is detected to be played, the obtained live video stream can be rendered and played in a target playing mode through the target player.
For example, if a live video stream is played from 0 point to 2 points, a switching operation of switching the live play mode to the playback play mode is detected at 2 points, and the switching operation triggers playback of the content between 1 point and 2 points. The acquisition of the playback video stream between 1 point and 2 points is performed by the playback player. And after the video frame of the previous preset frame of the playback video stream in the period of time is successfully obtained, closing the current live broadcast player, and rendering and playing the playback video stream in a playback playing mode through the playback player.
After the playback video stream obtained as described above is played to the end, the playing period of the playback video stream should be from 2 to 3 points, and therefore, a live video stream in the playing period between 2 to 3 points can be acquired by a live player. If the user does not switch the playback play mode to the live play mode at this time, the obtained live video stream between the 2 point and the 3 point is continuously used as the playback video stream for playback. Namely, the obtained live video stream is rendered and played in a playback play mode through a playback player. In this way, the continuous playing of the video can be automatically realized after the playing of the obtained playback video stream is finished.
If the user performs a switching operation of switching the playback play mode to the live play mode after the playback video stream is played, for example, dragging the progress bar on the play interface to the rightmost end, the live player acquires the live video stream starting from the point 3, and plays the live video stream starting from the point 3 through the live player.
In this embodiment, in the above manner, if the user does not perform other operations in the whole playback process, the live video stream may be acquired after the playback process is finished. Therefore, the problems of frequent data interaction and excessive network resource occupation existing in the process of uninterruptedly and repeatedly acquiring data from the server can be solved.
In another implementation, the detecting whether the preset update condition is satisfied may be detecting whether an internal switching operation is generated in the playing process of the target video stream, where the internal switching operation is a switching operation performed in the same target playing mode to switch a playing point. For example, the target play mode is a playback mode, that is, the internal switching operation is a playback switching operation performed again by the user in the playback play mode.
And if the internal switching operation is detected to exist, acquiring the live broadcast video stream generated in the time interval corresponding to the internal switching operation through the live broadcast player.
If the detected number of times of the internal switching operation is one, obtaining a time interval between the internal switching operation and a switching operation for switching the current playing mode to the target playing mode. The resulting live video stream is then obtained for the time interval.
And if the number of times of the internal switching operation is detected to be two or more, acquiring a time interval between two adjacent internal switching operations, and acquiring a live video stream generated in the time interval.
For example, live broadcasting is performed from 0 point to 2 points, and if the user triggers a switching operation at 2 points, the switching operation is used to perform playback of content between 1 point and 2 points. If the user has already watched the playback content from 1 point to 1 point, the playback switching operation is triggered, and in order to implement that each switching operation of the user is executed based on the latest live video stream, when the playback switching operation is detected again, the latest live video stream needs to be acquired. I.e. the live player gets a live video stream from 2 point to 2 point ten. And performing playback positioning of the playback switching operation again based on the obtained updated live video stream.
Similar to the above principle, if multiple internal switching operations are performed during playback, for a certain internal switching operation, a time interval between two adjacent internal switching operations can be obtained, and then a live video stream in the time interval can be obtained by a live player.
In this embodiment, generally, when a live video stream (an m3u8 list of a video stream) is updated on a terminal, one end of a server sets a corresponding update rule, for example, sets two preset durations, a first preset duration and a second preset duration, where the first preset duration may be two hours and the second preset duration may be ten minutes. When the live video stream is sent, the first preset time length and the second preset time length can be used as a sending unit.
For example, if the span of the internal switching operation satisfies a first preset duration, for example, two hours, when the live video stream is updated, the live video stream within the first preset duration may be obtained from the server. If the time interval from the last live video stream update does not exceed the second preset time length, for example, 10 minutes, during the internal switching operation, only the live video stream within the second preset time length may be acquired. Therefore, the problem of resource consumption of the terminal and the server caused by the fact that the first preset time length is required to be used as a unit for acquiring the live video stream every time can be solved.
In this embodiment, the playback video stream contains a plurality of video segments, and each video segment contains a plurality of video frames. Each video clip is used as the minimum unit of video playing, that is, the decoding playing is started from the first video frame of each video clip, but the decoding playing cannot be started from one of the video frames in the video clip directly. In this case, there may be a problem that, for example, the user switches to the playback mode by dragging the progress bar, and if the user drags the progress bar to an intermediate position, it indicates that the user wants to perform playback from the intermediate position. In fact, there is a possibility that the middle position corresponds to a certain video frame inside the video clip, and when the video playback is performed, if the decoding and playing are started from the first video frame of the video clip, there will be a deviation between the starting video frame of the playback and the playback video frame designated by the user.
In this embodiment, when the target player renders and plays the obtained target video stream in the target play mode, the target player may decode the target video stream to the video frame by determining the video frame actually corresponding to the switching operation of the user in the target video stream, and then perform the rendering and playing operation. Referring to fig. 6, the process is implemented by:
step S610, obtaining a switching position pointed by the switching operation, and obtaining a target video clip corresponding to the switching position in the target video stream.
Step S620, obtaining a target video frame corresponding to the switching position in the target video clip.
Step S630, decoding the target video segment in the target playing mode by the target player, and starting to perform rendering and playing operations when the target video frame is decoded.
In this embodiment, a switching position to which a switching operation initiated by a user is directed is obtained, for example, the switching position to which the user is directed is a middle position of a current progress bar. After the playback video stream is obtained, a target video segment corresponding to the switching position is obtained accordingly, for example, a first video segment included in the playback video stream.
And the target video clip comprises a plurality of video frames, so that a target video frame specifically corresponding to the switching position is further obtained, for example, the second video frame in the target video clip.
When the playback is performed in the playback play mode by the playback player, similarly, decoding is started from a first video frame (e.g., I frame) of the target video segment, and if the first video frame is not the target video frame, the first video frame is only decoded and is not played in a rendering manner. And when the target video frame, such as the second video frame, is decoded, the operation of rendering and playing is started again.
In this way, although the first video frame is decoded, the rendering and playing are not performed, and the content of the first video frame is not shown to the user, but is shown to the user by starting playing from the second video frame. In this way, the switching position performed by the user is the same as the actual play point that is finally presented to the user.
Referring to fig. 7, a schematic diagram of exemplary components of an electronic device according to an embodiment of the present application is provided, where the electronic device may be the live broadcast receiving terminal 300 shown in fig. 1. The electronic device may include a storage medium 110, a processor 120, a video playback device 130, and a communication interface 140. In this embodiment, the storage medium 110 and the processor 120 are both located in the electronic device and are separately disposed. However, it should be understood that the storage medium 110 may be separate from the electronic device and may be accessed by the processor 120 through a bus interface. Alternatively, the storage medium 110 may be integrated into the processor 120, for example, may be a cache and/or general purpose registers.
The video playing apparatus 130 may be understood as the electronic device or the processor 120 of the electronic device, or may be understood as a software functional module that is independent of the electronic device or the processor 120 and implements the video playing method under the control of the electronic device.
As shown in fig. 8, the video playing apparatus 130 may include a detecting module 131 and a playing module 132. The functions of the functional modules of the video playing apparatus 130 are described in detail below.
The detecting module 131 is configured to, in a process of playing a current video stream in a current playing mode through a current player, execute an operation of acquiring a target video stream through the target player if a switching operation of switching the current playing mode to a target playing mode is detected.
It is understood that the detection module 131 can be used to perform the step S210, and for the detailed implementation of the detection module 131, reference can be made to the above-mentioned content related to the step S210.
A playing module 132, configured to close the current player after obtaining the video frame of the previous preset frame of the target video stream, and render and play the obtained target video stream in the target playing mode through the target player.
It is understood that the playing back module 132 can be used to execute the step S220, and the detailed implementation of the playing back module 132 can refer to the content related to the step S220.
In a possible implementation manner, the current video stream is a live video stream, the current player is a live player, and the video playing apparatus 130 further includes an updating module, configured to:
and after the target playing mode is switched, when the preset updating condition is detected to be met, acquiring a live video stream corresponding to the updating condition through the live player.
In a possible implementation manner, the update module is configured to obtain a live video stream by:
and after the obtained target video stream is detected to be played, obtaining the playing time interval of the target video stream, and obtaining the live video stream generated in the playing time interval through the live player.
In one possible implementation manner, the video playing apparatus 130 further includes a resume module, and the resume module is configured to:
and after the obtained target video stream is detected to be played, rendering and playing the obtained live video stream in the target playing mode through the target player.
In a possible implementation manner, the update module may be configured to obtain a live video stream by:
detecting whether an internal switching operation is generated in the playing process of the target video stream, wherein the internal switching operation is a switching operation of switching playing points executed in the same target playing mode;
and if the internal switching operation is detected, acquiring a live broadcast video stream generated in a time interval corresponding to the internal switching operation through the live broadcast player.
In a possible implementation manner, when the update module detects an internal switching operation, the update module may obtain a live video stream in the following manner:
if the detected number of times of the internal switching operation is one, obtaining a time interval between the internal switching operation and the switching operation for switching the current playing mode to the target playing mode;
if the detected number of times of the internal switching operation is more than or equal to two times, obtaining a time interval between two adjacent internal switching operations;
and acquiring the live video stream generated in the time interval through the live player.
In one possible implementation, the target video stream includes a plurality of video segments, each of the video segments includes a plurality of video frames, and the playing module 132 may be configured to render and play the target video stream by:
obtaining a switching position pointed by the switching operation, and obtaining a target video clip corresponding to the switching position in the target video stream;
obtaining a target video frame corresponding to the switching position in the target video clip;
and decoding the target video fragment in the target playing mode through the target player, and starting to perform rendering and playing operations when the target video frame is decoded.
In a possible implementation manner, the video playing apparatus 130 further includes a dotting module, where the dotting module is configured to:
obtaining a target video frame with a target object in the live video stream;
importing each target video frame into a dotting model obtained by pre-training, and outputting description information of each target video frame;
and aiming at each target video frame, acquiring the position information of the target video frame in the live video stream, and identifying a dotting label at a position corresponding to the position information on a playing interface, wherein the dotting label is used for expanding the description information of the target video frame.
In one possible implementation, the video playing apparatus 130 further includes a presentation module, and the presentation module may be configured to:
and when the trigger operation aiming at any one of the dotting labels is detected, displaying the description information corresponding to the dotting label.
In one possible implementation, the target objects include a character object and a scene object;
the dotting model is obtained by utilizing a plurality of sample templates to train the constructed neural network model in advance, and the sample templates are a plurality of images formed by the same character object under different scene objects.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
Further, an embodiment of the present application also provides a computer-readable storage medium, where the computer-readable storage medium stores machine-executable instructions, and the machine-executable instructions, when executed, implement the video playing method provided by the foregoing embodiment.
Specifically, the computer readable storage medium can be a general storage medium, such as a removable disk, a hard disk, and the like, and when executed, the computer program on the computer readable storage medium can execute the video playing method. With regard to the processes involved when the executable instructions in the computer-readable storage medium are executed, reference may be made to the related descriptions in the above method embodiments, which are not described in detail herein.
To sum up, in the video playing method, the video playing apparatus, the electronic device, and the readable storage medium provided by the present application, during the playing of the current video stream in the current playing mode by the current player, if the switching operation for switching the current playing mode to the target playing mode is detected, the operation for acquiring the target video stream is executed by the target player. And after the video frame of the previous preset frame of the target video stream is obtained, closing the current player, and rendering and playing the target video stream in a target playing mode through the target player. Therefore, two players can be utilized, after the first few frames of the target video stream are successfully obtained, the current player broadcast is converted into the target player for playing, switching traces between pictures in two playing modes can be avoided, and the effect of smooth switching is achieved.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
Claims (10)
1. A video playback method, the method comprising:
in the process of playing the current video stream in the current playing mode through the current player, if the switching operation of switching the current playing mode to the target playing mode is detected, executing the operation of acquiring the target video stream through the target player;
after the video frame of the previous preset frame of the target video stream is obtained, closing the current player, and rendering and playing the obtained target video stream in the target playing mode through the target player;
the current video stream is a live video stream, the current player is a live player, and in the step of rendering and playing the obtained target video stream, when a preset updating condition is detected to be met, the live video stream corresponding to the updating condition is obtained through the live player, and the target video stream is rendered and played based on the obtained live video stream;
the step of obtaining the live video stream corresponding to the update condition through the live player includes that when an internal switching operation is generated in the playing process of the target video stream, the live video stream generated in a time interval corresponding to the internal switching operation is obtained through the live player, wherein when the number of times of the internal switching operation is one, the time interval is the time interval between the internal switching operation and the switching operation for switching the current playing mode to the target playing mode, and when the number of times of the internal switching operation is greater than or equal to two times, the time interval is the time interval between two adjacent internal switching operations.
2. The video playing method according to claim 1, wherein the step of obtaining, by the live player, a live video stream corresponding to a preset update condition when it is detected that the preset update condition is satisfied includes:
and after the obtained target video stream is detected to be played, obtaining the playing time interval of the target video stream, and obtaining the live video stream generated in the playing time interval through the live player.
3. The video playback method of claim 2, further comprising:
and after the obtained target video stream is detected to be played, rendering and playing the obtained live video stream in the target playing mode through the target player.
4. The video playing method according to claim 1, wherein the target video stream comprises a plurality of video segments, each of the video segments comprises a plurality of video frames, and the step of rendering and playing the obtained target video stream in the target playing mode by the target player comprises:
obtaining a switching position pointed by the switching operation, and obtaining a target video clip corresponding to the switching position in the target video stream;
obtaining a target video frame corresponding to the switching position in the target video clip;
and decoding the target video fragment in the target playing mode through the target player, and starting to perform rendering and playing operations when the target video frame is decoded.
5. The video playback method of claim 1, wherein the live video stream comprises a plurality of video frames, the method further comprising:
obtaining a target video frame with a target object in the live video stream;
importing each target video frame into a dotting model obtained by pre-training, and outputting description information of each target video frame;
and aiming at each target video frame, acquiring the position information of the target video frame in the live video stream, and identifying a dotting label at a position corresponding to the position information on a playing interface, wherein the dotting label is used for expanding the description information of the target video frame.
6. The video playback method of claim 5, wherein the method further comprises:
and when the trigger operation aiming at any one of the dotting labels is detected, displaying the description information corresponding to the dotting label.
7. The video playback method according to claim 5, wherein the target object includes a character object and a scene object;
the dotting model is obtained by utilizing a plurality of sample templates to train the constructed neural network model in advance, and the sample templates are a plurality of images formed by the same character object under different scene objects.
8. A video playback apparatus, comprising:
the detection module is used for executing the operation of acquiring the target video stream through the target player if the switching operation of switching the current playing mode to the target playing mode is detected in the process of playing the current video stream in the current playing mode through the current player;
the playing module is used for closing the current player after the video frame of the previous preset frame of the target video stream is obtained, and rendering and playing the obtained target video stream in the target playing mode through the target player;
the current video stream is a live video stream, the current player is a live player, and the playing module is used for acquiring the live video stream corresponding to a preset updating condition through the live player when the condition that the preset updating condition is met is detected, and rendering and playing a target video stream based on the acquired live video stream;
the playing module is configured to, when an internal switching operation is generated in a playing process of the target video stream, obtain, by a live player, a live video stream generated in a time interval corresponding to the internal switching operation, where the time interval is a time interval between the internal switching operation and a switching operation for switching a current playing mode to the target playing mode when the number of times of the internal switching operation is one, and the time interval is a time interval between two adjacent internal switching operations when the number of times of the internal switching operation is greater than or equal to two times.
9. An electronic device comprising one or more storage media and one or more processors in communication with the storage media, the one or more storage media storing processor-executable machine-executable instructions that, when executed by the electronic device, are executed by the processors to perform the video playback method of any of claims 1-7.
10. A computer-readable storage medium storing machine-executable instructions for execution by a processor, the machine-executable instructions when executed implement the video playback method of any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010833560.0A CN111954022B (en) | 2020-08-18 | 2020-08-18 | Video playing method and device, electronic equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010833560.0A CN111954022B (en) | 2020-08-18 | 2020-08-18 | Video playing method and device, electronic equipment and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111954022A CN111954022A (en) | 2020-11-17 |
CN111954022B true CN111954022B (en) | 2022-04-12 |
Family
ID=73342128
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010833560.0A Active CN111954022B (en) | 2020-08-18 | 2020-08-18 | Video playing method and device, electronic equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111954022B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114095791A (en) * | 2021-11-15 | 2022-02-25 | 广州博冠信息科技有限公司 | Live broadcast playback method and device, electronic equipment and storage medium |
CN114286184B (en) * | 2021-12-15 | 2023-11-28 | 北京达佳互联信息技术有限公司 | Video playing method and device, electronic equipment and storage medium |
CN115529492A (en) * | 2022-08-22 | 2022-12-27 | 海信视像科技股份有限公司 | Image rendering method and device and electronic equipment |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101610406A (en) * | 2009-06-30 | 2009-12-23 | 中兴通讯股份有限公司 | A kind of video switching method and device |
CN101917590A (en) * | 2009-12-17 | 2010-12-15 | 新奥特(北京)视频技术有限公司 | Network live broadcasting system with playback function and player |
CN108810572A (en) * | 2018-06-14 | 2018-11-13 | 深圳市茁壮网络股份有限公司 | A kind of video broadcasting method and device |
CN109168020A (en) * | 2018-10-22 | 2019-01-08 | 广州虎牙科技有限公司 | Method for processing video frequency, device, calculating equipment and storage medium based on live streaming |
CN109168078A (en) * | 2018-09-10 | 2019-01-08 | 苏宁智能终端有限公司 | A kind of video definition switching method and device |
CN109348240A (en) * | 2018-10-25 | 2019-02-15 | 网易(杭州)网络有限公司 | Video broadcasting method, apparatus and system, electronic equipment and storage medium |
CN109922375A (en) * | 2017-12-13 | 2019-06-21 | 上海聚力传媒技术有限公司 | Event methods of exhibiting, playback terminal, video system and storage medium in live streaming |
-
2020
- 2020-08-18 CN CN202010833560.0A patent/CN111954022B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101610406A (en) * | 2009-06-30 | 2009-12-23 | 中兴通讯股份有限公司 | A kind of video switching method and device |
CN101917590A (en) * | 2009-12-17 | 2010-12-15 | 新奥特(北京)视频技术有限公司 | Network live broadcasting system with playback function and player |
CN109922375A (en) * | 2017-12-13 | 2019-06-21 | 上海聚力传媒技术有限公司 | Event methods of exhibiting, playback terminal, video system and storage medium in live streaming |
CN108810572A (en) * | 2018-06-14 | 2018-11-13 | 深圳市茁壮网络股份有限公司 | A kind of video broadcasting method and device |
CN109168078A (en) * | 2018-09-10 | 2019-01-08 | 苏宁智能终端有限公司 | A kind of video definition switching method and device |
CN109168020A (en) * | 2018-10-22 | 2019-01-08 | 广州虎牙科技有限公司 | Method for processing video frequency, device, calculating equipment and storage medium based on live streaming |
CN109348240A (en) * | 2018-10-25 | 2019-02-15 | 网易(杭州)网络有限公司 | Video broadcasting method, apparatus and system, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111954022A (en) | 2020-11-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111954022B (en) | Video playing method and device, electronic equipment and readable storage medium | |
US11482192B2 (en) | Automated object selection and placement for augmented reality | |
US10911815B1 (en) | Personalized recap clips | |
US10643264B2 (en) | Method and computer readable medium for presentation of content items synchronized with media display | |
CN112753225A (en) | Video processing for embedded information card location and content extraction | |
CN108924576A (en) | A kind of video labeling method, device, equipment and medium | |
CN111078070B (en) | PPT video barrage play control method, device, terminal and medium | |
CN111131876B (en) | Control method, device and terminal for live video and computer readable storage medium | |
JP2015100039A (en) | Information processor | |
CN111988670B (en) | Video playing method and device, electronic equipment and computer readable storage medium | |
CN110177295B (en) | Subtitle out-of-range processing method and device and electronic equipment | |
CN109040773A (en) | A kind of video improvement method, apparatus, equipment and medium | |
CN113194349A (en) | Video playing method, commenting method, device, equipment and storage medium | |
CN113301413B (en) | Information display method and device | |
US20170171277A1 (en) | Method and electronic device for multimedia recommendation based on android platform | |
CN111881395A (en) | Page presenting method, device, equipment and computer readable storage medium | |
CN107770603B (en) | Video image processing method and device and terminal equipment | |
CN113101633B (en) | Cloud game simulation operation method and device and electronic equipment | |
CN112989112B (en) | Online classroom content acquisition method and device | |
CN110647374A (en) | Interaction method and device for holographic display window and electronic equipment | |
WO2022011905A1 (en) | Notification information pushing method, smart terminal, and storage medium | |
CN110287934B (en) | Object detection method and device, client and server | |
CN111667313A (en) | Advertisement display method and device, client device and storage medium | |
CN114640876B (en) | Multimedia service video display method, device, computer equipment and storage medium | |
CN112866748B (en) | AI-based video advertisement implantation method and device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |