WO2025112968A1 - 文本显示方法、装置、电子设备及存储介质 - Google Patents

文本显示方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2025112968A1
WO2025112968A1 PCT/CN2024/125898 CN2024125898W WO2025112968A1 WO 2025112968 A1 WO2025112968 A1 WO 2025112968A1 CN 2024125898 W CN2024125898 W CN 2024125898W WO 2025112968 A1 WO2025112968 A1 WO 2025112968A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
display
rendering result
target
aligned
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2024/125898
Other languages
English (en)
French (fr)
Inventor
秦超
齐汉民
彭兵
毕文韬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Publication of WO2025112968A1 publication Critical patent/WO2025112968A1/zh
Anticipated expiration legal-status Critical
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47205End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for manipulating displayed content, e.g. interacting with MPEG-4 objects, editing locally
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44012Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving rendering scenes according to scene graphs, e.g. MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content

Definitions

  • the present disclosure relates to the field of computer vision technology, and in particular to a text display method, device, electronic device and storage medium.
  • the present disclosure provides a text display method, device, electronic device and storage medium.
  • the present disclosure provides a text display method, comprising:
  • a text display device comprising:
  • An acquisition module used for acquiring multiple video frames, wherein the multiple video frames include a target video frame to be edited
  • a first execution module is used to obtain a target text from a designated editing position of a target frame video image, and display the target text at the designated editing position;
  • the rendering module is used to render the target text and obtain the rendering result
  • the second execution module is used to align the rendering result with the target text, and display the aligned rendering result at the designated editing position.
  • the present disclosure provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the text display method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
  • the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the text display method of the first aspect or any corresponding embodiment thereof.
  • the text display method after determining the target frame video image to be edited from multiple frames of video images, obtains and displays the target text at the specified editing position where the text editing needs to be performed in the target frame video image, and then renders the target text to obtain a rendering result.
  • FIG1 is a schematic diagram of text editing input in the prior art
  • FIG2 is a schematic diagram of a rendering effect result of the prior art
  • FIG3 is a flow chart of a text display method according to an embodiment of the present disclosure.
  • FIG4 is a schematic diagram of text editing input according to an embodiment of the present disclosure.
  • FIG5 is a schematic diagram showing a target text according to an embodiment of the present disclosure.
  • FIG6 is a schematic diagram of a rendering effect according to an embodiment of the present disclosure.
  • FIG7 is a flow chart of another text display method according to an embodiment of the present disclosure.
  • FIG8 is a flow chart of another text display method according to an embodiment of the present disclosure.
  • FIG9 is a schematic diagram of another rendering effect according to an embodiment of the present disclosure.
  • FIG10 is a schematic diagram of engine position relationship according to an embodiment of the present disclosure.
  • FIG11 is a schematic diagram of a component framework of a video editing software according to an embodiment of the present disclosure.
  • FIG12 is a structural block diagram of a text display device according to an embodiment of the present disclosure.
  • FIG. 13 is a schematic diagram of the hardware structure of the electronic device according to an embodiment of the present disclosure.
  • the embodiments of the present disclosure provide a text display method, which enables the user to directly view the rendered result of the target text when editing at the specified location of the input target text, so that the user can quickly determine whether the aligned rendering result currently displayed at the specified editing location meets his or her own needs, thereby helping to enhance the interactive ability of the video editing software to perform text editing, and making the way of displaying the rendered result of the target text more intuitive and user-friendly.
  • a text display method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
  • FIG. 3 is a flow chart of the text display method according to an embodiment of the present disclosure. As shown in FIG. 3 , the flow chart includes the following steps:
  • Step S301 obtaining multiple frames of video images.
  • the multiple video frames include the target video frames to be edited.
  • the multiple video frames may be all the video frames constituting the video, or may be partial video frames captured according to user requirements.
  • the video corresponding to the multi-frame video images comes from a scene recorded in real time using a camera device (e.g., a video camera, a smart phone, a surveillance camera, etc.).
  • the video can be obtained from a local database or downloaded from a cloud database. There is no limitation on the method of obtaining the video to be identified, and it can be set according to actual needs.
  • Step S302 obtaining the target text from the designated editing position of the target frame video image, and displaying the target text at the designated editing position.
  • the designated editing position can be understood as a position where text editing is allowed, and the designated editing position can be a user-specified position or a preset default position.
  • the target text can be understood as the text that the user needs to add to the target frame video image.
  • the target text When the target text is obtained at the designated editing position on the target frame video image, it indicates that the user has entered the target text at the designated editing position. Therefore, in order to facilitate the user to clearly understand the content currently entered at the designated editing position, the target text is displayed at the designated editing position so that the user can intuitively view the currently entered target text, and when the target text is entered incorrectly, it can be adjusted in time to obtain the correct target text.
  • Step S303 render the target text to obtain a rendering result.
  • the currently acquired target text is rendered to obtain a rendering result.
  • the content of the target text rendering includes but is not limited to: font, font size, color, alignment, shadow and
  • the rendering result can be a static image or a dynamic animation effect, depending on the user's choice, which is not limited here.
  • Step S304 align the rendering result with the target text, and display the aligned rendering result at the designated editing position.
  • the rendering result after rendering may be quite different from the target text
  • a correspondence between the rendering result and the target text is established so that the rendering result can be aligned with the target text, thereby ensuring that the aligned rendering result can be directly displayed at the specified editing position, so that users can more intuitively confirm whether the current rendering effect meets their needs, making the way of displaying the result after rendering the target text more user-friendly, thereby helping users to quickly complete text editing.
  • the text display method after determining the target frame video image to be edited from multiple frames of video images, obtains and displays the target text at the designated editing position where the text editing is required in the target frame video image, and then renders the target text to obtain the rendering result.
  • the rendering result is aligned with the target text, and then the aligned rendering result is displayed at the designated editing position, so that the user can quickly determine whether the aligned rendering result currently displayed at the designated editing position meets their own needs, thereby helping to enhance the interactive ability of the video editing software to perform text editing, making the method of displaying the rendered result of the target text more user-friendly, and helping to improve the user experience.
  • the process of displaying the rendering display result of the target text by the above-mentioned text display method can be shown in Figures 4 to 6.
  • the virtual box in the target frame video image is the designated editing position.
  • the target text (“#punch card”) can be entered on the text to be entered, and then after the "#punch card” is entered, it is displayed at the designated editing position.
  • the schematic diagram of displaying the aligned rendering result at the designated editing position can be shown in Figure 6.
  • the bold "#punch card” superimposed with the "#punch card” is the rendering result after alignment, which can be used as the rendering display result of the target text.
  • FIG. 7 is a flow chart of the text display method according to an embodiment of the present disclosure. As shown in FIG. 7 , the flow chart includes the following steps:
  • Step S701 acquiring multiple frames of video images.
  • Step S702 obtaining the target text from the designated editing position of the target frame video image, and displaying the target text at the designated editing position.
  • Step S703 render the target text to obtain a rendering result.
  • Step S704 align the rendering result with the target text, and display the aligned rendering result at the designated editing position.
  • step S704 includes:
  • Step S7041 according to the current font size of the target text, determining whether the first display window displays the current font size and the second display window displays the current font size.
  • the first display window is a window for displaying multiple frames of video images
  • the second display window is a window for displaying rendering results. Since the rendering results and the target text are displayed in different windows, and different windows may display text differently, in order to facilitate targeted alignment of the rendering results with the target text, when the current font size of the target text is determined, the display ratio between the current font size displayed in the first display window and the current font size displayed in the second display window is determined, so that the font size of the aligned rendering result displayed in the second display window can be ensured to be consistent with the current font size through the display ratio.
  • the display ratio can be calculated in the following manner:
  • the current font size (fontSize) of the target text used to display in the first display window is in points (pt).
  • the expression for converting it to pixels is as follows: systemSize*ScreenScale, where systemSize is the font size in points and ScreenDPI is the pixel density per inch of the first display window.
  • the pixel conversion expression corresponding to the second display window is as follows: fontSize*300/72.0, where 300 represents the pixel density per inch of the second display window, and 72.0 is the number of points in 1 inch.
  • fontSize systemSize*ScreenScale*72.0/300;
  • fontSize systemSize*(Player2Width/(Player1Width*ScreenScale))*ScreenScale*72.0/300;
  • the final display ratio rate Player2Width/player1Width)*(72.0/300.0).
  • Player2Width is the display width of the second display window.
  • Player1Width is the display width of the first display window.
  • Player2Width can be a preset fixed value, such as: 720.0.
  • Step S7042 adjust the rendering result based on the display ratio to obtain an aligned rendering result.
  • the adjustment direction of the rendering result can be clarified, and then targeted alignment can be performed to obtain the aligned rendering result. Therefore, when it is displayed subsequently, the readability of the aligned rendering result can be guaranteed not to be affected, which is beneficial to enhance the visualization effect of the rendering display result of the target text and facilitate improving the user experience.
  • step S7042 includes:
  • Step a1 determining a first value corresponding to a text configuration parameter according to a target text displayed in a first display window according to a current font size.
  • the text configuration parameters can be understood as the configuration parameters for displaying the target text in the first display window under the current font size.
  • the text configuration parameters include but are not limited to the following parameters: font size, text width, background rounding, character spacing, line spacing, shadow width, etc.
  • Step a2 determining a second value of the text configuration parameter in the second display window based on the display ratio and the first value.
  • an adjusted value suitable for the second display window can be obtained, and then This ensures that the text maintains a consistent configuration across different display windows, providing a unified and readable user experience.
  • the calculation process of determining the second value by the first value may be as shown in Table 1 below:
  • the text editing component is a component that supports the user to input target text in the first display window.
  • Step a3 adjusting the text configuration parameter of the rendering result according to the second value to obtain an aligned rendering result.
  • the text configuration parameter of the rendering result is specifically adjusted according to the second value, thereby obtaining an aligned rendering result that can be consistent with the target text.
  • step a3 includes:
  • Step a31 determining the first display line number of the target text in the first display window
  • Step a32 determining the second display row number of the rendering result under the second display result
  • Step a33 if the second display line number is greater than the first display line number, a line break is added to the target text to change the first display line number to the second display line number.
  • the second display line number is compared with the first display line number. If the second display line number is greater than the first display line number, add a line break to the target text to change the first display line number to the second display line number, thereby ensuring that the aligned rendering result has the same number of lines as the target text display.
  • Step S7043 displaying the aligned rendering result at the designated editing position.
  • the text display method provided in this embodiment aligns the rendering result with the target text, and then Displaying the aligned rendering result on the top can ensure that the readability of the aligned rendering result is not affected, which is beneficial to enhancing the visualization effect of the rendering display result of the target text and improving the user experience.
  • FIG8 is a flow chart of the text display method according to an embodiment of the present disclosure. As shown in FIG8 , the flow chart includes the following steps:
  • Step S801 acquiring multiple frames of video images.
  • Step S802 obtaining the target text from the designated editing position of the target frame video image, and displaying the target text at the designated editing position.
  • Step S803 render the target text to obtain a rendering result.
  • Step S804 align the rendering result with the target text, and display the aligned rendering result at the designated editing position.
  • Step S805 if the target frame video image is a continuous multi-frame image, then during the playback of the multi-frame images, respond to the position movement instruction executed on the aligned rendering result, track the movement trajectory of the aligned rendering result, and determine the position refresh rate of the aligned rendering result based on the current playback frame rate of the multi-frame image.
  • the position refresh rate of the aligned rendering result is determined based on the current playback frame rate of the multi-frame image, so that when the aligned rendering result is moved, the aligned rendering result can be displayed accordingly with the movement of the position, which helps to enhance the user experience.
  • step S805 includes:
  • Step b1 switching the current playback frame rate to the target playback frame rate, and determining the second position refresh rate of the aligned rendering result based on the target playback frame rate.
  • the target playback frame rate is higher than the current playback frame rate.
  • the current playback frame rate is switched to the target playback frame rate, and then the second position refresh rate of the aligned rendering result is determined based on the target playback frame rate, which can ensure a better alignment effect. For example: if the current playback frame rate is 30 frames/second, the target playback frame rate can be adjusted to 60 frames/second.
  • step S805 further includes:
  • Step b2 in response to the aligned rendering result, the movement is stopped and the target playback frame rate is restored to the current playback frame rate.
  • the target playback frame rate is restored to the current playback frame rate.
  • Step S806 Display the aligned rendering result in each frame of the multiple frames according to the position refresh rate. Target editing location.
  • the corresponding aligned rendering results are displayed at the target editing position of each frame image, which can ensure that the aligned rendering results can be consistent between multiple frames of images, thereby achieving visual continuity, thereby improving visual effects and enhancing user experience.
  • the text display method provided in this embodiment can enrich the functional diversity of text editing for videos, thereby not only improving the visual effect but also enhancing the user experience.
  • the target text displayed at the designated editing position is hidden. For example, in combination with the target text shown in FIG. 5 , it is displayed as shown in FIG. 9 .
  • the first display window may be provided by the first engine of the current operating system of the electronic device, and the second display window is provided by the second engine.
  • the first engine can be understood as an engine embedded in the current operating system for performing text editing tasks. That is, when the user needs to input the target text, the first engine is called so that the user can input the target text through the text editing component provided by the first engine.
  • the second engine can be understood as an engine for performing text rendering tasks. When the target text needs to be rendered, the second engine obtains the target text to be rendered from the first engine, and renders the target text through the text rendering component provided by the second engine to obtain the rendering result.
  • the second engine is located below the first engine, so as to facilitate the rendering result to be better aligned with the target text input by the user.
  • the present disclosure also provides a component framework of a video editing software, as shown in FIG11 , when the user enters the target text at the designated editing position of the target frame video image, the text rendering component provided by the second engine is disabled, and the text editing component provided by the first engine is displayed, so that the user can enter and display the target text on the text editing component.
  • the text editing component is automatically hidden, and the second engine is started to render the target text, and then the aligned rendering result is displayed at the position (designated editing position) where the target text is entered by text alignment, thereby using visual difference to achieve the purpose of allowing the video editing software to support text editing and advanced display effects at the same time.
  • a text display device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated.
  • the term "module” can implement a combination of software and/or hardware of a predetermined function.
  • the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
  • This embodiment provides a text display device, as shown in FIG12 , including:
  • An acquisition module 1201 is used to acquire multiple video frames, wherein the multiple video frames include a target video frame to be edited.
  • the first execution module 1202 is used to obtain the target text from the designated editing position of the target frame video image, and display the target text at the designated editing position;
  • the rendering module 1203 is used to render the target text and obtain a rendering result
  • the second execution module 1204 is used to align the rendering result with the target text, and display the aligned rendering result at the designated editing position.
  • the first execution module 1202 includes: a first processing unit, used to determine, based on the current font size of the target text, a display ratio between the current font size displayed in the first display window and the current font size displayed in the second display window, the first display window being a window for displaying multiple frames of video images, and the second display window being a window for displaying rendering results; a first adjustment unit, used to adjust the rendering result based on the display ratio to obtain an aligned rendering result; and a second processing unit, used to display the aligned rendering result at a designated editing position.
  • the first adjustment unit includes: a first determination unit, used to determine a first value corresponding to a text configuration parameter based on a target text displayed in the first display window according to the current font size; a second determination unit, used to determine a second value of the text configuration parameter in the second display window based on the display ratio and the first value; and a third processing unit, used to adjust the text configuration parameter of the rendering result according to the second value to obtain an aligned rendering result.
  • the second determination unit includes: a first line number determination module, used to determine the first display line number of the target text in the first display window; a second line number determination module, used to determine the second display line number of the rendering result in the second display result; a first adjustment module, used to add a line break to the target text if the second display line number is greater than the first display line number, so as to change the first display line number to the second display line number.
  • the device also includes: a second adjustment module, which is used to respond to the position movement instruction executed on the aligned rendering result during the playback of the multi-frame images, track the movement trajectory of the aligned rendering result, and determine the position refresh rate of the aligned rendering result based on the current playback frame rate of the multi-frame images; a display module, which is used to display the aligned rendering result at the target editing position of each frame image in the multi-frame images according to the position refresh rate.
  • a second adjustment module which is used to respond to the position movement instruction executed on the aligned rendering result during the playback of the multi-frame images, track the movement trajectory of the aligned rendering result, and determine the position refresh rate of the aligned rendering result based on the current playback frame rate of the multi-frame images
  • a display module which is used to display the aligned rendering result at the target editing position of each frame image in the multi-frame images according to the position refresh rate.
  • the display module includes: a fourth processing unit, used to switch the current playback frame rate to the target playback frame rate, and determine the second position refresh rate of the aligned rendering result based on the target playback frame rate, and the target playback frame rate is higher than the current playback frame rate.
  • the device further includes: a third execution module, configured to stop moving in response to the aligned rendering result and restore the target playback frame rate to the current playback frame rate.
  • the device before displaying the aligned rendering result at the designated editing position, the device further includes: a fourth execution module, configured to hide the target text displayed at the designated editing position.
  • the text display device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and/or other devices that can provide the above functions.
  • ASIC Application Specific Integrated Circuit
  • the embodiment of the present disclosure also provides an electronic device having the text display device shown in FIG. 12 above.
  • FIG. 13 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present disclosure.
  • the electronic device includes: one or more processors 10, a memory 20, and an interface for connecting various components. Including high-speed interface and low-speed interface. Each component utilizes different buses to communicate with each other, and can be installed on a common mainboard or installed in other ways as needed.
  • the processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input/output device (such as a display device coupled to the interface).
  • an external input/output device such as a display device coupled to the interface.
  • multiple processors and/or multiple buses can be used together with multiple memories and multiple memories.
  • multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).
  • a processor 10 is taken as an example in Figure 13.
  • the processor 10 may be a central processing unit, a network processor or a combination thereof.
  • the processor 10 may further include a hardware chip.
  • the hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof.
  • the programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
  • the memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
  • the memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc.
  • the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device.
  • the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • the memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
  • a volatile memory such as a random access memory
  • the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive
  • the memory 20 may also include a combination of the above types of memory.
  • the electronic device further includes an input device 30 and an output device 40.
  • the processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means, and FIG13 takes the connection via a bus as an example.
  • the input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick, etc.
  • the output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc.
  • the above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
  • the present disclosure also provides a computer-readable storage medium.
  • the method according to the present disclosure can be implemented in hardware, firmware, or recorded in a storage medium, or downloaded through a network and originally stored in a remote storage medium or a non-temporary machine-readable storage medium and stored in a local storage medium. Code, so that the methods described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware.
  • the storage medium can be a disk, an optical disk, a read-only storage memory, a random access storage memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above types of memory.
  • a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code.
  • a storage component that can store or receive software or computer code.
  • a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information.
  • the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
  • the prompt information in response to receiving an active request from the user, may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form.
  • the pop-up window may also carry a selection control for the user to choose "agree” or “disagree” to provide personal information to the electronic device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本公开涉及计算机视觉技术领域,公开了文本显示方法、装置、电子设备及存储介质。本公开提供了一种文本显示方法,包括:获取多帧视频图像,多帧视频图像中包括待进行文本编辑的目标帧视频图像;从目标帧视频图像的指定编辑位置上获取目标文本,并将目标文本显示在指定编辑位置上;渲染目标文本,得到渲染结果;将渲染结果与目标文本对齐,并将对齐后的渲染结果显示在指定编辑位置上。

