Display device, video seamless switching method, and storage medium

By using the GStreamer plugin in the Android media player, seamless switching between videos is achieved, resolving the brief black screen issue during video transitions in the Android media player and improving the user experience.

CN117651186BActive Publication Date: 2026-11-27HISENSE VISUAL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310702174.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-13
Publication Date
2026-11-27
Estimated Expiration
2043-06-13

AI Technical Summary

Technical Problem

The existing media player for Android systems lacks a seamless switching function when switching videos, causing a brief black screen on the playback page, which affects the user experience.

Method used

By using the multimedia framework GStreamer's functional plugins in the Android system media player, seamless switching between videos is achieved. This includes replacing and processing plugins for video source acquisition, bitstream encapsulation format, demultiplexer, multi-queue buffering, and video decoding, ensuring the consistency of video stream encoding format and avoiding the need to close the original bitstream and restart.

Benefits of technology

It enables seamless switching between videos, avoids brief black screens, and improves the user experience during video switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117651186B_ABST
    Figure CN117651186B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a display device, a video seamless switching method and a storage medium. The display device comprises a controller configured to: in response to a first playing instruction, play first video data; the first playing instruction is used to indicate that a target processing module completes decoding of a first frame of a first video stream, and the target processing module is used to perform unpacking processing and decoding processing on the first video stream; in the process of playing the first video data, in response to a switching instruction, stopping the target processing module from processing the first video stream, and processing a second video stream through the target processing module to obtain second video data, and switching the first video data to the second video data; the switching instruction is used to indicate seamless switching from the first video stream to the second video stream; and an encoding format of the first video stream is the same as an encoding format of the second video stream. The present disclosure can realize seamless switching between videos of an Android system player mediaplayer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of video playback technology, and in particular to a display device, a method for seamless video switching, and a storage medium. Background Technology

[0002] Users often need to switch between videos at any time while watching them, whether local or online. Seamless switching is essential. However, the Android media player, MediaPlayer, currently lacks this feature.

[0003] In existing technologies, switching between videos using the Android media player (MediaPlayer) is achieved by closing the previous original stream and restarting the new stream. However, this method of video switching causes a brief black screen on the playback page, resulting in a poor user viewing experience.

[0004] Therefore, how to achieve seamless switching between video streams is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides a method for seamless switching between display devices and videos, which enables seamless switching between videos in the Android system media player and avoids brief black screen phenomena during video switching.

[0006] In a first aspect, this disclosure provides a display device, comprising:

[0007] The controller is configured as follows:

[0008] In response to a first playback command, the first video data is played; the first playback command is used to instruct the target processing module to complete the decoding of the first frame of the first video stream, and the target processing module is used to perform decapsulation and decoding processing on the first video stream;

[0009] During the playback of the first video data, in response to a switching command, the target processing module stops processing the first video stream, and the target processing module processes the second video stream to obtain the second video data, thus switching the first video data to the second video data; the switching command is used to indicate a seamless switch from the first video stream to the second video stream; the encoding format of the first video stream is the same as that of the second video stream.

[0010] As an optional implementation of this invention, the seamless switching of the first video stream to the second video stream is accomplished based on various functional plugins in the multimedia framework GStreamer, which includes the following functional plugins:

[0011] Video source acquisition plugin, bitstream encapsulation format plugin, demultiplexer plugin, multi-queue buffer plugin, video decoding plugin, audio track selection plugin, audio decoding plugin, sound processing plugin, resampling plugin, audio-visual synchronization plugin, video playback plugin, and audio playback plugin.

[0012] As an optional implementation of this invention, the controller is further configured to:

[0013] Replace the first video source acquisition plugin, the first bitstream encapsulation format plugin, and the first demultiplexer plugin with the second video source acquisition plugin, the second bitstream encapsulation format plugin, and the second demultiplexer plugin;

[0014] For the audio path, replace the first audio track selection plugin and the first audio decoding plugin with the second audio track selection plugin and the second audio decoding plugin.

[0015] As an optional implementation of this invention, the controller is specifically configured as follows:

[0016] The step of switching the first video data to the second video data includes:

[0017] The display timestamp corresponding to the last frame of the first video stream is obtained based on the first demultiplexer plugin;

[0018] Set the display timestamp of the last frame of the first video stream to the display timestamp of the first frame of the second video stream, and seamlessly switch the first video data to the second video data.

[0019] As an optional implementation of this invention, the controller is further configured to:

[0020] The processing of the second video stream by the target processing module further includes:

[0021] The target processing module decapsulates the second video stream and determines whether the data after decapsulation of the second video stream includes the compressed encoded data of the second audio stream.

[0022] If the data after decapsulation of the second video stream includes compressed and encoded data of the second audio stream, then the clock of each functional plug-in will be switched to the audio clock.

[0023] Based on the second demultiplexer plugin, obtain the second video stream compressed encoded data and the second audio stream compressed encoded data;

[0024] The compressed encoded data of the second video stream and the compressed encoded data of the second audio stream are respectively sent to the multi-queue buffer plugin.

[0025] As an optional implementation of this invention, the controller is further configured to:

[0026] The step of determining whether the data after decapsulation of the second video stream includes the compressed encoded data of the second audio stream further includes:

[0027] If the data after decapsulation of the second video stream does not include the compressed and encoded data of the second audio stream, then the clock of each functional plug-in will be switched to the system clock.

[0028] Based on the second demultiplexer plugin, obtain the second video stream compressed encoding data;

[0029] The compressed and encoded data of the second video stream is sent to the multi-queue buffer plugin.

