A method for synchronously displaying distributed multi-device rolling captions

By using a time synchronization method between an NTP server and an NTP client, the problems of large computational load and cumbersome information interaction for multi-device scrolling subtitles are solved, achieving continuity and fluency of subtitles across multiple devices.

CN118828088BActive Publication Date: 2025-12-05TIANDI SUNSHINE COMM TECH (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410832044.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2025-12-05
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

Existing technologies involve large computational loads and cumbersome information interaction when displaying scrolling text synchronously on multiple devices, resulting in insufficient system stability and reliability.

Method used

Time synchronization is achieved by using an NTP server and an NTP client. By generating a BMP bitmap and calculating the initial playback time and coordinates, information interaction and computation are reduced, enabling accurate synchronization between multiple devices.

Benefits of technology

It improves the continuity and smoothness of distributed multi-device scrolling subtitles, reduces information interaction between devices and a large amount of position calculation, and ensures the continuity and smoothness of subtitle playback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118828088B_ABST
    Figure CN118828088B_ABST
Patent Text Reader

Abstract

The application discloses a kind of distributed multi-device rolling caption synchronous display method, comprising: step one, determine ntp server device, collect caption information, including: caption content, caption color, caption size, caption position Y, user specified moving speed-fast / medium / slow, user specified interval time Tw of cyclic play caption;Step two, determine ntp client one device and ntp client two device, here with two client devices as an example.The key of distributed device to realize rolling caption is how to synchronize between multiple devices, the application adopts the mode of ntp server and ntp client, carries out the accurate synchronization of time between multiple devices from the level of time, through the calculation of initial play time and initial play coordinate of each ntp client device, ensure the coherence and fluency of caption play between distributed multiple devices, and reduce a large amount of information interaction and a large amount of calculation of caption position between multiple devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of scrolling text display technology, and more specifically to a method for synchronous display of distributed multi-device scrolling text. Background Technology

[0002] In certain situations, such as large conferences, performances, and sporting events, it may be necessary to display the same subtitle content on multiple screens or devices simultaneously. Traditional single-screen display methods are not suitable for such scenarios. The distributed multi-device scrolling subtitle synchronous display method consists of multiple displays. By synchronizing the display, it ensures that the scrolling subtitle content on multiple devices remains consistent, thereby achieving a unified display effect. At the same time, unified control improves the stability and reliability of the system, avoiding the disruption of the overall effect due to the failure of a single device.

[0003] Existing technologies employ a master-slave device approach, where the slave device needs to monitor and receive motion signals sent by the master device in real time, listening to every movement of the master device's subtitles at the spatial level. This involves a great deal of information exchange between devices, making the method cumbersome, and the computational load is substantial for each movement of the master device's subtitles. Summary of the Invention

[0004] Therefore, the present invention provides a method for synchronous display of distributed multi-device scrolling text to solve the above-mentioned problems in the prior art. To achieve the above objective, the present invention provides the following technical solution: According to a first aspect of the present invention, a method for synchronous display of distributed multi-device scrolling text includes:

[0005] Step 1: Determine the NTP server device and collect subtitle information, including: subtitle content, subtitle color, subtitle size, subtitle position Y, user-specified movement speed, and user-specified interval time Tw for looping subtitles;

[0006] Step 2: Determine NTP client device 1 and NTP client device 2. Here, we take two client devices as an example, but multiple NTP client devices can be used according to actual needs.

[0007] Step 3: The server device moves its own BMP bitmap starting from the right end of the screen according to the subtitle information;

[0008] Step 4: The client device generates a BMP bitmap based on the subtitle content, color, and size using the FreeType font library.

[0009] Step 5: Synchronize server time and obtain the initial subtitle playback time:

[0010] Step Six: The server device calculates the playback time of the BMP bitmap and adds the user-defined time as the waiting interval to achieve the loop playback of subtitles, and notifies the client to play synchronously.

[0011] Furthermore, in step one, determining the NTP server device and collecting subtitle information, it is also necessary to generate a BMP bitmap based on the subtitle content, color, and size using the FreeType font library, and control the BMP playback speed according to the user-specified movement speed.

[0012] Furthermore, step two, determining NTP client device one and NTP client device two, also includes: the client device periodically sending time query requests to the server device to obtain accurate time information from the server device.

[0013] Furthermore, step three, where the server device moves its own BMP bitmap from the right end of the screen based on the subtitle information, also includes: obtaining the initial playback time and notifying NTP client device one and NTP client device two of the subtitle information, its own initial playback time Ts, and the screen device width Xs. Here, two client devices are used as an example, but multiple NTP client devices can be used according to actual needs.

[0014] Furthermore, in step four, the client device generates a BMP bitmap based on the subtitle content, color, and size using the FreeType font library. Specifically, the client device generates a BMP bitmap based on the subtitle content, color, and size using the FreeType font library. The user specifies the movement speed and screen width Xs, and the device calculates the number of subtitle movements N before playing the subtitles, using the following formula:

[0015] If it is an NTP client device, then: N1 = Xs / (v / f); f is the movement frequency, in times / second, v is the number of moving pixels generated by the user-specified movement speed, in pixels / second, N1 can only take integer values, and if the calculation result has a remainder, add 1, where Xs is the screen device width, in pixels;

[0016] The formula for calculating the distance Xn1 from N1 subtitle movements is:

[0017] Xn1=N1*(v / f)

[0018] The initial playback coordinates of the NTP client device are: Xn1-Xs; simultaneously, the NTP client device calculates its own playback time Tc1 using the following formula:

[0019] Tc1=Ts+f*N1

[0020] Where Ts is the initial playback time of the server;

[0021] That is, at time Tc1, an NTP client device starts playing its own BMP bitmap at coordinates Xn1-Xs.

[0022] Furthermore, step four, where the client device generates a BMP bitmap based on the subtitle content, color, and size using the FreeType font library, also includes:

[0023] If it is an NTP client device, then: N2 = 2Xs / (v / f); f is the movement frequency in seconds, v is the number of pixels generated at the user-specified movement speed in pixels per second, N can only take integer values, and if the calculation result has a remainder, add 1, where Xs is the screen device width in pixels.

[0024] The formula for calculating the distance Xn2 that the subtitle moves N2 times is:

[0025] Xn2=N2*(v / f)

[0026] The initial playback coordinates of the second NTP client device are: Xn2 - 2Xs; simultaneously, the second NTP client device calculates its own playback time Tc2 using the following formula:

[0027] Tc2 = Ts + f * 2N, where Ts is the initial playback time of the server;

[0028] That is, at time Tc2, the second NTP client device starts playing its own BMP bitmap at coordinates Xn2-2Xs.

[0029] Furthermore, step five, synchronizing the server time and obtaining the initial subtitle playback time, specifically involves: if an NTP client device restarts, the NTP client device will first send a time query request to the server device to obtain the server's accurate time information. This information is used to calibrate the local clock to ensure that the local clock is synchronized with the server device's clock. The client then requests the initial subtitle playback time from the server device. Given the current synchronization time, the client calculates its own playback time Tc1 using the initial subtitle playback time from the server device, as described in step four above, and compares Tc1 with the current time.

[0030] Furthermore, in step six, the server device calculates the playback time of the BMP bitmap and adds the user-defined time as a waiting interval to achieve the looped playback of subtitles and notifies the client to play them synchronously. Specifically, to meet the user's need for repeated playback of subtitles, the server device is set to loop the subtitles after a certain number of seconds. This function calculates the time required to play the width of one BMP bitmap (Tb) and adds the user-defined time as a waiting interval (Tw). After each waiting interval, the server device repeatedly plays the BMP bitmap and notifies the client device of the initial playback time of the repeated BMP bitmap. The client device will repeat the operation in step four above to play the subtitles synchronously.

[0031] A distributed multi-device scrolling text synchronous display system includes an NTP server device and multiple NTP client devices. The NTP server device includes:

[0032] Subtitle information acquisition module: collects subtitle content, subtitle color, subtitle size, subtitle position, user-specified movement speed, and user-specified interval for looping subtitle playback;

[0033] The NTP server module provides accurate time information to client devices; continuously monitors the offset and accuracy of the local clock, compares and adjusts it with a reference time source to maintain the accuracy and stability of the clock; and responds to time query requests from client devices, providing the system with a stable and unique time standard.

[0034] Notification module: Notifies the client module of the collected subtitle information and its own playback time;

[0035] Subtitle playback module: It generates its own BMP bitmap using the FreeType font library and controls the BMP playback speed based on the user-specified scrolling speed;

[0036] The calculation module; based on the user-defined waiting interval, the next subtitle playback will occur after the calculated time.

[0037] Furthermore, the NTP client device includes:

[0038] NTP client module: Periodically sends time query requests to the NTP server device and obtains the time information returned by the server. By synchronizing the time with the server, it ensures that the system has a stable and unique time standard.

[0039] Receiving module; receives subtitle information and initial playback time sent by the server device;

[0040] The calculation module calculates the initial playback time and initial playback position of the local machine, and after restarting, it calculates whether it needs to play subtitles, and if so, at what coordinates to play the subtitles, to ensure the continuity and smoothness of subtitles across distributed multi-device systems.

[0041] The subtitle playback module generates its own BMP bitmap using the FreeType font library and controls the BMP playback speed based on the user-specified scrolling speed.

[0042] The present invention has the following advantages:

[0043] 1. The key to implementing scrolling subtitles in distributed devices lies in how to synchronize multiple devices. This invention uses an NTP server and an NTP client to achieve precise time synchronization between multiple devices. By calculating the initial playback time and initial playback coordinates of each NTP client device, the continuity and smoothness of subtitle playback between distributed multiple devices are guaranteed, and the large amount of information interaction and calculation of subtitle position between multiple devices are reduced.

[0044] 2. To address users' need for repeated playback of subtitles, a waiting interval data was designed. Users can set the waiting interval to loop the playback of the subtitle BMP bitmap. Attached Figure Description

[0045] Figure 1 This is one of the flowcharts for a distributed multi-device scrolling text synchronous display method according to the present invention;

[0046] Figure 2 This is a second flowchart of a method for synchronous display of distributed multi-device scrolling text according to the present invention;

[0047] Figure 3 This is the third flowchart of a method for synchronous display of distributed multi-device scrolling text according to the present invention;

[0048] Figure 4 This is the fourth flowchart of a method for synchronous display of distributed multi-device scrolling text according to the present invention;

[0049] Figure 5 This is the fifth flowchart of a distributed multi-device scrolling text synchronous display method according to the present invention;

[0050] Figure 6 This is a device structure diagram of a distributed multi-device scrolling subtitle synchronous display system according to the present invention. Detailed Implementation

[0051] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0052] like Figures 1 to 6 As shown, according to the first aspect of the present invention, a method for synchronous display of distributed multi-device scrolling text includes:

[0053] Step 1: Determine the NTP server device and collect subtitle information, including: subtitle content, subtitle color, subtitle size, subtitle position Y, user-specified movement speed, and user-specified interval time Tw for looping subtitles;

[0054] Step 2: Determine NTP client device 1 and NTP client device 2. Here, we take two client devices as an example, but multiple NTP client devices can be used according to actual needs.

[0055] Step 3: The server device moves its own BMP bitmap starting from the right end of the screen according to the subtitle information;

[0056] Step 4: The client device generates a BMP bitmap based on the subtitle content, color, and size using the FreeType font library.

[0057] Step 5: Synchronize server time and obtain the initial subtitle playback time:

[0058] Step Six: The server device calculates the playback time of the BMP bitmap and adds the user-defined time as the waiting interval to achieve the loop playback of subtitles, and notifies the client to play synchronously.

[0059] In this embodiment, the key to implementing scrolling subtitles in distributed devices lies in how multiple devices synchronize. This invention uses an NTP server and an NTP client to achieve precise time synchronization between multiple devices. By calculating the initial playback time and initial playback coordinates of each NTP client device, the continuity and smoothness of subtitle playback between distributed devices are ensured, and the large amount of information interaction and calculation of subtitle position between multiple devices are reduced.

[0060] Step 1: Determine the NTP server device. In addition to collecting subtitle information, it is also necessary to generate a BMP bitmap based on the subtitle content, color, and size using the FreeType font library. The playback speed of the BMP can be controlled by the user-specified movement speed.