Description

文本显示方法、装置、电子设备及存储介质
相关申请的交叉引用
本申请要求于2023年11月27日提交的,申请号为202311596000.8、发明名称为“文本显示方法、装置、电子设备及存储介质”的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本公开涉及计算机视觉技术领域,具体涉及文本显示方法、装置、电子设备及存储介质。
背景技术
随着视频的玩法逐渐丰富、成熟,在视频编辑软件中为视频增加文字成为用户常用的编辑功能。但在实际应用过程中,由于用户只能在需要添加文字的位置上查看文字的渲染结果,不利于用户快速确定当前的渲染结果是否满足用户的文本编辑意图。
发明内容
有鉴于此,本公开提供了一种文本显示方法、装置、电子设备及存储介质。
第一方面,本公开提供了一种文本显示方法,包括:
获取多帧视频图像,多帧视频图像中包括待进行文本编辑的目标帧视频图像;
从目标帧视频图像的指定编辑位置上获取目标文本,并将目标文本显示在指定编辑位置上;
渲染目标文本,得到渲染结果;
将渲染结果与目标文本对齐,并将对齐后的渲染结果显示在指定编辑位置上。
第二方面,本公开提供了一种文本显示装置,包括:
获取模块,用于获取多帧视频图像,多帧视频图像中包括待进行文本编辑的目标帧视频图像;
第一执行模块,用于从目标帧视频图像的指定编辑位置上获取目标文本,并将目标文本显示在指定编辑位置上;
渲染模块,用于渲染目标文本,得到渲染结果;
第二执行模块,用于将渲染结果与目标文本对齐,并将对齐后的渲染结果显示在指定编辑位置上。
第三方面,本公开提供了一种电子设备,包括:存储器和处理器,存储器和处理器之间互相通信连接,存储器中存储有计算机指令,处理器通过执行计算机指令,从而执行上述第一方面或其对应的任一实施方式的文本显示方法。
第四方面,本公开提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机指令,计算机指令用于使计算机执行上述第一方面或其对应的任一实施方式的文本显示方法。
本公开实施例提供的文本显示方法,在从多帧视频图像中确定待进行文本编辑的目标帧视频图像后,在目标帧视频图像中需要进行文本编辑的指定编辑位置上,获取并显示目标文本,进而对该目标文本进行渲染,得到渲染结果。
附图说明
为了更清楚地说明本公开具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是现有技术的文本编辑输入示意图;
图2是现有技术的渲染效果结果示意图;
图3是根据本公开实施例的文本显示方法的流程示意图;
图4是根据本公开实施例的文本编辑输入示意图;
图5是根据本公开实施例的目标文本的显示示意图;
图6是根据本公开实施例的渲染效果示意图;
图7是根据本公开实施例的另一文本显示方法的流程示意图;
图8是根据本公开实施例的又一文本显示方法的流程示意图;
图9是根据本公开实施例的又一渲染效果示意图;
图10是根据本公开实施例的引擎位置关系示意图;
图11是根据本公开实施例的视频编辑软件的组件框架示意图;
图12是根据本公开实施例的文本显示装置的结构框图;
图13是本公开实施例的电子设备的硬件结构示意图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
如图1所示,在实际应用中,当用户需要对当前视频添加文本时,需要预先确定当前帧视频中需要添加文本的文本添加位置(视频内容中的虚框),进而再在键盘提供的输入框中输入待输入文本。当待输入文本输入完成后,在文本添加位置显示该待输入文本的渲染结果。例如:如图2所示,以待输入文本为“#打卡”为例,当“#打卡”在键盘提供的 输入框中输入完成,则在文本添加位置上显示“#打卡”对应的渲染结果。
由于待输入文本的输入位置和渲染结果的显示位置是不同的控件提供的,且显示位置也存在较大差异,因此,采用该种方式进行文本编辑,不利于用户快速确定当前的渲染结果是否满足用户的文本编辑意图。
基于此,本公开实施例提供了一种文本显示方法,能够用户在输入目标文本的指定位置编辑上,直接查看到目标文本渲染后的结果,以便用户快速确定当前在指定编辑位置上显示的对齐后渲染结果是否满足自身需求,从而有助于增强视频编辑软件执行文本编辑的交互能力,使显示目标文本渲染后的结果的方式更直观且友好。
根据本公开实施例,提供了一种文本显示方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
在本实施例中提供了一种文本显示方法,可用于上述的电子设备,例如,电脑,移动终端等等,图3是根据本公开实施例的文本显示方法的流程图,如图3所示,该流程包括如下步骤:
步骤S301,获取多帧视频图像。
多帧视频图像中包括待进行文本编辑的目标帧视频图像。多帧视频图像可以是组成视频的全部帧视频图像,也可以是根据用户需求截取的部分帧视频图像。
多帧视频图像对应的视频来自使用摄像设备(例如:摄像机、智能手机、监控摄像头等)实时录制的场景。该视频可以是从本地数据库中获取得到的,也可以是从云端数据库中下载得到的。在此对待识别视频的获取方式并不做任何限定,具体根据实际需求进行设置即可。
步骤S302,从目标帧视频图像的指定编辑位置上获取目标文本,并将目标文本显示在指定编辑位置上。
指定编辑位置可以理解为是被允许可以进行文本编辑的位置,该指定编辑位置可以是用户指定位置,也可以是预设的默认位置。目标文本可以理解为是用户需要添加在目标帧视频图像上的文本。
当在目标帧视频图像上的指定编辑位置上获取到目标文本,则表征用户在指定编辑位置上输入了目标文本,因此,为便于用户明确当前在指定编辑位置上输入的内容,则将目标文本显示在指定编辑位置上,以便用户能够直观地查看当前输入的目标文本,以当目标文本输入错误时,可以及时调整,得到正确的目标文本。
步骤S303,渲染目标文本,得到渲染结果。
为使目标文本的显示更美观,则对当前获取的目标文本进行渲染,进而得到渲染结果。其中,对目标文本进行渲染的内容包括但不限于:字体、字号、颜色、对齐方式、阴影和 描边等效果。其中,渲染后渲染结果可以为静态的图片或动态的动画效果,具体取决于用户的选择,在此不进行限定。
步骤S304,将渲染结果与目标文本对齐,并将对齐后的渲染结果显示在指定编辑位置上。
由于渲染后的渲染结果可能与目标文本之间的差异较大,因此,为便于用户能够更直观的查看目标文本渲染后的显示结果,则建立渲染结果与目标文本之间的对应关系,以将渲染结果能够与目标文本对齐,进而保障对齐后的渲染结果可以直接在指定编辑位置上进行显示,便于用户可以更直观的确认当前渲染效果是否满足自身的需求,使显示目标文本渲染后的结果的方式更友好,从而有助于用户快速完成文本编辑。
本实施例提供的文本显示方法,在从多帧视频图像中确定待进行文本编辑的目标帧视频图像后,在目标帧视频图像中需要进行文本编辑的指定编辑位置上,获取并显示目标文本,进而对该目标文本进行渲染,得到渲染结果。为便于用户能够直观的从指定位置编辑上查看到目标文本渲染后的结果,则将渲染结果与目标文本对齐,进而将对齐后的渲染结果显示在指定编辑位置上,以便用户快速确定当前在指定编辑位置上显示的对齐后渲染结果是否满足自身需求,从而有助于增强视频编辑软件执行文本编辑的交互能力,使显示目标文本渲染后的结果的方式更友好,有利于提升用户的使用体验。
在一些可选的实施场景中,通过上述文本显示方法显示目标文本的渲染显示结果的过程可以如图4至图6所示。其中,如图4所示,目标帧视频图像中的虚框即为指定编辑位置。如图5所示,在用户选中指定编辑位置后,可以在待输入文本上面输入目标文本(“#打卡”),进而在“#打卡”输入完成后,显示在该指定编辑位置上。以渲染效果是将“#打卡”加粗显示为例,则将对齐后的渲染结果显示指定编辑位置上的示意图即可如图6所示。其中,与“#打卡”叠加显示的加粗的“#打卡”是经过对齐后的渲染结果,可以将其作为目标文本的渲染显示结果。
在本实施例中提供了一种文本显示方法,可用于上述的电子设备,例如,电脑,移动终端等等,图7是根据本公开实施例的文本显示方法的流程图,如图7所示,该流程包括如下步骤:
步骤S701,获取多帧视频图像。
步骤S702,从目标帧视频图像的指定编辑位置上获取目标文本,并将目标文本显示在指定编辑位置上。
步骤S703,渲染目标文本,得到渲染结果。
步骤S704,将渲染结果与目标文本对齐,并将对齐后的渲染结果显示在指定编辑位置上。
具体地,上述步骤S704包括:
步骤S7041,根据目标文本的当前字号,确定第一显示窗口显示当前字号与第二显示 窗口之间显示当前字号的显示比值。
第一显示窗口为显示多帧视频图像的窗口,第二显示窗口为显示渲染结果的窗口。由于渲染结果和目标文本分别采用不同的窗口进行显示,且不同窗口在显示文本时可能存在差异,因此,为便于将渲染结果与目标文本进行针对性对齐,则在确定目标文本当前字号的情况下,确定第一显示窗口显示当前字号与第二显示窗口之间显示当前字号的显示比值,以便通过该显示比值可以确保在第二显示窗口显示的对齐后的渲染结果的字号与该当前字号一致。
在一可选地实施场景中,在当前字号确定的情况下,显示比值可以采用下述方式计算:
目标文本用于在第一显示窗口显示的当前字号(fontSize)的单位为磅(pt),将其转换像素的表达式如下:systemSize*ScreenScale,其中,systemSize是以磅为单位的字号大小,ScreenDPI是第一显示窗口每英寸的像素密度。
第二显示窗口对应的像素转换表达式如下:fontSize*300/72.0,其中,300表示第二显示窗口每英寸的像素密度,72.0是1英寸中的磅数。
为将渲染结果与目标文本对齐,则建立如下关系式:
fontSize*300/72.0=systemSize*ScreenScale;
fontSize=systemSize*ScreenScale*72.0/300;
fontSize=systemSize*(Player2Width/(Player1Width*ScreenScale))*ScreenScale*72.0/300;
最终得到的显示比值rate=Player2Width/player1Width)*(72.0/300.0)。
其中,Player2Width为第二显示窗口的显示宽度。Player1Width为第一显示窗口的显示宽度。在一示例中,Player2Width可以为预设的固定值,例如:720.0。
步骤S7042,基于显示比值,调节渲染结果,得到对齐后的渲染结果。
基于显示比值,可以明确渲染结果的调节方向,进而可以针对性对齐,得到对齐后的渲染结果,从而后续进行显示时,可以保障对齐后的渲染结果的可读性不会受到影响,有利于增强目标文本的渲染显示结果的可视化效果,便于提升用户的使用体验。
在一可选的实施方式中,上述步骤S7042包括:
步骤a1,根据第一显示窗口按照当前字号显示的目标文本,确定文本配置参数对应的第一数值。
文本配置参数可以理解为是在当前字号下,通过第一显示窗口下显示目标文本的配置参数。文本配置参数包括但不限于以下参数:字体大小、文本宽度、背景圆角、字间距、行间距、阴影宽度等。为便于明确调节方向,则先确定在第一显示窗口显示目标文本时,该文本配置参数对应的第一数值。
步骤a2,基于显示比值以及第一数值,确定文本配置参数在第二显示窗口下的第二数值。
基于显示比值以及第一数值,可以得到适用于第二显示窗口的调整后的数值,进而可 以确保文本在不同的显示窗口上保持一致的配置效果,从而可以提供统一和可读性良好的用户体验。
在一可选地实施场景中,通过第一数值确定第二数值的计算过程可以如下表1所示:
表1
其中,文本编辑组件为支持用户在第一显示窗口内输入目标文本的组件。
步骤a3,将渲染结果的文本配置参数按照第二数值进行调节,得到对齐后的渲染结果。
为使渲染结果的显示字号与当前字号相同,则将渲染结果的文本配置参数按照第二数值进行针对性调节,进而得到能够与目标文本保持一致的对齐后的渲染结果。
在一些可选地实施方式中,若文本配置参数为最大显示宽度,则上述步骤a3包括:
步骤a31,确定目标文本在第一显示窗口下的第一显示行数;
步骤a32,确定渲染结果在第二显示结果下的第二显示行数;
步骤a33,若第二显示行数大于第一显示行数,则在目标文本中添加换行符,以将第一显示行数变为第二显示行数。
具体的,根据第一显示窗口的最大显示宽度,确定当前采用第一显示窗口显示目标文本时的第一显示行数。根据第二显示窗口的最大显示宽度,确定对齐后的渲染结果在第二显示结果下的第二显示行数。为避免出现渲染后的第二显示行数与第一显示行数不一致而影响用户视觉体验的情况发生,则将第二显示行数与第一显示行数进行对比。若第二显示行数大于第一显示行数,则在目标文本中添加换行符,以将第一显示行数变为第二显示行数,进而保障对齐后的渲染结果与目标文本显示的行数相同。
步骤S7043,将对齐后的渲染结果显示在指定编辑位置上。
本实施例提供的文本显示方法,将渲染结果与目标文本进行对齐,进而在指定编辑位 置上显示对齐后的渲染结果,可以保障对齐后的渲染结果的可读性不会受到影响,进而有利于增强目标文本的渲染显示结果的可视化效果,便于提升用户的使用体验。
在本实施例中提供了一种文本显示方法,可用于上述的电子设备,例如,电脑,移动终端等等,图8是根据本公开实施例的文本显示方法的流程图,如图8所示,该流程包括如下步骤:
步骤S801,获取多帧视频图像。
步骤S802,从目标帧视频图像的指定编辑位置上获取目标文本,并将目标文本显示在指定编辑位置上。
步骤S803,渲染目标文本,得到渲染结果。
步骤S804,将渲染结果与目标文本对齐,并将对齐后的渲染结果显示在指定编辑位置上。
步骤S805,若目标帧视频图像为连续的多帧图像,则在多帧图像播放的过程中,响应对对齐后的渲染结果执行的位置移动指令,追踪对齐后的渲染结果的移动轨迹,并基于多帧图像的当前播放帧率,确定对齐后的渲染结果的位置刷新速率。
在预览对齐后的渲染结果在目标帧视频图像中的显示情况,则播放多帧图像。但在播放多帧图像的过程中,若接收到用户对对齐后的渲染结果触发的位置移动指令,则追踪对齐后的渲染结果的移动轨迹,以确定对齐后的渲染结果在每一帧图像上对应显示的目标编辑位置。
为便于对齐后的渲染结果显示效果更友好,则基于多帧图像的当前播放帧率,确定对齐后的渲染结果的位置刷新速率,以便在移动对齐后的渲染结果的过程中,对齐后的渲染结果能够跟随位置的移动而进行相应显示,进而有助于增强用户的使用体验。
具体的,上述步骤S805包括:
步骤b1,将当前播放帧率切换成目标播放帧率,并基于目标播放帧率确定对齐后的渲染结果的第二位置刷新速率。
目标播放帧率高于当前播放帧率。为提高的对齐后的渲染结果的拖动流畅度,则将当前播放帧率切换成目标播放帧率,进而基于目标播放帧率确定对齐后的渲染结果的第二位置刷新速率,能够保障对齐效果更佳。例如:若当前播放帧率为30帧/秒,则可以将目标播放帧率调节为60帧/秒。
在一些可选的实施方式中,上述步骤S805还包括:
步骤b2,响应对齐后的渲染结果停止移动,将目标播放帧率恢复成当前播放帧率。
由于调节目标播放帧率的目的是保障对齐后的渲染结果能够跟随用户手势的移动而对齐显示,便于提升用户的预览体验,而并非是针对多帧图像的播放速度进行调节,因此,在用户停止对对齐后的渲染结果的移动之后,将目标播放帧率恢复成当前播放帧率。
步骤S806,按照位置刷新速率,将对齐后的渲染结果显示在多帧图像中每一帧图像的 目标编辑位置上。
按照位置刷新速率,在每一帧图像的目标编辑位置上显示对应的对齐后的渲染结果,能够保障对齐后的渲染结果在多帧图像之间可以保持一致,进而实现视觉上的连贯性,从而可以提高视觉效果、增强用户体验。
本实施例提供的文本显示方法,能够丰富对视频进行文本编辑的功能多样性,进而不仅可以提高视觉效果,还可以增强用户体验。
在一可选的实施方式中,为便于用户能够清晰的查看对齐后的渲染效果,则将指定编辑位置上显示的目标文本隐藏。例如:结合图5所示的目标文本,则显示的时候如图9所示。
在一可选的实施场景中,第一显示窗口可以是由电子设备当前操作系统的第一引擎提供的,第二显示窗口是由第二引擎提供的。其中,第一引擎可以理解为是嵌入在当前操作系统中,用于执行文本编辑任务的引擎。即,当用户需要输入目标文本时,调用第一引擎,以使用户可以通过第一引擎提供的文本编辑组件输入目标文本。第二引擎可以理解为是用于执行文本渲染任务的引擎。当需要渲染目标文本时,第二引擎从第一引擎中获取待进行文本渲染的目标文本,并通过第二引擎提供的文本渲染组件对目标文本进行渲染,得到渲染结果。在一示例中,如图10所示,在对目标帧视频图像执行文本编辑的过程中,第二引擎位于第一引擎下方,进而便于将渲染结果能够更好的与用户输入的目标文本对齐。
基于相同构思,本公开还提供一种视频编辑软件的组件框架,如图11所示,当用户在目标帧视频图像的指定编辑位置上输入目标文本时,禁用第二引擎提供的文本渲染组件,显示第一引擎提供的文本编辑组件,以便用户在该文本编辑组件上进行输入和显示目标文本。当目标文本输入完成后,自动隐藏该文本编辑组件,启动第二引擎对目标文本进行渲染,进而通过文本对齐的方式,将对齐后的渲染结果显示在输入目标文本的位置(指定编辑位置)上,从而利用视觉差达到让视频编辑软件可以对文本编辑和高级显示效果同时支持的目的。
在本实施例中还提供了一种文本显示装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
本实施例提供一种文本显示装置,如图12所示,包括:
获取模块1201,用于获取多帧视频图像,多帧视频图像中包括待进行文本编辑的目标帧视频图像;
第一执行模块1202,用于从目标帧视频图像的指定编辑位置上获取目标文本,并将目标文本显示在指定编辑位置上;
渲染模块1203,用于渲染目标文本,得到渲染结果;
第二执行模块1204,用于将渲染结果与目标文本对齐,并将对齐后的渲染结果显示在指定编辑位置上。
在一些可选的实施方式中,第一执行模块1202包括:第一处理单元,用于根据目标文本的当前字号,确定第一显示窗口显示当前字号与第二显示窗口之间显示当前字号的显示比值,第一显示窗口为显示多帧视频图像的窗口,第二显示窗口为显示渲染结果的窗口;第一调节单元,用于基于显示比值,调节渲染结果,得到对齐后的渲染结果;第二处理单元,用于将对齐后的渲染结果显示在指定编辑位置上。
在一些可选的实施方式中,第一调节单元包括:第一确定单元,用于根据第一显示窗口按照当前字号显示的目标文本,确定文本配置参数对应的第一数值;第二确定单元,用于基于显示比值以及第一数值,确定文本配置参数在第二显示窗口下的第二数值;第三处理单元,用于将渲染结果的文本配置参数按照第二数值进行调节,得到对齐后的渲染结果。
在一些可选的实施方式中,第二确定单元包括:第一行数确定模块,用于确定目标文本在第一显示窗口下的第一显示行数;第二行数确定模块,用于确定渲染结果在第二显示结果下的第二显示行数;第一调节模块,用于若第二显示行数大于第一显示行数,则在目标文本中添加换行符,以将第一显示行数变为第二显示行数。
在一些可选的实施方式中,若目标帧视频图像为连续的多帧图像,则装置还包括:第二调节模块,用于在多帧图像播放的过程中,响应对对齐后的渲染结果执行的位置移动指令,追踪对齐后的渲染结果的移动轨迹,并基于多帧图像的当前播放帧率,确定对齐后的渲染结果的位置刷新速率;显示模块,用于按照位置刷新速率,将对齐后的渲染结果显示在多帧图像中每一帧图像的目标编辑位置上。
在一些可选的实施方式中,显示模块包括:第四处理单元,用于将当前播放帧率切换成目标播放帧率,并基于目标播放帧率确定对齐后的渲染结果的第二位置刷新速率,目标播放帧率高于当前播放帧率。
在一些可选的实施方式中,装置还包括:第三执行模块,用于响应对齐后的渲染结果停止移动,将目标播放帧率恢复成当前播放帧率。
在一些可选的实施方式中,在将对齐后的渲染结果显示在指定编辑位置上之前,装置还包括:第四执行模块,用于将指定编辑位置上显示的目标文本隐藏。
上述各个模块和单元的更进一步的功能描述与上述对应实施例相同,在此不再赘述。
本实施例中的文本显示装置是以功能单元的形式来呈现,这里的单元是指ASIC(Application Specific Integrated Circuit,专用集成电路)电路,执行一个或多个软件或固定程序的处理器和存储器,和/或其他可以提供上述功能的器件。
本公开实施例还提供一种电子设备,具有上述图12所示的文本显示装置。
请参阅图13,图13是本公开可选实施例提供的一种电子设备的结构示意图,如图13所示,该电子设备包括:一个或多个处理器10、存储器20,以及用于连接各部件的接口, 包括高速接口和低速接口。各个部件利用不同的总线互相通信连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在一些可选的实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图13中以一个处理器10为例。
处理器10可以是中央处理器,网络处理器或其组合。其中,处理器10还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路,可编程逻辑器件或其组合。上述可编程逻辑器件可以是复杂可编程逻辑器件,现场可编程逻辑门阵列,通用阵列逻辑或其任意组合。
其中,存储器20存储有可由至少一个处理器10执行的指令,以使至少一个处理器10执行实现上述实施例示出的方法。
存储器20可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器20可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些可选的实施方式中,存储器20可选包括相对于处理器10远程设置的存储器,这些远程存储器可以通过网络连接至该电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
存储器20可以包括易失性存储器,例如,随机存取存储器;存储器也可以包括非易失性存储器,例如,快闪存储器,硬盘或固态硬盘;存储器20还可以包括上述种类的存储器的组合。
该电子设备还包括输入装置30和输出装置40。处理器10、存储器20、输入装置30和输出装置40可以通过总线或者其他方式连接,图13中以通过总线连接为例。
输入装置30可接收输入的数字或字符信息,以及产生与该电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等。输出装置40可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。上述显示设备包括但不限于液晶显示器,发光二极管,显示器和等离子体显示器。在一些可选的实施方式中,显示设备可以是触摸屏。
本公开实施例还提供了一种计算机可读存储介质,上述根据本公开实施例的方法可在硬件、固件中实现,或者被实现为可记录在存储介质,或者被实现通过网络下载的原始存储在远程存储介质或非暂时机器可读存储介质中并将被存储在本地存储介质中的计算机 代码,从而在此描述的方法可被存储在使用通用计算机、专用处理器或者可编程或专用硬件的存储介质上的这样的软件处理。其中,存储介质可为磁碟、光盘、只读存储记忆体、随机存储记忆体、快闪存储器、硬盘或固态硬盘等;进一步地,存储介质还可以包括上述种类的存储器的组合。可以理解,计算机、处理器、微处理器控制器或可编程硬件包括可存储或接收软件或计算机代码的存储组件,当软件或计算机代码被计算机、处理器或硬件访问且执行时,实现上述实施例示出的方法。
可以理解的是,在使用本公开各实施例公开的技术方案之前,均应当依据相关法律法规通过恰当的方式对本公开所涉及个人信息的类型、使用范围、使用场景等告知用户并获得用户的授权。
例如,在响应于接收到用户的主动请求时,向用户发送提示信息,以明确地提示用户,其请求执行的操作将需要获取和使用到用户的个人信息。从而,使得用户可以根据提示信息来自主地选择是否向执行本公开技术方案的操作的电子设备、应用程序、服务器或存储介质等软件或硬件提供个人信息。
作为一种可选的但非限定性的实现方式,响应于接收到用户的主动请求,向用户发送提示信息的方式例如可以是弹窗的方式,弹窗中可以以文字的方式呈现提示信息。此外,弹窗中还可以承载供用户选择“同意”或者“不同意”向电子设备提供个人信息的选择控件。
可以理解的是,上述通知和获取用户授权过程仅是示意性的,不对本公开的实现方式构成限定,其它满足相关法律法规的方式也可应用于本公开的实现方式中。
虽然结合附图描述了本公开的实施例,但是本领域技术人员可以在不脱离本公开的精神和范围的情况下做出各种修改和变型,这样的修改和变型均落入由所附权利要求所限定的范围之内。

