[go: up one dir, main page]

CN106331479B - Video processing method and device and electronic equipment - Google Patents

Video processing method and device and electronic equipment Download PDF

Info

Publication number
CN106331479B
CN106331479B CN201610701883.8A CN201610701883A CN106331479B CN 106331479 B CN106331479 B CN 106331479B CN 201610701883 A CN201610701883 A CN 201610701883A CN 106331479 B CN106331479 B CN 106331479B
Authority
CN
China
Prior art keywords
video
instruction
category
shooting
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610701883.8A
Other languages
Chinese (zh)
Other versions
CN106331479A (en
Inventor
包立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jupiter Technology Co ltd
Original Assignee
Beijing Kingsoft Internet Security Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201610701883.8A priority Critical patent/CN106331479B/en
Publication of CN106331479A publication Critical patent/CN106331479A/en
Application granted granted Critical
Publication of CN106331479B publication Critical patent/CN106331479B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The embodiment of the invention discloses a video processing method and device and electronic equipment, and relates to the field of multimedia technology application. The method comprises the following steps: acquiring stored first video data, wherein the first video data comprises a plurality of video clips; identifying the video category of each video clip, and determining the video category of each video clip; obtaining a plurality of video clips belonging to a first video category from the first video data; and synthesizing the plurality of video segments belonging to the first video category according to a video coding library to obtain second video data. The invention can automatically combine the video clips required by the user into one video from the shot video, thereby saving the time of the user and reducing the complexity of video processing.

Description

Video processing method and device and electronic equipment
Technical Field
The present invention relates to the field of multimedia technology application, and in particular, to a video processing method and apparatus, and an electronic device.
Background
With the popularization of the mobile internet and the coming of the fourth generation communication system (english: the 4th generation communication system, abbreviated as 4G), the sharing of short video is likely to become the development trend of the next generation communication as the third social carrier behind characters and pictures. Users will become more and more accustomed to making, sharing and watching short videos on social platforms. When a user makes a short video, various different requirements are met, and some users can share the short video only by shooting a section of video; however, some users want to combine multiple short videos into one long video for sharing after shooting the multiple short videos.
In a conventional shooting method, a user shoots a video using a shooting device (e.g., a camera) on an electronic device (e.g., a mobile phone). In a certain scene, a user clicks a camera application on a mobile phone to enter a shooting mode; and then clicking a corresponding shooting button, and the mobile phone can shoot the current picture. When the user releases the shooting button, the video shooting is finished, and a video is obtained. If the user wishes to record another video in a different scene, the above steps are repeated to obtain another video, and two shots form two independent videos. If a user wants to combine two shot videos into one video for playing, the two videos need to be spliced by other video editing tools, but the process is complex, and the user experience is reduced.
Disclosure of Invention
In view of this, embodiments of the present invention provide a video processing method and apparatus, and an electronic device, which can solve the problem in the prior art that a process is complex when multiple pieces of video are synthesized into one video.
In a first aspect, an embodiment of the present invention provides a method for processing a video, where the method includes:
acquiring stored first video data, wherein the first video data comprises a plurality of video clips;
identifying the video category of each video clip, and determining the video category of each video clip;
obtaining a plurality of video clips belonging to a first video category from the first video data;
and synthesizing the plurality of video segments belonging to the first video category according to a video coding library to obtain second video data, wherein the second video data comprises a plurality of continuous video segments belonging to the first video category.
With reference to the first aspect, in a first embodiment of the first aspect,
before the stored first video data is acquired, the method further comprises:
receiving a first starting instruction input by a user in a shooting mode, wherein the first starting instruction is an operation of pressing a shooting button by the user;
shooting a current image according to the first starting instruction;
receiving a first pause instruction input by the user, wherein the first pause instruction is the operation of releasing the shooting button by the user;
obtaining a first video clip according to the first starting instruction and the first pause instruction, and writing the first video clip into a disk file through the video coding library;
shooting a current image according to the first pause instruction;
receiving a second starting instruction input by the user, wherein the second starting instruction is the operation of pressing the shooting button again by the user;
obtaining a second video clip according to the first pause instruction and the second start instruction, and writing the second video clip into the disk file through the video coding library;
shooting the current image according to the second starting instruction;
receiving a second pause instruction input by the user, wherein the second pause instruction is the operation of releasing the shooting button again by the user;
obtaining a third video clip according to the second starting instruction and the second pausing instruction, and writing the third video clip into the disk file through the video coding library;
shooting the current image according to the second pause instruction;
wherein the first video segment, the second video segment, and the third video segment constitute the first video data.
With reference to the first aspect and the first implementation manner of the first aspect, in a second implementation manner of the first aspect,
the video categories further include a second video category;
the identifying the video category of each video clip and determining the video category to which each video clip belongs specifically include:
attributing the first video segment obtained according to the first starting instruction and the first pause instruction and the third video segment obtained according to the second starting instruction and the second pause instruction to the first video category;
and attributing the second video clip obtained according to the first pause instruction and the second start instruction to the second video category.
With reference to the first aspect and the second embodiment of the first aspect, in a third embodiment of the first aspect,
the synthesizing, according to the video coding library, the plurality of video segments belonging to the first video category to obtain second video data specifically includes:
and decoding and encoding the first video segment and the third video segment according to the video encoding library to obtain the second video data, wherein the second video data comprises the continuous first video segment and the continuous third video segment.
With reference to the first aspect and the first implementation manner of the first aspect, in a fourth implementation manner of the first aspect, the method further includes:
receiving an ending instruction input by the user, wherein the ending instruction is the operation of pressing a stop button by the user;
stopping shooting according to the ending instruction;
alternatively, the method further comprises:
judging whether the time of the pause instruction input by the user exceeds preset time or not;
and stopping shooting if the time of the pause instruction input by the user exceeds the preset time.
In a second aspect, an embodiment of the present invention provides an apparatus for processing a video, where the apparatus includes:
an acquisition unit configured to acquire stored first video data, the first video data including a plurality of video clips;
the identification unit is used for identifying the video category of each video clip and determining the video category of each video clip;
the acquiring unit is further configured to acquire a plurality of video segments belonging to a first video category from the first video data;
and the processing unit is used for synthesizing the plurality of video clips belonging to the first video category according to a video coding library to obtain second video data, wherein the second video data comprises a plurality of continuous video clips belonging to the first video category.
With reference to the second aspect, in a first implementation manner of the second aspect, the apparatus further includes:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a first starting instruction input by a user in a shooting mode, and the first starting instruction is an operation of pressing a shooting button by the user;
the shooting unit is used for shooting the current image according to the first starting instruction;
the receiving unit is further configured to receive a first pause instruction input by the user, where the first pause instruction is an operation of releasing the shooting button by the user;
the writing unit is used for obtaining a first video clip according to the first starting instruction and the first pause instruction, and writing the first video clip into a disk file through the video coding library;
the shooting unit is further used for shooting the current image according to the first pause instruction;
the receiving unit is further configured to receive a second starting instruction input by the user, where the second starting instruction is an operation of pressing the shooting button again by the user;
the writing unit is further configured to obtain a second video segment according to the first pause instruction and the second start instruction, and write the second video segment into the disk file through the video coding library;
the shooting unit is further used for shooting the current image according to the second starting instruction;
the receiving unit is further configured to receive a second pause instruction input by the user, where the second pause instruction is an operation of releasing the shooting button again by the user;
the writing unit is further configured to obtain a third video segment according to the second start instruction and the second pause instruction, and write the third video segment into the disk file through the video coding library;
the shooting unit is further used for shooting the current image according to the second pause instruction;
wherein the first video segment, the second video segment, and the third video segment constitute the first video data.
With reference to the second aspect and the first implementation manner of the second aspect, in a second implementation manner of the second aspect, the video categories identified by the identifying unit further include a second video category;
the identification unit is specifically configured to attribute the first video segment obtained according to the first start instruction and the first pause instruction and attribute the third video segment obtained according to the second start instruction and the second pause instruction to the first video category;
and attributing the second video clip obtained according to the first pause instruction and the second start instruction to the second video category.
With reference to the second aspect and the second implementation manner of the second aspect, in a third implementation manner of the second aspect, the processing unit is specifically configured to decode and encode the first video segment and the third video segment according to the video encoding library to obtain the second video data, where the second video data includes the continuous first video segment and the continuous third video segment.
With reference to the first implementation manner of the second aspect, in a fourth implementation manner of the second aspect, the receiving unit is further configured to receive an end instruction input by the user, where the end instruction is an operation of pressing a stop button by the user;
the shooting unit is further used for stopping shooting according to the ending instruction;
alternatively, the apparatus further comprises:
the judging unit is used for judging whether the time of the pause instruction input by the user exceeds the preset time or not;
the shooting unit is further used for stopping shooting if the time of the pause instruction input by the user exceeds preset time.
In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for performing any of the methods described above.
In a fourth aspect, an embodiment of the present invention further provides a storage medium, configured to store an application program, where the application program is configured to execute a video processing method provided in the embodiment of the present invention.
In a fifth aspect, an embodiment of the present invention further provides an application program, configured to execute the method for processing a video provided in the embodiment of the present invention.
According to the video processing method, the video processing device and the electronic equipment provided by the embodiment of the invention, the video segments belonging to the first video category in the first video data are obtained, and the video coding library is utilized to synthesize the video segments belonging to the first video category, so that the synthesized second video data comprises a plurality of continuous video segments belonging to the first video category, and the problems that in the prior art, when a plurality of video segments are synthesized into one video, the process is complex, the user time is wasted, and the user experience is reduced can be solved. The method and the device save the time of the user and reduce the complexity of video processing.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a video processing method according to an embodiment of the present invention;
fig. 2 is a flowchart of another video processing method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a video timing sequence according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a video processing apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of another video processing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a video processing method according to an embodiment of the present invention, where an implementation subject may be an electronic device according to an embodiment of the present invention. The electronic device can be a mobile device such as a smart phone and a tablet computer. As shown in fig. 1, the method of this embodiment specifically includes the following steps:
the following electronic device as an execution subject will be described by taking a mobile phone as an example.
Step 110, obtaining stored first video data, where the first video data includes a plurality of video segments.
In this embodiment, a user performs video shooting using a mobile phone. The user firstly clicks a shooting application (for example, a camera application in the mobile phone) on the mobile phone, the mobile phone enters a shooting mode according to a click instruction of the user, and calls a shooting device (for example, a camera in the mobile phone) in the mobile phone to shoot a current image in a scene, and writes the shot video data into a storage medium (for example, a disk file F) of the mobile phone. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
The disk file F refers to a storage space allocated on a storage medium of the electronic device for storing the photographed video data.
The mobile phone acquires stored first video data from the disk file F, wherein the first video data comprises a plurality of video clips.
It should be noted that each video clip may be shot in a different scene, or may be shot in the same scene. The user can change a plurality of shooting scenes according to the preference of the user.
In this embodiment, the mobile phone shoots a video clip in the first shooting scene, the mobile phone continues to shoot a video clip in the process of changing the shooting scene, and after the user changes the scene, the mobile phone shoots a video clip in the second shooting scene, and the steps are repeated until the user finishes shooting. That is, the mobile phone continues to shoot after receiving the shooting instruction input by the user, and does not stop shooting. The mobile phone writes the shot first video data (the first video data comprises a plurality of video clips) into a storage medium (for example, a disk file F) of the mobile phone.
And 120, identifying the video category of each video clip, and determining the video category of each video clip.
In this embodiment, the mobile phone obtains a plurality of video clips from the first video data, and identifies the video category to which each video clip belongs.
Step 130, obtaining a plurality of video clips belonging to a first video category from the first video data.
In this embodiment, after obtaining the video category to which each video clip belongs, the mobile phone only obtains a plurality of video clips belonging to the first video category from the first video data.
It should be noted that, after acquiring the plurality of video clips belonging to the first video category, the mobile phone may delete the plurality of video clips except the video clip belonging to the first video category from the disk file F.
Step 140, synthesizing the plurality of video segments belonging to the first video category according to a video coding library to obtain second video data, where the second video data includes the plurality of continuous video segments belonging to the first video category.
In this embodiment, a video coding library is built in the mobile phone. Wherein the video coding library may be implemented by way of example and not limitation by an ffmepg open source computer program. Through a video coding library, the mobile phone synthesizes the acquired multiple video clips belonging to the first video category to obtain second video data, wherein the second video data comprises multiple continuous video clips belonging to the first video category.
Ffmepg is a set of open source computer programs that can be used to record, convert digital audio, video, and convert them into streams. Which includes an audio/video coding library that can encode and decode various types of sound/images. The ffmepg program open source computer program is well known in the art and will not be repeated here.
In the embodiment, the plurality of video segments belonging to the first video category in the first video data are acquired, and the video coding library is utilized to synthesize the plurality of video segments belonging to the first video category, so that the synthesized second video data comprise a plurality of continuous video segments belonging to the first video category.
Fig. 2 is a flowchart of another video processing method provided in the embodiment of the present invention, and an implementation subject in the embodiment of the present invention may be an electronic device. The electronic device can be a mobile device such as a smart phone and a tablet computer. As shown in fig. 2, the method of this embodiment specifically includes the following steps:
the following electronic device as an execution subject will be described by taking a mobile phone as an example.
Step 200, receiving a first starting instruction input by a user in a shooting mode, wherein the first starting instruction is an operation of pressing a shooting button by the user.
In this embodiment, a user performs video shooting using a mobile phone. The user firstly clicks a shooting application (for example, a camera application in the mobile phone) on the mobile phone, the mobile phone enters a shooting mode according to a click instruction of the user, and a shooting device (for example, a camera in the mobile phone) in the mobile phone is called to shoot a current image in a scene.
In the shooting mode, a user inputs a first starting instruction, and the first starting instruction is the operation of pressing a shooting button in the mobile phone by the user. In this step, the operation of the user pressing the shooting button is a long press operation.
The mobile phone can also record a first time t1 when the first starting instruction is received after receiving the first starting instruction.
Step 201, shooting a current image according to a first starting instruction.
In this step, the current image may be an image in the first scene. After the mobile phone receives the first starting instruction, the mobile phone shoots the current image in the first scene according to the instruction.
Step 202, receiving a first pause instruction input by a user, wherein the first pause instruction is an operation of releasing a shooting button by the user.
In this step, after the user finishes shooting the current image in the first scene, the user changes the scene to prepare to shoot the image in the second scene, at this time, the user inputs a first pause instruction, and the first pause instruction is an operation of releasing a shooting button in the mobile phone by the user.
The mobile phone can also record a second time t2 when the first pause instruction is received after receiving the first pause instruction.
Step 203, obtaining a first video segment according to the first start instruction and the first pause instruction, and writing the first video segment into the disk file through the video coding library.
In this step, according to the description of the foregoing steps, after receiving the first start instruction, the mobile phone shoots the current image in the first scene. And after the mobile phone receives the first pause instruction, the user changes the scene. Then, at this time, the mobile phone obtains the first video clip v1 according to the first start instruction and the first pause instruction.
In this embodiment, the mobile phone has a built-in video coding library. Wherein the video coding library may be implemented by way of example and not limitation by an ffmepg open source computer program.
The handset also writes the first video clip v1 in the disk file F through the video coding library.
It is understood that when the mobile phone receives the first pause instruction, the mobile phone finishes shooting the first video clip v 1.
And step 204, shooting the current image according to the first pause instruction.
In this step, the current image may be an image of the user during the process of changing the scene. And after the mobile phone receives the first pause instruction, the mobile phone continues to shoot the current image according to the instruction.
And step 205, receiving a second starting instruction input by the user, wherein the second starting instruction is an operation of pressing the shooting button again by the user.
In this step, the user has finished changing the scene. And the user inputs a second starting instruction, wherein the second starting instruction is the operation of pressing the shooting button in the mobile phone again by the user. In this step, the operation of the user pressing the shooting button is a long press operation.
The mobile phone receiving the second starting instruction can also record a third time t3 when the second starting instruction is received.
And step 206, obtaining a second video segment according to the first pause instruction and the second start instruction, and writing the second video segment into the disk file through the video coding library.
In this step, according to the description of the foregoing steps, after receiving the first pause instruction, the mobile phone photographs an image of the user during a scene change process. After the mobile phone receives the second starting instruction, the user finishes scene change, and the mobile phone is ready to shoot the image of the second scene. Then, at this time, the mobile phone obtains a second video clip v2 according to the first pause instruction and the second start instruction.
The handset also writes the second video clip v2 in the disk file F again through the video coding library.
It should be noted that the mobile phone writes the second video segment v2 into the same disk file F as the first video segment v1, so that the first video segment v1 and the second video segment v2 in the disk file F are continuous video data.
And step 207, shooting the current image according to the second starting instruction.
In this step, the current image may be an image in the second scene. And after the mobile phone receives the second starting instruction, shooting the current image in the second scene by the mobile phone according to the second starting instruction.
And step 208, receiving a second pause instruction input by the user, wherein the second pause instruction is the operation of releasing the shooting button again by the user.
In this step, after the user finishes shooting the current image in the second scene, the user changes the scene to prepare to shoot the image in the third scene, at this time, the user inputs a second pause instruction, and the second pause instruction is an operation of releasing a shooting button in the mobile phone by the user.
The reception of the second pause instruction by the handset may also record a second time t4 at which the second pause instruction was received.
And 209, obtaining a third video segment according to the second starting instruction and the second pause instruction, and writing the third video segment into the disk file through the video coding library.
In this step, according to the description of the foregoing step, after receiving the second start instruction, the mobile phone shoots the current image in the second scene. And after the mobile phone receives the second pause instruction, the user changes the scene. Then, at this time, the mobile phone obtains a third video clip v3 according to the second start instruction and the second pause instruction.
The handset also writes the third video clip v3 in the disk file F again through the video coding library.
It should be noted that the mobile phone writes the third video segment v3 into the same disk file F as the first video segment v1 and the second video segment v2, so that the first video segment v1, the second video segment v2 and the third video segment v3 in the disk file F are continuous video data.
And step 210, shooting the current image according to the second pause instruction.
In this step, the current image may be an image of the user during the process of changing the scene. And after the mobile phone receives the second pause instruction, the mobile phone continues to shoot the current image according to the instruction.
And step 211, finishing shooting according to the acquired finishing instruction.
In this embodiment, after the image in the scene is completely captured, the mobile phone obtains the end instruction, and the capturing is ended according to the end instruction.
In this step, the ending instruction may be that the user clicks a stop/finish button in the mobile phone; or, the mobile phone judges whether the time of the pause instruction input by the user exceeds the preset time, and if the time of the pause instruction input by the user exceeds the preset time, the mobile phone determines that the shooting is finished.
It can be understood that, in the process of determining whether the time of the pause instruction input by the user exceeds the preset time, the mobile phone may also determine whether other instructions input by the user are received within the preset time. If the time of the pause instruction input by the user does not exceed the preset time and the mobile phone does not receive other instructions input by the user within the preset time, the mobile phone continues to execute the judging step; and if the time of the pause instruction input by the user does not exceed the preset time and the mobile phone receives other instructions input by the user within the preset time, the mobile phone executes corresponding operation according to the other instructions input by the user.
It should be noted that the other instruction input by the user may be a start instruction input by the user.
And 212, obtaining a fourth video segment according to the second pause instruction and the end instruction, and writing the fourth video segment into the disk file through the video coding library.
In this step, according to the description of the foregoing steps, after receiving the second pause instruction, the mobile phone photographs an image of the user in the process of changing the scene. And after the mobile phone receives the ending instruction, the mobile phone ends shooting. Then at this point the handset gets a fourth video clip v4 according to the second pause instruction and the end instruction.
The handset also writes the fourth video clip v4 in the disk file F again through the video coding library.
It should be noted that the cell phone writes the fourth video segment v4 into the same disk file F as the first video segment v1, the second video segment v2 and the third video segment v3, so that the first video segment v1, the second video segment v2, the third video segment v3 and the fourth video segment v4 in the disk file F are continuous video data.
In this embodiment, after shooting a video clip, the mobile phone writes the video clip into the disk file F immediately, and since the mobile phone continues shooting after receiving the first start instruction input by the user, the shooting is not stopped during the process of changing the scene, so that the plurality of video clips stored in the disk file F by the mobile phone constitute the first video data.
Step 213, obtaining the first video data from the disk file.
In this embodiment, the first video data is as shown in fig. 3, and the first video data includes four video segments, and each video segment is consecutive in time sequence to the previous video segment.
In fig. 3, after the mobile phone records a first time t1, the mobile phone starts shooting to form a first video clip v 1. When the second time t2 is recorded, the shooting of the first video clip v1 is finished, the mobile phone starts to shoot the second video clip v2, when the third time t3 is recorded, the shooting of the second video clip v2 is finished, the mobile phone starts to shoot the third video clip v3, and the mobile phone repeatedly executes the steps until the ending instruction is obtained, and the shooting is ended.
Step 214, obtaining the stored first video data, wherein the first video data comprises a plurality of video segments.
In this embodiment, the process of acquiring the stored first video data by the mobile phone is similar to the step 110 in the foregoing method embodiment, and details are not repeated here.
Step 215, identifying the video category of each video clip to obtain the video category to which each video clip belongs.
In this embodiment, the mobile phone obtains a first video clip v1, a second video clip v2, a third video clip v3, and a fourth video clip v4 from the first video data.
And the mobile phone determines the video category of each video clip according to the received sequence information of each start and pause instruction, and obtains the video category of each video clip. In actual operation, the video category of each video clip can be determined according to the recorded time information of each start and pause instruction, and the video category of each video clip is obtained.
In the present embodiment, the video categories include a first video category and a second video category.
The mobile phone attributing a first video clip v1 obtained according to the first starting instruction and the first pause instruction and a third video clip v3 obtained according to the second starting instruction and the second pause instruction to a first video category; and the mobile phone assigns a second video clip obtained according to the first pause instruction and the second start instruction and a fourth video clip obtained according to the second pause instruction and the end instruction to a second video category.
The first video category specifically refers to a video clip obtained after a current image in a scene is shot by a mobile phone; the second video category specifically refers to a video clip obtained after the mobile phone shoots a scene in the scene changing process.
Step 216, obtaining a plurality of video clips belonging to a first video category from the first video data.
In this embodiment, according to the foregoing description of step 215, the mobile phone identifies the video category of the video clip, and obtains the video category to which each video clip belongs. The mobile phone acquires a first video clip v1 and a third video clip v3 belonging to a first video category from the first video data.
Step 217, according to the video coding library, synthesizing the plurality of video segments belonging to the first video category to obtain second video data, wherein the second video data comprises a plurality of continuous video segments belonging to the first video category.
In this embodiment, through a video coding library, the mobile phone performs decoding and coding processing on the acquired first video segment v1 and the acquired third video segment v3 belonging to the first video category to obtain second video data, where the second video data includes the first video segment v1 and the third video segment v3 that belong to the first video category and are consecutive in time sequence.
In this embodiment, the mobile phone receives a plurality of start instructions and pause instructions input by a user, records time sequence information of each received instruction, shoots a current image according to the instructions, and sequentially writes a plurality of obtained video clips into a disk file to obtain first video data with a plurality of continuous video clips. The mobile phone obtains a plurality of video clips belonging to a first video category in the first video data according to the sequence of the received start and pause instructions, and synthesizes the plurality of video clips belonging to the first video category by using the video coding library, so that the synthesized second video data comprises a plurality of continuous video clips belonging to the first video category. The method and the device save the time of the user and reduce the complexity of video processing.
Fig. 4 is a schematic structural diagram of a video processing apparatus according to an embodiment of the present invention, and as shown in fig. 4, the apparatus according to the embodiment may include: an acquisition unit 410, a recognition unit 420 and a processing unit 430.
The acquiring unit is used for acquiring stored first video data, and the first video data comprises a plurality of video clips;
the identification unit is used for identifying the video category of each video clip and determining the video category of each video clip;
the acquiring unit is further configured to acquire a plurality of video segments belonging to a first video category from the first video data;
and the processing unit is used for synthesizing the plurality of video clips belonging to the first video category according to a video coding library to obtain second video data, wherein the second video data comprises a plurality of continuous video clips belonging to the first video category.
Further, the apparatus further comprises:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a first starting instruction input by a user in a shooting mode, and the first starting instruction is an operation of pressing a shooting button by the user;
the shooting unit is used for shooting the current image according to the first starting instruction;
the receiving unit is further configured to receive a first pause instruction input by the user, where the first pause instruction is an operation of releasing the shooting button by the user;
the writing unit is used for obtaining a first video clip according to the first starting instruction and the first pause instruction, and writing the first video clip into a disk file through the video coding library;
the shooting unit is further used for shooting the current image according to the first pause instruction;
the receiving unit is further configured to receive a second starting instruction input by the user, where the second starting instruction is an operation of pressing the shooting button again by the user;
the writing unit is further configured to obtain a second video segment according to the first pause instruction and the second start instruction, and write the second video segment into the disk file through the video coding library;
the shooting unit is further used for shooting the current image according to the second starting instruction;
the receiving unit is further configured to receive a second pause instruction input by the user, where the second pause instruction is an operation of releasing the shooting button again by the user;
the writing unit is further configured to obtain a third video segment according to the second start instruction and the second pause instruction, and write the third video segment into the disk file through the video coding library;
the shooting unit is further used for shooting the current image according to the second pause instruction;
wherein the first video segment, the second video segment, and the third video segment constitute the first video data.
Further, the video categories identified by the identifying unit 420 further include a second video category;
the identification unit is specifically configured to attribute the first video segment obtained according to the first start instruction and the first pause instruction and attribute the third video segment obtained according to the second start instruction and the second pause instruction to the first video category;
and attributing the second video clip obtained according to the first pause instruction and the second start instruction to the second video category.
Further, the processing unit 430 is specifically configured to decode and encode the first video segment and the third video segment according to the video encoding library to obtain the second video data, where the second video data includes the continuous first video segment and the continuous third video segment.
Further, the receiving unit 440 is further configured to receive an end instruction input by the user, where the end instruction is an operation of pressing a stop button by the user;
the shooting unit 450 is further configured to stop shooting according to the ending instruction;
alternatively, the device may also be constructed as given in fig. 5. Fig. 5 is a schematic structural diagram of another video processing apparatus according to an embodiment of the present invention, and as shown in fig. 5, the apparatus further includes:
a determining unit 510, configured to determine whether a time of the pause instruction input by the user exceeds a preset time;
the photographing unit 450 is further configured to stop photographing if the time of the pause instruction input by the user exceeds a preset time.
The video processing apparatus of this embodiment may be configured to execute the technical solutions of the method embodiments shown in fig. 1 and fig. 2, and the implementation principles and technical effects thereof are similar and will not be described herein again.
Accordingly, the video processing apparatus provided in the embodiment of the present invention can also be implemented by another structure. The processing means of the video may be provided in the electronic device. Fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention, which can implement the processes in the embodiments shown in fig. 1-2 of the present invention, and as shown in fig. 6, the electronic device may include: the electronic device comprises a shell 61, a processor 62, a memory 63, a circuit board 64 and a power circuit 65, wherein the circuit board 64 is arranged inside a space enclosed by the shell 61, and the processor 62 and the memory 63 are arranged on the circuit board 64; a power supply circuit 65 for supplying power to each circuit or device of the electronic apparatus; the memory 63 is a storage medium for storing executable application program code; the processor 62 executes a program corresponding to the executable program code by reading the executable application program code stored in the memory 63, for executing a video processing method provided by the foregoing embodiment.
For the specific execution process of the above steps by the processor 62 and the steps further executed by the processor 62 by running the executable program code, reference may be made to the description of the embodiment shown in fig. 1-2 of the present invention, which is not described herein again.
The electronic device exists in a variety of forms, including but not limited to:
(1) a mobile communication device: such devices are characterized by mobile communications capabilities and are primarily targeted at providing voice, data communications. Such electronic devices include: smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) Ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such electronic devices include: PDA, MID, and UMPC devices, etc., such as ipads.
(3) A portable entertainment device: such devices can display and play multimedia content. This type of device comprises: audio, video players (e.g., ipods), handheld game consoles, electronic books, and smart toys and portable car navigation devices.
(4) And other electronic equipment with data interaction function.
It should be noted that, in this document, terms such as "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. The term "comprising", without further limitation, means that the element so defined is not excluded from the group consisting of additional identical elements in the process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments.
In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof.
In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
For convenience of description, the above devices are described separately in terms of functional division into various units/modules. Of course, the functionality of the units/modules may be implemented in one or more software and/or hardware implementations of the invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.

