WO2023185968A1 - 相机功能页面切换方法、装置、电子设备及存储介质 - Google Patents

相机功能页面切换方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2023185968A1
WO2023185968A1 PCT/CN2023/084887 CN2023084887W WO2023185968A1 WO 2023185968 A1 WO2023185968 A1 WO 2023185968A1 CN 2023084887 W CN2023084887 W CN 2023084887W WO 2023185968 A1 WO2023185968 A1 WO 2023185968A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
page
shooting
preview image
editing
Prior art date
Application number
PCT/CN2023/084887
Other languages
English (en)
French (fr)
Inventor
程清栋
Original Assignee
北京字跳网络技术有限公司
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 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2023185968A1 publication Critical patent/WO2023185968A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/667Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes

Definitions

  • Embodiments of the present disclosure relate to the technical fields of smart terminals and the Internet, and in particular, to a camera function page switching method, device, electronic device, storage medium, computer program product, and computer program.
  • the APP in the process of calling the camera unit for video shooting, will provide at least two function pages, namely the video shooting page and the video editing page.
  • the video shooting page is the default page for the camera function, and the video shooting page displays real-time After the shooting is completed, edit or view the video through the video editing page.
  • Embodiments of the present disclosure provide a camera function page switching method, device, electronic equipment, storage media, computer program products and computer programs to overcome the problem of a black screen phenomenon when returning from a video editing page to a video shooting page.
  • embodiments of the present disclosure provide a camera function page switching method, applied to a terminal device, where the terminal device has a camera unit, and the method includes:
  • a video editing page is started, the video editing page is used to edit the first video based on an editing instruction input by a user; in response to a shooting trigger instruction for the video editing page, all the video editing pages are closed.
  • the video editing page starts the video shooting page; obtains a preview image based on the first video, and displays the preview image in the video shooting page, wherein the preview image includes a video generated according to the first video At least one video frame; after the camera unit is initialized, collect the second video through the camera unit; jump to the video editing page, and play the synthesized video through the video editing page, wherein the synthesized video is based on
  • the target editing operation is generated after processing the first video and the second video.
  • an embodiment of the present disclosure provides a device for switching camera function pages, including:
  • An editing module configured to start a video editing page based on the selected first video, where the video editing page is used to edit the first video based on editing instructions input by the user;
  • a shooting module configured to close the video editing page and start the video shooting page in response to a shooting triggering instruction for the video editing page
  • An initialization module configured to obtain a preview image based on the first video and display the preview image in the video shooting page, wherein the preview image includes at least one video frame generated according to the first video;
  • the shooting module is also used to collect the second video through the camera unit after the camera unit is initialized;
  • the editing module is also configured to jump to the video editing page and play a synthesized video through the video editing page, wherein the synthesized video is based on a target editing operation of the first video and the second video. Generated after video processing.
  • an electronic device including:
  • a processor and a memory communicatively connected to the processor
  • the memory stores computer execution instructions
  • the processor executes computer execution instructions stored in the memory to implement the camera function page switching method described in the first aspect and various possible designs of the first aspect.
  • embodiments of the present disclosure provide a computer-readable storage medium.
  • Computer-executable instructions are stored in the computer-readable storage medium.
  • the processor executes the computer-executable instructions, the above first aspect and the first aspect are implemented.
  • the camera function page switching method is described.
  • embodiments of the present disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the camera function page switching method described in the first aspect and various possible designs of the first aspect. .
  • embodiments of the present disclosure provide a computer program that, when executed by a processor, implements the camera function page switching method described in the first aspect and various possible designs of the first aspect.
  • FIG. 1A is a schematic diagram of an application scenario of the camera function page switching method provided by an embodiment of the present disclosure.
  • Figure 1B is a schematic diagram of the black screen phenomenon during camera function page switching in the related art.
  • FIG. 2 is a schematic flowchart 1 of a camera function page switching method provided by an embodiment of the present disclosure.
  • FIG. 3 is a schematic diagram of displaying a preview image in a video shooting page according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic flowchart 2 of a camera function page switching method provided by an embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram of a process for obtaining a target frame based on pose information according to an embodiment of the present disclosure.
  • FIG. 6 is a flow chart of specific implementation steps of step S204 in the embodiment shown in FIG. 4 .
  • FIG. 7 is a schematic diagram of acquiring multi-frame pictures according to an embodiment of the present disclosure.
  • FIG. 8 is a structural block diagram of a camera function page switching device provided by an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • FIG. 10 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present disclosure.
  • the camera function page switching method provided by the embodiment of the present disclosure can be applied to application scenarios such as video shooting, editing, uploading and sharing of video APPs and social APPs.
  • the method provided by the embodiments of the present disclosure can be applied to a terminal device, such as a smartphone.
  • the terminal device has a camera unit, such as a camera module for image acquisition.
  • a video APP runs in the terminal device.
  • the video APP displays different camera function pages on the terminal device and combines interactive operation instructions input by the user to realize functions such as video shooting and editing.
  • FIG. 1A is a schematic diagram of an application scenario of the camera function page switching method provided by an embodiment of the present disclosure.
  • the application scenario is an application scenario of short video shooting.
  • the short video APP provides two interfaces: a video shooting page and a video editing page.
  • the video shooting page is used to call the camera unit to display real-time images.
  • the user observes and operates the video shooting page, Realize the shooting of short videos; then, after reaching the preset shooting duration of the short video APP, enter the video editing page, display the video information (video duration, video name, etc.) in the video editing page, and edit the short videos shot previously
  • the clips can be displayed and played back, and the short video clips can be edited in combination with the editing instructions input by the user; then, after the editing is completed, (by clicking the return button) return to the video shooting page, so that the user can continue to edit the short video clips conveniently and quickly.
  • Video shooting meets the needs of users in the short video shooting application scenario to repeatedly perform the "shooting-editing-shooting-editing” process, so as to perform video fusion based on multiple (at least two) videos shot to generate a composite video. Furthermore, the function of generating composite videos based on the process of "shooting-editing-shooting-editing" can be realized through a designated functional mode of the APP, such as "selected shooting mode", "synthetic shooting mode", etc. .
  • Figure 1B is a schematic diagram of the black screen phenomenon during switching of camera function pages in related technologies; as shown in Figure 1B, during actual use, when returning from the video editing page to the video shooting page, the camera unit will be displayed with a delay in the video shooting page The captured real-time images will cause a black screen, which will affect the smoothness and look and feel of the APP operation and reduce the user experience.
  • An embodiment of the present disclosure provides a camera function page switching method to solve the above problem.
  • FIG. 2 is a schematic flowchart 1 of a camera function page switching method provided by an embodiment of the present disclosure.
  • the method of the embodiment of the present disclosure can be applied in a terminal device.
  • the terminal device has a camera unit.
  • the camera function page switching method includes:
  • Step S101 Based on the selected first video, start a video editing page, which is used to edit the first video based on the editing instructions input by the user.
  • the APP in the terminal device is run and enters the corresponding video function interface
  • the APP will start and display the video shooting page, and at the same time, by calling
  • the camera unit displays the real-time image collected by the camera unit on the video shooting page.
  • the user observes and operates the video shooting page and shoots the video through the camera unit, thereby obtaining the selected first video.
  • This process is a general process of video shooting in the prior art, and will not be described again here.
  • the first video may be shot in advance and stored locally on the terminal device, and a video is selected as the first video through the user's selection operation.
  • the video editing page can be started based on an operation instruction input by the user, such as an instruction generated for a gesture operation of the control "enter video editing page", or, after obtaining the first video, No user operation is required.
  • the editing page is automatically launched. It can be set according to specific needs. I will not give examples one by one here.
  • the video editing page may be a program function module including a display interface provided in the APP, and the video editing page is used to edit the first video based on editing instructions input by the user.
  • display functions such as video playback and video information display (such as video duration, video size, resolution, etc.) of the previously shot video (first video) can be implemented; for another example, it can be implemented to Modify the video information (such as modifying the video name, classification tags, etc.), video compression, video uploading, video publishing and other functions for the previously shot video (first video), so as to realize various editing of the first video after the recording is completed.
  • the operation can be set according to specific needs.
  • the function of editing the first video that can be realized by the video editing page is not specifically limited here.
  • the layout and style of various controls and icons in the display interface of the video editing page can also be set as needed, and will not be described in detail here.
  • the user can view the video and related information through the interactive interface of the terminal device, and then perform corresponding editing operations on the video.
  • the specific editing operations have been illustrated in the previous steps and will not be repeated here.
  • the user can also only view the video without performing editing operations on the video editing page, which will not be described here.
  • Step S102 In response to the shooting triggering instruction for the video editing page, close the video editing page and start the video shooting page.
  • the user inputs a return operation to the terminal device, and the terminal device generates a corresponding shooting trigger instruction and responds.
  • the shooting trigger instruction is used to close the video editing page and return to the video shooting page.
  • the video shooting page is similar to the video editing page. It can be a program function module including a display interface provided in the APP, and displays the real-time data collected by the camera unit by calling the interface of the camera unit provided by the operating system.
  • Image, starting the video shooting page is the process of starting the function module of the program.
  • the video shooting page includes at least one control for saving the real-time images collected by the camera unit as video data, that is, the shooting control. After the shooting control is triggered, the terminal device will start video shooting.
  • the rendering environment is set as the initial rendering environment, where the initial rendering environment is used to draw the video shooting page and preview image in the display interface.
  • the terminal device has a display interface, and both the video shooting page and the video editing page are displayed through the display interface.
  • the corresponding rendering environment needs to be supported.
  • the rendering environment includes information such as rendering methods, types, parameters, etc., because the video shooting page and the video editing page are processed through different Implemented by program function modules, therefore, they correspond to different rendering environments.
  • the rendering environment needs to be initialized and set to the initial rendering environment so that the video shooting page can be displayed normally.
  • Step S103 Obtain a preview image based on the first video, and display the preview image in the video shooting page, where the preview image includes at least one video frame generated according to the first video.
  • the preview image is image data generated through the first video.
  • the preview image includes at least one video frame generated according to the first video.
  • the preview image includes a frame in the first video.
  • a video frame is a picture, such as the last frame of the first video.
  • the preview image includes continuous multi-frame pictures, that is, the preview image can be regarded as a video clip, such as the last 0.1 second of the video clip in the first video.
  • displaying the preview image on the video shooting page includes: sequentially displaying consecutive multiple frames of pictures on the video shooting page within a preset time period, where the preset time period represents the initialization time of the camera unit.
  • the display fluency and smoothness of the video shooting page can be further improved. Authenticity, improve the visual effect.
  • Video frames in the video generate predicted frames, which can achieve realistic display effects, making the "simulated image” (preview image) displayed on the video shooting page closer to the real-time image actually captured by the camera unit, making it impossible (or difficult) for users to It is found that what is currently displayed is a "simulated image", which improves the display effect and user perception.
  • step S103 it also includes:
  • Step S104 After the camera unit is initialized, collect the second video through the camera unit.
  • Step S105 Jump to the video editing page, and play the synthesized video through the video editing page, where the synthesized video is generated by processing the first video and the second video based on the target editing operation.
  • the terminal device collects real-time images through the camera unit, and the real-time images are displayed on the video shooting page. Since the preview image used in the above steps is generated from the video frame in the first video, the similarity between the preview image and the real-time image actually collected by the camera unit is higher. Therefore, after the camera unit is initialized, the real-time image is displayed On the video shooting page, the frame skipping phenomenon between the two images (i.e., the preview image and the real-time image) is smaller, making it even more difficult for users to detect the frame skipping phenomenon, and improving the smoothness of the startup of the video shooting page.
  • the camera unit After the camera unit is initialized, it also includes:
  • the terminal device responds to the jump instruction input by the user and starts and jumps to the video. Edit page to edit the second video.
  • the terminal device fuses the first video and the second video to generate a synthesized video with better quality.
  • the synthesized video may have at least one of the following advantages over the second video: higher frame rate, higher resolution, and fewer noise points. This enables the APP to generate better quality videos in the functional mode of executing the "shooting-editing-shooting-editing" process.
  • the video shooting page is displayed through the display interface of the terminal device.
  • Figure 3 is a schematic diagram of displaying a preview image in the video shooting page according to an embodiment of the present disclosure.
  • the display interface includes In the first area and the second area, a page map corresponding to the video shooting page is drawn in the first area of the display interface; a preview image is drawn in the second area of the display interface. Therefore, the performance of the video shooting page displayed on the display interface is exactly the same as that after the video shooting page is fully started (that is, after the camera unit is initialized), and a black screen (in the second area) is avoided.
  • the video editing page is started, and the video editing page is used to edit the first video based on the editing instructions input by the user; in response to the video editing page
  • the shooting trigger instruction closes the video editing page and starts the video shooting page; obtains a preview image based on the first video and displays the preview image in the video shooting page until the camera unit is initialized, wherein the preview image includes generating based on the first video of at least one video frame. Since when returning to the shooting page from the editing page, the preview image obtained after processing the previously shot first video is displayed in the shooting page, preventing the video shooting page from being in a black screen state, so that the video shooting page can instantly display the shooting content in terms of look and feel. This improves the fluency and look and feel of generated synthetic videos and improves user experience.
  • FIG. 4 is a schematic flowchart 2 of a camera function page switching method provided by an embodiment of the present disclosure. Based on the embodiment shown in Figure 2, the embodiment of the present disclosure further refines the implementation steps of S101-S102.
  • the camera function page switching method includes:
  • Step S201 After shooting the first video through the camera unit of the terminal device, start the video editing page, which is used to edit the first video based on the editing instructions input by the user.
  • Step S202 In response to the shooting trigger instruction for the video editing page, close the video editing page.
  • Step S203 Obtain first posture information and second posture information, wherein the first posture information represents the body angle of the terminal device when shooting the first video, and the second posture information represents the current body angle of the terminal device. .
  • the pose information is information used to characterize the shooting angle of the terminal device when shooting a video, that is, the body angle of the terminal device, where the body angle includes the horizontal rotation angle of the body, and also includes the body angle. vertical rotation angle. Specifically, it can be obtained by collecting angle information through a sensor installed in the terminal device, such as a gyroscope sensor.
  • the first posture information is the body angle of the terminal device when shooting the first video
  • the second posture information represents the current body angle of the terminal device, that is, the body angle when the video shooting page is launched.
  • the first posture information is collected synchronously when shooting the first video
  • the first posture information includes a posture sequence
  • the posture sequence includes at least one posture value
  • the posture value Characterizes the body angle of the terminal device during the shooting of the first video
  • each pose value corresponds to a video frame.
  • the second pose information is starting The numerical value representing the body angle obtained in real time during the video shooting page.
  • the pose value in the first pose information and the second pose information have the same data structure. Therefore, the pose value of the first pose information and the pose value in the second pose information can be compared. The two pose information are compared, and then the body angle comparison is achieved.
  • Step S204 Obtain the target frame in the first video based on the first posture information and the second posture information, where the angle difference between the body angle corresponding to the target frame and the body angle corresponding to the preview image is less than the angle threshold.
  • the image captured by the terminal device through the camera unit Content and shooting angle have a fixed mapping relationship, that is, when the shooting angle is the same, the content of the image captured by the terminal device is similar or even the same.
  • the video frame shot at the same body angle as the current body angle is used as the target frame, and In subsequent steps, a preview image is generated based on the target frame and displayed on the video shooting page to achieve accurate prediction of real-time images that are not displayed on the video shooting page (because the camera unit has not completed initialization), so that the image content in the preview image is consistent with the real one.
  • the image content of the real-time image collected by the camera unit is more similar, realizing a realistic replacement of the "black screen" process and improving the user's perception.
  • Figure 5 is a schematic diagram of a process for obtaining a target frame based on pose information provided by an embodiment of the present disclosure.
  • the terminal device captures the first video in the first stage.
  • the body of the terminal device changes accordingly.
  • the terminal device shoots the first video, it synchronously generates the corresponding pose sequence (i.e., the first pose information).
  • the pose sequence includes The pose value A, the pose value B, and the pose value C respectively correspond to the three body angles of the terminal device (shown as body angle a, body angle b, and body angle c in the figure).
  • the terminal device starts the video editing page and edits the first video (not shown in the figure).
  • the terminal device responds to the shooting trigger instruction in the second stage, closes the video editing page, and starts the video shooting page.
  • the body angle d second pose information
  • the target frame includes consecutive multiple frames of pictures;
  • the first pose information includes a pose sequence and a corresponding timestamp sequence,
  • the pose sequence includes at least one pose value, and the pose value represents the first shot of the shot.
  • the timestamp sequence includes at least one timestamp.
  • the timestamp corresponds to the pose value one-to-one.
  • the timestamp represents the collection moment of the pose value and can also represent the time of the first video. Play time.
  • step S204 includes three specific implementation steps of steps S2041, S2042 and S2043.
  • Step S2041 Determine the first body angle based on the second pose information.
  • Step S2042 Determine the target pose value and the corresponding target timestamp based on the first body angle and the first attitude information.
  • Step S2043 Determine consecutive multi-frame pictures based on the target timestamp corresponding to the target pose value and at least one timestamp after the target timestamp.
  • the second pose information is a value representing the body angle obtained in real time when starting the video shooting page.
  • the value representing the body angle corresponding to the second pose information traverse the values corresponding to the first pose information.
  • pose sequence to obtain the closest pose value, that is, the target pose value.
  • the target timestamp corresponding to the target pose value is obtained.
  • obtain the video frame corresponding to the target timestamp according to the corresponding relationship between the timestamp sequence and the first video, and then, for example, according to the target For several consecutive timestamps after the timestamp, the corresponding video frames are obtained respectively, thereby obtaining consecutive multi-frame pictures, that is, the target frame.
  • Figure 7 is a schematic diagram of acquiring multi-frame pictures provided by an embodiment of the present disclosure.
  • the corresponding body angle a is determined according to the pose information A (second pose information) when starting the video shooting page. ; After that, determine the corresponding pose value a1 from the first pose information corresponding to the first video (including a pose sequence and a timestamp sequence), where the pose value a1 is closest to the body angle a, and less than the angle threshold. Further, the corresponding target timestamp t1 and N timestamps (t2, t3, t4) after the target timestamp t1 are determined according to the pose value a1. Since video frames correspond to timestamps one-to-one, the target timestamp and the video frames corresponding to N timestamps after the target timestamp t are determined as continuous multi-frame pictures, that is, the target frame.
  • multiple continuous video frames matching the current body angle are obtained through the first posture information and the second posture information, and then the video clips can be displayed as preview images in the subsequent steps during video shooting.
  • the video clips can be displayed as preview images in the subsequent steps during video shooting.
  • it further simulates the real-time image captured by the video shooting page, so that the user cannot detect the high startup delay of the video shooting page due to the initialization process of the camera unit, improving operation fluency and User experience.
  • Step S205 Generate a preview image according to the target frame, where the preview image includes consecutive multiple frames of pictures.
  • the target frame is the preview image, and the two are equivalent.
  • the target frame generated in the above steps that is, the continuous multi-frame pictures, is directly used as the preview image for subsequent processing.
  • the target frame obtained in the above steps can be processed, such as image frame fusion, image frame interpolation and other video processing steps, to generate a preview image, thereby improving the image quality of the preview image. Better and smoother.
  • the specific implementation method of the above video processing process is an existing technology and will not be described again here.
  • Step S206 Perform Gaussian blur on the preview image to obtain the image to be displayed.
  • step S205 Gaussian blur can be further performed on the image to generate an image to be displayed.
  • the user is temporarily unable to observe the details of the image displayed on the video shooting page, and cannot detect the process of the terminal device replacing the "black screen" with the image to be displayed, thereby improving the user experience.
  • the above-mentioned image processing steps can be set according to specific needs.
  • the specific implementation method is based on the existing technology and will not be described again here.
  • Step S207 Initialize the camera unit through the first process to start the video shooting page.
  • Step S208 Display the image to be displayed in the video shooting page through the second process until the camera unit is initialized.
  • the "black screen" in the video shooting page can be avoided by displaying the image to be displayed, and on the other hand, by initializing the camera unit to start the video shooting page.
  • the startup of the video shooting page referred to here refers to the complete startup of the video shooting page, that is, the real-time image actually collected by the camera unit can be obtained by calling the camera unit.
  • the image to be displayed can be displayed in the video shooting page at the first time without being affected by the process.
  • the impact of the camera initialization process enables the instant start-up of the video shooting page, improving visual effects and operational fluency.
  • Step S209 After the camera unit is initialized, collect the second video through the camera unit.
  • Step S210 Jump to the video editing page, and play the synthesized video through the video editing page, where the synthesized video is generated by processing the first video and the second video based on the target editing operation.
  • step S201, step S202, step S209, and step S210 is the same as the implementation manner of step S101, step S102, step S104, and step S105 in the embodiment shown in FIG. 2 of the present disclosure, and will not be repeated here. Let’s go over them one by one.
  • FIG. 8 is a structural block diagram of a camera function page switching device provided by an embodiment of the present disclosure. For convenience of explanation, only parts related to the embodiments of the present disclosure are shown. Referring to Figure 8, camera function page switching device 3:
  • the editing module 31 is used to start the video editing page based on the selected first video, and the video editing page is used to edit the first video based on the editing instructions input by the user;
  • the shooting module 32 is configured to close the video editing page and start the video shooting page in response to the shooting triggering instruction for the video editing page;
  • the initialization module 33 is configured to obtain a preview image based on the first video and display the preview image in the video shooting page until the camera unit is initialized, wherein the preview image includes at least one video frame generated based on the first video.
  • the shooting module 32 is also used to collect the second video through the camera unit after the camera unit is initialized;
  • the editing module 31 is also used to jump to the video editing page and play the synthesized video through the video editing page, where the synthesized video is generated by processing the first video and the second video based on the target editing operation.
  • the initialization module 33 when obtaining the preview image based on the first video, is specifically configured to: obtain the first posture information and the second posture information, where the first posture information represents the location of the terminal device.
  • the body angle when shooting the first video, and the second pose information represents the current body angle of the terminal device; according to the first pose information and the second pose information, the target frame in the first video is obtained, where the target frame The angle difference between the corresponding body angle and the body angle corresponding to the preview image is less than the angle threshold; a preview image is generated according to the target frame.
  • the target frame includes consecutive multi-frame pictures;
  • the first pose information includes a pose sequence and a corresponding timestamp sequence, the pose sequence includes at least one pose value, and the pose value represents the shot of the first
  • the body angle of the terminal device during a video the timestamp sequence includes at least one timestamp, and the timestamp corresponds to the pose value one-to-one;
  • the initialization module 33 obtains
  • the target frame in the first video is specifically used to: determine the first body angle based on the second pose information; determine the target pose value and the corresponding target time based on the first body angle and the first pose information.
  • Stamp determine consecutive multi-frame pictures based on the target timestamp corresponding to the target pose value and at least one timestamp after the target timestamp.
  • the preview image includes continuous multi-frame pictures; the initialization module 33 displays the preview image in the video shooting page, including: displaying the continuous multi-frame pictures in sequence in the video within a preset time period.
  • the preset duration represents the initialization duration of the camera unit.
  • the initialization module 33 before displaying the preview image in the video shooting page, is also used to: perform Gaussian blur on the preview image to obtain an image to be displayed; before displaying the preview image in the video page, the initialization module 33 When in the shooting page, it is specifically used to: display the image to be displayed in the video shooting page.
  • the terminal device has a display interface
  • the initialization module 33 displays the preview image in the video shooting page, specifically for: drawing a page map corresponding to the video shooting page in the first area of the display interface;
  • the second area of the display interface draws a preview image.
  • the shooting module 32 is also used to: set the rendering environment to an initial rendering environment, where the initial rendering environment is used to draw the video shooting page and preview images in the display interface. .
  • the shooting module 32 when starting the video shooting page, is specifically used to: initialize the camera unit through the first process to start the video shooting page; the initialization module 33 displays the preview image on the video shooting page.
  • the shooting module 32 when inside the page, it is specifically used to: display the preview image in the video shooting page through the second process.
  • the camera function page switching device 3 provided by the embodiment of the present disclosure can execute the technical solution of the above method embodiment. Its implementation principles and technical effects are similar, and the embodiments of the present disclosure will not be repeated here.
  • FIG 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. As shown in Figure 9, the electronic device 4 includes:
  • Processor 41 and memory 42 communicatively connected to processor 41;
  • Memory 42 stores computer execution instructions
  • the processor 41 executes the computer execution instructions stored in the memory 42 to implement the camera function page switching method in the embodiment shown in FIGS. 2 to 7 .
  • processor 41 and the memory 42 are connected through the bus 43 .
  • the electronic device 900 may be a terminal device or a server.
  • terminal devices may include but are not limited to mobile phones, laptops, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA for short), tablet computers (Portable Android Device, PAD for short), portable multimedia players (Portable Mobile terminals such as Media Player (PMP for short), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs, desktop computers, etc.
  • PDA Personal Digital Assistant
  • PAD Personal Android Device
  • portable multimedia players Portable Mobile terminals such as Media Player (PMP for short
  • vehicle-mounted terminals such as vehicle-mounted navigation terminals
  • fixed terminals such as digital TVs, desktop computers, etc.
  • the electronic device shown in FIG. 10 is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
  • the electronic device 900 may include a processing device (such as a central processing unit, a graphics processor, etc.) 901, which may process data according to a program stored in a read-only memory (Read Only Memory, ROM for short) 902 or from a storage device. 908 loads the program in the random access memory (Random Access Memory, RAM for short) 903 to perform various appropriate actions and processing. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored.
  • the processing device 901, ROM 902 and RAM 903 are connected to each other via a bus 904.
  • An input/output (I/O) interface 905 is also connected to bus 904.
  • the following devices can be connected to the I/O interface 905: input devices 906 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a Liquid Crystal Display (LCD). ), an output device 907 such as a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909.
  • the communication device 909 may allow the electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data.
  • FIG. 10 illustrates electronic device 900 with various means, it should be understood that implementation or availability of all illustrated means is not required. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product comprising a computer-readable medium Essentially a computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program may be downloaded and installed from the network via communication device 909, or from storage device 908, or from ROM 902.
  • the processing device 901 the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • the computer-readable storage medium may be, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard drive, random access memory (RAM), read only memory (ROM), removable Programmd read-only memory (EPROM or flash memory), fiber optics, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the above.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; it may also exist independently without being assembled into the electronic device.
  • the above computer-readable medium carries one or more programs.
  • the electronic device is caused to execute the method shown in the above embodiment.
  • Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional Procedural programming language—such as "C" or a similar programming language.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it can be connected to External computer (e.g. using an Internet service provider to connect via the Internet).
  • LAN Local Area Network
  • WAN Wide Area Network
  • each block in the flowchart or block diagram may represent a module, segment, or portion of code that contains one or more logic functions that implement the specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown one after another may actually execute substantially in parallel, or they may sometimes execute in the reverse order, depending on the functionality involved.
  • each block in the block diagram and/or flowchart illustration, and each block in the block diagram and/or flowchart illustration may be implemented using dedicated hardware-based systems that perform specified functions or operations, or may be implemented using a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments of the present disclosure can be implemented in software or hardware.
  • the name of a unit does not constitute a limitation on the unit itself under certain circumstances.
  • the editing module can also be described as "a module for starting a video editing page based on the selected first video.”
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs Systems on Chips
  • CPLD Complex Programmable Logical device
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
  • the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, laptop disks, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM portable compact disk read-only memory
  • magnetic storage device or any suitable combination of the above.
  • a camera function page switching method applied to a terminal device, the terminal device has a camera unit, the method includes:
  • a video editing page is started, the video editing page is used to edit the first video based on an editing instruction input by a user; in response to a shooting trigger instruction for the video editing page, all the video editing pages are closed.
  • the video editing page starts the video shooting page; obtains a preview image based on the first video, and displays the preview image in the video shooting page, wherein the preview image includes a video generated according to the first video At least one video frame; after the camera unit is initialized, collect the second video through the camera unit; jump to the video editing page, and play the synthesized video through the video editing page, wherein the synthesized video is based on
  • the target editing operation is generated after processing the first video and the second video.
  • obtaining a preview image based on the first video includes: obtaining first posture information and second posture information, wherein the first posture information represents the The body angle of the terminal device when shooting the first video, and the second pose information represents the current body angle of the terminal device; according to the first pose information and the second pose information, the third pose information is obtained A target frame in a video, wherein the angle difference between the body angle corresponding to the target frame and the body angle corresponding to the preview image is less than an angle threshold; the preview image is generated according to the target frame.
  • the target frame includes a continuous multi-frame picture
  • the first pose information includes a pose sequence and a corresponding timestamp sequence
  • the pose sequence includes at least one pose value
  • the pose value represents the body angle of the terminal device during the process of shooting the first video
  • the timestamp sequence includes at least one timestamp
  • the timestamp is one by one with the pose value
  • obtaining the target frame in the first video according to the first posture information and the second posture information including: determining the first body angle according to the second posture information; One body angle and first attitude information, determine the target pose value and the corresponding target timestamp;
  • the continuous multi-frame pictures are determined according to the target timestamp corresponding to the target pose value and at least one timestamp after the target timestamp.
  • the preview image includes a continuous multi-frame picture; and displaying the preview image in the video shooting page includes: placing the continuous multi-frame picture on The preset duration is sequentially displayed in the video shooting page, wherein the preset duration represents the initialization duration of the camera unit.
  • the method further includes: collecting a real-time image through the camera unit; and displaying the real-time image on the video shooting page.
  • the method before displaying the preview image in the video shooting page, the method further includes: performing Gaussian blur on the preview image to obtain an image to be displayed; displaying the preview image In the video shooting page, the method includes: displaying the image to be displayed in the video shooting page.
  • the terminal device has a display interface
  • displaying the preview image in the video shooting page includes: drawing the video in a first area of the display interface Photograph the page map corresponding to the page; draw the preview image in the second area of the display interface.
  • the method further includes: setting the rendering environment as an initialization rendering environment, wherein the initialization rendering environment is used to draw the Video capture page and preview image.
  • starting the video shooting page includes: initializing the camera unit through a first process to start the video shooting page; and displaying the preview image on the video In the shooting page, the method includes: displaying the preview image in the video shooting page through a second process.
  • a camera function page switching device including:
  • An editing module configured to start a video editing page after shooting the first video through the camera unit of the terminal device, and the video editing page is used to edit the first video based on the editing instructions input by the user;
  • a shooting module configured to close the video editing page and start the video shooting page in response to a shooting trigger instruction for the video editing page
  • An initialization module configured to obtain a preview image based on the first video and display the preview image in the video shooting page until the camera unit is initialized, wherein the preview image includes at least one video frame generated according to the first video.
  • the initialization module when obtaining a preview image based on the first video, is specifically configured to: obtain first posture information and second posture information, wherein the first posture information represents The body angle of the terminal device when shooting the first video, and the second pose information represents the current body angle of the terminal device; according to the first pose information and the second pose information, the target frame in the first video is obtained, where , the angle difference between the body angle corresponding to the target frame and the body angle corresponding to the preview image is less than the angle threshold; a preview image is generated based on the target frame.
  • the target frame includes consecutive multi-frame pictures;
  • the first pose information includes a pose sequence and a corresponding timestamp sequence, the pose sequence includes at least one pose value, and the pose value represents The body angle of the terminal device during the shooting of the first video, the timestamp sequence includes at least one timestamp, and the timestamp corresponds to the pose value one-to-one;
  • the initialization module based on the first pose information and the second pose information, When obtaining the target frame in the first video, it is specifically used to: determine the first body angle based on the second pose information; determine the first body angle based on the first body angle and the first pose information. information, determine the target pose value and the corresponding target timestamp; determine consecutive multi-frame pictures based on the target timestamp corresponding to the target pose value, and at least one timestamp after the target timestamp.
  • the preview image includes continuous multi-frame pictures; the initialization module displays the preview image in the video shooting page, including: displaying the continuous multi-frame pictures in sequence within a preset time period.
  • the preset duration represents the initialization duration of the camera unit.
  • the initialization module is further configured to: collect real-time images through the camera unit; and display the real-time images on the video shooting page.
  • the initialization module before displaying the preview image in the video shooting page, is also used to: perform Gaussian blur on the preview image to obtain an image to be displayed; the initialization module displays the preview image in the video When in the shooting page, it is specifically used to: display the image to be displayed in the video shooting page.
  • the terminal device has a display interface
  • the initialization module displays the preview image in the video shooting page, specifically for: drawing a page map corresponding to the video shooting page in the first area of the display interface; Draw a preview image in the second area of the display interface.
  • the shooting module is also used to: set the rendering environment to an initial rendering environment, wherein the initial rendering environment is used to draw the video shooting page and preview in the display interface image.
  • the shooting module when the shooting module starts the video shooting page, it is specifically used to: initialize the camera unit through the first process to start the video shooting page; the initialization module displays the preview image on the video shooting page.
  • the initialization module displays the preview image on the video shooting page.
  • an electronic device including: a processor, and a memory communicatively connected to the processor;
  • the memory stores computer execution instructions
  • the processor executes computer execution instructions stored in the memory to implement the camera function page switching method described in the first aspect and various possible designs of the first aspect.
  • a computer-readable storage medium is provided.
  • Computer-executable instructions are stored in the computer-readable storage medium.
  • a processor executes the computer-executed instructions, Implement the camera function page switching method described in the first aspect and various possible designs of the first aspect.
  • embodiments of the present disclosure provide a computer program product, including a computer program.
  • the computer program When the computer program is executed by a processor, the camera function page switching method described in the first aspect and various possible designs of the first aspect is implemented.
  • embodiments of the present disclosure provide a computer program.
  • the computer program is executed by a processor, the camera function page switching method described in the first aspect and various possible designs of the first aspect is implemented.
  • the camera function page switching method, device, electronic device, storage medium, computer program product and computer program provided by the embodiments of the present disclosure start a video editing page based on the selected first video, and the video editing page is used for user-based switching.
  • the input editing instruction edits the first video; in response to the shooting trigger instruction for the video editing page, closes the video editing page and starts the video shooting page; obtains a preview image based on the first video, and The preview image is displayed in the video shooting page, wherein the preview image includes at least one video frame generated according to the first video; after the camera unit is initialized, a second video is collected through the camera unit; Jump to the video editing page, and play the synthesized video through the video editing page, wherein the synthesized video is based on the target editing operation.
  • the first video and the second video are processed and generated. Since when returning to the shooting page from the editing page, the preview image obtained after processing the previously shot first video is displayed in the shooting page, preventing the video shooting page from being in a black screen state, so that the video shooting page can instantly display the shooting content in terms of look and feel. This improves the fluency and look and feel of generated synthetic videos and improves user experience.

Abstract

本公开实施例提供一种相机功能页面切换方法、装置、电子设备、存储介质、计算机程序产品以及计算机程序,通过基于选定的第一视频,启动视频编辑页,视频编辑页用于基于用户输入的编辑指令对第一视频进行编辑;响应于针对视频编辑页的拍摄触发指令,关闭视频编辑页,启动视频拍摄页;基于第一视频获取预览图像,并将预览图像显示在视频拍摄页内,其中,预览图像包括根据第一视频生成的至少一个视频帧;在相机单元初始化完毕后,通过相机单元采集第二视频;跳转至视频编辑页,并通过视频编辑页播放合成视频,其中,合成视频是基于目标编辑操作对第一视频和第二视频进行处理后生成的。避免视频拍摄页处于黑屏状态,从而提高生成合成视频的流畅度和观感,提高用户使用体验。

Description

相机功能页面切换方法、装置、电子设备及存储介质
相关申请的交叉引用
本申请要求于2022年03月30日提交的申请号为202210330864.4、名称为“相机功能页面切换方法、装置、电子设备及存储介质”的中国专利申请的优先权,此申请的内容通过引用并入本文。
技术领域
本公开实施例涉及智能终端及互联网技术领域,尤其涉及一种相机功能页面切换方法、装置、电子设备、存储介质、计算机程序产品以及计算机程序。
背景技术
当前,基于相机单元的摄像功能,已成为智能终端设备的基础功能之一。许多互联网应用程序(Application,APP),会通过终端设备调用相机单元,来实现视频录制、编辑,以及上传、分享等一系列功能。
相关技术中,APP在调用相机单元进行视频拍摄的过程中,至少会提供两个功能页,即视频拍摄页和视频编辑页,通常视频拍摄页为相机功能的默认页,通过视频拍摄页显示实时的拍摄内容,当拍摄完毕后,再通过视频编辑页对视频进行编辑或查看。
然而,在实际使用过程中,当从视频编辑页返回视频拍摄页的时候,视频拍摄页内无法在第一时间显示实时的拍摄内容,而会出现黑屏现象,影响APP操作的流畅度和观感,降低用户使用体验。
发明内容
本公开实施例提供一种相机功能页面切换方法、装置、电子设备、存储介质、计算机程序产品以及计算机程序,以克服当从视频编辑页返回视频拍摄页的时候,会出现黑屏现象的问题。
第一方面,本公开实施例提供一种相机功能页面切换方法,应用于终端设备,所述终端设备具有相机单元,所述方法包括:
基于选定的第一视频,启动视频编辑页,所述视频编辑页用于基于用户输入的编辑指令对所述第一视频进行编辑;响应于针对所述视频编辑页的拍摄触发指令,关闭所述视频编辑页,启动视频拍摄页;基于所述第一视频获取预览图像,并将所述预览图像显示在所述视频拍摄页内,其中,所述预览图像包括根据所述第一视频生成的至少一个视频帧;在相机单元初始化完毕后,通过所述相机单元采集第二视频;跳转至所述视频编辑页,并通过所述视频编辑页播放合成视频,其中,所述合成视频是基于目标编辑操作对所述第一视频和所述第二视频进行处理后生成的。
第二方面,本公开实施例提供一种相机功能页面切换装置,包括:
编辑模块,用于基于选定的第一视频,启动视频编辑页,所述视频编辑页用于基于用户输入的编辑指令对所述第一视频进行编辑;
拍摄模块,用于响应于针对所述视频编辑页的拍摄触发指令,关闭所述视频编辑页,启动视频拍摄页;
初始化模块,用于基于所述第一视频获取预览图像,并将所述预览图像显示在所述视频拍摄页内,其中,所述预览图像包括根据所述第一视频生成的至少一个视频帧;
所述拍摄模块,还用于在相机单元初始化完毕后,通过所述相机单元采集第二视频;
所述编辑模块,还用于跳转至所述视频编辑页,并通过所述视频编辑页播放合成视频,其中,所述合成视频是基于目标编辑操作对所述第一视频和所述第二视频进行处理后生成的。
第三方面,本公开实施例提供一种电子设备,包括:
处理器,以及与所述处理器通信连接的存储器;
所述存储器存储计算机执行指令;
所述处理器执行所述存储器存储的计算机执行指令,以实现如上第一方面以及第一方面各种可能的设计所述的相机功能页面切换方法。
第四方面,本公开实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的相机功能页面切换方法。
第五方面,本公开实施例提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的相机功能页面切换方法。
第六方面,本公开实施例提供一种计算机程序,所述计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的相机功能页面切换方法。
附图说明
为了更清楚地说明本公开实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1A为本公开实施例提供的相机功能页面切换方法的一种应用场景示意图。
图1B为相关技术中相机功能页面切换过程中的黑屏现象示意图。
图2为本公开实施例提供的相机功能页面切换方法的流程示意图一。
图3为本公开实施例提供的一种将预览图像显示在视频拍摄页内的示意图。
图4为本公开实施例提供的相机功能页面切换方法的流程示意图二。
图5为本公开实施例提供的一种基于位姿信息获取目标帧的过程示意图。
图6为图4所示实施例中步骤S204的具体实现步骤流程图。
图7为本公开实施例提供的一种获取多帧图片的示意图。
图8为本公开实施例提供的相机功能页面切换装置的结构框图。
图9为本公开实施例提供的一种电子设备的结构示意图。
图10为本公开实施例提供的电子设备的硬件结构示意图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
下面对本公开实施例的应用场景进行解释:
本公开实施例提供的相机功能页面切换方法,例如可以应用于视频类APP、社交类APP的视频拍摄、编辑、上传分享等应用场景下。具体地,本公开实施例提供的方法,可以应用于终端设备,例如智能手机,终端设备具有相机单元,例如用于进行图像采集的相机模组。在终端设备内运行有例如视频类APP,该视频类APP通过在终端设备上显示不同的相机功能页面,结合用户输入的交互操作指令,来实现视频拍摄、编辑等功能。图1A为本公开实施例提供的相机功能页面切换方法的一种应用场景示意图,具体地,该应用场景为短视频拍摄的应用场景。如图1A所示,示例性地,短视频APP内提供视频拍摄页和视频编辑页两个界面,其中,视频拍摄页用于调用相机单元显示实时图像,用户通过观察和操作该视频拍摄页,实现短视频的拍摄;之后,在达到该短视频APP预设的拍摄时长后,进入视频编辑页,在视频编辑页内显示视频信息(视频时长、视频名称等),并对之前拍摄的短视频片段进行显示、回放,并可以结合用户输入的编辑指令,对短视频片段进行编辑;再后,编辑完毕后,(通过点击返回按钮)返回视频拍摄页,使用户可以方便、快捷的继续进行短视频拍摄,满足短视频拍摄应用场景下,用户反复进行“拍摄-编辑-拍摄-编辑”的流程需要,从而基于多次(至少两次)拍摄的视频进行视频融合,生成合成视频的目的。进一步地,该基于“拍摄-编辑-拍摄-编辑”的流程而生成合成视频的功能,可以通过APP的一种指定的功能模式实现,例如,“精选拍摄模式”、“合成拍摄模式”等。
图1B为相关技术中相机功能页面切换过程中的黑屏现象示意图;如图1B所示,在实际使用过程中,当从视频编辑页返回视频拍摄页的时候,视频拍摄页内会延迟显示相机单元拍摄的实时图像,而会出现黑屏现象,影响APP操作的流畅度和观感,降低用户使用体验。
发明人在付出创造性劳动后发现,这是由于:从APP的视频拍摄页进入视频编辑页后,相机单元会进入非工作状态,而之后由视频编辑页返回视频拍摄页时,相机单元需要重新启动并进行初始化,在该过程中,相机单元无法进行图像的采集,因此,造成视频拍摄页内无实时图像可显示,形成黑屏。因此,如何在相机单元进行初始化阶段,获得逼真的图像显示在视频拍摄页内,来实现对相机单元真实采集的实时图像进行模拟,从而在使视频拍摄页在观感上能瞬间启动,是当前亟需解决的问题。本公开实施例提供一种相机功能页面切换方法以解决上述问题。
参考图2,图2为本公开实施例提供的相机功能页面切换方法的流程示意图一。本公开实施例的方法可以应用在终端设备中,终端设备具有相机单元,该相机功能页面切换方法包括:
步骤S101:基于选定的第一视频,启动视频编辑页,所述视频编辑页用于基于用户输入的编辑指令对所述第一视频进行编辑。
示例性地,参考图1A所示的应用场景示意图,一种可能的实现方式中,在终端设备内的APP运行并进入相应的视频功能界面后,APP会启动并显示视频拍摄页,同时通过调用相机单元,将相机单元采集的实时图像显示在视频拍摄页,用户通过观察和操作视频拍摄页,通过相机单元进行视频拍摄,进而得到选定的第一视频。该过程为现有技术中视频拍摄过程的一般流程,此处不再赘述。在另一种可能的实现方式中,第一视频可以是提前拍摄并存储在终端设备本地的,通过用户的选取操作,选定一个视频为第一视频。
进一步地,在获得第一视频后,可以基于用户输入的操作指令,例如针对“进入视频编辑页”的控件的手势操作而生成的指令,启动视频编辑页,或者,在获得第一视频后,无需用户操作,根据预设的程序逻辑,自动启动编辑页面,可根据具体需要设置,此处不再一一举例。
其中,视频编辑页可以是APP内所提供一个包括显示界面的程序功能模块,视频编辑页用于基于用户输入的编辑指令对第一视频进行编辑。具体地,通过视频编辑页,例如可以实现对之前拍摄的视频(第一视频)进行视频回放、视频信息显示(例如视频时长、视频大小、分辨率等)等显示功能;再例如,可以实现对之前拍摄的视频(第一视频)进行视频信息修改(例如修改视频名称、分类标签等)、视频压缩,以及视频上传、视频发布等功能,从而实现对第一视频在录制完成后的各种编辑操作,可以根据具体的需要设置,此处不对视频编辑页所能够实现的对第一视频进行编辑的功能进行具体限定。同时,基于视频编辑页所具体实现的功能,视频编辑页的显示界面内各种控件、图标的布局以及样式,也可以根据需要进行设置,此处不再具体赘述。
在视频编辑页启动后,用户通过终端设备的交互界面,查看视频及相关信息后,可以对视频进行相应的编辑操作,具体编辑操作已在之前步骤中举例说明,此处不再赘述。当然,用户也可以仅查看而不在视频编辑页进行编辑操作,此处不再赘述。
步骤S102:响应于针对视频编辑页的拍摄触发指令,关闭视频编辑页,启动视频拍摄页。
示例性地,在完成上述步骤之后,用户向终端设备输入返回操作,终端设备生成对应的拍摄触发指令并进行响应,该拍摄触发指令用于关闭该视频编辑页,并返回至视频拍摄页。其中,示例性地,视频拍摄页与视频编辑页类似,可以是APP内所提供一个包括显示界面的程序功能模块,通过调用操作系统所提供的相机单元的接口,来显示相机单元所采集的实时图像,启动视频拍摄页即启动该程序功能模块的过程。其中,视频拍摄页内至少包括一个用于将相机单元所采集的实时图像保存为视频数据的控件,即拍摄控件,在该拍摄控件被触发后,终端设备会开始进行视频拍摄。
在一种可能的实现方式中,在关闭视频编辑页之后,启动视频拍摄页之前,还包括步骤:
将渲染环境设置为初始化渲染环境,其中,初始化渲染环境用于在显示界面内绘制视频拍摄页和预览图像。
具体地,终端设备具有显示界面,视频拍摄页和视频编辑页均通过显示界面进行显示。而在通过显示界面对视频拍摄页和视频编辑页进行显示,需要对应渲染环境进行支持,具体地,渲染环境包括渲染方法、类型、参数等信息,由于视频拍摄页和视频编辑页是通过不同的程序功能模块实现的,因此,二者对应不同的渲染环境。在视频编辑页之后,为了实现后续对视频拍摄页的显示,需要对渲染环境进行初始化,将渲染环境设置为初始化渲染环境,从而使视频拍摄页能够被正常显示。
步骤S103:基于所述第一视频获取预览图像,并将预览图像显示在视频拍摄页内,其中,预览图像包括根据第一视频生成的至少一个视频帧。
示例性地,预览图像是通过第一视频生成的图像数据,具体地,预览图像包括根据第一视频生成的至少一个视频帧,在一种可能的实现方式中,预览图像包括第一视频中的一个视频帧,即一张图片,例如第一视频的最后一帧图像。由于启动视频拍摄页后,相机单元启动并初始化需要一定的时间,例如400毫秒。在该时间段内,无法通过相机单元获取真实采集的实时图像,因此无法在视频拍摄页内瞬间显示出实时图像,导致了黑屏现象。本公开实施例中,通过从第一视频中截取至少一帧的数据并显示在视频拍摄页面内,使视频拍摄页在观感上是瞬间启动的,避免黑屏问题。
在另一种可能的实现方式中,预览图像包括连续的多帧图片,即预览图像可视为一个视频片段,例如第一视频中的最后0.1秒的视频片段。更具体地,将预览图像显示在视频拍摄页包括:将连续的多帧图片,在预设时长内依次显示在视频拍摄页内,其中,预设时长表征相机单元的初始化时长。本公开实施例步骤中,通过将第一视频中的多个连续帧(视频片段)作为预览图像显示在视频拍摄页内,避免黑屏问题的同时,可以进一步的提高视频拍摄页的显示流畅度和真实性,提高观感效果。
同时,参考图1A所示的应用场景示意图,由于在本公开实施例方法所使用的应用场景中,用户通过终端设备拍摄短视频时,会反复实施“拍摄-编辑-拍摄-编辑”的流程,因此,当用户再次(至少为第二次)进行拍摄时,相机单元实际采集的图像,与上一次拍摄的第一视频,在内容上会具有一定的相似性,因此,通过之前拍摄的第一视频中的视频帧,生成预测帧,可以实现逼真的显示效果,使视频拍摄页上显示的“模拟图像”(预览图像)与相机单元实际采集的实时图像更加相近,使用户无法(或不易)发现当前显示的为“模拟图像”,提高显示效果和用户观感。
进一步地,在步骤S103之后,还包括:
步骤S104:在相机单元初始化完毕后,通过相机单元采集第二视频。
步骤S105:跳转至视频编辑页,并通过视频编辑页播放合成视频,其中,合成视频是基于目标编辑操作对第一视频和第二视频进行处理后生成的。
示例性地,相机单元初始化完毕后,终端设备通过相机单元采集实时图像,并实时图像显示在视频拍摄页。由于上述步骤中使用的预览图像是通过第一视频中的视频帧生成的,使预览图像与相机单元真实采集的实时图像的相似性更高,因此,在相机单元初始化完毕后,将实时图像显示在视频拍摄页时,两帧图像(即预览图像与实时图像)之间产生的跳帧现象更小,甚至使用户难以发现跳帧现象,提高视频拍摄页的启动流畅度。
进一步地,在相机单元初始化完毕后,还包括:
通过相机单元采集实时图像,得到第二视频;启动并跳转至视频编辑页,并通过视频编辑页播放合成视频,其中,合成视频是基于目标编辑操作对第一视频和第二视频进行处理后生成的。
示例性地,在通过相机单元采集实时图像后,得到第二视频,用户会对第二视频进一步的进行编辑,此种情况下,终端设备响应用户输入的跳转指令,启动并跳转转视频编辑页面,对第二视频进行编辑。具体地,在一种可能的实现方式中,终端设备基于第一视频和第二视频进行融合,生成质量更好的合成视频。更具体地,合成视频相对第二视频,可以具有以下至少一种优点:帧率更高、分辨率更高、噪声点更少。从而使APP在执行“拍摄-编辑-拍摄-编辑”流程的功能模式下,能够生成质量更好的视频。
其中,示例性地,视频拍摄页通过终端设备的显示界面进行显示,图3为本公开实施例提供的一种将预览图像显示在视频拍摄页内的示意图,如图3所示,显示界面包括第一区域和第二区域,在显示界面的第一区域绘制视频拍摄页对应的页面贴图;在显示界面的第二区域绘制预览图像。从而使显示界面上所显示的视频拍摄页与视频拍摄页完全启动后(即相机单元初始化完成之后)的表现完全相同,避免(在第二区域的)黑屏出现。
在本公开实施例中,通过在通过终端设备的相机单元拍摄第一视频后,启动视频编辑页,视频编辑页用于基于用户输入的编辑指令对第一视频进行编辑;响应于针对视频编辑页的拍摄触发指令,关闭视频编辑页,启动视频拍摄页;基于第一视频获取预览图像,并将预览图像显示在视频拍摄页内,直至相机单元初始化完毕,其中,预览图像包括根据第一视频生成的至少一个视频帧。由于在从编辑页面返回拍摄页面时,将由之前拍摄的第一视频进行处理后得到预览图像显示在拍摄页面内,避免视频拍摄页处于黑屏状态,使视频拍摄页在观感上能瞬间显示拍摄内容,从而提高生成合成视频的流畅度和观感,提高用户使用体验。
参考图4,图4为本公开实施例提供的相机功能页面切换方法的流程示意图二。本公开实施例在图2所示实施例的基础上,进一步细化了S101-S102的实现步骤,该相机功能页面切换方法包括:
步骤S201:在通过终端设备的相机单元拍摄第一视频后,启动视频编辑页,视频编辑页用于基于用户输入的编辑指令对第一视频进行编辑。
步骤S202:响应于针对视频编辑页的拍摄触发指令,关闭视频编辑页。
步骤S203:获取第一位姿信息和第二位姿信息,其中,第一位姿信息表征终端设备在拍摄第一视频时的机身角度,第二位姿信息表征终端设备当前的机身角度。
示例性地,位姿信息是用于表征终端设备在拍摄视频时的拍摄角度的信息,也即终端设备的机身角度,其中,机身角度即包括机身的水平旋转角度,也包括机身的竖直旋转角度。具体地,可以通过设置在终端设备内的传感器,例如陀螺仪传感器来采集角度信息而得到。其中,第一位姿信息是终端设备在拍摄第一视频时的机身角度,第二位姿信息表征终端设备当前的机身角度,即启动视频拍摄页时的机身角度。
其中,在一种可能的实现方式中,第一位姿信息是在拍摄第一视频时同步采集的,第一位姿信息包括位姿序列,位姿序列包括至少一个位姿值,位姿值表征拍摄第一视频的过程中终端设备的机身角度,每一位姿值对应一个视频帧。而第二位姿信息是在启动 视频拍摄页时实时获取的表征机身角度的数值,第一位姿信息中的位姿值和第二位姿信息的数据结构相同,因此,可以对第一位姿信息的位姿值和第二位姿信息进行比较,进而实现机身角度的比较。
步骤S204:根据第一位姿信息和第二位姿信息,获取第一视频中的目标帧,其中,目标帧对应的机身角度与预览图像对应的机身角度的角度差小于角度阈值。
在本公开实施例所对应的应用场景中,用户使用终端设备(例如智能手机)拍摄短视频时,当用户本身所处位置、环境不发生较大改变时,终端设备通过相机单元拍摄的图像的内容,与拍摄角度是具有固定映射关系的,即当拍摄角度相同时,终端设备所拍摄的图像内容,也是近似甚至相同的。基于发明人的上述发现,通过使用第一位姿信息中不同的位姿值和第二位姿信息进行对比,将与当前机身角度相同的机身角度拍摄的视频帧,作为目标帧,并在后续步骤中基于目标帧生成预览图像在视频拍摄页显示,实现对视频拍摄页内(由于相机单元未完成初始化而)未显示的实时图像的精确预测,使预览图像中的图像内容与真实的由相机单元采集的实时图像的图像内容更加近似,实现对“黑屏”过程的逼真替换,提高用户观感。
图5为本公开实施例提供的一种基于位姿信息获取目标帧的过程示意图,如图5所示,基于用户的操作,终端设备在第一阶段拍摄第一视频,随着拍摄第一视频时用户持机姿势的变化,终端设备的机身随之变化,终端设备在拍摄第一视频时,并同步生成对应的位姿序列(即第一位姿信息),例如,位姿序列中包括位姿值A、位姿值B、位姿值C,分别对应终端设备的三个机身角度(图中示为机身角度a、机身角度b、机身角度c)。之后,终端设备启动视频编辑页,对第一视频进行编辑(图中未示出),编辑完成后,终端设备在第二阶段响应于拍摄触发指令,关闭视频编辑页,启动视频拍摄页,根据当前时刻(启动视频拍摄页时刻)的机身角度d(第二位姿信息),确定角度差小于角度阈值的位姿值B,为目标位姿值,并将目标位姿值对应的视频帧,确定为目标帧。
在一种可能的实现方式中,目标帧包括连续的多帧图片;第一位姿信息包括位姿序列和对应的时间戳序列,位姿序列包括至少一个位姿值,位姿值表征拍摄第一视频的过程中终端设备的机身角度,时间戳序列中包括至少一个时间戳,时间戳与位姿值一一对应,时间戳表征位姿值的采集时刻,同时也可表征第一视频的播放时刻。如图6所示,步骤S204包括步骤S2041、S2042和S2043三个具体的实现步骤。
步骤S2041:根据第二位姿信息,确定第一机身角度。
步骤S2042:根据第一机身角度和第一位姿信息,确定目标位姿值以及对应的目标时间戳。
步骤S2043:根据目标位姿值对应的目标时间戳,以及目标时间戳之后的至少一个时间戳,确定连续的多帧图片。
示例性地,第二位姿信息是在启动视频拍摄页时实时获取的表征机身角度的数值,根据该第二位姿信息对应的表征机身角度的数值,遍历第一位姿信息对应的位姿序列,从而获得一个最接近的位姿值,即目标位姿值。进一步地,根据与位姿序列对应的时间戳序列,得到与目标位姿值对应的目标时间戳。在获得目标时间戳后,根据时间戳序列与第一视频的对应关系,获得目标时间戳对应的视频帧,之后,示例性地,再根据目标 时间戳之后的连续几个时间戳,分别获得对应的视频帧,从而,得到连续的多帧图片,也即,目标帧。
图7为本公开实施例提供的一种获取多帧图片的示意图,如图7所示,根据启动视频拍摄页时的位姿信息A(第二位姿信息),确定对应的机身角度a;之后,从第一视频对应的第一位姿信息(包括一个位姿序列和一个时间戳序列)中,确定对应的位姿值a1,其中,位姿值a1距离机身角度a最接近,且小于角度阈值。进一步地,根据位姿值a1确定对应的目标时间戳t1,以及目标时间戳t1之后的N个时间戳(t2、t3、t4)。由于视频帧与时间戳一一对应,因此,将目标时间戳以及目标时间戳t之后的N个时间戳所对应的视频帧,确定为连续的多帧图片,也即,目标帧。
本公开实施例中,通过第一位姿信息和第二位姿信息,获得与当前机身角度相匹配的多个连续视频帧,进而可以在后续步骤中以视频片段作为预览图像显示在视频拍摄页内,在避免“黑屏”问题的同时,进一步地模拟视频拍摄页真实采集的实时图像,使用户无法察觉到由于相机单元的初始化过程导致的高视频拍摄页的启动延迟,提高操作流畅性和用户使用体验。
步骤S205:根据目标帧,生成预览图像,预览图像包括连续的多帧图片。
示例性地,在一种可能的实现方式中,目标帧即为预览图像,二者等同,将上述步骤中生成的目标帧,即连续的多帧图片,直接作为预览图像进行后续处理。在另一种可能的实现方式中,可以基于上述步骤中获得的目标帧,对其进行处理,例如图像帧融合、图像插帧等视频处理步骤,从而生成预览图像,从而使预览图像的图像质量更好、更加流畅。其中,上述视频处理过程的具体实现方式为现有技术,此处不再赘述。
步骤S206:对预览图像进行高斯模糊,得到待显示图像。
可选地,在步骤S205之后,还可以进一步对图像进行高斯模糊,生成待显示图像。从而使用户暂时无法观察到视频拍摄页内所显示的图像的细节,而无法察觉到终端设备通过待显示图像对“黑屏”进行替换的过程,提高用户体验。其中,上述对图像进行处理的步骤,可根据具体需要设置,具体实现方式为现有技术,此处不再赘述。
步骤S207:通过第一进程对相机单元进行初始化,以启动视频拍摄页。
步骤S208:通过第二进程将待显示图像显示在视频拍摄页内,直至相机单元初始化完毕。
示例性地,在获得预览图像后,一方面,可通过对待显示图像的显示,来避免视频拍摄页内的“黑屏”,另一方面,通过对相机单元进行初始化,以启动视频拍摄页,此时所指的视频拍摄页的启动,是指视频拍摄页的完全启动,即能够通过调用相机单元,来获得相机单元真实采集的实时图像。本公开实施例步骤中,通过分进程处理相机单元的初始化过程和待显示图像(预览图像)的显示过程,可以使待显示图像(预览图像)第一时间显示在视频拍摄页内,不会受到相机初始化过程的影响,实现视频拍摄页瞬间启动的观感,提高视觉效果和操作的流畅度。
步骤S209:在相机单元初始化完毕后,通过相机单元采集第二视频。
步骤S210:跳转至视频编辑页,并通过视频编辑页播放合成视频,其中,合成视频是基于目标编辑操作对第一视频和第二视频进行处理后生成的。
本公开实施例中,步骤S201、步骤S202、步骤S209、步骤S210的实现方式与本公开图2所示实施例中的步骤S101、步骤S102、步骤S104、步骤S105的实现方式相同,在此不再一一赘述。
对应于上文实施例的相机功能页面切换方法,图8为本公开实施例提供的相机功能页面切换装置的结构框图。为了便于说明,仅示出了与本公开实施例相关的部分。参照图8,相机功能页面切换装置3:
编辑模块31,用于基于选定的第一视频,启动视频编辑页,视频编辑页用于基于用户输入的编辑指令对第一视频进行编辑;
拍摄模块32,用于响应于针对视频编辑页的拍摄触发指令,关闭视频编辑页,启动视频拍摄页;
初始化模块33,用于基于第一视频获取预览图像,并将预览图像显示在视频拍摄页内,直至相机单元初始化完毕,其中,预览图像包括根据第一视频生成的至少一个视频帧。
拍摄模块32,还用于在相机单元初始化完毕后,通过相机单元采集第二视频;
编辑模块31,还用于跳转至视频编辑页,并通过视频编辑页播放合成视频,其中,合成视频是基于目标编辑操作对第一视频和第二视频进行处理后生成的。
在本公开的一个实施例中,初始化模块33在基于第一视频获取预览图像时,具体用于:获取第一位姿信息和第二位姿信息,其中,第一位姿信息表征终端设备在拍摄第一视频时的机身角度,第二位姿信息表征终端设备当前的机身角度;根据第一位姿信息和第二位姿信息,获取第一视频中的目标帧,其中,目标帧对应的机身角度与预览图像对应的机身角度的角度差小于角度阈值;根据目标帧,生成预览图像。
在本公开的一个实施例中,目标帧包括连续的多帧图片;第一位姿信息包括位姿序列和对应的时间戳序列,位姿序列包括至少一个位姿值,位姿值表征拍摄第一视频的过程中终端设备的机身角度,时间戳序列中包括至少一个时间戳,时间戳与位姿值一一对应;初始化模块33在根据第一位姿信息和第二位姿信息,获取第一视频中的目标帧时,具体用于:根据第二位姿信息,确定第一机身角度;根据第一机身角度和第一位姿信息,确定目标位姿值以及对应的目标时间戳;根据目标位姿值对应的目标时间戳,以及目标时间戳之后的至少一个时间戳,确定连续的多帧图片。
在本公开的一个实施例中,预览图像包括连续的多帧图片;初始化模块33在将预览图像显示在视频拍摄页内,包括:将连续的多帧图片,在预设时长内依次显示在视频拍摄页内,其中,预设时长表征相机单元的初始化时长。
在本公开的一个实施例中,初始化模块33在将预览图像显示在视频拍摄页内之前,还用于:对预览图像进行高斯模糊,得到待显示图像;初始化模块33在将预览图像显示在视频拍摄页内时,具体用于:将待显示图像显示在视频拍摄页内。
在本公开的一个实施例中,终端设备具有显示界面,初始化模块33在将预览图像显示在视频拍摄页内,具体用于:在显示界面的第一区域绘制视频拍摄页对应的页面贴图;在显示界面的第二区域绘制预览图像。
在本公开的一个实施例中,拍摄模块32在关闭视频编辑页之后,还用于:将渲染环境设置为初始化渲染环境,其中,初始化渲染环境用于在显示界面内绘制视频拍摄页和预览图像。
在本公开的一个实施例中,拍摄模块32在启动视频拍摄页时,具体用于:通过第一进程对相机单元进行初始化,以启动视频拍摄页;初始化模块33在将预览图像显示在视频拍摄页内时,具体用于:通过第二进程将预览图像显示在视频拍摄页内。
其中,编辑模块31、拍摄模块32和初始化模块33依次连接。本公开实施例提供的相机功能页面切换装置3可以执行上述方法实施例的技术方案,其实现原理和技术效果类似,本公开实施例此处不再赘述。
图9为本公开实施例提供的一种电子设备的结构示意图,如图9所示,电子设备4包括:
处理器41,以及与处理器41通信连接的存储器42;
存储器42存储计算机执行指令;
处理器41执行存储器42存储的计算机执行指令,以实现如图2-图7所示实施例中的相机功能页面切换方法。
其中,可选地,处理器41和存储器42通过总线43连接。
相关说明可以对应参见图2-图7所对应的实施例中的步骤所对应的相关描述和效果进行理解,此处不做过多赘述。
参考图10,其示出了适于用来实现本公开实施例的电子设备900的结构示意图,电子设备900可以为终端设备或服务器。其中,终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、个人数字助理(Personal Digital Assistant,简称PDA)、平板电脑(Portable Android Device,简称PAD)、便携式多媒体播放器(Portable Media Player,简称PMP)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图10示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图10所示,电子设备900可以包括处理装置(例如中央处理器、图形处理器等)901,其可以根据存储在只读存储器(Read Only Memory,简称ROM)902中的程序或者从存储装置908加载到随机访问存储器(Random Access Memory,简称RAM)903中的程序而执行各种适当的动作和处理。在RAM 903中,还存储有电子设备900操作所需的各种程序和数据。处理装置901、ROM 902以及RAM 903通过总线904彼此相连。输入/输出(I/O)接口905也连接至总线904。
通常,以下装置可以连接至I/O接口905:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置906;包括例如液晶显示器(Liquid Crystal Display,简称LCD)、扬声器、振动器等的输出装置907;包括例如磁带、硬盘等的存储装置908;以及通信装置909。通信装置909可以允许电子设备900与其他设备进行无线或有线通信以交换数据。虽然图10示出了具有各种装置的电子设备900,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介 质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置909从网络上被下载和安装,或者从存储装置908被安装,或者从ROM 902被安装。在该计算机程序被处理装置901执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被电子设备执行时,使得电子设备执行上述实施例所示的方法。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(Local Area Network,简称LAN)或广域网(Wide Area Network,简称WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方 框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定,例如,编辑模块还可以被描述为“用于基于选定的第一视频,启动视频编辑页的模块”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
第一方面,根据本公开的一个或多个实施例,提供了一种相机功能页面切换方法,应用于终端设备,所述终端设备具有相机单元,所述方法包括:
基于选定的第一视频,启动视频编辑页,所述视频编辑页用于基于用户输入的编辑指令对所述第一视频进行编辑;响应于针对所述视频编辑页的拍摄触发指令,关闭所述视频编辑页,启动视频拍摄页;基于所述第一视频获取预览图像,并将所述预览图像显示在所述视频拍摄页内,其中,所述预览图像包括根据所述第一视频生成的至少一个视频帧;在相机单元初始化完毕后,通过所述相机单元采集第二视频;跳转至所述视频编辑页,并通过所述视频编辑页播放合成视频,其中,所述合成视频是基于目标编辑操作对所述第一视频和所述第二视频进行处理后生成的。
根据本公开的一个或多个实施例,所述基于所述第一视频获取预览图像,包括:获取第一位姿信息和第二位姿信息,其中,所述第一位姿信息表征所述终端设备在拍摄第一视频时的机身角度,所述第二位姿信息表征所述终端设备当前的机身角度;根据所述第一位姿信息和第二位姿信息,获取所述第一视频中的目标帧,其中,所述目标帧对应的机身角度与所述预览图像对应的机身角度的角度差小于角度阈值;根据所述目标帧,生成所述预览图像。
根据本公开的一个或多个实施例,所述目标帧包括连续的多帧图片;所述第一位姿信息包括位姿序列和对应的时间戳序列,所述位姿序列包括至少一个位姿值,所述位姿值表征拍摄所述第一视频的过程中所述终端设备的机身角度,所述时间戳序列中包括至少一个时间戳,所述时间戳与所述位姿值一一对应;根据所述第一位姿信息和第二位姿信息,获取所述第一视频中的目标帧,包括:根据所述第二位姿信息,确定第一机身角度;根据所述第一机身角度和第一位姿信息,确定目标位姿值以及对应的目标时间戳; 根据所述目标位姿值对应的目标时间戳,以及所述目标时间戳之后的至少一个时间戳,确定所述连续的多帧图片。
根据本公开的一个或多个实施例,所述预览图像包括连续的多帧图片;所述将所述预览图像显示在所述视频拍摄页内,包括:将所述连续的多帧图片,在预设时长内依次显示在所述视频拍摄页内,其中,所述预设时长表征所述相机单元的初始化时长。
根据本公开的一个或多个实施例,在所述相机单元初始化完毕后,所述方法还包括:通过所述相机单元采集实时图像;将所述实时图像显示在所述视频拍摄页。
根据本公开的一个或多个实施例,在将所述预览图像显示在所述视频拍摄页内之前,还包括:对所述预览图像进行高斯模糊,得到待显示图像;将所述预览图像显示在所述视频拍摄页内,包括:将所述待显示图像显示在所述视频拍摄页内。
根据本公开的一个或多个实施例,所述终端设备具有显示界面,所述将所述预览图像显示在所述视频拍摄页内,包括:在所述显示界面的第一区域绘制所述视频拍摄页对应的页面贴图;在所述显示界面的第二区域绘制所述预览图像。
根据本公开的一个或多个实施例,在关闭所述视频编辑页之后,还包括:将渲染环境设置为初始化渲染环境,其中,所述初始化渲染环境用于在所述显示界面内绘制所述视频拍摄页和所述预览图像。
根据本公开的一个或多个实施例,所述启动视频拍摄页,包括:通过第一进程对相机单元进行初始化,以启动所述视频拍摄页;所述将所述预览图像显示在所述视频拍摄页内,包括:通过第二进程将所述预览图像显示在所述视频拍摄页内。
第二方面,根据本公开的一个或多个实施例,提供了一种相机功能页面切换装置,包括:
编辑模块,用于在通过终端设备的相机单元拍摄第一视频后,启动视频编辑页,视频编辑页用于基于用户输入的编辑指令对第一视频进行编辑;
拍摄模块,用于响应于针对视频编辑页的拍摄触发指令,关闭视频编辑页,启动视频拍摄页;
初始化模块,用于基于所述第一视频获取预览图像,并将预览图像显示在视频拍摄页内,直至相机单元初始化完毕,其中,预览图像包括根据第一视频生成的至少一个视频帧。
根据本公开的一个或多个实施例,初始化模块在基于所述第一视频获取预览图像时,具体用于:获取第一位姿信息和第二位姿信息,其中,第一位姿信息表征终端设备在拍摄第一视频时的机身角度,第二位姿信息表征终端设备当前的机身角度;根据第一位姿信息和第二位姿信息,获取第一视频中的目标帧,其中,目标帧对应的机身角度与预览图像对应的机身角度的角度差小于角度阈值;根据目标帧,生成预览图像。
根据本公开的一个或多个实施例,目标帧包括连续的多帧图片;第一位姿信息包括位姿序列和对应的时间戳序列,位姿序列包括至少一个位姿值,位姿值表征拍摄第一视频的过程中终端设备的机身角度,时间戳序列中包括至少一个时间戳,时间戳与位姿值一一对应;初始化模块在根据第一位姿信息和第二位姿信息,获取第一视频中的目标帧时,具体用于:根据第二位姿信息,确定第一机身角度;根据第一机身角度和第一位姿 信息,确定目标位姿值以及对应的目标时间戳;根据目标位姿值对应的目标时间戳,以及目标时间戳之后的至少一个时间戳,确定连续的多帧图片。
根据本公开的一个或多个实施例,预览图像包括连续的多帧图片;初始化模块在将预览图像显示在视频拍摄页内,包括:将连续的多帧图片,在预设时长内依次显示在视频拍摄页内,其中,预设时长表征相机单元的初始化时长。
根据本公开的一个或多个实施例,在相机单元初始化完毕后,初始化模块,还用于:通过相机单元采集实时图像;将实时图像显示在视频拍摄页。
根据本公开的一个或多个实施例,初始化模块在将预览图像显示在视频拍摄页内之前,还用于:对预览图像进行高斯模糊,得到待显示图像;初始化模块在将预览图像显示在视频拍摄页内时,具体用于:将待显示图像显示在视频拍摄页内。
根据本公开的一个或多个实施例,终端设备具有显示界面,初始化模块在将预览图像显示在视频拍摄页内,具体用于:在显示界面的第一区域绘制视频拍摄页对应的页面贴图;在显示界面的第二区域绘制预览图像。
根据本公开的一个或多个实施例,拍摄模块在关闭视频编辑页之后,还用于:将渲染环境设置为初始化渲染环境,其中,初始化渲染环境用于在显示界面内绘制视频拍摄页和预览图像。
根据本公开的一个或多个实施例,拍摄模块在启动视频拍摄页时,具体用于:通过第一进程对相机单元进行初始化,以启动视频拍摄页;初始化模块在将预览图像显示在视频拍摄页内时,具体用于:通过第二进程将预览图像显示在视频拍摄页内。
第三方面,根据本公开的一个或多个实施例,提供了一种电子设备,包括:处理器,以及与所述处理器通信连接的存储器;
所述存储器存储计算机执行指令;
所述处理器执行所述存储器存储的计算机执行指令,以实现如上第一方面以及第一方面各种可能的设计所述的相机功能页面切换方法。
第四方面,根据本公开的一个或多个实施例,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的相机功能页面切换方法。
第五方面,本公开实施例提供一种计算机程序产品,包括计算机程序,计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的相机功能页面切换方法。
第六方面,本公开实施例提供一种计算机程序,计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的相机功能页面切换方法。
本公开实施例提供的相机功能页面切换方法、装置、电子设备、存储介质、计算机程序产品以及计算机程序,通过基于选定的第一视频,启动视频编辑页,所述视频编辑页用于基于用户输入的编辑指令对所述第一视频进行编辑;响应于针对所述视频编辑页的拍摄触发指令,关闭所述视频编辑页,启动视频拍摄页;基于所述第一视频获取预览图像,并将所述预览图像显示在所述视频拍摄页内,其中,所述预览图像包括根据所述第一视频生成的至少一个视频帧;在相机单元初始化完毕后,通过所述相机单元采集第二视频;跳转至所述视频编辑页,并通过所述视频编辑页播放合成视频,其中,所述合成视频是基于目标编辑操作对所 述第一视频和所述第二视频进行处理后生成的。由于在从编辑页面返回拍摄页面时,将由之前拍摄的第一视频进行处理后得到预览图像显示在拍摄页面内,避免视频拍摄页处于黑屏状态,使视频拍摄页在观感上能瞬间显示拍摄内容,从而提高生成合成视频的流畅度和观感,提高用户使用体验。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。

Claims (13)

  1. 一种相机功能页面切换方法,应用于终端设备,所述终端设备具有相机单元,所述方法包括:
    基于选定的第一视频,启动视频编辑页,所述视频编辑页用于基于用户输入的编辑指令对所述第一视频进行编辑;
    响应于针对所述视频编辑页的拍摄触发指令,关闭所述视频编辑页,启动视频拍摄页;
    基于所述第一视频获取预览图像,并将所述预览图像显示在所述视频拍摄页内,其中,所述预览图像包括根据所述第一视频生成的至少一个视频帧;
    在相机单元初始化完毕后,通过所述相机单元采集第二视频;
    跳转至所述视频编辑页,并通过所述视频编辑页播放合成视频,其中,所述合成视频是基于目标编辑操作对所述第一视频和所述第二视频进行处理后生成的。
  2. 根据权利要求1所述的方法,其中,所述基于所述第一视频获取预览图像,包括:
    获取第一位姿信息和第二位姿信息,其中,所述第一位姿信息表征所述终端设备在拍摄第一视频时的机身角度,所述第二位姿信息表征所述终端设备当前的机身角度;
    根据所述第一位姿信息和第二位姿信息,获取所述第一视频中的目标帧,其中,所述目标帧对应的机身角度与所述预览图像对应的机身角度的角度差小于角度阈值;
    根据所述目标帧,生成所述预览图像。
  3. 根据权利要求2所述的方法,其中,所述目标帧包括连续的多帧图片;所述第一位姿信息包括位姿序列和对应的时间戳序列,所述位姿序列包括至少一个位姿值,所述位姿值表征拍摄所述第一视频的过程中所述终端设备的机身角度,所述时间戳序列中包括至少一个时间戳,所述时间戳与所述位姿值一一对应;
    根据所述第一位姿信息和第二位姿信息,获取所述第一视频中的目标帧,包括:
    根据所述第二位姿信息,确定第一机身角度;
    根据所述第一机身角度和第一位姿信息,确定目标位姿值以及对应的目标时间戳;
    根据所述目标位姿值对应的目标时间戳,以及所述目标时间戳之后的至少一个时间戳,确定所述连续的多帧图片。
  4. 根据权利要求1至3任一项所述的方法,其中,所述预览图像包括连续的多帧图片;所述将所述预览图像显示在所述视频拍摄页内,包括:
    将所述连续的多帧图片,在预设时长内依次显示在所述视频拍摄页内,其中,所述预设时长表征所述相机单元的初始化时长。
  5. 根据权利要求1至4任一项所述的方法,其中,在将所述预览图像显示在所述视频拍摄页内之前,还包括:
    对所述预览图像进行高斯模糊,得到待显示图像;
    将所述预览图像显示在所述视频拍摄页内,包括:
    将所述待显示图像显示在所述视频拍摄页内。
  6. 根据权利要求1至5任一项所述的方法,其中,所述终端设备具有显示界面,所述将所述预览图像显示在所述视频拍摄页内,包括:
    在所述显示界面的第一区域绘制所述视频拍摄页对应的页面贴图;
    在所述显示界面的第二区域绘制所述预览图像。
  7. 根据权利要求6所述的方法,其中,在关闭所述视频编辑页之后,还包括:
    将渲染环境设置为初始化渲染环境,其中,所述初始化渲染环境用于在所述显示界面内绘制所述视频拍摄页和所述预览图像。
  8. 根据权利要求1至7任一项所述的方法,其中,所述启动视频拍摄页,包括:
    通过第一进程对相机单元进行初始化,以启动所述视频拍摄页;
    所述将所述预览图像显示在所述视频拍摄页内,包括:
    通过第二进程将所述预览图像显示在所述视频拍摄页内。
  9. 一种相机功能页面切换装置,应用于终端设备,所述终端设备具有相机单元,所述装置包括:
    编辑模块,用于基于选定的第一视频,启动视频编辑页,所述视频编辑页用于基于用户输入的编辑指令对所述第一视频进行编辑;
    拍摄模块,用于响应于针对所述视频编辑页的拍摄触发指令,关闭所述视频编辑页,启动视频拍摄页;
    初始化模块,用于基于所述第一视频获取预览图像,并将所述预览图像显示在所述视频拍摄页内,其中,所述预览图像包括根据所述第一视频生成的至少一个视频帧;
    所述拍摄模块,还用于在相机单元初始化完毕后,通过所述相机单元采集第二视频;
    所述编辑模块,还用于跳转至所述视频编辑页,并通过所述视频编辑页播放合成视频,其中,所述合成视频是基于目标编辑操作对所述第一视频和所述第二视频进行处理后生成的。
  10. 一种电子设备,包括:处理器,以及与所述处理器通信连接的存储器;
    所述存储器存储计算机执行指令;
    所述处理器执行所述存储器存储的计算机执行指令,以实现如权利要求1至8任一项所述的相机功能页面切换方法。
  11. 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如权利要求1至8任一项所述的相机功能页面切换方法。
  12. 一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现权利要求1至8任一项所述的相机功能页面切换方法。
  13. 一种计算机程序,所述计算机程序被处理器执行时实现权利要求1至8任一项所述的相机功能页面切换方法。
PCT/CN2023/084887 2022-03-30 2023-03-29 相机功能页面切换方法、装置、电子设备及存储介质 WO2023185968A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210330864.4A CN116939354A (zh) 2022-03-30 2022-03-30 相机功能页面切换方法、装置、电子设备及存储介质
CN202210330864.4 2022-03-30

Publications (1)

Publication Number Publication Date
WO2023185968A1 true WO2023185968A1 (zh) 2023-10-05

Family

ID=88199351

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/084887 WO2023185968A1 (zh) 2022-03-30 2023-03-29 相机功能页面切换方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN116939354A (zh)
WO (1) WO2023185968A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008109426A (ja) * 2006-10-26 2008-05-08 Funai Electric Co Ltd 表示装置
CN106375661A (zh) * 2016-09-21 2017-02-01 惠州Tcl移动通信有限公司 一种移动终端的摄像头切换的方法及装置
CN107645674A (zh) * 2017-09-15 2018-01-30 成都视达科信息技术有限公司 一种视频播放方法和系统
CN113811855A (zh) * 2019-05-06 2021-12-17 苹果公司 用于捕获和管理视觉媒体的用户界面
CN113923357A (zh) * 2021-10-09 2022-01-11 上汽通用五菱汽车股份有限公司 一种汽车360全景的控制方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008109426A (ja) * 2006-10-26 2008-05-08 Funai Electric Co Ltd 表示装置
CN106375661A (zh) * 2016-09-21 2017-02-01 惠州Tcl移动通信有限公司 一种移动终端的摄像头切换的方法及装置
CN107645674A (zh) * 2017-09-15 2018-01-30 成都视达科信息技术有限公司 一种视频播放方法和系统
CN113811855A (zh) * 2019-05-06 2021-12-17 苹果公司 用于捕获和管理视觉媒体的用户界面
CN113923357A (zh) * 2021-10-09 2022-01-11 上汽通用五菱汽车股份有限公司 一种汽车360全景的控制方法

Also Published As

Publication number Publication date
CN116939354A (zh) 2023-10-24

Similar Documents

Publication Publication Date Title
CN108616696B (zh) 一种视频拍摄方法、装置、终端设备及存储介质
US11670339B2 (en) Video acquisition method and device, terminal and medium
WO2020015334A1 (zh) 视频处理方法、装置、终端设备及存储介质
CN112165632B (zh) 视频处理方法、装置及设备
WO2023051185A1 (zh) 图像处理方法、装置、电子设备及存储介质
CN109582122B (zh) 增强现实信息提供方法、装置及电子设备
CN112653920B (zh) 视频处理方法、装置、设备及存储介质
WO2021254502A1 (zh) 目标对象显示方法、装置及电子设备
KR102339205B1 (ko) 가상 장면 디스플레이 방법 및 디바이스, 및 저장 매체
US20240119082A1 (en) Method, apparatus, device, readable storage medium and product for media content processing
US20230328197A1 (en) Display method and apparatus based on augmented reality, device, and storage medium
WO2022048504A1 (zh) 视频处理方法、终端设备及存储介质
WO2023165515A1 (zh) 拍摄方法、装置、电子设备和存储介质
US20220159197A1 (en) Image special effect processing method and apparatus, and electronic device and computer readable storage medium
CN112035046B (zh) 榜单信息显示方法、装置、电子设备及存储介质
US20240129576A1 (en) Video processing method, apparatus, device and storage medium
WO2023169305A1 (zh) 特效视频生成方法、装置、电子设备及存储介质
WO2024046360A1 (zh) 媒体内容处理方法、装置、设备、可读存储介质及产品
CN105323624A (zh) 一种录制视频的方法、装置和系统
WO2023185968A1 (zh) 相机功能页面切换方法、装置、电子设备及存储介质
CN114025237A (zh) 视频生成方法、装置和电子设备
CN113873319A (zh) 视频处理方法、装置、电子设备及存储介质
US20240121502A1 (en) Image preview method and apparatus, electronic device, and storage medium
CN115499672B (zh) 图像显示方法、装置、设备及存储介质
CN114339356B (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: 23778333

Country of ref document: EP

Kind code of ref document: A1