Display device and display method of external subtitles
Patent Information
- Application Number
- CN202610805839.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-04
- Publication Date
- 2026-10-16
AI Technical Summary
[0005]本申请提供一种显示设备及外挂字幕的显示方法,以解决显示设备不能成功加载并显示外挂字幕的问题
[0007]上述技术方案具有以下有益效果或优点:
Smart Images

Figure CN122933964A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of display device technology, and in particular to a display device and a method for displaying external subtitles. Background Technology
[0002] Display devices are intelligent devices capable of presenting a user interface and supporting user interaction. Taking smart TVs as an example, smart TVs are television products based on Internet application technology, equipped with open operating systems and chips, possessing open application platforms, enabling two-way human-computer interaction, and integrating multiple functions such as audio-visual, entertainment, and data to meet diverse and personalized user needs.
[0003] When playing video content corresponding to video resources, display devices can support displaying external subtitles independent of the video resources. External subtitles, as a supplement to the video content, can meet the viewing needs of users with different languages and the information retrieval needs in special scenarios. When displaying external subtitles, the display device loads them based on the method of passing Uniform Resource Locator (URL) parameters using the player. Specifically, the path parameter of the subtitle file is appended to the end of the video resource's URL. The player extracts the subtitle path information when parsing the video URL, and then loads the subtitle file through a separate network request or local file read operation. During playback, the subtitle content is rendered synchronously with the video frame on the timeline.
[0004] However, the above-mentioned method of loading external subtitles by passing the subtitle path through URL parameters has a limited information carrying capacity of the URL (for example, the maximum length of the URL is usually no more than 2048 bytes as specified by the HTTP protocol). When multiple external subtitles need to be loaded at the same time, the path information of multiple subtitle files will exceed the information carrying capacity of the URL (i.e., the maximum length limit), causing the player to be unable to fully receive and recognize all subtitle paths, so that the external subtitles cannot be successfully loaded and displayed. Summary of the Invention
[0005] This application provides a display device and a method for displaying external subtitles to solve the problem that the display device cannot successfully load and display external subtitles.
[0006] In a first aspect, some embodiments of this application provide a display device, including: The monitor is configured to display the user interface; The controller is configured with a player module; the controller is configured as follows: In response to a playback request for a video resource associated with at least two external subtitles, a resource mapping file is generated based on the path information of the video resource and the path information of the external subtitles; Input the resource mapping file into the player module; The player module is controlled to parse the first path information of the video resource and the second path information of the first target subtitle that is in the selected state in the resource mapping file. The player module is controlled to load the video resource according to the first path information and to load the first target subtitle according to the second path information. The video resource and the first target subtitle are synchronized on the timeline, and the synchronized video resource and the first target subtitle are output to the display for display.
[0007] The above technical solution has the following beneficial effects or advantages: By managing video and multiple subtitle resources in a unified manner through resource mapping files, the path length limitation caused by URL parameter concatenation can be overcome, enabling simultaneous loading of multiple external subtitles, improving the stability and compatibility of multi-subtitle loading, and thus achieving reliable loading and synchronous display of multiple external subtitles.
[0008] In some embodiments of this application, the controller generates a resource mapping file based on the path information of the video resource and the path information of the external subtitle, specifically configured as follows: The resource mapping file is generated during the playback preparation phase of the player module; The playback preparation phase is the time period from the receipt of the playback request to the start of the player module decoding the first frame of video data.
[0009] The above technical solution has the following beneficial effects or advantages: By embedding the resource mapping file generation process into the idle phase of the corresponding playback flow in the player module, it does not occupy the critical path of video decoding and playback, and does not introduce additional start-up delay, thereby ensuring the smoothness of video playback and user experience.
[0010] In some embodiments of this application, the controller controls the player module to parse the first path information of the video resource and the second path information of the first target subtitle in the selected state from the resource mapping file, specifically configured as follows: The player module is controlled to parse the first path information of the video resource and the path information of the external subtitle to be selected corresponding to the video resource in the resource mapping file; In response to a subtitle selection instruction for a first target subtitle, the path information of the first target subtitle is determined as the second path information; the first target subtitle is one of the external subtitles to be selected.
[0011] The above technical solution has the following beneficial effects or advantages: The system adopts a logical sequence of first parsing the entire subtitle list and then allowing the user to select the target subtitle, which is compatible with the user's actual operating habits; at the same time, it avoids the limitation of needing to determine the target subtitle during the playback request stage, thereby improving the flexibility of subtitle selection and the interactive experience.
[0012] In some embodiments of this application, the controller is further configured to: In response to a subtitle switching instruction for a second target subtitle, the third path information of the second target subtitle is parsed in the resource mapping file; The player module is controlled to load the second target subtitle according to the third path information; The video resource and the second target subtitle are synchronized on the timeline, and the synchronized video resource and the second target subtitle are output to the display for display.
[0013] The above technical solution has the following beneficial effects or advantages: It enables seamless subtitle switching during playback without interrupting video playback or re-initiating playback requests, thus improving the response speed and smoothness of subtitle switching and alleviating issues such as stuttering and the need to restart playback during subtitle switching.
[0014] In some embodiments of this application, the controller is further configured to: Create a demultiplex instance for the resource mapping file; The controller executes the parsing of the first path information of the video resource and the second path information of the first target subtitle in the selected state in the resource mapping file, specifically configured as follows: Through the demultiplexing example, the first path information of the video resource and the second path information of the first target subtitle in the selected state are parsed in the resource mapping file. The controller is configured to load the video resource according to the first path information and load the first target subtitle according to the second path information, specifically as follows: Through the demultiplexing instance, the video resource is loaded according to the first path information, and the first target subtitle is loaded according to the second path information.
[0015] The above technical solution has the following beneficial effects or advantages: By managing video and all external subtitle resources through a single unified demultiplexing instance, system resource consumption can be reduced, memory overhead and CPU load of the player module can be lowered, thereby improving the device's multitasking capabilities.
[0016] In some embodiments of this application, the controller is further configured to: The video resource data is loaded using the demultiplexing instance; The path information of the external subtitle in the unselected state is parsed using the demultiplexing instance; If an incoming subtitle data packet is detected in the external subtitle that is in an unselected state, the demultiplexing instance is controlled to discard the subtitle data packet.
[0017] The above technical solution has the following beneficial effects or advantages: Implement an on-demand loading mechanism for subtitle resources, loading only the subtitles currently selected by the user, and parsing the path information of unselected subtitles without loading the actual data; at the same time, actively discard unexpectedly incoming unselected subtitle data packets, further saving system memory and network bandwidth, and reducing the waste of system resources.
[0018] In some embodiments of this application, the controller is further configured to: In response to a user's instruction to update the external subtitles of the video resource, the path information of the external subtitles associated with the video resource is updated to form update information; Generate an updated resource mapping file based on the updated information; The updated resource mapping file is input into the player module.
[0019] The above technical solution has the following beneficial effects or advantages: It supports dynamic updates (such as adding and deleting) of external subtitles during playback. The list of selectable subtitles can be updated without stopping the current playback, which can improve the flexibility and applicability of external subtitle display and meet the needs of users to adjust the subtitles at any time during viewing.
[0020] In some embodiments of this application, the player module includes a video decoding unit and a subtitle decoding unit; before the controller performs timeline synchronization of the video resource and the first target subtitle, it is further configured to: The video decoding unit is controlled to decode the video resources to form video frame data; The subtitle decoding unit is controlled to decode the first target subtitle to form subtitle data; The controller performs timeline synchronization between the video resource and the first target subtitle, specifically configured as follows: The video frame data and the subtitle data are synchronized on the timeline.
[0021] The above technical solution has the following beneficial effects or advantages: The system employs independent decoding of video and subtitles, with two decoding units working in parallel without interfering with each other, thus improving decoding efficiency. At the same time, the decoding process is separated from the synchronization process, which facilitates separate maintenance and expansion, thereby ensuring the decoding quality of video and subtitles.
[0022] In some embodiments of this application, the controller performs timeline synchronization of the video frame data and the subtitle data, specifically configured as follows: Detect the first timestamp of the video frame data and the second timestamp of the subtitle data; The timeline is aligned based on the first timestamp and the second timestamp, and the aligned subtitle data is superimposed on the corresponding video frame data to generate display data; The controller is configured to output the synchronized video resources and the first target subtitles to the display for display. The display data is output to the display, and the display is controlled to display the display data.
[0023] The above technical solution has the following beneficial effects or advantages: Precise timeline alignment based on timestamps ensures accurate synchronization between subtitles and video footage; simultaneously, subtitle data is directly overlaid onto video frames before display to generate uniform display data, avoiding desynchronization issues during later layer overlay and ensuring the accuracy and stability of subtitle display.
[0024] Secondly, this application also provides a method for displaying external subtitles, including: In response to a playback request for a video resource associated with at least two external subtitles, a resource mapping file is generated based on the path information of the video resource and the path information of the external subtitles; Input the resource mapping file into the player module; The player module is controlled to parse the first path information of the video resource and the second path information of the first target subtitle that is in the selected state in the resource mapping file. The player module is controlled to load the video resource according to the first path information and to load the first target subtitle according to the second path information. The video resource and the first target subtitle are synchronized on the timeline, and the synchronized video resource and the first target subtitle are output to the display for display.
[0025] The above technical solution has the following beneficial effects or advantages: By generating resource mapping files to uniformly integrate the path information of video resources and multiple external subtitles, it can adapt to the management and calling of multiple external subtitle resources. The corresponding playback path is obtained by parsing the resource mapping files, and the selected target subtitle resources are loaded as needed. Simultaneously, timeline synchronization processing is performed on video and subtitle resources to ensure that the subtitle content matches the timing of the video frame, thereby improving the matching degree of video playback and subtitle display in scenarios with multiple external subtitles and enhancing the user's viewing experience. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a schematic diagram illustrating an operational scenario between a display device and a control device provided in some embodiments of this application; Figure 2 This is a schematic diagram of the hardware configuration of a display device provided in some embodiments of this application; Figure 3 This is a schematic diagram of the software configuration of a display device provided in some embodiments of this application; Figure 4 A flowchart illustrating a method for displaying external subtitles provided in some embodiments of this application; Figure 5 This is a schematic diagram illustrating the generation of resource mapping files provided in some embodiments of this application; Figure 6 This application provides schematic diagrams of subtitle switching processes for some embodiments. Figure 7 A flowchart illustrating the process of dynamically updating external subtitles provided in some embodiments of this application; Figure 8 A schematic diagram illustrating the decoding process of video resources and target subtitle resources provided in some embodiments of this application; Figure 9 This is a schematic diagram of the overall pipeline architecture of the player module provided in some embodiments of this application; Figure 10 This application provides internal structural diagrams of audio / video format context demultiplexing modules according to some embodiments. Figure 11 This is an interactive timing diagram of the external subtitle display method provided in some embodiments of this application. Detailed Implementation
[0028] The embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described below do not represent all embodiments consistent with this application. They are merely examples of systems and methods consistent with some aspects of this application as detailed in the claims.
[0029] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0030] 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.
[0031] 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.
[0032] The term "module" refers to any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0033] In this embodiment, the display device 200 generally refers to a device with screen display and data processing capabilities. For example, the display device 200 includes, but is not limited to, smart TVs, mobile terminals, computers, monitors, advertising screens, wearable devices, virtual reality devices, augmented reality devices, etc.
[0034] Figure 1 This is a schematic diagram illustrating an operational scenario between a display device and a control device provided in some embodiments of this application. For example... Figure 1 As shown, a user can operate the display device 200 via touch operation, a mobile terminal 300, and a control device 100. The control device 100 receives user input commands and converts them into control commands that the display device 200 can recognize and respond to. For example, the control device 100 can be a remote control, a stylus, a gamepad, etc.
[0035] The mobile terminal 300 can function as a control device for human-computer interaction between the user and the display device 200. It can also function as a communication device for establishing a communication connection with the display device 200 and exchanging data. In some embodiments, the mobile terminal 300 can have software applications installed on it and communicate with the display device 200 via network communication protocols to achieve one-to-one control and data communication. Furthermore, it can transmit audio and video content displayed on the mobile terminal 300 to the display device 200 for synchronized display.
[0036] In some embodiments, the mobile terminal 300 or other electronic devices may also simulate the functions of the control device 100 by running an application that controls the display device 200.
[0037] like Figure 1 The diagram also shows that the display device 200 communicates with the server 400 via various communication methods. This allows the display device 200 to communicate via a local area network (LAN), a wireless local area network (WLAN), and other networks.
[0038] Display device 200 can provide broadcast television reception function, and can also be equipped with intelligent network television function that provides computer support function, including but not limited to network television, smart television, Internet Protocol television (IPTV), etc.
[0039] Figure 2 Provided for some embodiments of this application Figure 1 Hardware configuration block diagram of display device 200.
[0040] In some embodiments, the display device 200 may include at least one of a tuner 210, a communication device 220, a detector 230, a device interface 240, a controller 250, a display 260, an audio output device 270, a memory, a power supply, and a user input interface 280.
[0041] In some embodiments, detector 230 is used to acquire signals from the external environment or to interact with the outside world. For example, detector 230 includes a light receiver, a sensor for acquiring ambient light intensity; or, detector 230 includes an image acquisition device, such as a camera, which can be used to acquire external environmental scenes, user attributes, or user interaction gestures; or, detector 230 includes a sound acquisition device, such as a microphone, for receiving external sounds.
[0042] In some embodiments, the display 260 includes display function components for presenting images and driving components for driving image display. The display 260 is used to receive and display image signals output from the controller 250. For example, the display 260 can be used to display video content, image content, menu control interface components, and user control UI interfaces, etc.
[0043] In some embodiments, the communication device 220 is a component used to communicate with external devices or the server 400 according to various communication protocol types. The display device 200 may have multiple communication devices 220 depending on the supported communication methods. For example, when the display device 200 supports wireless network communication, it may have a communication device 220 with WiFi functionality. When the display device 200 supports Bluetooth connectivity, it needs to have a communication device 220 with Bluetooth functionality.
[0044] The communication device 220 enables the display device 200 to communicate with external devices or the server 400 via wireless or wired connections. Wired connections utilize data cables, interfaces, or other components to connect the display device 200 to external devices. Wireless connections utilize wireless signals or wireless networks. The display device 200 can directly establish a connection with external devices or indirectly through gateways, routers, or other connection devices.
[0045] In some embodiments, the controller 250 may include at least one of a central processing unit, a video processor, an audio processor, a graphics processor, and a power processor, and a first to an nth interface for input / output. The controller 250 controls the operation of the display device and responds to user operations through various software control programs stored in memory. The controller 250 controls the overall operation of the display device 200.
[0046] In some embodiments, the controller 250 and the tuner 210 may be located in different separate devices, that is, the tuner 210 may also be located in an external device of the main device where the controller 250 is located, such as an external set-top box.
[0047] In some embodiments, a user can input user commands through a graphical user interface (GUI) displayed on a display 260, and the user input interface 280 receives the user input commands through the graphical user interface (GUI).
[0048] In some embodiments, the audio output device 270 can be a built-in speaker of the display device 200 or an external audio output device connected to the display device 200. For the external audio output device connected to the display device 200, the display device 200 may also be provided with an external audio output terminal, through which the audio output device can be connected to the display device 200 to output sound from the display device 200.
[0049] In some embodiments, the user input interface 280 can be used to receive instructions from user input.
[0050] To enable user interaction, in some embodiments, the display device 200 may run an operating system. The operating system is a computer program used to manage and control the hardware and software resources of the display device 200. The operating system can control the display device to provide a user interface; for example, the operating system can directly control the display device to provide a user interface, or it can provide a user interface by running an application. The operating system also allows users to interact with the display device 200.
[0051] It should be noted that the operating system can be a native operating system based on a specific operating platform, a third-party operating system that is deeply customized based on a specific operating platform, or an independent operating system specifically developed for display devices.
[0052] An operating system can be divided into different modules or levels based on the functions it implements, for example... Figure 3 As shown, in some embodiments, the system is divided into three layers, from top to bottom: the Applications layer (referred to as the "application layer"), the middleware layer, and the hardware layer.
[0053] In some embodiments, the application layer provides services and interfaces for applications, enabling the display device 200 to run applications and interact with the user based on the applications. The application layer may contain at least one application, which may be a built-in Windows program, system settings program, or clock program of the operating system; or it may be an application developed by a third-party developer. In specific implementations, the application packages in the application layer are not limited to the examples above.
[0054] The framework layer provides application programming interfaces (APIs) and a programming framework for applications. The application framework layer includes predefined functions. It acts as a central processing unit, determining the actions taken by applications within the application layer. Through the API, applications can access system resources and obtain system services during execution.
[0055] like Figure 3 As shown, Figure 3 Provided for some embodiments of this application Figure 1 The diagram shows the software configuration of the display device. In some embodiments, the system of the display device 200 can be divided into three layers, from top to bottom: the application layer, the middleware layer, and the hardware layer.
[0056] The application layer mainly includes commonly used applications on TVs, as well as the application framework. The commonly used applications are mainly browser-based applications, such as HTML5 apps, and native apps. An application framework is a complete program model that has all the basic functions required by standard application software, such as file access, data exchange, and the user interface for these functions (toolbar, status bar, menu, dialog box).
[0057] Native apps can support online or offline access, push notifications, or access to local resources.
[0058] The middleware layer includes various television protocols, multimedia protocols, and system components. Middleware can use the basic services (functions) provided by system software to connect different parts of application systems or different applications on the network, achieving resource sharing and function sharing.
[0059] The hardware layer mainly includes the Hardware Abstraction Layer (HAL) interface, hardware, and drivers. The HAL interface is a unified interface for all TV chips, with the specific logic implemented by each individual chip. Drivers mainly include: audio drivers, display drivers, Bluetooth drivers, camera drivers, Wi-Fi drivers, USB drivers, HDMI drivers, sensor drivers (such as fingerprint sensors, temperature sensors, pressure sensors, etc.), and power drivers.
[0060] It should be noted that the above examples are merely a simple division of operating system functions and do not limit the specific form of the operating system of the display device 200 in this application embodiment. Depending on the function of the display device, the type of operating system, and other factors, the number of levels and the specific level type of the operating system may be expressed in other forms.
[0061] In some embodiments, when the display device 200 plays video resources, it can support displaying external subtitles independent of the video resources. External subtitles, as a supplement to the video content, can meet the viewing needs of users speaking different languages, as well as the information retrieval needs in special scenarios. When loading and displaying external subtitles, the display device 200 relies on the player module to complete the loading via URL parameters.
[0062] In some embodiments, the display device 200 appends the path parameter of the subtitle file to the end of the URL of the video resource. When the player module parses the video URL, it extracts the subtitle path information, loads the subtitle file through an independent network request or local file reading operation, and finally renders the subtitle content and video screen synchronously according to the timeline during playback.
[0063] To facilitate understanding, the loading background of external subtitles will be explained first. When the display device 200 plays video resources, the user can select the external subtitle file to be loaded through the operation interface of the display device 200. The external subtitle file is a text data file independent of the video resource file, usually stored in formats such as SRT (SubRip Text), ASS (Advanced SubStation Alpha), and SUB, which contains the start and end times of each subtitle and its corresponding text content. When a video resource is associated with an external subtitle, basic functionality can be achieved by passing it through URL parameters.
[0064] However, when a video resource is associated with multiple external subtitles (for example, a movie provides external subtitle files in Chinese, English, and Japanese), the length of the URL is limited by the communication protocol (such as the HTTP protocol, which stipulates that the maximum length of the URL is usually no more than 2048 bytes). The path information of multiple subtitle files exceeds the maximum carrying capacity of the URL, and the player module cannot fully receive and recognize all subtitle paths, resulting in the failure to load some or all external subtitles.
[0065] Furthermore, when using URL parameter passing, the loading of video resources and subtitle resources are independent processes, completed separately through different network requests or file read operations. Since the initialization of subtitle files (including file opening, format parsing, encoding recognition, etc.) requires additional processing time, in unstable network environments or with large subtitle files, the subtitle stream may become ready later than the video stream, resulting in no subtitles displayed for several seconds (usually 3 to 5 seconds) after the video starts playing, impacting the user's viewing experience.
[0066] To address the aforementioned issues, this application implements a resource mapping file to uniformly manage the path information of video resources and multiple external subtitles, replacing the URL parameter concatenation method. This overcomes the limitation of URL length on the number of subtitles, and by uniformly managing multiple subtitles through resource mapping files, it improves the stability of multi-subtitle loading and the smoothness of switching, while reducing the system resource consumption of the display device 200. The technical solution of this application will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0067] In this embodiment, for ease of description, video resources and external subtitle resources are collectively referred to as media resources. A resource mapping file is a descriptive file organized in a structured data format (such as Extensible Markup Language XML format) to record the path information of video resources and the path information of at least two external subtitles associated with the video resources.
[0068] In some embodiments, based on the hardware and software architecture of the display device 200 described above, the controller 250 is configured with a player module and is configured to implement the method for displaying external subtitles provided in the embodiments of this application. Figure 4 This is a flowchart illustrating a method for displaying external subtitles according to some embodiments of this application. Figure 4 As shown, controller 250 is configured to perform the following steps: S401. In response to a playback request for a video resource associated with at least two external subtitles, generate a resource mapping file based on the path information of the video resource and the path information of the external subtitles.
[0069] When a user selects to play a video resource through the user interface of display device 200, controller 250 receives the playback request for the video resource. The playback request carries the identification information of the video resource (such as a Uniform Resource Identifier URI or file path), and controller 250 queries the external subtitle information associated with this video resource based on the identification information of the video resource.
[0070] In some implementations, the controller 250 can obtain a list of external subtitle files located in the same directory as the video resource or in a specified subtitle directory by querying the media library index or file system directory where the video resource is located. When the query result shows that the video resource is associated with at least two external subtitles, the resource mapping file generation process is triggered.
[0071] In some embodiments, the controller 250 generates a resource mapping file during the playback preparation phase of the player module. The playback preparation phase is the time period from receiving a playback request until the player module begins decoding the first frame of video data.
[0072] In some embodiments, the playback process of the player module includes, in sequence, an initialization phase, a preparation phase, a start phase, and a decoding and rendering phase. During the preparation phase, the player module has not yet begun decoding the video data. The controller 250 utilizes idle time to generate the resource mapping file, without occupying the critical path for video decoding and playback, thereby avoiding the introduction of additional playback delays and ensuring smooth video playback.
[0073] Figure 5 This is a schematic diagram illustrating the generation of resource mapping files provided in some embodiments of this application. In some embodiments, after receiving a playback request during the preparation phase, the controller 250 determines whether the video resource is associated with external subtitles; if so, it collects the path information of the video resource and the path information of all associated external subtitles, and organizes the above path information into a resource mapping file according to a preset structured format.
[0074] In some embodiments, the resource mapping file adopts XML format. XML format has good extensibility and self-descriptive properties, and can clearly express the hierarchical relationships and attribute information between resources. The resource mapping file contains a resource list node (AssetList), under which there are at least one video resource entry and at least two external subtitle resource entries. Each resource entry contains a resource type field (MediaType) and a resource path field (Path). The resource type field indicates the media resource type corresponding to this entry, such as video (VIDEO) or subtitle (SUBTITLE); the resource path field records the access path of this media resource, which can be an absolute path, a relative path, or a network URL address from the local file system.
[0075] For example, the content structure of a resource mapping file (such as one named playlist.xml) is as follows: <xml version="1.0" encoding="UTF-8" standalone="no"> <hsplaylistassetmap> <creator language="en"> Display Device< / creator> <issuedate> 2026-04-27T21:32:17Z< / issuedate> <issuer language="en"> VIDAA< / issuer> <isap> 1< / isap> <assetlist> <asset> <mediatype> VIDEO< / mediatype> <path> http: / / path_to_file / test.mp4< / path> < / asset> <asset> <mediatype> SUBTITLE< / mediatype> <path> http: / / path_to_file / test.ch.srt< / path> < / asset> <asset> <mediatype> SUBTITLE< / mediatype> <path> http: / / path_to_file / test.eng.ass< / path> < / asset> <asset> <mediatype> SUBTITLE< / mediatype> <path> http: / / path_to_file / test.jp.srt< / path> < / asset> < / assetlist> < / hsplaylistassetmap> The `HSPlaylistAssetMap` is the root node of the resource mapping file, used to identify this file as a resource mapping file defined in this scheme. The `Creator` field records the entity that created this file, the `IssueDate` field records the file creation time, and the `Issuer` field records the publisher information. The `IsAP` field indicates whether the resource path is an absolute path. When the `IsAP` value is 1, it means that the `Path` field in each Asset entry uses an absolute path; when the `IsAP` value is 0, it means that the `Path` field in each Asset entry uses a relative path relative to the directory where the resource mapping file is located.
[0076] The AssetList node contains multiple Asset child nodes, each representing a media resource entry. In the example above, AssetList contains four Asset entries: the first Asset has MediaType "VIDEO," indicating a video resource, and its path points to the file test.mp4; the second Asset has MediaType "SUBTITLE," indicating an external subtitle resource, and its path points to a Chinese SRT subtitle file; the third Asset has MediaType "SUBTITLE," and its path points to an English ASS subtitle file; the fourth Asset has MediaType "SUBTITLE," and its path points to a Japanese SRT subtitle file. In this way, a single resource mapping file manages the path information of one video resource and three external subtitle resources uniformly, no longer constrained by URL length limitations.
[0077] It should be noted that the XML format described above is merely an example. Resource mapping files can also use other structured data formats, such as JSON (JavaScript Object Notation), YAML (YAML Ain't MarkupLanguage), or custom binary formats, as long as they can record the mapping relationship between video resources and multiple external subtitle resources. This application does not impose any restrictions on this.
[0078] In other embodiments, for SUB / IDX format subtitle files (a subtitle format that includes image data and an index file), a subtitle entry may correspond to two physical files (a .idx index file and a .sub data file). In this case, the controller 250 configures two Path fields for this subtitle entry in the resource mapping file, pointing to the .idx file and the .sub file respectively. The player module can recognize this subtitle entry as a multi-file type subtitle and load it accordingly during parsing.
[0079] S402. Input the resource mapping file into the player module.
[0080] After generating the resource mapping file, the controller 250 inputs the resource mapping file to the player module. In some implementations, the controller 250 passes the path (or file handle) of the resource mapping file to the input interface of the player module. Upon receiving the resource mapping file, the player module treats it as a media resource description file to be processed, instead of directly passing the video resource URL.
[0081] In some embodiments, the player module is implemented based on the FFmpeg / libav multimedia framework. After the preparation phase ends and the start command is received, the controller 250 passes the resource mapping file to the GStreamer of the player module for further processing.
[0082] In this embodiment of the disclosure, by generating a resource mapping file during the preparation stage, the path information of multiple subtitles is uniformly encapsulated in the resource mapping file, avoiding the path length limitation caused by URL parameter concatenation, realizing the simultaneous management and loading of multiple external subtitles, and improving the stability and compatibility of subtitle loading.
[0083] In some embodiments, the controller 250 controls the player module to parse the path information of the video resources and the path information of the subtitle resources in the resource mapping file. The player module performs a full parsing of the resource mapping file, extracting the first path information of the video resources and the path information of all external subtitles to be selected corresponding to the video resources.
[0084] In some embodiments, the player module reads the contents of the resource mapping file, traverses all Asset child nodes under the AssetList node according to the XML parsing rules, distinguishes video resources and subtitle resources according to the MediaType field of each Asset child node, and extracts the corresponding Path field values respectively.
[0085] After parsing, the player module obtains a complete list of media resource paths, including: a primary path (corresponding to the video resource) and path information for at least two external subtitles to be selected. The player module can determine the primary target subtitle from the external subtitles to be selected based on preset rules or user instructions.
[0086] In some embodiments, the controller 250 determines the path information of the first target subtitle as the second path information in response to a subtitle selection instruction for the first target subtitle, where the first target subtitle is one of the external subtitles to be selected. The subtitle selection instruction may be actively triggered by the user through the interactive interface of the display device 200 (for example, the user selects Chinese in the subtitle menu), or may be automatically determined by the controller 250 according to a preset policy.
[0087] In some implementations, the controller 250 may automatically match the external subtitle of the corresponding language as the first target subtitle according to the system language setting of the display device 200. For example, when the system language of the display device 200 is set to Chinese, the controller 250 preferentially selects, as the first target subtitle, a subtitle whose file extension or file name contains identifiers such as ch, chs, zh, chi, and Chinese; when the system language is set to English, the subtitle containing identifiers such as en, eng, and English is preferentially selected. If no subtitle corresponding to the system language is matched, the first subtitle in the list of external subtitles to be selected is selected as the first target subtitle.
[0088] In other implementations, the controller 250 may determine the first target subtitle according to the user's historical subtitle selection record. For example, the controller 250 records the subtitle language type selected by the user in each of the past N video playbacks (N is a preset value, such as N=5), counts the selection frequency of each language type, and selects the subtitle corresponding to the language type with the highest frequency as the first target subtitle.
[0089] The embodiments of the present disclosure adopt a logical sequence of first parsing the full subtitle list and then allowing the user to select or the system to automatically determine the target subtitle, which is adapted to the actual operation habits of the user; at the same time, the limitation that the target subtitle needs to be determined at the playback request stage is avoided, and the flexibility of subtitle selection and interactive experience are improved.
[0090] In the prior art, an independent demux instance is created for each external subtitle, that is, independent cache space needs to be allocated for each subtitle stream, and the memory consumption increases linearly with the number of subtitles, which imposes great pressure on resource management of an embedded system such as the display device 200. At the same time, when the user switches subtitles during playback, it is necessary to destroy the demux instance of the current subtitle and create a demux instance of the new subtitle, which involves operations such as resource release, reinitialization, and stream positioning, resulting in obvious stuttering during subtitle switching.
[0091] To address the aforementioned issues, in some embodiments, the controller 250 creates a demux instance for the resource mapping file. The demux instance is a processing unit within the player module, used to manage the data reading and streaming distribution of each media resource in the resource mapping file. The controller 250 performs path resolution and resource loading operations through the demux instance; specifically, it parses the first path information of the video resource and the second path information of the selected first target subtitle in the resource mapping file using the demux instance, and loads the video resource based on the first path information and the first target subtitle based on the second path information using the demux instance.
[0092] In some embodiments, the internal structure of the demultiplexing instance is based on a custom implementation of AVFormatContext in the FFmpeg / libav framework, hereinafter referred to as AVFormatContext_hsvideo. AVFormatContext_hsvideo, as a custom demultiplexer, is registered and managed in the libav module according to the general AVFormatContext, allowing the player module to process resource mapping files in the same way as it processes ordinary media files.
[0093] In some embodiments, the internal processing flow of AVFormatContext_hsvideo is as follows: First, the Source module is responsible for calling various network protocols or local file system protocols such as HTTP, NAS (Network Attached Storage), and SMB (Server Message Block) to pull raw data streams from the data source indicated by the path information; then, the Queue module performs a small amount of caching on the raw data output by the Source module (for example, the cache size for each data stream is 128KB to 256KB) to mitigate instantaneous data interruptions caused by network fluctuations; next, AVFormatContext_hsvideo constructs independent AVFormatContext-vid and AVFormatContext-ext_sub management objects for each media resource (video resource or external subtitle resource) in the resource mapping file, and each management object is independently responsible for the data parsing and stream management of the corresponding media resource.
[0094] On the data output side, the Stream_Align module manages the call scheduling of the read_packet function. Based on the currently selected stream information (i.e., the identifier of the first target subtitle), the Stream_Align module determines which AVFormatContext object to read the data packet from. For streams that are not currently being played (i.e., the data stream corresponding to external subtitles that are not currently selected), the Stream_Align module only parses the path information and does not read the actual data. The Stream_Align module outputs the selected data packets to the read_packet function using pull mode, and finally, the av_read_frame function provides the synchronized video and subtitle data to the outside world.
[0095] In some embodiments, the controller 250 loads video resource data through a demultiplexing instance and simultaneously parses the path information of external subtitles in an unselected state through the demultiplexing instance. When the player module reads data from the data source through the demultiplexing instance, there may be a situation where data packets unexpectedly flow into the unselected subtitles (e.g., data flow caused by network data prefetching or buffer preloading). The controller 250 detects whether subtitle data packets are flowing into the unselected subtitles, and if it detects that subtitle data packets are flowing into the unselected subtitles, it controls the demultiplexing instance to discard these subtitle data packets.
[0096] For example, the Stream_Align module maintains an identifier for the currently selected stream. Each time the read_packet function is called, the Stream_Align module checks whether the stream identifier to which the data packet belongs matches the identifier of the currently selected stream. If they match, the data packet is output normally; if they do not match, the data packet is discarded and the corresponding memory space is released.
[0097] This embodiment of the disclosure manages video and all external subtitle resources through a single unified demultiplexing instance, which reduces system resource consumption. Compared with the prior art that creates an independent demultiplexing instance for each subtitle, this application only requires one demultiplexing instance, which can reduce the memory overhead and CPU load of the player module.
[0098] In some embodiments, during video playback, the user may need to switch the currently displayed subtitles. For example, switching from Chinese to English, from one language to another, or from subtitles to bilingual display. To meet this need, the controller 250 is configured to implement the subtitle switching function.
[0099] Figure 6 This is a schematic diagram illustrating the subtitle switching process provided in some embodiments of this application. For example... Figure 6 As shown, in some embodiments, the controller 250, in response to a subtitle switching instruction for a second target subtitle, parses the third path information of the second target subtitle in the resource mapping file (S601). The subtitle switching instruction can be an instruction triggered by a user selecting another subtitle on the subtitle switching interface of the display device 200 via a remote control or touch operation; the second target subtitle is another subtitle among the external subtitles to be selected, excluding the first target subtitle.
[0100] After parsing and obtaining the third path information, the controller 250 controls the player module to load the second target subtitle according to the third path information (S602). For example, the controller 250 updates the currently selected stream identifier in the demultiplexing instance, switching from the stream identifier corresponding to the first target subtitle to the stream identifier corresponding to the second target subtitle. In the subsequent read_packet call, the Stream_Align module reads the data packet of the second target subtitle from the corresponding AVFormatContext-ext_sub management object according to the updated stream identifier.
[0101] After loading the second target subtitle, the controller 250 synchronizes the video resource and the second target subtitle on the timeline, and outputs the synchronized video resource and the second target subtitle to the display 260 for display (S603). The synchronization process is the same as the synchronization process of the first target subtitle, and will be described in detail in subsequent embodiments.
[0102] It should be noted that during subtitle switching, the decoding and rendering of video resources remain unaffected, and the video continues to display normally. The player module only changes the source of the subtitle data stream; it does not require recreating the demultiplexing instance, re-initiating playback requests, or interrupting the video decoding process.
[0103] This embodiment of the disclosure enables seamless subtitle switching during playback. The switching process does not require interrupting video playback or re-initiating playback requests, thereby improving the response speed and smoothness of subtitle switching and alleviating the problem of stuttering during subtitle switching and the need to restart playback.
[0104] In some embodiments, during video playback, users may need to add new external subtitles or delete existing ones. For example, a user may download a new subtitle file from the network while watching a video and want to load and use it immediately; or a user may want to remove subtitle options that are no longer needed from the subtitle list.
[0105] Figure 7 This is a schematic diagram illustrating the process of dynamically updating external subtitles according to some embodiments of this application. For example... Figure 7 As shown, in some embodiments, the controller 250 also responds to a user's instruction to update the external subtitles of the video resource, updating the path information of the external subtitles associated with the video resource to form update information (S701). An updated resource mapping file is generated based on the update information (S702), and then the updated resource mapping file is input to the player module (S703).
[0106] In some implementations, the subtitle update instruction may include an add subtitle instruction and a delete subtitle instruction. For the add subtitle instruction, the update instruction carries the path information of the subtitle to be added, and the controller 250 appends this path information to the subtitle path list of the current video resource to form update information; for the delete subtitle instruction, the update instruction carries the identification information of the subtitle to be deleted, and the controller 250 removes the corresponding path information from the subtitle path list of the current video resource to form update information.
[0107] After generating the updated information, controller 250 regenerates an updated resource mapping file based on the updated information (i.e., the updated set of video resource path information and external subtitle path information). The format of the updated resource mapping file is the same as the initial resource mapping file, but the content of the Asset child nodes under the AssetList node reflects the updated set of path information.
[0108] The controller 250 passes the path to the updated resource mapping file to the player module. Upon receiving this path, the player module re-parses the resource list in the updated resource mapping file and updates its internal list of selectable external subtitles. After the subtitle list is updated, the user can select a new target subtitle from the updated list for display.
[0109] It should be noted that the entire update process is completed in the background, and the current playback status of the video is not affected, so the display of the current subtitles is not interrupted for the user.
[0110] This embodiment supports dynamic updating (such as adding and deleting) of external subtitles during playback. The list of selectable subtitles can be updated without stopping the current playback, which can improve the flexibility and applicability of external subtitle display and thus meet the user's need to adjust the subtitles at any time during viewing.
[0111] In some embodiments, after the path resolution and resource loading of video resources and target subtitle resources are completed through the resource mapping file, the player module needs to decode the video resources and target subtitle resources separately. The player module includes a video decoding unit and a subtitle decoding unit, which operate independently and in parallel.
[0112] Figure 8 This is a schematic diagram illustrating the decoding process of video resources and target subtitle resources provided in some embodiments of this application. For example... Figure 8 As shown, in some embodiments, controller 250 is configured to perform the following steps: S801 controls the video decoding unit to decode video resources to form video frame data.
[0113] The video decoding unit calls the corresponding hardware or software decoder based on the encoding format of the video resource (such as H.264, H.265 / HEVC, VP9, AV1, etc.) to decode the compressed video data into frame-by-frame raw image data (such as pixel matrices in YUV or RGB format). The decoding output of the video decoding unit is frame-by-frame video frame data, and each frame of video frame data is associated with a first timestamp (Presentation Time Stamp, PTS), which indicates when this video frame should be displayed.
[0114] S802: Control the subtitle decoding unit to decode the first target subtitle to form subtitle data.
[0115] The subtitle decoding unit calls the corresponding subtitle parser according to the format of the subtitle file (such as SRT, ASS, SUB, etc.) to parse the text content of the subtitle file into structured subtitle data. Each subtitle data includes the subtitle text content, the subtitle display start time, and the subtitle display end time. The subtitle decoding unit generates a corresponding second timestamp based on the subtitle display start and end times.
[0116] In some implementations, for SRT format subtitle files, the subtitle decoding unit parses the subtitle file line by line, identifies the sequence number, timecode, and text content of each subtitle, converts the timecode into a timestamp value in milliseconds, and concatenates multiple lines of text content into a complete subtitle text.
[0117] For ASS format subtitle files, the subtitle decoding unit parses the style information of the subtitle file (such as font, font size, color, position, border, shadow, etc.) and records the style parameters when generating subtitle data, so that the subtitles can be rendered according to the specified style when displayed.
[0118] For subtitle files in SUB / IDX format, the subtitle decoding unit parses the IDX index file to obtain the time information and the offset of the image data in the SUB file for each subtitle. Based on the offset, it extracts the corresponding subtitle image data (usually RLE-encoded bitmap data) from the SUB file and decodes it to form the subtitle image.
[0119] S803. Synchronize the video frame data and subtitle data along the timeline.
[0120] The controller 250 performs timeline synchronization between the decoded video frame data and subtitle data, rather than directly synchronizing the original video resource files and subtitle resource files. The controller 250 detects the first timestamp of the video frame data and the second timestamp of the subtitle data, aligns the timeline based on the first timestamp and the second timestamp, and overlays the aligned subtitle data onto the corresponding video frame data to generate display data.
[0121] In some embodiments, subtitle overlay can be based on the pixel buffer of video frame data. At a specified position in the video frame data (usually the bottom center of the video screen), the subtitle text is rendered as pixel data according to the style parameters of the subtitle data (such as font, font size, color, transparency, border, etc.) and blended with the pixel data of the video frame (alpha blending) to generate the overlaid display data.
[0122] In some implementations, the controller 250 uses a text rendering engine (such as the FreeType font rendering library) to render the subtitle text as bitmap data, and then uses an image overlay module to composite the subtitle bitmap with the video frame. The composited display data is a complete video frame, containing the original video image and the subtitle content overlaid on it.
[0123] The controller 250 outputs display data to the display 260 and controls the display 260 to display the display data. Since the display data is a unified data of video frames and subtitles pre-synthesized, the display 260 only needs to process it according to the normal video frame display method, without the need for additional layer management and compositing operations, which can reduce the processing complexity of the display subsystem.
[0124] In this embodiment, video and subtitles are decoded independently, with the two decoding units working in parallel without interference, thus improving decoding efficiency. On a multi-core CPU or a display device 200 supporting hardware decoding, the video decoding unit can utilize a GPU (Graphics Processing Unit) or dedicated video decoding hardware for hardware-accelerated decoding, while the subtitle decoding unit performs subtitle parsing on the CPU with a lower computational load. The concurrent execution of both units without blocking each other shortens the end-to-end latency from resource loading to the first frame display. Furthermore, separating the decoding process from the synchronization process facilitates separate maintenance and expansion, thereby ensuring the decoding quality of both video and subtitles.
[0125] In some embodiments, to improve the synchronization accuracy of subtitle display, the controller 250 may adopt at least one of the following optimization strategies: setting a timestamp calibration module at the output of the video decoding unit and the subtitle decoding unit, periodically (e.g., every 5 seconds) comparing the timestamps of the two data streams and fine-tuning the clock offset; extending the display time interval of the subtitle data with forward and backward tolerance (e.g., each extended by 50 milliseconds) to compensate for the slight delay introduced by subtitle parsing and rendering; and performing inter-frame smoothing processing on the subtitle overlay in scenarios with high video frame rates (e.g., 60fps) to avoid position jitter of the subtitles between adjacent frames.
[0126] In other embodiments, when the controller 250 supports simultaneous display of multiple subtitles (such as bilingual subtitles), the controller 250 can generate corresponding subtitle data for the first target subtitle and the second target subtitle (or more target subtitles) respectively, and overlay the multiple subtitle data onto different positions of the video frame during the overlay stage. For example, the first language subtitle is overlaid at the bottom center of the video screen, and the second language subtitle is overlaid above the first language subtitle at a preset spacing. The timeline synchronization logic of the multiple subtitles is the same as that of the single subtitle, and each subtitle is aligned and matched with the video frame according to its own timestamp.
[0127] In this embodiment, precise timeline alignment is performed based on timestamps to ensure the synchronization accuracy between subtitles and video frames. At the same time, subtitle data is directly superimposed onto video frames before display to generate unified display data, avoiding asynchrony issues that may occur during later layer superposition, thus ensuring the accuracy and stability of subtitle display.
[0128] Figure 9 This is a schematic diagram of the overall pipeline architecture of the player module provided in some embodiments of this application. For example... Figure 9 As shown, in some embodiments, the player module is built on the GStreamer multimedia framework and consists of a media playback container 900 (mediaplaybin), a unified resource decoding container 910 (uridecodebin), a decoding container 920 (decodebin), a parsing container 930 (parsebin), and a playback output container 940 (playsink) cascaded in sequence. The unified resource decoding container 910 contains a video source component and a data queue component. The data queue component sends raw data to the parsing container in pull mode. The parsing container 930 integrates the libav multimedia processing library 931. The libav library 931 has pre-built common audio and video processing function modules such as parsing, positioning, speed adjustment, and track switching, and a newly added audio and video format context demultiplexing module (AvFormatContext-hsvideo) serves as the core data processing unit. The video stream, audio stream, and subtitle stream output by the parsing container 930 are written to their respective video queue, audio queue, and subtitle queue for buffering in push mode. After global timeline synchronization is completed by the stream synchronizer, they are distributed to the video processing link 941 (vbin), audio processing link 942 (abin), and subtitle processing link 943 (subsink) in the playback output container. Each link sequentially passes through the decoding unit and the output unit to complete data processing, ultimately achieving synchronized rendering and output of audio and video content and external subtitles.
[0129] Figure 10 This is a schematic diagram of the internal structure of the audio / video format context demultiplexing module (AvFormatContext-hsvideo) provided in some embodiments of this application. For example... Figure 10 As shown, in some embodiments, the AvFormatContext-hsvideo module is internally divided into four layers: a data source layer, a data cache layer, a format parsing layer, and a stream scheduling layer. The data source layer contains data source units supporting multiple transmission protocols, capable of reading raw data from video resources and external subtitle resources via protocols such as file transfer (HTTP), network file system (NFS), and server message block (SMB). After acquiring data, the data source unit pushes the bitstream to the corresponding cache component. The data cache layer configures an independent data queue 1001 for each media resource. The raw data read by the data source unit is written to the corresponding data queue for temporary caching in push mode, and each data queue then outputs the cached data to the subsequent context management unit in pull mode. The format parsing layer creates a corresponding data queue for each data queue. Independent audio and video format context management objects (i.e., context management in the diagram) are responsible for format identification and data packet parsing of the corresponding media resources. The stream scheduling layer reads data packets from each format context management object in pull mode through the stream alignment unit (Stream-Align), schedules the output order of data packets according to the currently selected track information, and uniformly passes the selected data packets to the data packet reading (read_packet) interface 1002. The data packet reading interface continues to transmit data in pull mode, and finally provides a standardized synchronous media data stream to the outside world through the audio and video frame reading interface (av_read_frame) function 1003.
[0130] Figure 11 This is an interactive timing diagram illustrating the external subtitle display method provided in some embodiments of this application. For example... Figure 11 As shown, in some embodiments, the user sends a video resource playback request associated with at least two external subtitles to the controller through the interactive interface displayed on the monitor 260. During the playback preparation phase of the player module, the controller 250 queries and collects all external subtitle path information corresponding to the video resource, and generates a resource mapping file containing the mapping relationship between the video and multiple subtitle paths. The controller 250 inputs the resource mapping file to the player module. The controller 250 controls the demultiplexer to parse the resource mapping file, extract the first path information of the video resource and the path information of all external subtitles to be selected, and determines the first target subtitle.
[0131] The controller 250 controls the demultiplexer to load video resource data according to the first path information and load corresponding subtitle data according to the second path information of the first target subtitle. Simultaneously, it discards incoming data packets without selected subtitles. The demultiplexer sends the separated video data packets to the video decoding unit and the subtitle data packets to the subtitle decoding unit. The video decoding unit decodes and generates video frame data with a first timestamp, and the subtitle decoding unit decodes and generates subtitle data with a second timestamp. The controller detects the timestamps of the two data streams and aligns them along the timeline. It then overlays the subtitle data onto the corresponding video frame to generate unified display data, which is output to the monitor for synchronized display.
[0132] Based on the aforementioned display device 200, some embodiments of this application also provide a method for displaying external subtitles, which can be applied to the display device 200, such as... Figure 4 As shown, the method includes the following steps: S401. In response to a playback request for a video resource associated with at least two external subtitles, generate a resource mapping file based on the path information of the video resource and the path information of the external subtitles.
[0133] S402. Input the resource mapping file into the player module.
[0134] S403, control the player module, and parse the first path information of the video resource and the second path information of the first target subtitle that is selected in the resource mapping file.
[0135] S404, Control the player module to load video resources according to the first path information, and load the first target subtitle according to the second path information.
[0136] S405. Synchronize the video resources and the first target subtitles on the timeline, and output the synchronized video resources and the first target subtitles to the monitor for display.
[0137] The specific implementation of the above steps is the same as the corresponding description in the aforementioned embodiment of display device 200, and will not be repeated here.
[0138] The method integrates the path information of video resources and multiple external subtitles by generating a resource mapping file, adapting to the management and calling of multiple external subtitle resources; it obtains the corresponding playback path by parsing the resource mapping file and loads the selected target subtitle resources as needed; at the same time, it performs timeline synchronization processing on video resources and subtitle resources to ensure that the subtitle content matches the timing of the video screen, thereby improving the matching degree of video playback and subtitle display in multi-external subtitle scenarios and improving the user's viewing experience.
[0139] In some embodiments, the controller 250 can also support simultaneous display of multiple subtitles (bilingual subtitle mode). In bilingual subtitle mode, the player module loads two subtitle data streams simultaneously: a first target subtitle and a second target subtitle. After being decoded independently, the two subtitle data streams are superimposed onto different positions on the video frame during the subtitle overlay stage. For example, the first subtitle is located at the bottom of the video frame, and the second subtitle is located at the top of the video frame or above the first subtitle. The timelines of the two subtitle streams are calculated synchronously and independently, without interference.
[0140] In some embodiments, the external subtitle path recorded in the resource mapping file can be a local file system path or a remote network path (such as an HTTP URL, NAS shared path, SMB network path, etc.). When the subtitle path is a remote network path, the player module retrieves the subtitle file data from the remote server through the corresponding network protocol. The controller 250 can dynamically adjust the size of the prefetch buffer for subtitle data according to the network status. When the network status is good, the buffer is increased (e.g., 512KB) to reduce the number of network requests, and when the network status is poor, the buffer is decreased (e.g., 128KB) to reduce the loading wait time of the first subtitle.
[0141] The same or similar parts among the various embodiments in this specification can be referred to mutually, and will not be repeated here.
[0142] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or certain parts of the embodiments of the present invention.
[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0144] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the above exemplary discussion 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 described embodiments and various different variations of embodiments suitable for specific use considerations.< / xml>
Claims
1. A display device, characterized in that, include: The monitor is configured to display the user interface; The controller is equipped with a player module; The controller is configured to: In response to a playback request for a video resource associated with at least two external subtitles, a resource mapping file is generated based on the path information of the video resource and the path information of the external subtitles; Input the resource mapping file into the player module; The player module is controlled to parse the first path information of the video resource and the second path information of the first target subtitle that is in the selected state in the resource mapping file. The player module is controlled to load the video resource according to the first path information and to load the first target subtitle according to the second path information. The video resource and the first target subtitle are synchronized on the timeline, and the synchronized video resource and the first target subtitle are output to the display for display.
2. The display device according to claim 1, characterized in that, The controller generates a resource mapping file based on the path information of the video resource and the path information of the external subtitle, specifically configured as follows: The resource mapping file is generated during the playback preparation phase of the player module; The playback preparation phase is the time period from the receipt of the playback request to the start of the player module decoding the first frame of video data.
3. The display device according to claim 1, characterized in that, The controller executes control over the player module to parse the first path information of the video resource and the second path information of the first target subtitle in the selected state from the resource mapping file, specifically configured as follows: The player module is controlled to parse the first path information of the video resource and the path information of the external subtitle to be selected corresponding to the video resource in the resource mapping file; In response to a subtitle selection instruction for a first target subtitle, the path information of the first target subtitle is determined as the second path information; the first target subtitle is one of the external subtitles to be selected.
4. The display device according to claim 1, characterized in that, The controller is also configured to: In response to a subtitle switching instruction for a second target subtitle, the third path information of the second target subtitle is parsed in the resource mapping file; The player module is controlled to load the second target subtitle according to the third path information; The video resource and the second target subtitle are synchronized on the timeline, and the synchronized video resource and the second target subtitle are output to the display for display.
5. The display device according to claim 1, characterized in that, The controller is also configured to: Create a demultiplex instance for the resource mapping file; The controller executes the parsing of the first path information of the video resource and the second path information of the first target subtitle in the selected state in the resource mapping file, specifically configured as follows: Through the demultiplexing example, the first path information of the video resource and the second path information of the first target subtitle in the selected state are parsed in the resource mapping file. The controller is configured to load the video resource according to the first path information and load the first target subtitle according to the second path information, specifically as follows: Through the demultiplexing instance, the video resource is loaded according to the first path information, and the first target subtitle is loaded according to the second path information.
6. The display device according to claim 5, characterized in that, The controller is also configured to: The video resource data is loaded using the demultiplexing instance; The path information of the external subtitle in the unselected state is parsed using the demultiplexing instance; If an incoming subtitle data packet is detected in the external subtitle that is in an unselected state, the demultiplexing instance is controlled to discard the subtitle data packet.
7. The display device according to claim 1, characterized in that, The controller is also configured to: In response to a user's instruction to update the external subtitles of the video resource, the path information of the external subtitles associated with the video resource is updated to form update information; Generate an updated resource mapping file based on the updated information; The updated resource mapping file is input into the player module.
8. The display device according to claim 1, characterized in that, The player module includes a video decoding unit and a subtitle decoding unit; before the controller performs timeline synchronization between the video resource and the first target subtitle, it is also configured to: The video decoding unit is controlled to decode the video resources to form video frame data; The subtitle decoding unit is controlled to decode the first target subtitle to form subtitle data; The controller performs timeline synchronization between the video resource and the first target subtitle, specifically configured as follows: The video frame data and the subtitle data are synchronized on the timeline.
9. The display device according to claim 8, characterized in that, The controller performs time-axis synchronization of the video frame data and the subtitle data, specifically configured as follows: Detect the first timestamp of the video frame data and the second timestamp of the subtitle data; The timeline is aligned based on the first timestamp and the second timestamp, and the aligned subtitle data is superimposed on the corresponding video frame data to generate display data; The controller is configured to output the synchronized video resources and the first target subtitles to the display for display. The display data is output to the display, and the display is controlled to display the display data.
10. A method for displaying external subtitles, characterized in that, include: In response to a playback request for a video resource associated with at least two external subtitles, a resource mapping file is generated based on the path information of the video resource and the path information of the external subtitles; Input the resource mapping file into the player module; The player module is controlled to parse the first path information of the video resource and the second path information of the first target subtitle that is in the selected state in the resource mapping file. The player module is controlled to load the video resource according to the first path information and to load the first target subtitle according to the second path information. The video resource and the first target subtitle are synchronized on the timeline, and the synchronized video resource and the first target subtitle are output to the display for display.