[0030] As an optional implementation of this invention, the controller is further configured to:

[0031] If the data after decapsulation of the second video stream does not include the compressed encoding data of the second audio stream, then a preset compressed encoding data of the second audio stream is created based on the second demultiplexer plugin;

[0032] Based on the preset second audio stream compression encoding data, create a preset second audio track selection plugin and a preset second audio decoding plugin;

[0033] The preset second audio track selection plugin, the preset second audio decoding plugin, the multi-queue buffer plugin, and the sound processing plugin are linked to form a preset audio path.

[0034] Secondly, a method for seamless video switching is provided, the method comprising:

[0035] In response to a first playback command, the first video data is played; the first playback command is used to instruct the target processing module to complete the decoding of the first frame of the first video stream, and the target processing module is used to perform decapsulation and decoding processing on the first video stream;

[0036] During the playback of the first video data, in response to a switching command, the target processing module stops processing the first video stream, and the target processing module processes the second video stream to obtain the second video data, thus switching the first video data to the second video data; the switching command is used to indicate a seamless switch from the first video stream to the second video stream; the encoding format of the first video stream is the same as that of the second video stream.

[0037] As an optional implementation of this invention, the seamless switching of the first video stream to the second video stream is accomplished based on various functional plugins in the multimedia framework GStreamer, which includes the following functional plugins:

[0038] Video source acquisition plugin, bitstream encapsulation format plugin, demultiplexer plugin, multi-queue buffer plugin, video decoding plugin, audio track selection plugin, audio decoding plugin, sound processing plugin, resampling plugin, audio-visual synchronization plugin, video playback plugin, and audio playback plugin.

[0039] As an optional implementation of this invention, the method further includes:

[0040] Replace the first video source acquisition plugin, the first bitstream encapsulation format plugin, and the first demultiplexer plugin with the second video source acquisition plugin, the second bitstream encapsulation format plugin, and the second demultiplexer plugin;

[0041] For the audio path, replace the first audio track selection plugin and the first audio decoding plugin with the second audio track selection plugin and the second audio decoding plugin.

[0042] As an optional implementation of this invention, the step of switching the first video data to the second video data includes:

[0043] The display timestamp corresponding to the last frame of the first video stream is obtained based on the first demultiplexer plugin;

[0044] Set the display timestamp of the last frame of the first video stream to the display timestamp of the first frame of the second video stream, and seamlessly switch the first video data to the second video data.

[0045] As an optional implementation of this invention, the processing of the second video stream by the target processing module further includes:

[0046] The target processing module decapsulates the second video stream and determines whether the data after decapsulation of the second video stream includes the compressed encoded data of the second audio stream.

[0047] If the data after decapsulation of the second video stream includes compressed and encoded data of the second audio stream, then the clock of each functional plug-in will be switched to the audio clock.

[0048] Based on the second demultiplexer plugin, obtain the second video stream compressed encoded data and the second audio stream compressed encoded data;

[0049] The compressed encoded data of the second video stream and the compressed encoded data of the second audio stream are respectively sent to the multi-queue buffer plugin.

[0050] As an optional implementation of this invention, the step of determining whether the data after decapsulation of the second video stream includes the compressed encoded data of the second audio stream further includes:

[0051] If the data after decapsulation of the second video stream does not include the compressed and encoded data of the second audio stream, then the clock of each functional plug-in will be switched to the system clock.

[0052] Based on the second demultiplexer plugin, obtain the second video stream compressed encoding data;

[0053] The compressed and encoded data of the second video stream is sent to the multi-queue buffer plugin.

[0054] As an optional implementation of the present invention, if the data after decapsulation of the second video stream does not include the second audio stream compressed encoding data, then a preset second audio stream compressed encoding data is created based on the second demultiplexer plugin.

[0055] Based on the preset second audio stream compression encoding data, create a preset second audio track selection plugin and a preset second audio decoding plugin;

[0056] The preset second audio track selection plugin, the preset second audio decoding plugin, the multi-queue buffer plugin, and the sound processing plugin are linked to form a preset audio path.

[0057] Thirdly, a computer-readable storage medium is provided, comprising: storing a computer program on the computer-readable storage medium, wherein when the computer program is executed by a processor, it implements the seamless video switching method as described in the second aspect.

[0058] Fourthly, a computer program product is provided, comprising: when the computer program product is run on a computer, causing the computer to implement the seamless video switching method as described in the second aspect.

[0059] Compared with the prior art, the technical solution provided in this disclosure has the following advantages: Responding to a first playback command, first video data is played. The first playback command instructs the target processing module to complete decoding of the first frame of the first video stream. The target processing module performs decapsulation and decoding processing on the first video stream. During the playback of the first video data, in response to a switching command, the target processing module stops processing the first video stream and processes the second video stream to obtain second video data, switching the first video data to the second video data. Since the switching command instructs a seamless switch from the first video stream to the second video stream, and the encoding format of the first video stream is the same as that of the second video stream, there is no need to close the first video stream during video switching. The target processing module directly performs decapsulation and decoding processing on the second video stream to obtain the second video data, switching the first video data to the second video data. This avoids the brief black screen phenomenon that occurs when closing the original bitstream and restarting playback of a new bitstream, thus achieving seamless switching between different videos and improving the user experience during video switching. Attached Figure Description

[0060] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0061] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0062] Figure 1A This is a schematic diagram illustrating an application scenario of a seamless video switching method for a display device provided in an embodiment of this disclosure;

[0063] Figure 1B This is a hardware configuration block diagram of a control device 100 according to one or more embodiments of the present disclosure;