Claims (9)

1. A method for processing video, the method comprising:
obtaining stored first video data, the first video data comprising a plurality of video segments that are consecutive in time;
identifying the video category of each video clip, and determining the video category of each video clip;
obtaining a plurality of video clips belonging to a first video category from the first video data;
synthesizing the plurality of video segments belonging to the first video category according to a video coding library to obtain second video data, wherein the second video data comprises a plurality of continuous video segments belonging to the first video category;
before the stored first video data is acquired, the method further comprises:
receiving a first starting instruction input by a user in a shooting mode, wherein the first starting instruction is an operation of pressing a shooting button by the user;
shooting a current image according to the first starting instruction;
receiving a first pause instruction input by the user, wherein the first pause instruction is the operation of releasing the shooting button by the user;
obtaining a first video clip according to the first starting instruction and the first pause instruction, and writing the first video clip into a disk file through the video coding library;
shooting a current image according to the first pause instruction;
receiving a second starting instruction input by the user, wherein the second starting instruction is the operation of pressing the shooting button again by the user;
obtaining a second video clip according to the first pause instruction and the second start instruction, and writing the second video clip into the disk file through the video coding library;
shooting the current image according to the second starting instruction;
receiving a second pause instruction input by the user, wherein the second pause instruction is the operation of releasing the shooting button again by the user;
obtaining a third video clip according to the second starting instruction and the second pausing instruction, and writing the third video clip into the disk file through the video coding library;
shooting the current image according to the second pause instruction;
wherein the first video segment, the second video segment, and the third video segment constitute the first video data;
the identifying the video category of each video clip and the determining the video category to which each video clip belongs includes:
taking a video clip shot between the start instruction and the pause instruction as a video clip belonging to a first video category;
after obtaining the plurality of video segments belonging to the first video category, the method further comprises:
video segments not belonging to the first video category are deleted.
2. The method of processing video according to claim 1, wherein the video category further comprises a second video category;
the identifying the video category of each video clip and determining the video category to which each video clip belongs specifically include:
attributing the first video segment obtained according to the first starting instruction and the first pause instruction and the third video segment obtained according to the second starting instruction and the second pause instruction to the first video category;
and attributing the second video clip obtained according to the first pause instruction and the second start instruction to the second video category.
3. The method according to claim 2, wherein the synthesizing the plurality of video segments belonging to the first video category according to a video coding library to obtain the second video data specifically comprises:
and decoding and encoding the first video segment and the third video segment according to the video encoding library to obtain the second video data, wherein the second video data comprises the continuous first video segment and the continuous third video segment.
4. The method for processing video according to claim 1, wherein the method further comprises:
receiving an ending instruction input by the user, wherein the ending instruction is the operation of pressing a stop button by the user;
stopping shooting according to the ending instruction;
alternatively, the method further comprises:
judging whether the time of the pause instruction input by the user exceeds preset time or not;
and stopping shooting if the time of the pause instruction input by the user exceeds the preset time.
5. An apparatus for processing video, the apparatus comprising:
an acquisition unit configured to acquire stored first video data including a plurality of video segments that are continuous in time;
the identification unit is used for identifying the video category of each video clip and determining the video category of each video clip;
the acquiring unit is further configured to acquire a plurality of video segments belonging to a first video category from the first video data;
the processing unit is used for synthesizing the plurality of video segments belonging to the first video category according to a video coding library to obtain second video data, and the second video data comprises a plurality of continuous video segments belonging to the first video category;
the device further comprises:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a first starting instruction input by a user in a shooting mode, and the first starting instruction is an operation of pressing a shooting button by the user;
the shooting unit is used for shooting the current image according to the first starting instruction;
the receiving unit is further configured to receive a first pause instruction input by the user, where the first pause instruction is an operation of releasing the shooting button by the user;
the writing unit is used for obtaining a first video clip according to the first starting instruction and the first pause instruction, and writing the first video clip into a disk file through the video coding library;
the shooting unit is further used for shooting the current image according to the first pause instruction;
the receiving unit is further configured to receive a second starting instruction input by the user, where the second starting instruction is an operation of pressing the shooting button again by the user;
the writing unit is further configured to obtain a second video segment according to the first pause instruction and the second start instruction, and write the second video segment into the disk file through the video coding library;
the shooting unit is further used for shooting the current image according to the second starting instruction;
the receiving unit is further configured to receive a second pause instruction input by the user, where the second pause instruction is an operation of releasing the shooting button again by the user;
the writing unit is further configured to obtain a third video segment according to the second start instruction and the second pause instruction, and write the third video segment into the disk file through the video coding library;
the shooting unit is further used for shooting the current image according to the second pause instruction;
wherein the first video segment, the second video segment, and the third video segment constitute the first video data;
the identification unit identifies the video category of each video clip and determines the video category to which each video clip belongs, and the identification unit comprises the following steps:
taking a video clip shot between the start instruction and the pause instruction as a video clip belonging to a first video category;
the acquiring unit is further configured to delete a video clip not belonging to the first video category after acquiring the plurality of video clips belonging to the first video category.
6. The apparatus according to claim 5, wherein the video category identified by the identifying unit further comprises a second video category;
the identification unit is specifically configured to attribute the first video segment obtained according to the first start instruction and the first pause instruction and attribute the third video segment obtained according to the second start instruction and the second pause instruction to the first video category;
and attributing the second video clip obtained according to the first pause instruction and the second start instruction to the second video category.
7. The apparatus according to claim 6, wherein the processing unit is specifically configured to decode and encode the first video segment and the third video segment according to the video coding library to obtain the second video data, where the second video data includes the consecutive first video segment and the consecutive third video segment.
8. The device according to claim 5, wherein the receiving unit is further configured to receive an end instruction input by the user, where the end instruction is an operation of the user pressing a stop button;
the shooting unit is further used for stopping shooting according to the ending instruction;
alternatively, the apparatus further comprises:
the judging unit is used for judging whether the time of the pause instruction input by the user exceeds the preset time or not;
the shooting unit is further used for stopping shooting if the time of the pause instruction input by the user exceeds preset time.
9. An electronic device, characterized in that the electronic device comprises: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing the processing method of any one of the preceding claims 1 to 4.
CN201610701883.8A 2016-08-22 2016-08-22 Video processing method and device and electronic equipment Active CN106331479B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610701883.8A CN106331479B (en) 2016-08-22 2016-08-22 Video processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610701883.8A CN106331479B (en) 2016-08-22 2016-08-22 Video processing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN106331479A CN106331479A (en) 2017-01-11
CN106331479B true CN106331479B (en) 2020-04-17