Claims (11)

  1. 一种文本显示方法,所述方法包括:
    获取多帧视频图像,所述多帧视频图像中包括待进行文本编辑的目标帧视频图像;
    从所述目标帧视频图像的指定编辑位置上获取目标文本,并将所述目标文本显示在所述指定编辑位置上;
    渲染所述目标文本,得到渲染结果;
    将所述渲染结果与所述目标文本对齐,并将对齐后的渲染结果显示在所述指定编辑位置上。
  2. 根据权利要求1所述的方法,其中,所述将所述渲染结果与所述目标文本对齐,并将对齐后的渲染结果显示在所述指定编辑位置上,包括:
    根据所述目标文本的当前字号,确定第一显示窗口显示所述当前字号与第二显示窗口之间显示所述当前字号的显示比值,所述第一显示窗口为显示所述多帧视频图像的窗口,所述第二显示窗口为显示渲染结果的窗口;
    基于所述显示比值,调节所述渲染结果,得到对齐后的渲染结果;
    将所述对齐后的渲染结果显示在所述指定编辑位置上。
  3. 根据权利要求2所述的方法,其中,所述基于所述显示比值,调节所述渲染结果,得到对齐后的渲染结果,包括:
    根据所述第一显示窗口按照所述当前字号显示的所述目标文本,确定文本配置参数对应的第一数值;
    基于所述显示比值以及所述第一数值,确定所述文本配置参数在所述第二显示窗口下的第二数值;
    将所述渲染结果的文本配置参数按照所述第二数值进行调节,得到所述对齐后的渲染结果。
  4. 根据权利要求3所述的方法,其中,若所述文本配置参数为最大显示宽度,则所述将所述渲染结果的文本配置参数按照所述第二数值进行调节,得到所述对齐后的渲染结果,包括:
    确定所述目标文本在所述第一显示窗口下的第一显示行数;
    确定所述渲染结果在所述第二显示结果下的第二显示行数;
    若所述第二显示行数大于所述第一显示行数,则在所述目标文本中添加换行符,以将所述第一显示行数变为所述第二显示行数。
  5. 根据权利要求1所述的方法,其中,若所述目标帧视频图像为连续的多帧图像,则所述方法还包括:
    在所述多帧图像播放的过程中,响应对所述对齐后的渲染结果执行的位置移动指令,追踪所述对齐后的渲染结果的移动轨迹,并基于所述多帧图像的当前播放帧率,确定所述对齐后的渲染结果的位置刷新速率;
    按照所述位置刷新速率,将所述对齐后的渲染结果显示在所述多帧图像中每一帧图像的目标编辑位置上。
  6. 根据权利要求5所述的方法,其中,所述基于所述多帧图像的当前播放帧率,确定所述对齐后的渲染结果的位置刷新速率,包括:
    将所述当前播放帧率切换成目标播放帧率,并基于所述目标播放帧率确定所述对齐后的渲染结果的第二位置刷新速率,所述目标播放帧率高于所述当前播放帧率。
  7. 根据权利要求6所述的方法,其中,所述方法还包括:
    响应所述对齐后的渲染结果停止移动,将所述目标播放帧率恢复成所述当前播放帧率。
  8. 根据权利要求1所述的方法,其中,在将对齐后的渲染结果显示在所述指定编辑位置上之前,所述方法还包括:
    将所述指定编辑位置上显示的所述目标文本隐藏。
  9. 一种文本显示装置,所述装置包括:
    获取模块,用于获取多帧视频图像,所述多帧视频图像中包括待进行文本编辑的目标帧视频图像;
    第一执行模块,用于从所述目标帧视频图像的指定编辑位置上获取目标文本,并将所述目标文本显示在所述指定编辑位置上;
    渲染模块,用于渲染所述目标文本,得到渲染结果;
    第二执行模块,用于将所述渲染结果与所述目标文本对齐,并将对齐后的渲染结果显示在所述指定编辑位置上。
  10. 一种电子设备,包括:
    存储器和处理器,所述存储器和所述处理器之间互相通信连接,所述存储器中存储有计算机指令,所述处理器通过执行所述计算机指令,从而执行权利要求1至8中任一项所述的文本显示方法。
  11. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机指令,所述计算机指令用于使计算机执行权利要求1至8中任一项所述的文本显示方法。