[0061] In this embodiment, the subtitle content is the text or text to be scrolled on the screen; the subtitle color defines the color of the subtitle displayed on the screen; the subtitle size is the size or dimensions of the text in the subtitle; the subtitle position (Y) is the vertical position of the subtitle on the screen; the user-specified scrolling speed (fast / medium / slow) is a user-input or preset parameter used to define the scrolling speed of the subtitle on the screen; and the user-specified loop playback interval (Tw) controls the loop playback interval of the subtitle. Freetype is an open-source, cross-platform, and portable font rendering engine. It allows applications to render characters in font files as bitmap images for display on the screen. The server device uses the Freetype font library to render each character in the subtitle into a bitmap (bmp) format based on the collected subtitle content, subtitle color, and subtitle size. These bitmap images are then used to display the subtitle on the screen, and the user-specified scrolling speed (fast / medium / slow) is converted into a specific scrolling speed parameter. This parameter controls the scrolling speed of the BMP bitmap on the screen. The server device calculates the time required for each character or paragraph of text to scroll on the screen based on the scrolling speed parameter. Then, it controls the playback speed of the BMP bitmap according to this time, thereby achieving the scrolling effect of subtitles on the screen.

[0062] Step 2: Determine NTP client device 1 and NTP client device 2. Here, we take two client devices as an example. Multiple NTP client devices can be used according to actual needs. This also includes: the client devices will periodically send time query requests to the server device to obtain accurate time information from the server device.