[0064] Figure 2 This is a hardware configuration block diagram of a computer device according to one or more embodiments of the present disclosure;

[0065] Figure 3A This is a schematic diagram of the software configuration of a computer device according to one or more embodiments of the present disclosure;

[0066] Figure 3B This is a schematic diagram showing an icon control page of an application program in a computer device according to one or more embodiments of the present disclosure;

[0067] Figure 4A A flowchart illustrating a seamless video switching method provided in an embodiment of this disclosure;

[0068] Figure 4B This is a schematic diagram of a video stream decoding process provided in an embodiment of the present disclosure;

[0069] Figure 5A A schematic diagram of a GStreamer playback framework based on a plug-in design provided in this disclosure embodiment;

[0070] Figure 5B A schematic diagram of a seamless switching architecture for a system player based on GStreamer, provided in an embodiment of this disclosure;

[0071] Figure 6 A flowchart illustrating another seamless video switching method provided in this disclosure embodiment;

[0072] Figure 7 A flowchart illustrating yet another seamless video switching method provided in this disclosure embodiment;

[0073] Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure. Detailed Implementation

[0074] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0075] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0076] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.

[0077] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.

[0078] For online viewing, common live streaming protocols include RTMP, RTSP, and HTTP; common video-on-demand protocols include MP4, FLV, and HLS.

[0079] A video player needs to go through the following steps to play a video file from the Internet: protocol decryption, decapsulation, audio and video decoding, and audio and video synchronization.

[0080] For local playback, each video has its own format, such as .mp4, .rmvb, .avi, etc. These formats represent de-encapsulation formats, or video encapsulation formats.

[0081] Playing a local file with a video player involves the following steps: decapsulation, decoding of audio and video, and audio-video synchronization.

[0082] The purpose of protocol decryption is to parse streaming media protocol data into standard, corresponding encapsulation formats. When audio and video are transmitted over the network, various streaming media protocols are often used, such as HTTP, RTMP, or MMS. These protocols transmit signaling data along with the audio and video data. This signaling data includes playback controls (play, pause, stop) and descriptions of network status. Protocol decryption removes the signaling data, retaining only the audio and video data. For example, data transmitted using the RTMP protocol, after protocol decryption, is output as FLV format data.

[0083] The purpose of decapsulation is to separate the input data into compressed audio and video streams. There are many types of encapsulation formats, such as MP4, MKV, RMVB, TS, FLV, and AVI. Its function is to combine already compressed video and audio data according to a specific format. For example, after decapsulation, FLV format data outputs an H.264 encoded video stream and an AAC encoded audio stream.

[0084] The function of decoding is to convert compressed video / audio data into uncompressed raw video / audio data. Audio compression standards include AAC, MP3, AC-3, etc., while video compression standards include H.264, MPEG2, VC-1, etc. Through decoding, compressed video data is output as uncompressed color data, such as YUV420P, RGB, etc.; compressed audio data is output as uncompressed audio sampled data, such as PCM data.

[0085] The function of audio-visual synchronization is to synchronize the decoded video and audio data based on the parameter information obtained during the decapsulation module processing, and then send the video and audio data to the system's graphics card and sound card for playback.

[0086] Video encoding, in essence, is the compression of data, thereby reducing the bandwidth or storage space required.

[0087] In existing technologies, the Android system media player does not have a seamless switching function, but there is a market demand for seamless switching. Therefore, it is necessary to develop this technology for terminal devices that use Android system media players.

[0088] Based on the above problems, in this embodiment of the disclosure, in response to a first playback command, first video data is played. The first playback command instructs the target processing module to complete decoding of the first frame of the first video stream. The target processing module performs decapsulation and decoding processing on the first video stream. During the playback of the first video data, in response to a switching command, the target processing module stops processing the first video stream and processes the second video stream to obtain second video data, switching the first video data to the second video data. Since the switching command instructs a seamless switch from the first video stream to the second video stream, and the encoding format of the first video stream is the same as that of the second video stream, there is no need to close the first video stream during video switching. The target processing module directly performs decapsulation and decoding processing on the second video stream to obtain the second video data, switching the first video data to the second video data. This avoids the brief black screen phenomenon that occurs when closing the original bitstream and restarting playback of a new bitstream, thus achieving seamless switching between different videos and improving the user experience during video switching.

[0089] For example, such as Figure 1A As shown, Figure 1A This is a schematic diagram illustrating an application scenario of a seamless video switching method for a display device provided in an embodiment of this disclosure. Figure 1A In this system, users can operate the display device 200 via the control device 100 or the terminal device 300. For example, when a user is watching a TV series online, the display device 200 is currently playing the first episode. After watching the first episode for 10 minutes, if the user feels the plot is progressing too slowly, they can switch to the second episode via the control device 100. Alternatively, when watching a video stored locally on the display device 200, the user can switch to the next video via the terminal device 300. The display device 200 can be a smart TV, laptop, projector, desktop computer, etc.; the terminal device 300 can be a smartphone, tablet, portable smartwatch, etc.

[0090] In some embodiments, the display device 200 also communicates with the server 400. The display device 200 may communicate via a local area network (LAN), wireless local area network (WLAN), and other networks. The server 400 may provide various content and interactive features to the display device 200. The server 400 may be a cluster or multiple clusters, and may include one or more types of servers.