Family

ID=57741771

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610701883.8A Active CN106331479B (en) 2016-08-22 2016-08-22 Video processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN106331479B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878587A (en) * 2017-01-20 2017-06-20 深圳众思科技有限公司 Micro- method for processing video frequency, device and electronic equipment
CN107872620B (en) * 2017-11-22 2020-06-02 北京小米移动软件有限公司 Video recording method and device, and computer-readable storage medium
CN110392281B (en) * 2018-04-20 2022-03-18 腾讯科技(深圳)有限公司 Video synthesis method and device, computer equipment and storage medium
CN108769801B (en) 2018-05-28 2019-03-29 广州虎牙信息科技有限公司 Synthetic method, device, equipment and the storage medium of short-sighted frequency
CN109474849B (en) * 2018-11-12 2019-11-26 广东乐心医疗电子股份有限公司 Multimedia data processing method, system, terminal and computer readable storage medium
CN113297416B (en) * 2021-05-21 2024-11-12 北京大米科技有限公司 Video data storage method, device, electronic device and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546698A (en) * 2013-10-31 2014-01-29 广东欧珀移动通信有限公司 Method and device for storing video recorded by mobile terminal
CN104796602A (en) * 2015-03-23 2015-07-22 北京畅游天下网络技术有限公司 Method and device for combination of video files
CN104853081A (en) * 2014-02-19 2015-08-19 腾讯科技(北京)有限公司 Breakpoint filming method, device and mobile terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546698A (en) * 2013-10-31 2014-01-29 广东欧珀移动通信有限公司 Method and device for storing video recorded by mobile terminal
CN104853081A (en) * 2014-02-19 2015-08-19 腾讯科技(北京)有限公司 Breakpoint filming method, device and mobile terminal
CN104796602A (en) * 2015-03-23 2015-07-22 北京畅游天下网络技术有限公司 Method and device for combination of video files