[0063] In this embodiment, the NTP client devices are part of the distributed system. They need to ensure that their local time is synchronized with the NTP server device's time to achieve accurate synchronization of the scrolling text. The NTP client devices periodically send time query requests to the NTP server device. These requests contain the client device's current local time so that the server device can assess the time difference and perform calibration. After receiving the client device's time query request, the NTP server device returns its current accurate time information. Upon receiving the time information returned by the server device, the client device calculates the difference between its local time and the server time. Then, it adjusts its local clock based on this difference to keep it consistent with the server device's time. This process typically involves adding or subtracting a time offset to correct for local clock errors. By periodically sending time query requests and calibrating the local clock, the client devices can ensure that their local time is synchronized with the server device's time. This synchronization is crucial for the synchronized display of scrolling text in the distributed system because it ensures that all devices operate on the same time base, thus achieving accurate synchronized display of the text.

[0064] Step 3: The server device moves its own BMP bitmap from the right end of the screen based on the subtitle information. This also includes: obtaining the initial playback time, and notifying NTP client device 1 and NTP client device 2 of the subtitle information, its own initial playback time Ts, and the screen device width Xs. Here, two client devices are used as an example, but multiple NTP client devices can be used according to actual needs.

[0065] In this embodiment, the server device uses previously collected subtitle information to generate a BMP bitmap. Once the bitmap is generated, the server device moves the BMP bitmap from the right edge of the screen in a preset scrolling direction. The server device also needs to determine an initial playback time Ts, which is the moment when the subtitles begin scrolling on the server. This time may be based on the server device's current time or a specific timestamp, depending on the system's requirements. Once the server device determines the initial playback time Ts and the screen device width Xs, it sends this information, along with the subtitle information itself, to client device 1 and client device 2. This information is crucial for the client devices because they need to know when the subtitles will start playing and the range of the subtitles scrolling on the screen. After receiving this information, the client devices calibrate their local clocks based on the server device's initial playback time Ts to ensure synchronized subtitle playback. At the same time, they also use the screen device width Xs to calculate the subtitle scrolling boundary to ensure the subtitles are displayed correctly on the screen. In this way, both the server device and the client devices can operate based on the same time base and subtitle information, thereby ensuring the synchronized display of scrolling subtitles on multiple devices.