PCT/CN2024/125898 2023-11-27 2024-10-18 文本显示方法、装置、电子设备及存储介质 Pending WO2025112968A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202311596000.8 2023-11-27
CN202311596000.8A CN120050470A (zh) 2023-11-27 2023-11-27 文本显示方法、装置、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2025112968A1 true WO2025112968A1 (zh) 2025-06-05

Family

ID=95748602

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/125898 Pending WO2025112968A1 (zh) 2023-11-27 2024-10-18 文本显示方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN120050470A (zh)
WO (1) WO2025112968A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109145272A (zh) * 2018-07-27 2019-01-04 广州视源电子科技股份有限公司 文本渲染和布局方法、装置、设备和存储介质
KR20210117086A (ko) * 2020-03-18 2021-09-28 주식회사 딥하이 딥러닝 기반의 vtt를 이용한 비디오 편집 방법 및 그 시스템
CN113747240A (zh) * 2021-09-10 2021-12-03 荣耀终端有限公司 视频处理方法、设备、存储介质和程序产品
US20220283697A1 (en) * 2021-03-02 2022-09-08 Beijing Bytedance Network Technology Co., Ltd. Video editing and playing method, apparatus, device and medium
CN116167910A (zh) * 2023-01-03 2023-05-26 深圳前海环融联易信息科技服务有限公司 文本编辑方法、装置、计算机设备及计算机可读存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109145272A (zh) * 2018-07-27 2019-01-04 广州视源电子科技股份有限公司 文本渲染和布局方法、装置、设备和存储介质
KR20210117086A (ko) * 2020-03-18 2021-09-28 주식회사 딥하이 딥러닝 기반의 vtt를 이용한 비디오 편집 방법 및 그 시스템
US20220283697A1 (en) * 2021-03-02 2022-09-08 Beijing Bytedance Network Technology Co., Ltd. Video editing and playing method, apparatus, device and medium
CN113747240A (zh) * 2021-09-10 2021-12-03 荣耀终端有限公司 视频处理方法、设备、存储介质和程序产品
CN116167910A (zh) * 2023-01-03 2023-05-26 深圳前海环融联易信息科技服务有限公司 文本编辑方法、装置、计算机设备及计算机可读存储介质