[0091] In some embodiments, the control device 100 may be a remote control. Communication between the remote control and the display device includes infrared protocol communication, Bluetooth protocol communication, and other short-range communication methods, controlling the display device 200 wirelessly or via wired means. Users can input user commands through buttons on the remote control, voice input, control panel input, etc., to control the display device 200. Figure 1B An exemplary configuration block diagram of the control device 100 is shown. (Refer to...) Figure 1B As shown, the control device 100 includes a controller 110, a communication interface 130, a user input / output interface 140, a storage device, and a power supply. The control device 100 can receive user input operation commands and convert them into commands that the display device 200 can recognize and respond to, acting as an intermediary for interaction between the user and the display device 200. The communication interface 130 is used for external communication and includes at least one of the following: a Wi-Fi chip, a Bluetooth module, NFC (Near Field Communication), or a suitable alternative module. The user input / output interface 140 includes at least one of the following: a microphone, a touchpad, a sensor, buttons, or a suitable alternative module.

[0092] In some embodiments, a terminal device 300 (e.g., a mobile terminal) can also be used to control the display device 200. For example, an application running on the terminal device 300 can be used to control the display device 200. The terminal device 300 can install software applications with the display device 200 to establish a connection and communication via network communication protocols, achieving one-to-one control operations and data communication. Semantic content displayed on the terminal device 300 can also be transmitted to the display device 200 to achieve synchronous display.

[0093] In some embodiments, the display device 200 may receive commands without using the terminal device 300 described above, but instead receive user control via touch or gestures. For example, when the display device 200 is a smart TV, the user accesses the wireless network display interface via touch screen or gesture control.

[0094] The seamless video switching method provided in this disclosure can be implemented based on a computer device, or a functional module or functional entity within the computer device.

[0095] The computer equipment can be a personal computer (PC), server, mobile phone, tablet computer, laptop computer, mainframe computer, etc., and this disclosure does not specifically limit it.

[0096] For example, Figure 2 This is a hardware configuration block diagram of a computer device according to one or more embodiments of the present disclosure. Figure 2As shown, the computer device includes at least one of the following: a tuner / demodulator 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a display 260, an audio output interface 270, a memory, a power supply, and a user interface 280. The controller 250 includes at least one of a central processing unit (CPU), a video processor, an audio processor, a graphics processing unit (GPU), RAM (Random Access Memory), ROM (Read-Only Memory), a first to nth interface for input / output, and a communication bus. The display 260 can be at least one of a liquid crystal display, an OLED display, a touch display, and a projection display, and can also be a projection device and a projection screen. The tuner / demodulator 210 receives broadcast television signals via wired or wireless means, and demodulates audio and video signals, such as EPG audio and video data signals, from multiple wireless or wired broadcast television signals. The communicator 220 is a component used to communicate with external devices or servers according to various communication protocol types. For example, the communicator may include at least one of the following: a Wi-Fi module, a Bluetooth module, a wired Ethernet module, other network communication protocol chips or near-field communication protocol chips, and an infrared receiver. Computer equipment can establish the transmission and reception of control signals and data signals with a server or local control device through the communicator 220. The detector 230 is used to collect signals from the external environment or to interact with the external environment. For example, the detector 230 includes a light receiver, a sensor for collecting ambient light intensity; or, the detector 230 includes an image acquisition device, such as a camera, which can be used to collect external environmental scenes, user attributes, or user interaction gestures; or, the detector 230 includes a sound acquisition device, such as a microphone, for receiving external sound. The external device interface 240 may include, but is not limited to, one or more of the following: a high-definition multimedia interface (HDMI), an analog or data high-definition component input interface (component), a composite video input interface (CVBS), a USB input interface (USB), an RGB port, etc. It may also be a composite input / output interface formed by multiple of the above interfaces. The controller 250 and the tuner 210 can be located in different separate devices, that is, the tuner 210 can also be located in an external device of the main device where the controller 250 is located, such as an external set-top box.

[0097] In some embodiments, the controller 250 controls the operation of the computer device and responds to user operations through various software control programs stored in memory. The controller 250 controls the overall operation of the computer device. The user can input commands through a graphical user interface (GUI) displayed on the monitor 260, and the user input interface receives the user input commands through the GUI. Alternatively, the user can input commands by entering specific sounds or gestures, and the user input interface receives the user input commands by recognizing the sounds or gestures through sensors.

[0098] In some embodiments, the display 260 includes a display screen assembly for presenting images, a driving assembly for driving image display, an assembly for receiving image signals output from a controller, and a user interface (UI) for displaying video content, image content, menu control interface, and user control interface. For example, the display may be at least one of a liquid crystal display (LCD), an OLED (Organic Light-Emitting Diode) display, a touch display, and a projection display, and may also be a projection device and a projection screen. Users can input user commands through a graphical user interface (GUI) displayed on the display 260, and the user input interface receives the user input commands through the GUI. Alternatively, users can input user commands by inputting specific sounds or gestures, and the user input interface receives the user input commands by recognizing the sounds or gestures through sensors. A "user interface" is the medium through which an application or operating system interacts and exchanges information with a user; it realizes the conversion between the internal form of information and a form acceptable to the user. A common form of user interface is the graphical user interface, which refers to a user interface related to computer operation displayed graphically. For example, it can be an interface element such as an icon, window, or control displayed on the screen of a computer device. Controls can include visible interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, and navigation bars. The user interface can be used to receive control signals from terminal device 100 (such as an infrared remote control).

[0099] Figure 3A This is a schematic diagram of the software configuration of a computer device according to one or more embodiments of the present disclosure, such as... Figure 3A As shown, the system is divided into four layers, from top to bottom: the Applications layer (referred to as the "Application Layer"), the Application Framework layer (referred to as the "Framework Layer"), the Android runtime and system library layer (referred to as the "System Runtime Library Layer"), and the kernel layer.