[0066] Step 4: The client device generates a BMP bitmap based on the subtitle content, color, and size using the FreeType font library. Specifically, the client device generates a BMP bitmap based on the subtitle content, color, and size using the FreeType font library. The user specifies the movement speed and screen width Xs, and the device calculates the number of subtitle movements N before playing the subtitles. The formula is:

[0067] If it is an NTP client device, then: N1 = Xs / (v / f); f is the movement frequency, in times / second, v is the number of moving pixels generated by the user-specified movement speed, in pixels / second, N1 can only take integer values, and if the calculation result has a remainder, add 1, where Xs is the screen device width, in pixels;

[0068] The formula for calculating the distance Xn1 from N1 subtitle movements is:

[0069] Xn1=N1*(v / f)

[0070] The initial playback coordinates of the NTP client device are: Xn1-Xs; simultaneously, the NTP client device calculates its own playback time Tc1 using the following formula:

[0071] Tc1=Ts+f*N1

[0072] Where Ts is the initial playback time of the server;

[0073] That is, at time Tc1, an NTP client device starts playing its own BMP bitmap at coordinates Xn1-Xs.

[0074] Step 4: The client device generates a BMP bitmap based on the subtitle content, color, and size using the FreeType font library. This also includes:

[0075] If it is an NTP client device, then: N2 = 2Xs / (v / f); f is the movement frequency in seconds, v is the number of pixels generated at the user-specified movement speed in pixels per second, N can only take integer values, and if the calculation result has a remainder, add 1, where Xs is the screen device width in pixels.

[0076] The formula for calculating the distance Xn2 that the subtitle moves N2 times is:

[0077] Xn2=N2*(v / f)

[0078] The initial playback coordinates of the second NTP client device are: Xn2 - 2Xs; simultaneously, the second NTP client device calculates its own playback time Tc2 using the following formula:

[0079] Tc2 = Ts + f * 2N, where Ts is the initial playback time of the server;

[0080] That is, at time Tc2, the second NTP client device starts playing its own BMP bitmap at coordinates Xn2-2Xs.

[0081] In this embodiment, the client device uses the FreeType font library to generate a BMP bitmap for display based on the received subtitle content, color, and size. To ensure the subtitles reach the other end of the screen while scrolling, the client device needs to calculate the number of subtitle movements N. This depends on the screen width Xs, the user-specified movement speed (represented by movement pixels v), and the movement frequency f. The formula for calculating the number of movements N considers the distance v / f of each movement and the total screen width. Since N must be an integer, any remainder is rounded up to ensure the subtitles can scroll completely off the screen. Based on the number of movements N and the distance v / f of each movement, the client device calculates the total distance Xn the subtitles need to move before playback. This distance is used to determine the initial position where the subtitles begin playback. The client device then determines the playback position of the subtitles based on the calculated movement distance Xn. The initial coordinates are Xn1-Xs for client device one, which is the distance from the right edge of the screen after the subtitle moves N1 times. For client device two, the initial coordinates are Xn2-2Xs, because more movements may be needed to ensure that the subtitle is fully displayed on both screens. The client device uses the server device's initial playback time Ts and the calculated number of moves N to determine its own playback time Tc. This ensures that all devices start playing subtitles on the same time base. When the calculated playback time Tc is reached, the client device starts playing its BMP bitmap at the predetermined initial coordinates to achieve the scrolling subtitle display effect. If there are more than two devices in the distributed system, the above calculation process will be similarly applied to each device. Each device will calculate its own unique number of moves N, movement distance Xn, initial playback coordinates, and playback time Tc based on its screen width and position.

