Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
First embodiment
As shown in fig. 1, an embodiment of the present invention provides a method for generating a video thumbnail, which is applied to a mobile terminal with a camera, and the method specifically includes:
step 101: and acquiring at least one video with a second frame rate in the process of recording the target video according to the first frame rate.
And the first frame rate is higher than the second frame rate, and at least one fast shot video is acquired in the process of recording the target video. Therefore, the image data output by the camera in the process of recording the target can be directly utilized, the step of acquiring the video at the second frame rate is simplified, and the processing amount of the image processor and the central processing unit is reduced.
Step 102: and generating a thumbnail picture set of the target video based on the videos at the at least one second frame rate.
The thumbnail set comprises at least one thumbnail, and one thumbnail corresponds to a video with a second frame rate. Specifically, at least one frame of thumbnail is an image output from a camera at different moments in the target video recording process, the characteristic information of each time period of the target video can be reflected, the thumbnails at all moments are integrated, the whole content of the whole target video can be previewed, and a user can browse the specific content of the target video without playing the whole video.
Step 103: and establishing an association relation between the thumbnail picture set and the target video.
After the thumbnail set is obtained, the association relationship between the target video and the thumbnail set is established so as to facilitate the subsequent preview and play.
Therefore, in the process of recording the target video, the video with the second frame rate is obtained, the thumbnail set of the target video is generated based on the video with the second frame rate, the association relationship between the thumbnail set and the video with the second frame rate is established, and the images in the thumbnail set are played during previewing, so that a user can know the main information of the target video file through the corresponding thumbnail set without playing the target video, the user can know the video content accurately and find the video file to be browsed or checked quickly.
Second embodiment
The above first embodiment briefly describes the method for generating a video thumbnail of the present invention, and the following embodiment further describes the method with reference to the drawings and specific application scenarios.
As shown in fig. 2, the method for generating a video thumbnail according to an embodiment of the present invention specifically includes the following steps:
step 201: and in the process of recording the target video according to the first frame rate and the first size, recording the video according to the second frame rate and the second size to generate at least one video with the second frame rate.
The first frame rate is higher than the second frame rate, and the second size is smaller than the first size. The first frame rate and the second frame rate are recording frame rates, the first size and the second size are imaging pixel points, and the larger the size is, the more the pixel points are. In the process of recording the target video, the camera simultaneously runs a new path of data, and at least one video with a second size is recorded according to a second frame rate, wherein the video is a quick shot small-size video of the target video. When the camera ISP controls the camera to run the data required by the target video, it runs a new path of small-sized image data at the same time, preferably, the first frame rate is an integer multiple of the second frame rate, for example, a 1080P target video of 30fps is recorded by the camera of the mobile terminal, and then a new path of data is recorded at a recording frame rate of 176 × 144 according to 5fps, that is, every 6 frames of images of the target video are recorded, that is, 1 frame of small-sized video is recorded.
Further, step 201 may be specifically implemented according to the following steps: in the process of recording the video according to the second frame rate, controlling an image processor of the mobile terminal to perform downsampling processing on image data output by the camera, and outputting a path of image data with a second size according to the second frame rate; video encoding the image data of the second size; and after the video recording is finished, generating at least one video with a second frame rate based on each frame of image subjected to video coding. The video has smaller size and fewer image frames, so the method can play a role of reducing the memory occupied by the video on a certain program.
Specifically, the step of generating at least one video of a second frame rate based on each frame of image after video coding includes: generating a video from all the frame preview images subjected to video coding; or, at preset time intervals, generating a video from the preview image subjected to video coding within the preset time. In order to further save memory resources, the target video can be segmented according to time length to obtain a plurality of short videos, and the images are extracted within a preset time length in each short video. Specifically, dividing a target video into a plurality of short videos according to a preset time length; and extracting a plurality of frames of initial images with preset lengths in each short video. For example, if the preset time period is 5 minutes, the target video is divided into a plurality of short videos every 5 minutes, wherein the length of the last short video may be less than 5 minutes. Further, the preset length is a time period intercepted in the short video; for example, a plurality of frames of initial images of the video corresponding to the second minute to the fourth minute in each short video are extracted. The longer the preset length is, the more the extracted initial image is, and the more accurate the whole content of the video file is covered.
Step 202: and generating a thumbnail picture set of the target video based on the videos at the at least one second frame rate.
The thumbnail set comprises at least one thumbnail, and one thumbnail corresponds to a video with a second frame rate. Specifically, at least one frame of thumbnail is an image output from a camera at different time in the recording process of the target video, and can reflect the characteristic information of each time period of the target video, and the thumbnails at all times can be combined to preview the whole content of the whole target video.
Specifically, as shown in fig. 6, in the process of recording the target video by the camera, data output by the camera is divided into three paths after passing through the image processor, and one path is output to the target video encoding module for encoding according to the first frame rate to generate the target video; one path of video is output to a thumbnail video coding module for coding according to a second frame rate so as to generate a thumbnail video; and one path of output is output to a display module for previewing in the recording process. The frame rates of the output image data of each path are different, and the image sizes are also different.
Step 203: and establishing an association relation between the thumbnail picture set and the target video.
After the thumbnail set is obtained, the association relationship between the target video and the thumbnail set is established and stored, so as to facilitate the subsequent preview playing.
Step 204: and receiving a target video preview instruction input by a user of the mobile terminal.
The target video preview command may be generated by automatic triggering or by manual triggering of a user. Further, the scenario of automatic trigger generation may be: a user clicks to enter a local multimedia library, and when the system detects that a target video is displayed in a current preview window, a preview instruction is automatically triggered; the scenario generated by the user manually triggering may be: the method comprises the steps that a touch action of a target video preview instruction is preset, and after a user clicks to enter a local multimedia library, when the touch action input by the user is detected to be matched with the touch action of the preset preview instruction, a preview instruction is triggered and generated.
Specifically, when videos only including one second frame rate are displayed, the thumbnail image sets in the corresponding videos are directly played after the target video preview instruction input by the user is acquired, so that the overall content of the target videos is previewed.
Step 205: and playing the thumbnail picture set corresponding to the target video according to the target video preview instruction.
After a target video preview instruction is acquired, playing a thumbnail set corresponding to a target video according to a default preview mode; i.e. the playback order and playback speed of the thumbnail set are default values. And the thumbnail picture set corresponding to the target video forms a preview video file. When the default preview mode cannot meet the preview requirement of the user, the user can input specified touch operation to realize different preview playing effects, and the specific implementation mode can refer to the following steps:
step 206: and detecting the touch operation of the mobile terminal user.
For videos with a plurality of second frame rates, after the preview instruction is obtained, a touch operation input by a user needs to be obtained to determine how to play the videos, such as a play start position, a play sequence, and the like. It is worth pointing out that, after the preview instruction is obtained, the default preview mode is entered, and the detection of the touch operation of the mobile terminal user is started at the same time, the triggering of the default preview mode and the triggering of the detection of the touch operation of the mobile terminal user can be performed synchronously, and when the mobile terminal user is detected to input the designated touch operation, the default preview mode is ended, and the preview mode corresponding to the specific touch operation is switched.
Step 207: and when the first touch operation is detected, playing the thumbnail picture sets corresponding to the target videos according to a preset sequence.
Specifically, the videos at the plurality of second frame rates generate thumbnail sets of the target video, the thumbnail sets corresponding to different time periods are formed into video file segments of different time periods, and when the first touch operation input by the user is detected, the corresponding video file segments are played in a preset sequence.
Step 208: when a second touch operation is detected, acquiring a first video in playing; determining a second video corresponding to a next time period of the first video in the thumbnail set; and plays the second video.
It is worth noting, among other things, that when a thumbnail set includes a plurality of thumbnail sets of different time periods, the thumbnail set of each time period forms a video file segment. For example, when the user clicks, the user switches to the next (chronologically distinguished) video file segment (second video) of the current video file segment (first video, video file segment formed by the currently played thumbnail) to play. In addition, when the touch operation input by the user is matched with the preset operation, extracting specific video segments in the videos with the second frame rates to play; or, taking a third video of the videos with the plurality of second frame rates as a starting image, and sequentially playing the starting image and the videos after the starting image. For example: when the user double clicks, sequentially switching and playing among thumbnail picture sets corresponding to the corresponding video segments of the beginning, the middle and the end (the videos of the beginning, the middle and the end are taken as specific video segments in the videos of the plurality of second frame rates); and continuously switching between the thumbnail sets of the videos at the second frame rates according to the sequence when the user presses the long button, and sequentially playing the thumbnail sets of the third video corresponding to the moment when the user releases the hand (taking the video corresponding to the stop of the long button as the initial video). Therefore, the user can adjust the playing sequence and the playing initial position of the thumbnail picture set according to the self requirement so as to better preview the whole content of the target video and quickly search the video file required by the user.
Further, the user may also manually adjust the play speed of the thumbnail image set, specifically after the step of receiving a target video preview instruction input by the mobile terminal user, the method further includes: receiving a play speed adjusting instruction input by a mobile terminal user; determining a target playing speed corresponding to the playing speed adjusting instruction; and controlling the video in the thumbnail set in the playing process to play according to the target playing speed. Here, when the user wants to further browse the thumbnail set corresponding to the target video quickly to obtain the entire content of the target video, that is, when the user is not satisfied with the current preview playing speed, the user may perform adjustment by inputting a specific touch operation to increase the playing speed of the preview image. Specifically, the touch operation of the play speed adjustment instruction may be set to slide operations such as sliding up, sliding down, sliding left, or sliding right, and further, the user may set an operation action of slow play of the preview image.
Therefore, in the process of recording the target video, the camera is controlled to run one path of data again to record the video with the second frame rate, the thumbnail set of the target video is generated based on the video with the second frame rate, the association relation between the thumbnail set and the video with the second frame rate is established, and the images in the thumbnail set are played during previewing, so that a user can know the main information of the target video file through the corresponding thumbnail set without playing the target video, the user can know the video content accurately, the video file to be browsed or checked is found quickly, and the user operation is simplified.
Third embodiment
The above first embodiment and the second embodiment briefly describe the method for generating a video thumbnail of the present invention, and the present embodiment will be further described with reference to the drawings and another application scenario. In the second embodiment, a new data is simultaneously run during the process of recording the target video, at least one video with the second frame rate is recorded, and a thumbnail set of the target video is generated based on the video.
As shown in fig. 3, the method for generating a video thumbnail according to an embodiment of the present invention specifically includes the following steps:
step 301: and acquiring preview image data in the process of recording the target video according to the first frame rate and the first size.
During the process of recording the target video according to the first frame rate and the first size, the camera outputs preview image data to the image processor in real time, wherein the image data is an unprocessed initial image.
Step 302: and extracting a frame of preview image of the preview image data every M frames, and reducing the frame of preview image to a preset size.
The camera outputs the acquired image data to the image processor in the recording process, the image processor outputs two paths of data after processing, wherein one path of data is output to the target video coding module for coding and storage, and the other path of data is output to the display module for display and preview. In order to reduce image processing steps, a camera application program extracts a plurality of frames of preview images from preview image data according to a preset frame interval in a path of data output to a display module and performs compression processing, wherein the value of M is greater than or equal to 1. The preset frame interval (i.e., the value of M) may be a default setting of the system or may be set by the user. The smaller the value of the preset frame interval is, the more the number of the extracted initial image frames is, the more the whole content of the video file can be covered; on the contrary, the larger the value of the preset frame interval is, the fewer the number of the extracted initial image frames is, and the smaller the occupied storage space is. Therefore, the user can set the preset frame interval independently according to the requirement, and the default setting of the system can set a better frame interval according to the experience value so as to occupy the memory resource to the minimum extent and cover the whole content of the video file to the maximum extent. For example, if the preset frame interval is set to 6, one frame is extracted every 6 frames in sequence from the multi-frame images of the video file. Taking the extraction of the initial image in the recording process as an example, when a camera of the mobile terminal is in normal recording, extracting corresponding multi-frame initial images according to a preset frame interval based on the existing recording process, and sending the extracted initial images to the video thumbnail generation control module, taking 6 frames as an example, that is, sending one frame to the video thumbnail generation control module for encoding every 6 frames.
In order to further save memory resources, the extracted image can be compressed according to the length-width ratio of the preview image data to ensure the fidelity performance of the image, and the image is reduced to a preset size to form a thumbnail consistent with the length-width ratio of the preview image data. The corresponding thumbnail is obtained by compressing the extracted image according to the length-width ratio of the preview image data, so that the memory space occupied by the thumbnail can be reduced, the length-width ratio of the thumbnail can be ensured to be equal to that of the preview image data, the problem of aliasing of the thumbnail is avoided, the preview effect of the thumbnail is improved, and the preview effect of the preview image is ensured.
Step 303: and carrying out video coding on the preview image reduced to the preset size.
The method of carrying out video coding on the preview image reduced to the preset size is adopted, and video coding, extraction and compression processing are not carried out firstly, so that the method can reduce one-time image processing process, simplify the image processing process and save image processing resources.
Step 304: and after the target video is recorded, generating at least one video with a second frame rate based on each frame of image subjected to video coding.
After the target video is recorded, the video with the corresponding second frame rate is processed and generated, so that the image processor generates the target video file and simultaneously generates the video file with the corresponding second frame rate.
Specifically, the steps include: generating a video from all the frame preview images subjected to video coding; or, at preset time intervals, generating a video from the preview image subjected to video coding within the preset time. In order to further save memory resources, the target video can be segmented according to time length to obtain a plurality of short videos, and the images are extracted within a preset time length in each short video. Specifically, dividing a target video into a plurality of short videos according to a preset time length; and extracting a plurality of frames of initial images with preset lengths in each short video.
Step 305: and generating a thumbnail picture set of the target video based on the videos at the at least one second frame rate.
The thumbnail set comprises at least one thumbnail, and one thumbnail corresponds to a video with a second frame rate. Specifically, the thumbnails are images output from cameras at different moments in the target video recording process, and can reflect characteristic information of each time period of the target video, and the thumbnails at all moments are combined to preview the whole content of the whole target video.
Referring to fig. 7 specifically, in the process of recording the target video by the camera, data output by the camera is divided into two paths after passing through the image processor, and one path is output to the target video encoding module for encoding according to the first frame rate to generate the target video; one path of output is output to a display module for previewing in the recording process; in addition, a preview image output from the image processor is extracted every M frames by a camera application program and compressed to a preset size, and the preview image is output to a thumbnail video encoding module for encoding after being processed by the camera application program so as to generate a thumbnail video.
Step 306: and establishing an association relation between the thumbnail picture set and the target video.
After the thumbnail set is obtained, the association relationship between the target video and the thumbnail set is established and stored, so as to facilitate the subsequent preview playing.
Step 307: and receiving a target video preview instruction input by a user of the mobile terminal.
The target video preview command may be generated by automatic triggering or by manual triggering of a user. Specifically, when videos only including one second frame rate are displayed, the thumbnail image sets in the corresponding videos are directly played after the target video preview instruction input by the user is acquired, so that the overall content of the target videos is previewed. Further, after receiving a target video preview instruction, entering a default preview mode by default for previewing, that is, playing a thumbnail set corresponding to the target video according to the target video preview instruction. When the default preview mode cannot meet the preview requirement of the user, different preview effects can be further realized through the following steps.
Step 308: and detecting the touch operation of the mobile terminal user according to the target video preview instruction.
For videos with a plurality of second frame rates, after the preview instruction is obtained, a touch operation input by a user needs to be obtained to determine how to play the videos, such as a play start position, a play sequence, and the like.
Step 309: and when the first touch operation is detected, playing the thumbnail sets corresponding to the target videos according to a preset sequence.
Specifically, the videos at the plurality of second frame rates generate thumbnail sets of the target video, the thumbnail sets corresponding to different time periods are formed into video file segments of different time periods, and when the first touch operation input by the user is detected, the corresponding video file segments are played in a preset sequence.
Step 310: when a second touch operation is detected, acquiring a first video in playing; determining a second video corresponding to a next time period of the first video in the thumbnail set; and plays the second video.
For example, when the user clicks, the user switches to the thumbnail set corresponding to the next (chronologically) video segment (second video) of the current video segment (first video) to play. In addition, when the touch operation input by the user is matched with the preset operation, extracting specific video segments in the videos with the second frame rates to play; or, taking a third video of the videos with the plurality of second frame rates as a starting image, and sequentially playing the starting image and the videos after the starting image. Therefore, the playing sequence and the playing initial position of the thumbnail set can be adjusted according to the self requirement, and the whole content of the target video can be better previewed.
Further, the user may also manually adjust the play speed of the thumbnail image set, specifically after the step of receiving a target video preview instruction input by the mobile terminal user, the method further includes: receiving a play speed adjusting instruction input by a mobile terminal user; determining a target playing speed corresponding to the playing speed adjusting instruction; and controlling the video in the thumbnail set in the playing process to play according to the target playing speed. Specifically, the touch operation of the play speed adjustment instruction may be set to slide operations such as sliding up, sliding down, sliding left, or sliding right, and further, the user may set an operation action of slow play of the preview image.
Therefore, in the process of recording the target video, the camera is not controlled to run one path of data again to record the video with the second frame rate, but the preview image output by the camera in the process of recording the target video is extracted according to the preset frame interval to generate the video with the second frame rate, the thumbnail picture set of the target video is further generated based on the video with the second frame rate, the association relation between the thumbnail picture set and the video with the second frame rate is established, and the image in the thumbnail picture set is played in the previewing process, so that a user can know the main information of the target video file through the corresponding thumbnail picture set without playing the target video, the user can conveniently and accurately know the video content, the video file to be browsed or checked can be quickly found, and the user operation is.
Fourth embodiment
The above first to third embodiments describe in detail the video preview method in different scenes, respectively, and the mobile terminal corresponding to the above first to third embodiments will be further described with reference to fig. 4 and 5.
As shown in fig. 4, the mobile terminal 400 according to the embodiment of the present invention can obtain at least one video with a second frame rate in the process of recording the target video according to the first frame rate in the first to third embodiments; generating a thumbnail set of the target video based on the videos at the at least one second frame rate; the method for establishing the incidence relation between the thumbnail picture set and the target video achieves the same effect, and specifically comprises the following functional modules: the method comprises the following steps:
a first obtaining module 410, configured to obtain at least one video at a second frame rate in a process of recording a target video at a first frame rate;
a generating module 420, configured to generate a thumbnail set of the target video based on the video at the at least one second frame rate acquired by the acquiring module;
the establishing module 430 is configured to establish an association relationship between the thumbnail image set generated by the generating module and the target video;
the thumbnail set comprises at least one thumbnail, one thumbnail corresponds to a video with a second frame rate, and the first frame rate is higher than the second frame rate.
Wherein the first obtaining module 410 includes:
a first generating unit 411, configured to record a target video according to a first frame rate and a first size, and perform video recording according to a second frame rate and a second size to generate at least one video at a second frame rate;
wherein the second size is smaller than the first size.
Wherein the first generating unit 411 includes:
an output subunit 4111, configured to control an image processor of the mobile terminal to perform downsampling processing on the image data output by the camera in a process of performing video recording according to the second frame rate, and output a path of image data of the second size;
an encoding subunit 4112 configured to perform video encoding on the image data of the second size output by the output subunit;
a first generating subunit 4113, configured to generate, after the video recording is completed, at least one video at the second frame rate based on each frame of image subjected to video encoding by the encoding subunit.
Specifically, as shown in fig. 6, in the process of recording the target video by the camera, the camera is controlled to run one new path of data again, that is, the data output by the camera is divided into three paths after passing through the image processor, and one path of data is output to the target video encoding module for encoding according to the first frame rate, so as to generate the target video; one path of video is output to a thumbnail video coding module for coding according to a second frame rate so as to generate a thumbnail video; and one path of output is output to a display module for previewing in the recording process.
Wherein, the first obtaining module 410 further includes:
an obtaining unit 412, configured to obtain preview image data during recording of a target video at a first frame rate and a first size;
an extracting unit 413 configured to extract one frame of preview image of the preview image data acquired by the acquiring unit every M frames, and reduce the one frame of preview image to a preset size;
an encoding unit 414, configured to perform video encoding on the preview image that is processed and reduced to a preset size by the extraction unit;
a second generating unit 415, configured to generate at least one video at a second frame rate based on each frame of image subjected to video encoding by the encoding unit after the target video is recorded;
wherein, M is greater than or equal to 1.
Specifically, as shown in fig. 7, in the process of recording the target video by the camera, data output by the camera is divided into two paths after passing through the image processor, and one path is output to the target video encoding module for encoding according to the first frame rate to generate the target video; one path of output is output to a display module for previewing in the recording process; in addition, a preview image output from the image processor is extracted every M frames by a camera application program and compressed to a preset size, and the preview image is output to a thumbnail video encoding module for encoding after being processed by the camera application program so as to generate a thumbnail video.
Wherein the second generating unit 415 includes:
a second generating subunit 4151, configured to generate one video from all the preview images subjected to video encoding; or,
a third generating subunit 4152, configured to generate a video from the preview image after video coding within the preset time interval every preset time interval.
Wherein, the mobile terminal 400 further includes:
a first receiving module 440, configured to receive a target video preview instruction input by a user of the mobile terminal;
the first playing module 450 is configured to play the thumbnail set corresponding to the target video according to the target video preview instruction received by the first receiving module.
Further, the mobile terminal 400 further includes:
the detection module 460 is configured to detect a touch operation of a mobile terminal user;
the second playing and playing module 470 is configured to play the thumbnail sets corresponding to the target videos according to a preset sequence when the detection module detects the first touch operation.
Wherein, the mobile terminal 400 further includes:
a second obtaining module 480, configured to obtain a first video being played when a second touch operation is detected;
the first processing module 490 is configured to determine a second video in the thumbnail set corresponding to a next time period of the first video acquired by the second acquiring module;
a third playing module 4100, configured to play the second video determined by the first processing module.
Wherein, the mobile terminal 400 further includes:
a second receiving module 4110, configured to receive a play speed adjustment instruction input by a user of the mobile terminal;
a second processing module 4120 for determining a target play speed corresponding to the play speed adjustment instruction;
a fourth playing module 4130, configured to control the video in the thumbnail set being played to be played at the target playing speed determined by the second processing module.
It is to be noted that the mobile terminal according to the embodiment of the present invention is a mobile terminal corresponding to the method for generating a video thumbnail, and both the implementation manner and the achieved technical effect of the method are applicable to the embodiment of the mobile terminal. The mobile terminal takes the multi-frame thumbnail images of the specific video file as the preview images of the specific video file, and plays the preview images in sequence during previewing, so that a user can directly preview the main information of the video file through the corresponding preview images without playing the video file, the user can know the video content accurately, the video file to be browsed or viewed can be found quickly, and the user operation is simplified.
Fifth embodiment
Fig. 8 is a block diagram of a mobile terminal 80 according to another embodiment of the present invention, and the mobile terminal shown in fig. 8 includes: at least one processor 801, a memory 802, a photographing component 803, and a user interface 804. The various components in the mobile terminal 800 are coupled together by a bus system 805. It is understood that the bus system 805 is used to enable communications among the components connected. The bus system 805 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 805 in fig. 8.
The user interface 804 may include, among other things, a display or a pointing device (e.g., a touch-sensitive pad or touch screen, etc.).
It will be appreciated that the memory 802 in embodiments of the invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of example, but not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data rate Synchronous Dynamic random access memory (ddr SDRAM ), Enhanced Synchronous SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct memory bus RAM (DRRAM). The memory 802 of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
In some embodiments, memory 802 stores the following elements, executable modules or data structures, or a subset thereof, or an expanded set thereof: an operating system 8021 and application programs 8022.
The operating system 8021 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks. The application program 8022 includes various application programs, such as a Media Player (Media Player), a Browser (Browser), and the like, for implementing various application services. A program implementing a method according to an embodiment of the present invention may be included in application program 8022.
In embodiments of the present invention, by calling a program or instructions stored in memory 802, in particular, a program or instructions stored in application program 8022. The processor 801 is configured to obtain at least one video at a second frame rate in a process of recording a target video at a first frame rate; generating a thumbnail set of the target video based on the videos at the at least one second frame rate; establishing an incidence relation between the thumbnail picture set and the target video; the thumbnail set comprises at least one thumbnail, one thumbnail corresponds to a video with a second frame rate, and the first frame rate is higher than the second frame rate.
The methods disclosed in the embodiments of the present invention described above may be implemented in the processor 801 or implemented by the processor 801. The processor 801 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 801. The Processor 801 may be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable Gate Array (FPGA) or other programmable logic device, discrete Gate or transistor logic device, discrete hardware component. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 802, and the processor 801 reads the information in the memory 802, and combines the hardware to complete the steps of the method.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the Processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
Specifically, the processor 801 is further configured to: in the process of recording the target video according to the first frame rate and the first size, video recording is carried out according to the second frame rate and the second size, and at least one video with the second frame rate is generated; wherein the second size is smaller than the first size.
Specifically, the processor 801 is further configured to: in the process of recording the video according to the second frame rate, controlling an image processor of the mobile terminal to carry out downsampling processing on image data output by the camera and outputting a path of image data with a second size; video encoding the image data of the second size; and after the video recording is finished, generating at least one video with a second frame rate based on each frame of image subjected to video coding.
Specifically, the processor 801 is further configured to: acquiring preview image data in the process of recording a target video according to a first frame rate and a first size; extracting a frame of preview image of the preview image data every M frames at intervals, and reducing the frame of preview image to a preset size; carrying out video coding on the preview image reduced to the preset size; after the target video is recorded, generating at least one video with a second frame rate based on each frame of image subjected to video coding; wherein, M is greater than or equal to 1.
Further, the processor 801 is further configured to: generating a video from all preview images subjected to video coding; or generating a video from the preview image subjected to video coding in the preset time length at every preset time length.
Wherein, the processor 801 is further configured to: receiving a target video preview instruction input by a mobile terminal user; and playing the thumbnail picture set corresponding to the target video according to the target video preview instruction.
Wherein, the processor 801 is further configured to: detecting touch operation of a mobile terminal user; and when the first touch operation is detected, playing the thumbnail picture sets corresponding to the target videos according to a preset sequence.
Wherein, the processor 801 is further configured to: when a second touch operation is detected, acquiring a first video in playing; determining a second video corresponding to a next time period of the first video in the thumbnail set; and playing the second video.
Wherein, the processor 801 is further configured to: receiving a play speed adjusting instruction input by a mobile terminal user; determining a target playing speed corresponding to the playing speed adjusting instruction; and controlling the video in the thumbnail set in the playing process to play according to the target playing speed.
The mobile terminal 800 of the embodiment of the present invention generates the thumbnail set of the target video and establishes the association relationship between the thumbnail set and the target video based on the video of the second frame rate generated in the process of recording the target video, and plays the images in the thumbnail set during the preview, so that the user can know the main information of the target video file through the corresponding thumbnail set without playing the target video, thereby facilitating the user to accurately know the video content, quickly finding the video file to be browsed or checked, and simplifying the user operation.
Sixth embodiment
Fig. 9 is a schematic structural diagram of a mobile terminal according to another embodiment of the present invention. Specifically, the mobile terminal 900 in fig. 9 may be a mobile phone, a tablet computer, a Personal Digital Assistant (PDA), or a vehicle-mounted computer.
Mobile terminal 900 in fig. 9 includes a power supply 910, memory 920, input unit 930, display unit 940, photographing component 950, processor 960, wifi (wireless fidelity) module 970, audio circuit 980, and RF circuit 990.
The input unit 930 may be used, among other things, to receive user-input information and to generate signal inputs related to user settings and function control of the mobile terminal 900. Specifically, in the embodiment of the present invention, the input unit 930 may include a touch panel 931. The touch panel 931, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 931 (for example, a user may operate the touch panel 931 by using a finger, a stylus pen, or any other suitable object or accessory), and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 931 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts it to touch point coordinates, and sends the touch point coordinates to the processor 960, where the touch controller can receive and execute commands sent by the processor 960. In addition, the touch panel 931 may be implemented by various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 931, the input unit 930 may also include other input devices 932, and the other input devices 932 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
Among them, the display unit 940 may be used to display information input by the user or information provided to the user and various menu interfaces of the mobile terminal. The display unit 940 may include a display panel 941, and the display panel 941 may be optionally configured in the form of an LCD or an Organic Light-Emitting Diode (OLED).
It should be noted that the touch panel 931 may overlay the display panel 941 to form a touch display screen, and when the touch display screen detects a touch operation on or near the touch display screen, the touch display screen transmits the touch operation to the processor 960 to determine the type of the touch event, and then the processor 960 provides a corresponding visual output on the touch display screen according to the type of the touch event.
The touch display screen comprises an application program interface display area and a common control display area. The arrangement modes of the application program interface display area and the common control display area are not limited, and can be an arrangement mode which can distinguish two display areas, such as vertical arrangement, left-right arrangement and the like. The application interface display area may be used to display an interface of an application. Each interface may contain at least one interface element such as an icon and/or widget desktop control for an application. The application interface display area may also be an empty interface that does not contain any content. The common control display area is used for displaying controls with high utilization rate, such as application icons like setting buttons, interface numbers, scroll bars, phone book icons and the like.
The processor 960 is a control center of the mobile terminal, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the first memory 921 and calling data stored in the second memory 922, thereby performing overall monitoring of the mobile terminal. Optionally, processor 960 may include one or more processing units.
In the embodiment of the present invention, by calling the software program and/or module stored in the first memory 921 and/or the data stored in the second memory 922, in the process of recording the target video according to the first frame rate, at least one video of the second frame rate is acquired; generating a thumbnail set of the target video based on the videos at the at least one second frame rate; establishing an incidence relation between the thumbnail picture set and the target video; the thumbnail set comprises at least one thumbnail, one thumbnail corresponds to a video with a second frame rate, and the first frame rate is higher than the second frame rate.
Specifically, the processor 960 is further configured to: in the process of recording the target video according to the first frame rate and the first size, video recording is carried out according to the second frame rate and the second size, and at least one video with the second frame rate is generated; wherein the second size is smaller than the first size.
Specifically, the processor 960 is further configured to: in the process of recording the video according to the second frame rate, controlling an image processor of the mobile terminal to carry out downsampling processing on image data output by the camera and outputting a path of image data with a second size; video encoding the image data of the second size; and after the video recording is finished, generating at least one video with a second frame rate based on each frame of image subjected to video coding.
Specifically, the processor 960 is further configured to: acquiring preview image data in the process of recording a target video according to a first frame rate and a first size; extracting a frame of preview image of the preview image data every M frames at intervals, and reducing the frame of preview image to a preset size; carrying out video coding on the preview image reduced to the preset size; after the target video is recorded, generating at least one video with a second frame rate based on each frame of image subjected to video coding; wherein, M is greater than or equal to 1.
Further, the processor 960 is further configured to: generating a video from all preview images subjected to video coding; or generating a video from the preview image subjected to video coding in the preset time length at every preset time length.
Wherein, the processor 960 is further configured to: receiving a target video preview instruction input by a mobile terminal user; and playing the thumbnail picture set corresponding to the target video according to the target video preview instruction.
Wherein, the processor 960 is further configured to: detecting touch operation of a mobile terminal user; when the first touch operation is detected, the videos in the thumbnail set corresponding to the target video are played according to a preset sequence.
Wherein, the processor 960 is further configured to: when a second touch operation is detected, acquiring a first video in playing; determining a second video corresponding to a next time period of the first video in the thumbnail set; and playing the second video.
Wherein, the processor 960 is further configured to: receiving a play speed adjusting instruction input by a mobile terminal user; determining a target playing speed corresponding to the playing speed adjusting instruction; and controlling the video in the thumbnail set in the playing process to play according to the target playing speed.
The mobile terminal 900 of the embodiment of the present invention generates the thumbnail set of the target video and establishes the association relationship between the thumbnail set and the target video based on the video of the second frame rate generated in the process of recording the target video, and plays the images in the thumbnail set during previewing, so that the user can know the main information of the target video file through the corresponding thumbnail set without playing the target video, thereby facilitating the user to accurately know the video content, quickly finding the video file to be browsed or checked, and simplifying the user operation.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
While the preferred embodiments of the present invention have been described, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the following claims.