[0100] Figure 3B This is a schematic diagram showing the icon control interface of an application included in a smart device (mainly a smart playback device, such as a smart TV, digital cinema system, or audio-visual server) according to one or more embodiments of this disclosure. Figure 3B As shown, the application layer contains at least one application whose corresponding icon control can be displayed on the screen, such as: live TV application icon control, video-on-demand (VOD) application icon control, media center application icon control, application center icon control, game application icon control, etc. Live TV applications can provide live television from different signal sources. Video-on-demand (VOD) applications can provide video from different storage sources. Unlike live TV applications, video-on-demand provides video display from certain storage sources. Media center applications can provide applications for playing various multimedia content. The application center can provide storage for various applications.

[0101] The seamless video switching method provided in this disclosure can be implemented based on the aforementioned computer equipment.

[0102] To illustrate this solution in more detail, the following will use examples to illustrate it. Figure 4A To explain, it is understandable that Figure 4A The steps involved may include more or fewer steps in actual implementation, and the order of these steps may also be different, in order to achieve the seamless video switching method for the controlled device side provided in the embodiments of this application.

[0103] Figure 4A This is a flowchart illustrating a seamless video switching method provided in an embodiment of this disclosure. Figure 4A As shown, the method specifically includes the following steps:

[0104] S41. In response to the first playback command, play the first video data.

[0105] The first playback instruction is used to instruct the target processing module to complete the decoding of the first frame of the first video stream, and the target processing module is used to perform decapsulation and decoding processing on the first video stream.

[0106] In real-world playback scenarios, the video played may be an online video or a local video. For online videos, commonly used protocols include RTMP, RTSP, and HTTP. Playing an online video file requires a video player to go through steps such as protocol decoding, decapsulation, audio and video decoding, and audio-visual synchronization. (Refer to...) Figure 4B As shown, Figure 4B This is a flowchart illustrating the video stream decoding process for online videos.

[0107] For local videos, there are various container formats, such as .mp4, .rmvb, .avi, etc. Playing a local video requires several steps: de-containerization, decoding of audio and video, and audio-video synchronization.

[0108] Specifically, the video playback application calls the Android Media Player, which executes specific playback logic to control the player and achieve seamless switching. Since the first playback command is used to instruct the target processing module to complete the decoding of the first frame of the first video stream, when the video playback application receives the first playback command sent by the player, it starts the first playback, that is, plays the first video data.

[0109] For example, the video playback application can be an application installed on the display device, such as Tencent Video, iQiyi Video, Youku Video, etc. The video playback application creates a player and calls the `setDataSource`, `prepare`, and `start` interfaces to initiate the first playback. Specifically, the player obtains the storage path or address of the first video stream by calling the `setDataSource` interface. The player completes preparatory work before playing the video by calling the `prepare` interface, including creating a decoder, downloading the first video stream, and parsing the first video stream. The player starts playing the first video stream by calling the `start` interface.

[0110] S42. During the playback of the first video data, in response to the switching command, the target processing module stops processing the first video stream, and the target processing module processes the second video stream to obtain the second video data, and the first video data is switched to the second video data.

[0111] The switching instruction is used to indicate a seamless switch from the first video stream to the second video stream; the encoding format of the first video stream is the same as that of the second video stream.

[0112] Specifically, during the playback of the first video data, the player receives a switching instruction indicating a seamless switch from the first video stream to the second video stream. In response to the switching instruction, the player stops decoding the first video stream using the target processing module and performs decapsulation and decoding on the second video stream using the target processing module. When the decoding of the first frame of the second video stream is complete, the player switches from the first video data to the second video data. During this process, since the encoding formats of the first and second video streams are the same and the same target processing module is used to process both streams, there is no need to exit the decapsulation module during the video switching process, saving time and achieving seamless switching between the first and second video streams.

[0113] For example, when playing an online video, before the first video stream has finished playing, the user switches to play the second video stream via remote control, mobile phone, or gesture control. The decapsulation module stops decapsulating the first video stream and directly decapsulates the second video stream. After the decapsulation process, the video data is sent to the decoding module for decoding. When the decoding of the first frame of the second video stream is completed, the first video data is switched to the second video data.

[0114] In this embodiment of the disclosure, in response to a first playback command, first video data is played. The first playback command instructs the target processing module to complete decoding of the first frame of the first video stream. The target processing module performs decapsulation and decoding processing on the first video stream. During the playback of the first video data, in response to a switching command, the target processing module stops processing the first video stream and processes the second video stream to obtain second video data, switching the first video data to the second video data. Since the switching command instructs a seamless switch from the first video stream to the second video stream, and the encoding format of the first video stream is the same as that of the second video stream, there is no need to close the first video stream during video switching. The target processing module directly performs decapsulation and decoding processing on the second video stream to obtain the second video data, switching the first video data to the second video data. This avoids the brief black screen phenomenon that occurs when closing the original bitstream and restarting playback of a new bitstream, thus achieving seamless switching between different videos and improving the user experience during video switching.

[0115] The above steps S41-S42 are implemented based on the plug-in-based GStreamer playback framework. This is achieved by replacing different plug-ins, allowing you to switch to the next video without exiting and restarting the player.

[0116] In some embodiments, the seamless switching of the first video stream to the second video stream is accomplished based on various functional plugins in the multimedia framework GStreamer;