[0082] Step 5: Synchronize server time and obtain the initial subtitle playback time. Specifically, if the NTP client device restarts, it will first send a time query request to the server device to obtain the server's accurate time information. It will then use this information to calibrate its local clock to ensure synchronization with the server device's clock. Finally, it will request the initial subtitle playback time from the server device. Knowing the current synchronization time, the client will use the server device's initial subtitle playback time to calculate its own playback time Tc1 using the information from Step 4 above. It will then compare Tc1 with the current time T.

[0083] In this embodiment, if the current time is less than the client's initial playback time Tc1, it indicates that the client has not yet reached the subtitle playback time and can wait for its own playback time Tc1. If the current time exceeds its initial playback time, time matching is performed to determine the next movement time T, and the screen position X of the subtitle on the client device at time T is calculated using the following formula:

[0084] X = ((T-Tc1) / (v / f)) + (Xn1-Xs) where f is the subtitle movement frequency, v is the number of moving pixels generated by the user-specified movement speed, i.e. how many pixels are moved per unit time, and Xn1-Xs is the initial playback coordinates of the client device obtained by the above four steps.

[0085] If X is less than its own screen length, then after a device on the client restarts, at time T, at position X, it will play its own BMP bitmap.

[0086] If X is greater than the length of its own display screen, it proves that the subtitles are playing on the second client device. At this time, calculate where the playback starts from in the BMP bitmap, using the following formula:

[0087] X-Xs, where Xs is the length of the display screen. If X-Xs is greater than the width of the BMP bitmap itself, it means that the client device has finished playing the subtitle. If X-Xs is less than the width of the BMP bitmap itself, then: at time T, the client device starts playing the subtitle from the left side of the screen, starting from the X-Xs position.

[0088] Step Six: The server device calculates the playback time of the BMP bitmap and adds the user-defined time as a waiting interval to achieve the loop playback of subtitles and notifies the client to play them synchronously. Specifically, to meet the user's need for repeated playback of subtitles, the server device is set to loop the subtitles after a certain number of seconds. This function calculates the time required to play the width of one BMP bitmap (Tb), adds the user-defined time, and sets a waiting interval (Tw). After each waiting interval, the server device repeatedly plays the BMP bitmap and notifies the client device of the initial playback time of the repeated BMP bitmap. The client device will then repeat the operation in Step Four above to play the subtitles synchronously.

[0089] In this embodiment, the key to implementing scrolling subtitles in distributed devices lies in how multiple devices synchronize. This invention uses an NTP server and an NTP client to achieve precise time synchronization between multiple devices. By calculating the initial playback time and initial playback coordinates of each NTP client device, the continuity and smoothness of subtitle playback between distributed devices are ensured, and the large amount of information interaction and calculation of subtitle positions between multiple devices are reduced. In response to the user's need for repeated playback of subtitles, waiting interval data is designed. Users can set the waiting interval to loop the playback of subtitle BMP bitmaps.

[0090] A distributed multi-device scrolling text synchronous display system includes an NTP server device and multiple NTP client devices.

[0091] NTP server equipment, including:

[0092] Subtitle information acquisition module: collects subtitle content, subtitle color, subtitle size, subtitle position, user-specified movement speed, and user-specified interval for looping subtitle playback;

[0093] The NTP server module provides accurate time information to client devices; continuously monitors the offset and accuracy of the local clock, compares and adjusts it with a reference time source to maintain the accuracy and stability of the clock; and responds to time query requests from client devices, providing the system with a stable and unique time standard.

[0094] Notification module: Notifies the client module of the collected subtitle information and its own playback time;