Also Published As

Publication number Publication date
CN106331479A (en) 2017-01-11

Similar Documents

Publication Publication Date Title
CN106331479B (en) Video processing method and device and electronic equipment
US10939069B2 (en) Video recording method, electronic device and storage medium
CN107018443B (en) Video recording method and device and electronic equipment
US9342516B2 (en) Media presentation playback annotation
CN108156520B (en) Video playing method and device, electronic equipment and storage medium
CN106792152B (en) Video synthesis method and terminal
CN111970562A (en) Video processing method, video processing device, storage medium and electronic equipment
CN108989609A (en) Video cover generation method, device, terminal device and computer storage medium
CN106331822B (en) Method and device for playing multiple videos and electronic equipment
CN111246301B (en) Video playing method and device, electronic equipment and computer readable storage medium
CN107995482B (en) Video file processing method and device
CN110162652A (en) A kind of picture display method and device, terminal device
CN106791535B (en) Video recording method and device
CN106254776A (en) Video processing method and device and electronic equipment
WO2020015331A1 (en) Video photographing method and apparatus, terminal device and storage medium
CN106604147A (en) Video processing method and apparatus
US9325776B2 (en) Mixed media communication
CN106303238A (en) Video shooting method and device and electronic equipment
CN113992638B (en) Method, device, storage location and electronic device for synchronously playing multimedia resources
CN106817538A (en) Electronic equipment, picture shooting method and device
CN104754222A (en) Terminal camera shooting method and terminal
CN104754268A (en) Method and device for recording reversed-sequence video
CN106331553B (en) Video storage method and device and electronic equipment
CN116016817B (en) Video editing method, device, electronic device and storage medium
CN113489899A (en) Special effect video recording method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201201

Address after: Room 115, area C, 1 / F, building 8, yard 1, yaojiayuan South Road, Chaoyang District, Beijing 100123

Patentee after: Beijing LEMI Technology Co.,Ltd.

Address before: 100085 Beijing City, Haidian District Road 33, two floor East Xiaoying

Patentee before: BEIJING KINGSOFT INTERNET SECURITY SOFTWARE Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231220

Address after: 3870A, 3rd Floor, Building 4, Courtyard 49, Badachu Road, Shijingshan District, Beijing, 100144

Patentee after: Beijing Jupiter Technology Co.,Ltd.

Address before: 100123 room 115, area C, 1st floor, building 8, yard 1, yaojiayuan South Road, Chaoyang District, Beijing

Patentee before: Beijing LEMI Technology Co.,Ltd.

TR01 Transfer of patent right