[0117] The multimedia framework GStreamer includes the following functional plugins: video source acquisition plugin, stream encapsulation format plugin, demultiplexer plugin, multi-queue buffer plugin, video decoding plugin, audio track selection plugin, audio decoding plugin, sound processing plugin, resampling plugin, audio-visual synchronization plugin, video playback plugin, and audio playback plugin.

[0118] The video source acquisition plugin is used to obtain the video file of the target video stream and the display timestamp (PTS) corresponding to the last frame of the target video stream. PTS is primarily used to measure when a decoded video frame is displayed.

[0119] The bitstream encapsulation format plugin is used to obtain the bitstream encapsulation format of the target video stream.

[0120] The demultiplexer plugin is used to separate a target video stream in a preset bitstream encapsulation format to obtain compressed video and audio stream data. Preset bitstream encapsulation formats include, but are not limited to, MP4, MKV, RMVB, TS, FLV, and AVI. For example, after decapsulating FLV bitstream data, an H.264 encoded video stream and an AAC encoded audio stream can be obtained.

[0121] The multi-queue buffer plugin is used to store video stream compressed encoding data and audio stream compressed encoding data in different queues respectively.

[0122] Video decoding plugins are used to decode compressed video data into uncompressed raw video data. They can output compressed video data as uncompressed color data, such as YUV420P or RGB.

[0123] The audio track selection plugin is used to select the audio track of the target audio stream's compressed encoded data.

[0124] Audio decoding plugins are used to decode compressed audio data into uncompressed raw audio data. For example, audio compression standards include AAC, MP3, and AC-3, while video compression standards include H.264, H.265, MPEG2, and VC-1. Audio decoding plugins output compressed audio data as uncompressed audio sampled data, such as PCM data.

[0125] Audio processing plugins are used to process the raw audio data after the target audio stream has been decoded. Examples include, but are not limited to, noise reduction.

[0126] Resampling plugins are used to resample the raw audio data after the target audio stream has been decoded, such as processing the sound to play at double speed.

[0127] The audio-visual synchronization plugin is used to synchronize the decoded original video data and original audio data based on the parameter information obtained during the decapsulation plugin processing.

[0128] A video playback plugin used to play video data.

[0129] An audio playback plugin used to play audio data.

[0130] For example, refer to Figure 5A As shown, Figure 5A This is a schematic diagram of the GStreamer playback framework, which is based on a plug-in design.

[0131] In some embodiments, the first video source acquisition plugin, the first bitstream encapsulation format plugin, and the first demultiplexer plugin are replaced with the second video source acquisition plugin, the second bitstream encapsulation format plugin, and the second demultiplexer plugin.

[0132] The entire pipeline includes both video and audio paths. Since different video sources have different file acquisition paths and different container formats, it is necessary to replace the video source acquisition plugin, the bitstream container format plugin, and the demultiplexer plugin. It should be noted that in this embodiment, the seamless switching architecture of the system player based on GStreamer supports switching between video streams with the same container format.

[0133] For the audio path, replace the first audio track selection plugin and the first audio decoding plugin with the second audio track selection plugin and the second audio decoding plugin.

[0134] For the audio path, since different video sources have different numbers of audio tracks and different audio encoding formats, it is necessary to replace the audio track selection plugin and the audio decoding plugin.

[0135] For example, refer to Figure 5B As shown, Figure 5B This is a schematic diagram of the seamless switching architecture of a system player based on GStreamer.

[0136] In some embodiments, switching the first video data to the second video data includes:

[0137] The display timestamp corresponding to the last frame of the first video stream is obtained based on the first demultiplexer plugin;

[0138] Set the display timestamp of the last frame of the first video stream to the display timestamp of the first frame of the second video stream, and seamlessly switch the first video data to the second video data.

[0139] Specifically, during the playback of the first video stream, the demultiplexer plugin records the maximum value of the current PTS. When the video decoding plugin receives a switching instruction to seamlessly switch from the first video stream to the second video stream, it determines whether the file of the second video stream has been obtained. If so, it reads the maximum value of the PTS recorded in the current demultiplexer plugin and then performs a seamless switch.

[0140] For example, refer to Figure 5B As shown, during the seamless switching process, the connection between the first demultiplexer plugin and the multi-queue buffer plugin is first disconnected. Then, the previous first video source acquisition plugin, first bitstream encapsulation format plugin, and first demultiplexer plugin are deleted. Next, based on the second video stream, the second video source acquisition plugin, second bitstream encapsulation format plugin, and second demultiplexer plugin are created. The display timestamp corresponding to the last frame of the first video stream from the first demultiplexer plugin is set to the second demultiplexer plugin, and the connection between the second demultiplexer plugin and the multi-queue buffer plugin is re-established. If the second video stream file is not acquired, a playback completion message is sent to the video playback application to notify it that playback has ended.

[0141] The specific steps for switching between video-only and non-video-only video sources differ. A video-only video source refers to a source that, after decapsulation, contains only the compressed video stream data. A non-video-only video source refers to a source that, after decapsulation, contains both compressed video and audio stream data.

[0142] For video-only source material, this issue is resolved by modifying the audio-visual synchronization clock. (See reference...) Figure 6 As shown, Figure 6 This is a flowchart illustrating the seamless switching process for video-only content sources. For example, if it is determined that the next content source is only video, the audio-visual synchronization clock is switched to the system clock. Then, when playing non-video-only content sources, the original clock is switched back.

[0143] In some embodiments, the processing of the second video stream by the target processing module further includes:

[0144] The target processing module decapsulates the second video stream and determines whether the data after decapsulation of the second video stream includes the compressed encoded data of the second audio stream.