[0095] Subtitle playback module: It generates its own BMP bitmap using the FreeType font library and controls the BMP playback speed based on the user-specified scrolling speed;

[0096] The calculation module; based on the user-defined waiting interval, the next subtitle playback will occur after the calculated time.

[0097] In this embodiment, the subtitle information acquisition module is responsible for collecting all parameters related to scrolling subtitles, including subtitle content, subtitle color, subtitle size, subtitle position, user-specified movement speed, and user-specified interval for looping subtitles. These parameters are necessary for generating and displaying scrolling subtitles. The NTP server module is the core of the NTP server. It provides accurate time information to client devices. It maintains clock accuracy and stability by continuously detecting the offset and accuracy of the local clock and comparing and adjusting it with a reliable time source. When a client device sends a time query request, the NTP server module responds to these requests and returns accurate time information. It provides a stable and unique time standard for the entire system, ensuring time synchronization of all devices. The notification module notifies the subtitle information acquisition module once it detects the scrolling subtitles. Once all subtitle information has been collected, and the subtitle playback module has generated a BMP bitmap and determined the playback speed, the notification module will notify the client module of this information, along with the server device's initial playback time. This information is crucial for the client devices, as they require it to synchronize the display of scrolling subtitles. The subtitle playback module uses the FreeType font library to generate a BMP bitmap based on the collected subtitle information. Then, it controls the playback speed of the BMP bitmap according to the user-specified movement speed to achieve the scrolling subtitle display effect. The calculation module is responsible for handling time-related calculation tasks. Based on the user-set waiting interval, the calculation module will wait for the corresponding time after the subtitle playback ends before triggering the next subtitle playback. This ensures that the scrolling subtitles loop according to the predetermined time interval.

[0098] NTP client devices include:

[0099] NTP client module: Periodically sends time query requests to the NTP server device and obtains the time information returned by the server. By synchronizing the time with the server, it ensures that the system has a stable and unique time standard.

[0100] Receiving module; receives subtitle information and initial playback time sent by the server device;

[0101] The calculation module calculates the initial playback time and initial playback position of the local machine, and after restarting, it calculates whether it needs to play subtitles, and if so, at what coordinates to play the subtitles, to ensure the continuity and smoothness of subtitles across distributed multi-device systems.

[0102] The subtitle playback module generates its own BMP bitmap using the FreeType font library and controls the BMP playback speed based on the user-specified scrolling speed.

[0103] In this embodiment, the NTP client module is responsible for periodically sending time query requests to the NTP server device and receiving time information returned by the server. Synchronizing time with the server ensures that each client device has a stable and unique time standard, which is crucial for ensuring time consistency across devices in a distributed system. The receiving module receives subtitle information and the initial playback time from the server device. This information is vital for the client devices, as they need it to correctly display the scrolling subtitles. The calculation module performs several key calculation tasks. First, it uses the initial playback time received from the server to determine the initial playback time of the local subtitles. Second, it calculates the initial playback position to ensure the subtitles begin scrolling at the correct position on the screen. If a client device restarts, the calculation module also determines whether subtitle playback needs to continue and calculates the correct coordinates for the subtitles to start playing again, maintaining the continuity and smoothness of the distributed multi-device subtitles. The subtitle playback module is responsible for the actual subtitle display. It uses the FreeType font library to generate a BMP bitmap based on the received subtitle information. Then, according to the user-specified movement speed, this module controls the playback speed of the BMP bitmap to achieve the scrolling subtitle display effect.

Claims