Also Published As

Publication number Publication date
CN120050470A (zh) 2025-05-27

Similar Documents

Publication Publication Date Title
US10547778B2 (en) Image display device for displaying an image in an image display area, and storage medium storing image display program for displaying an image in an image display area
WO2017113856A1 (zh) 弹幕显示方法和装置
CN108958630B (zh) 书写内容显示方法、装置及电子设备
KR20210147868A (ko) 비디오 처리 방법 및 장치
WO2022194003A1 (zh) 截屏方法、装置、电子设备以及可读存储介质
WO2017133475A1 (zh) 播放多媒体数据的方法、界面渲染方法及装置、设备
WO2024051540A1 (zh) 特效处理方法、装置、电子设备及存储介质
WO2024222356A1 (zh) 特效生成方法、装置、计算机设备及存储介质
WO2025162414A1 (zh) 媒体编辑的方法、装置、设备和存储介质
CN117462955A (zh) 游戏编辑方法、装置和电子设备
CN111726666A (zh) 视频显示控制方法和装置
JP2023522370A (ja) 画像表示方法、装置、機器及び記憶媒体
WO2019105062A1 (zh) 一种内容显示方法、装置和终端设备
CN114612292A (zh) 图像处理方法、装置、电子设备及存储介质
CN114756695A (zh) 一种多媒体资源的处理方法、装置、设备及存储介质
WO2025112968A1 (zh) 文本显示方法、装置、电子设备及存储介质
CN114666647B (zh) 不同信源之间实现画中画的方法、装置及相关组件
US20250220264A1 (en) Method, apparatus, electronic device and storage medium for camera function page switching
CN115904284B (zh) 显示控制方法、系统、电子设备和介质
CN113596561A (zh) 视频流播放方法、装置、电子设备和计算机可读存储介质
CN113744115A (zh) 图像帧的渲染方法、显示设备和计算机可读存储介质
US20250267332A1 (en) Livestreaming information display method, an apparatus, electronic device, and storage medium
CN111756998A (zh) 构图方法、装置及电子设备
WO2026092596A1 (zh) 用于多媒体通话的方法、装置、设备和存储介质
CN118678145A (zh) 视频数据的显示方法、装置、设备、介质及程序产品

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24896061

Country of ref document: EP

Kind code of ref document: A1