[0145] If the data after decapsulation of the second video stream includes compressed and encoded data of the second audio stream, then the clock of each functional plug-in will be switched to the audio clock.

[0146] Based on the second demultiplexer plugin, obtain the second video stream compressed encoded data and the second audio stream compressed encoded data;

[0147] The compressed encoded data of the second video stream and the compressed encoded data of the second audio stream are respectively sent to the multi-queue buffer plugin.

[0148] Specifically, the decapsulation module decapsulates the second video stream and determines whether the decapsulated data contains only compressed video stream data. If so, the second video stream is a video-only source; if it contains both compressed video stream data and compressed audio stream data, the second video stream is a non-video-only source. (Refer to...) Figure 7 As shown, Figure 7 This is a flowchart illustrating the seamless switching process for non-video-only video sources. Upon determining that the second video stream is a non-video-only source, the second demultiplexer plugin instructs the pipeline to switch its clock to an audio clock. The pipeline then instructs each functional plugin to switch its clock to an audio clock. Afterward, the compressed and encoded data of the second video stream is sent to the video buffer queue of the multi-queue buffer plugin; the compressed and encoded data of the second audio stream is sent to the audio buffer queue of the multi-queue buffer plugin.

[0149] In some embodiments, determining whether the data after decapsulation of the second video stream includes the compressed encoded data of the second audio stream further includes:

[0150] If the data after decapsulation of the second video stream does not include the compressed and encoded data of the second audio stream, then the clock of each functional plug-in will be switched to the system clock.

[0151] Based on the second demultiplexer plugin, obtain the second video stream compressed encoding data;

[0152] The compressed and encoded data of the second video stream is sent to the multi-queue buffer plugin.

[0153] Specifically, when it is determined that the second video stream is a video-only source, the second demultiplexer plugin notifies the pipeline to switch the clock to the system clock. The pipeline then notifies each functional plugin to switch the clock to the system clock. After that, the compressed and encoded data of the second video stream is sent to the video buffer queue of the multi-queue buffer plugin.

[0154] Because the video and audio paths are different, it is difficult to handle audio-visual synchronization after video switching. By adding a fake audio path to the videoonly source, the video and audio paths are made consistent, so the original clock can be used when synchronizing audio and video.

[0155] Furthermore, if the data after decapsulation of the second video stream does not include the second audio stream compressed encoding data, then a preset second audio stream compressed encoding data is created based on the second demultiplexer plugin;

[0156] Based on the preset second audio stream compression encoding data, create a preset second audio track selection plugin and a preset second audio decoding plugin;

[0157] The preset second audio track selection plugin, the preset second audio decoding plugin, the multi-queue buffer plugin, and the sound processing plugin are linked to form a preset audio path.

[0158] Specifically, after the second video stream is sent to the second demultiplexer plugin for decapsulation, it determines whether the decapsulated data contains only video stream compressed data. If so, the second video stream is a video-only source; if it contains both second video stream compressed data and second audio stream compressed data, the second video stream is a non-video-only source. If the second video stream is determined to be a non-video-only source, the second demultiplexer plugin creates a preset second audio stream compressed data path. Based on this preset second audio stream compressed data, it creates a preset second audio track selection plugin and a preset second audio decoding plugin and links them together. It reads the source data of the second video stream and sends it down to the multi-queue buffer plugin. Since the second video stream only contains video data, after sending one frame of video data, the preset second audio stream compressed data (i.e., fake audio data) is inserted and sent to the audio buffer queue of the multi-queue buffer plugin.

[0159] Furthermore, since the duration of a video frame differs from that of an audio frame (generally, a video frame is longer than an audio frame), after sending one frame of video data, audio data continues to be transmitted until the PTS difference between the audio and video data is less than 500ms. Thus, by simulating a preset audio stream compression encoding data, the synchronous clock remains consistent during seamless switching.

[0160] In this embodiment of the disclosure, in response to a first playback command, first video data is played. The first playback command instructs the target processing module to complete decoding of the first frame of the first video stream. The target processing module performs decapsulation and decoding processing on the first video stream. During the playback of the first video data, in response to a switching command, the target processing module stops processing the first video stream and processes the second video stream to obtain second video data, switching the first video data to the second video data. Since the switching command instructs a seamless switch from the first video stream to the second video stream, and the encoding format of the first video stream is the same as that of the second video stream, there is no need to close the first video stream during video switching. The target processing module directly performs decapsulation and decoding processing on the second video stream to obtain the second video data, switching the first video data to the second video data. This avoids the brief black screen phenomenon that occurs when closing the original bitstream and restarting playback of a new bitstream, thus achieving seamless switching between different videos and improving the user experience during video switching.

[0161] This disclosure provides a computer device, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any of the seamless video switching methods described in this disclosure.

[0162] Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure. Figure 8 As shown, the computer device includes a processor 810 and a storage device 820; the number of processors 810 in the computer device can be one or more. Figure 8 Taking a processor 810 as an example; the processor 810 and the storage device 820 in a computer device can be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.

[0163] Storage device 820, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the seamless video switching method in the embodiments of this disclosure. Processor 810 executes various functional applications and data processing of the computer device by running the software programs, instructions, and modules stored in storage device 820, thereby realizing the seamless video switching method provided in the embodiments of this disclosure.

[0164] Storage device 820 may primarily include a stored program area and a stored data area. The stored program area may store the operating system and at least one application program required for a given function; the stored data area may store data created based on terminal usage. Furthermore, storage device 820 may include a high-speed random access storage device, and may also include a non-volatile storage device, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, storage device 820 may further include storage devices remotely located relative to processor 810, which can be connected to computer equipment via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0165] The computer device provided in this embodiment can be used to execute the seamless video switching method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0166] This disclosure also provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions implement the various processes of the methods provided in any of the above embodiments and achieve the same technical effects. To avoid repetition, further details are omitted here.