1. A method for synchronously displaying distributed multi-device rolling captions, characterized by, Comprise: Step one, determine ntp server device, collect caption information, including: caption content, caption color, caption size, caption position Y, user specified moving speed, user specified interval time Tw of caption loop playing; Step two, determine the number of ntp client devices as multiple: ntp client one device, ntp client two device, …; Step three, server device moves its bmp bitmap from the right end of the screen according to the caption information; Step four, client device generates bmp bitmap according to caption content, caption color, caption size through freetype library; Step five, synchronize server time, get caption initial playing time: Step six, server device realizes caption loop playing by calculating bmp bitmap playing time and adding user set time as waiting interval, and informs client to synchronize playing; The step four, client device generates bmp bitmap according to caption content, caption color, caption size through freetype library, specifically: client device generates bmp bitmap according to caption content, caption color, caption size through freetype library, calculates the moving number N of caption before playing caption itself according to user specified moving speed and screen device width Xs, the formula is: If it is ntp client one device, then: N1=Xs / (v / f); f is moving frequency, v is user specified moving speed, N1 can only take integer value, if there is a remainder, add 1, wherein Xs is screen device width; Calculate the distance Xn1 of moving caption N1 times, the formula is: Xn1=N1* (v / f) The initial coordinate of ntp client one device playing is: Xn1-Xs; at the same time, ntp client one device calculates its playing time Tc1, the formula is: Tc1=Ts+f*N1 Wherein Ts is server initial playing time; That is, at Tc1 moment, ntp client one device starts playing its bmp bitmap at coordinate Xn1-Xs.

2. The method of claim 1, wherein, The step one, determine ntp server device, collect caption information also needs to generate its bmp bitmap according to caption content, caption color, caption size through freetype library, and control bmp playing speed through user specified moving speed.

3. The method of claim 1, wherein, The step two also includes: client device will send time query request to server device regularly to get accurate time information of server device.

4. The method of claim 1, wherein, The step three, server device moves its bmp bitmap from the right end of the screen according to caption information also includes: get initial playing time, inform ntp client one device, ntp client two device of caption information, its initial playing time Ts, screen device width Xs, here take two client devices as an example, multiple ntp client devices can be used according to actual demand.

5. The method of claim 1, wherein, The step four, client device generates bmp bitmap according to caption content, caption color, caption size through freetype library, also includes: If the ntp client two device, then: N2=2Xs / (v / f); f is the moving frequency, v is the user specified moving speed generated by the moving pixels, N can only be an integer value, if the calculation result has a remainder, then add 1, wherein Xs is the screen device width; Calculate the distance Xn2 of the subtitle moving N2 times, the formula is: Xn2=N2* (v / f) The initial coordinate of the ntp client two device playing is: Xn2-2Xs; at the same time, the ntp client two device calculates its own playing time Tc2, the formula is: Tc2=Ts+f*2N wherein Ts is the initial playing time of the server; That is, at the time of Tc2, the ntp client two device starts playing its own bmp bitmap at the coordinate Xn2-2Xs.

6. The method of claim 1, wherein, The step five, synchronizing the server time, obtaining the initial playing time of the subtitle, is specifically: if the ntp client one device restarts, the ntp client one device will first send a time query request to the server device to obtain the accurate time information of the server, use the information to calibrate the local clock, ensure that the local clock is synchronized with the server device clock, and request the initial playing time of the subtitle from the server device, in the case of knowing the current synchronization time, the client calculates its own playing time Tc1 through the initial playing time of the subtitle of the server device through the above step four, compares Tc1 with the current time.

7. The method of claim 1, wherein, The step six, the server device calculates the bmp bitmap playing time and adds the user set time as the waiting interval, realizes the cyclic playing of the subtitle, and notifies the client to synchronize the playing, specifically: according to the user's demand for playing the subtitle, the server device sets the cyclic playing function of the subtitle after a few seconds, which adds the user set time as a waiting interval Tw through calculating the 'playing one bmp bitmap itself width required time' Tb, after each waiting interval, the server device repeats playing the bmp bitmap, and notifies the client device the initial playing time of the bmp bitmap, the client device will repeat the above step four operation to synchronize the playing.

Citation Information

Patent Citations

  • Computer-implemented method, computer system, and computer program product for synchronizing output of media data across a plurality of devices

    CN103281289A

  • Subtitle scrolling method and system of tiled display system

    CN113641321A