[0167] The computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0168] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the discussion in some embodiments above is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the embodiments and various different variations of the embodiments suitable for specific application considerations.

Claims

1. A display device, characterized in that, include: The controller is configured as follows: In response to the first playback command, play the first video data; The first playback instruction is used to instruct the target processing module to complete the decoding of the first frame of the first video stream. The target processing module is used to perform decapsulation and decoding processing on the first video stream. During the playback of the first video data, in response to a switching command, the target processing module stops processing the first video stream, and the target processing module processes the second video stream to obtain the second video data. When the decoding of the first frame of the second video stream is completed, the first video data is switched to the second video data. The switching command is used to indicate a seamless switch from the first video stream to the second video stream. The encoding format of the first video stream is the same as that of the second video stream. The controller is also configured to: If the data after decapsulation of the second video stream does not include the compressed encoding data of the second audio stream, then a preset compressed encoding data of the second audio stream is created based on the second demultiplexer plugin; Based on the preset second audio stream compression encoding data, create a preset second audio track selection plugin and a preset second audio decoding plugin; The preset second audio track selection plugin, the preset second audio decoding plugin, the multi-queue buffer plugin, and the sound processing plugin are linked to form a preset audio path.

2. The display device according to claim 1, characterized in that, The seamless switching from the first video stream to the second video stream is accomplished based on various functional plugins in the multimedia framework GStreamer, which includes the following functional plugins: Video source acquisition plugin, bitstream encapsulation format plugin, demultiplexer plugin, multi-queue buffer plugin, video decoding plugin, audio track selection plugin, audio decoding plugin, sound processing plugin, resampling plugin, audio-visual synchronization plugin, video playback plugin, and audio playback plugin.

3. The display device according to claim 2, characterized in that, The controller is also configured to: Replace the first video source acquisition plugin, the first bitstream encapsulation format plugin, and the first demultiplexer plugin with the second video source acquisition plugin, the second bitstream encapsulation format plugin, and the second demultiplexer plugin; For the audio path, replace the first audio track selection plugin and the first audio decoding plugin with the second audio track selection plugin and the second audio decoding plugin.

4. The display device according to claim 3, characterized in that, The controller is specifically configured as follows: The step of switching the first video data to the second video data includes: The display timestamp corresponding to the last frame of the first video stream is obtained based on the first demultiplexer plugin; Set the display timestamp of the last frame of the first video stream to the display timestamp of the first frame of the second video stream, and seamlessly switch the first video data to the second video data.

5. The display device according to claim 4, characterized in that, The controller is also configured to: The process of processing the second video stream through the target processing module further includes: The target processing module decapsulates the second video stream and determines whether the data after decapsulation of the second video stream includes the compressed encoded data of the second audio stream. If the data after decapsulation of the second video stream includes compressed and encoded data of the second audio stream, then the clock of each functional plug-in will be switched to the audio clock. Based on the second demultiplexer plugin, obtain the second video stream compressed encoded data and the second audio stream compressed encoded data; The compressed encoded data of the second video stream and the compressed encoded data of the second audio stream are respectively sent to the multi-queue buffer plugin.

6. The display device according to claim 5, characterized in that, The controller is also configured to: The step of determining whether the data after decapsulation of the second video stream includes the compressed encoded data of the second audio stream further includes: If the data after decapsulation of the second video stream does not include the compressed and encoded data of the second audio stream, then the clock of each functional plug-in will be switched to the system clock. Based on the second demultiplexer plugin, obtain the second video stream compressed encoding data; The compressed and encoded data of the second video stream is sent to the multi-queue buffer plugin.

7. A method for seamless video switching, characterized in that, The method includes: In response to a first playback command, the first video data is played; the first playback command is used to instruct the target processing module to complete the decoding of the first frame of the first video stream, and the target processing module is used to perform decapsulation and decoding processing on the first video stream; During the playback of the first video data, in response to a switching command, the target processing module stops processing the first video stream, and the target processing module processes the second video stream to obtain the second video data. When the decoding of the first frame of the second video stream is completed, the first video data is switched to the second video data. The switching command is used to indicate a seamless switch from the first video stream to the second video stream. The encoding format of the first video stream is the same as that of the second video stream. The method further includes: If the data after decapsulation of the second video stream does not include the compressed encoding data of the second audio stream, then a preset compressed encoding data of the second audio stream is created based on the second demultiplexer plugin; Based on the preset second audio stream compression encoding data, create a preset second audio track selection plugin and a preset second audio decoding plugin; The preset second audio track selection plugin, the preset second audio decoding plugin, the multi-queue buffer plugin, and the sound processing plugin are linked to form a preset audio path.

8. The method according to claim 7, characterized in that, The seamless switching from the first video stream to the second video stream is accomplished based on various functional plugins in the multimedia framework GStreamer, which includes the following functional plugins: Video source acquisition plugin, bitstream encapsulation format plugin, demultiplexer plugin, multi-queue buffer plugin, video decoding plugin, audio track selection plugin, audio decoding plugin, sound processing plugin, resampling plugin, audio-visual synchronization plugin, video playback plugin, and audio playback plugin.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the seamless video switching method as described in any one of claims 7-8.

Citation Information

Patent Citations

  • Video playing method based on GStreamer frame

    CN107517411A