CN107197372B - Method and device for shearing batch vertical screen videos and electronic equipment - Google Patents

Method and device for shearing batch vertical screen videos and electronic equipment Download PDF

Info

Publication number
CN107197372B
CN107197372B CN201710521560.5A CN201710521560A CN107197372B CN 107197372 B CN107197372 B CN 107197372B CN 201710521560 A CN201710521560 A CN 201710521560A CN 107197372 B CN107197372 B CN 107197372B
Authority
CN
China
Prior art keywords
vertical screen
cut
video
screen video
time
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
CN201710521560.5A
Other languages
Chinese (zh)
Other versions
CN107197372A (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 Kingsoft Internet Security Software 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 CN201710521560.5A priority Critical patent/CN107197372B/en
Publication of CN107197372A publication Critical patent/CN107197372A/en
Application granted granted Critical
Publication of CN107197372B publication Critical patent/CN107197372B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440263Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the spatial resolution, e.g. for displaying on a connected PDA
    • H04N21/440272Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the spatial resolution, e.g. for displaying on a connected PDA for performing aspect ratio conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream

Abstract

The invention provides a method, a device and electronic equipment for shearing batch vertical screen videos, wherein the method comprises the steps of receiving a shearing instruction, and analyzing a time range from the shearing instruction; judging whether the time difference value between the corresponding time points of two adjacent key frames in the vertical screen video to be cut is within the time range or not; if so, extracting the video content between the adjacent key frames from the vertical screen video so as to cut the vertical screen video. According to the invention, the shearing effect of batch vertical screen videos can be improved, the labor cost is saved, and the shearing efficiency is improved.

Description

Method and device for shearing batch vertical screen videos and electronic equipment
Technical Field
The invention relates to the technical field of video processing, in particular to a method and a device for shearing batch vertical screen videos and electronic equipment.
Background
With the rapid development of the internet, a user can browse videos by using electronic equipment in a vertical screen mode, and the videos played in the vertical screen mode are generally vertical screen videos.
In the related art, a user can import a cross screen video into software for cutting a vertical screen video, for example, imove, and then cut and edit the cross screen video at will according to own requirements, but in some application scenarios, for example, if a plurality of short videos need to be cut from a batch of vertical screen videos, a large amount of manpower and repeated labor force are required to cut the videos, the cutting effect of the batch of vertical screen videos is poor, and the efficiency is low.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, one purpose of the present invention is to provide a method for shearing batch vertical screen videos, which can improve the shearing effect of batch vertical screen videos, save labor cost, and improve shearing efficiency.
Another object of the present invention is to provide a device for cutting a batch of vertical screen videos.
Another object of the present invention is to provide an electronic device.
It is another object of the invention to propose a non-transitory computer-readable storage medium.
It is a further object of the invention to propose a computer program product.
In order to achieve the above object, an embodiment of the first aspect of the present invention provides a method for cropping a batch of vertical screen videos, including: receiving a cutting instruction, and analyzing a time range from the cutting instruction; judging whether the time difference value between the corresponding time points of two adjacent key frames in the current vertical screen video to be cut is within the time range; if so, extracting the video content between the adjacent key frames from the vertical screen video so as to cut the vertical screen video.
In one embodiment of the present invention, further comprising:
traversing and reading a next vertical screen video to be cut from a preset folder;
and replacing the current vertical screen video to be cut by adopting the next vertical screen video to be cut.
In an embodiment of the present invention, before the receiving the cut instruction, the method further includes:
determining a key frame of each vertical screen video in a plurality of vertical screen videos to be cut based on the attribute values of the video frames;
determining a time point corresponding to each key frame;
writing the time point of the key frame into a preset file;
and storing the preset file.
In an embodiment of the present invention, before the determining whether a time difference between time points corresponding to two adjacent key frames in the currently to-be-clipped vertical screen video is within the time range, the method includes:
scanning the time points recorded in the preset file;
and acquiring a time difference value between time points corresponding to two adjacent key frames in the current vertical screen video to be cut to obtain a plurality of time difference values.
In an embodiment of the present invention, the determining whether a time difference between time points corresponding to two adjacent key frames in the currently to-be-clipped vertical screen video is within the time range includes:
and judging whether each time difference value in the plurality of time difference values is within the time range.
In an embodiment of the present invention, before the receiving the cut instruction, the method further includes:
adjusting the length and the width of the plurality of transverse screen videos based on a preset proportional value to obtain a plurality of vertical screen videos to be cut;
and storing the plurality of vertical screen videos to be cut in the preset folder.
According to the method for shearing batch vertical screen videos, provided by the embodiment of the first aspect of the invention, the shearing instruction is received, the time range is analyzed from the shearing instruction, whether the time difference value between the time points corresponding to two adjacent key frames in the current vertical screen video to be sheared is within the time range is judged, if yes, the video content between the adjacent key frames is extracted from the vertical screen video, so that the vertical screen video is sheared, the shearing effect of the batch vertical screen videos can be improved, the labor cost is saved, and the shearing efficiency is improved.
In order to achieve the above object, a second embodiment of the present invention provides a device for cropping a batch of portrait videos, including: the receiving module is used for receiving the cutting instruction and analyzing the time range from the cutting instruction; the judging module is used for judging whether a time difference value between time points corresponding to two adjacent key frames in the current vertical screen video to be cut is within the time range; and the cutting module is used for extracting the video content between the adjacent key frames from the vertical screen video when the time difference value is within the time range so as to cut the vertical screen video.
In one embodiment of the present invention, further comprising:
the reading module is used for reading the next vertical screen video to be cut in a traversing manner from the preset folder;
and the replacing module is used for replacing the current vertical screen video to be cut by adopting the next vertical screen video to be cut.
In one embodiment of the present invention, further comprising:
the first determining module is used for determining a key frame of each vertical screen video in a plurality of vertical screen videos to be cut based on the attribute values of the video frames;
a second determining module, configured to determine a time point corresponding to each key frame;
the writing module is used for writing the time point of the key frame into a preset file;
and the storage module is used for storing the preset file.
In one embodiment of the invention, the method comprises the following steps:
the scanning module is used for scanning the time points recorded in the preset file;
and the acquisition module is used for acquiring a time difference value between time points corresponding to two adjacent key frames in the current vertical screen video to be cut so as to obtain a plurality of time difference values.
In an embodiment of the present invention, the determining module is specifically configured to:
and judging whether each time difference value in the plurality of time difference values is within the time range.
In one embodiment of the present invention, further comprising:
the adjusting module is used for adjusting the length and the width of the plurality of transverse screen videos based on a preset proportion value to obtain a plurality of vertical screen videos to be cut;
and the storage module is used for storing the plurality of vertical screen videos to be cut in the preset folder.
According to the shearing device for the batch vertical screen videos, provided by the embodiment of the second aspect of the invention, the shearing instruction is received, the time range is analyzed from the shearing instruction, whether the time difference value between the time points corresponding to the two adjacent key frames in the current vertical screen video to be sheared is within the time range is judged, if yes, the video content between the two adjacent key frames is extracted from the vertical screen video, so that the vertical screen video is sheared, the shearing effect of the batch vertical screen videos can be improved, the labor cost is saved, and the shearing efficiency is improved.
In order to achieve the above object, an electronic device according to a third aspect of the present invention includes: a processor, a memory, a power circuit, a multimedia component, an audio component, an interface for input/output (I/O), a sensor component, and a communication component; wherein, the circuit board is arranged in the space enclosed by the shell, and the processor and the memory are arranged on the circuit board; the power supply circuit is used for supplying power to each circuit or device of the electronic equipment; 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: receiving a cutting instruction, and analyzing a time range from the cutting instruction; judging whether the time difference value between the corresponding time points of two adjacent key frames in the current vertical screen video to be cut is within the time range; if so, extracting the video content between the adjacent key frames from the vertical screen video so as to cut the vertical screen video.
The electronic device provided by the embodiment of the third aspect of the invention receives the cutting instruction, analyzes the time range from the cutting instruction, and judges whether the time difference value between the time points corresponding to two adjacent key frames in the vertical screen video to be cut is within the time range, if yes, extracts the video content between the adjacent key frames from the vertical screen video to cut the vertical screen video, so that the cutting effect of batch vertical screen videos can be improved, the labor cost is saved, and the cutting efficiency is improved.
To achieve the above object, a non-transitory computer-readable storage medium according to a fourth aspect of the present invention is a non-transitory computer-readable storage medium, wherein instructions of the storage medium, when executed by a processor of a mobile terminal, enable the mobile terminal to execute a method for cropping a batch of vertical-screen videos, the method including: receiving a cutting instruction, and analyzing a time range from the cutting instruction; judging whether the time difference value between the corresponding time points of two adjacent key frames in the current vertical screen video to be cut is within the time range; if so, extracting the video content between the adjacent key frames from the vertical screen video so as to cut the vertical screen video.
The non-transitory computer-readable storage medium provided in the embodiment of the fourth aspect of the present invention receives the cropping instruction, analyzes the time range from the cropping instruction, and determines whether the time difference between the time points corresponding to two adjacent key frames in the current to-be-cropped vertical screen video is within the time range, and if so, extracts the video content between the adjacent key frames from the vertical screen video to crop the vertical screen video, so as to improve the cropping effect of batch vertical screen videos, save the labor cost, and improve the cropping efficiency.
To achieve the above object, an embodiment of a fifth aspect of the present invention provides a computer program product, wherein when instructions of the computer program product are executed by a processor, the computer program product performs a method for cropping a batch of vertical screen videos, the method comprising: receiving a cutting instruction, and analyzing a time range from the cutting instruction; judging whether the time difference value between the corresponding time points of two adjacent key frames in the current vertical screen video to be cut is within the time range; if so, extracting the video content between the adjacent key frames from the vertical screen video so as to cut the vertical screen video.
According to the computer program product provided by the embodiment of the fifth aspect of the invention, the cutting instruction is received, the time range is analyzed from the cutting instruction, whether the time difference value between the time points corresponding to two adjacent key frames in the vertical screen video to be cut is within the time range is judged, if yes, the video content between the adjacent key frames is extracted from the vertical screen video, so that the vertical screen video is cut, the cutting effect of batch vertical screen videos can be improved, the labor cost is saved, and the cutting efficiency is improved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart of a method for cropping a batch of vertical-screen videos according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for cropping a batch of vertical-screen videos according to another embodiment of the present invention;
fig. 3 is a schematic flowchart of a method for cropping a batch of vertical-screen videos according to another embodiment of the present invention;
fig. 4 is a schematic flowchart of a method for cropping a batch of vertical-screen videos according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a batch vertical screen video cropping device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a batch vertical screen video cropping device according to another embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention. On the contrary, the embodiments of the invention include all changes, modifications and equivalents coming within the spirit and terms of the claims appended hereto.
Fig. 1 is a schematic flowchart of a method for clipping a batch of vertical screen videos according to an embodiment of the present invention.
The embodiment of the invention can be applied to the process of cutting batch vertical screen videos by a user, and is not limited.
Further, the user can cut the batch of vertical screen videos through a video cutting application program arranged in the terminal.
The application may refer to a software program running on an electronic device, such as a Personal Computer (PC), a cloud device or a mobile device, a mobile device such as a smart phone or a tablet Computer. The terminal may be a hardware device with various operating systems, such as a smart phone, a tablet computer, a personal digital assistant, and an electronic book, which is not limited thereto.
It should be noted that the execution main body in the embodiment of the present invention may be, for example, a Central Processing Unit (CPU) of the terminal in terms of hardware, and may be, for example, a service related to a video clip application in the terminal in terms of software, which is not limited to this.
Referring to fig. 1, the method includes:
in the present invention, the related service of the video clip-type application is exemplified as the FFmpeg service, which is not limited to this.
S11: a cut instruction is received and a time range is parsed from the cut instruction.
The time range can be, for example, 6s to 20s, and the time value in the time range represents the duration of the clipped vertical screen video required by the user.
The method comprises the steps that an operation interface can be provided on a front-end operation interface of a video cutting application program in the electronic equipment in advance, the operation interface can be configured to be capable of receiving a time range of requirements input by a user, a cutting instruction is further generated according to the time range, the front-end operation interface sends the cutting instruction to a related service of the video cutting application in a terminal, the service analyzes the cutting instruction, and the time range is analyzed.
Optionally, in some embodiments, referring to fig. 2, before S11, the method may further include:
s21: and adjusting the length and the width of the plurality of transverse screen videos based on a preset proportional value to obtain a plurality of vertical screen videos to be cut.
The preset ratio value may be, for example, 16: 9.
the preset proportional value may be preset by a factory program of the video clip application, or may be set by a user according to a requirement of the user, or may be configured adaptively by the video clip application according to a screen size of the electronic device in which the video clip application is installed, so that the method has better flexibility, and is not limited thereto.
For example, after a landscape video is acquired, a command in the FFmpeg service is called, the landscape video is cut into a vertical screen video in a ratio of 16:9 (keeping the height of the landscape video unchanged), that is, assuming that the height of the landscape video is ih, the height of the cut vertical screen video is h-ih, the width of the cut vertical screen video is w-ih 9/16, the coordinate of the corresponding start position is (iw/2-ih 9/32, 0), and the command is as follows:
ffmpeg -i input.mp4 -vf crop=ih*9/16:ih:iw/2-ih*9/32:0 output.mp4。
optionally, in an embodiment of the present invention, after obtaining a plurality of vertical screen videos to be clipped, the resolution of each vertical screen video may also be adjusted, for example, a command in the FFmpeg service may be invoked to convert the video into the required resolutions 1080 × 1920, 720 × 1280, and the like, where the command is as follows:
ffmpeg -i input.mp4 -s 320x240 output.mp4。
in the embodiment of the invention, as the resolution of most mobile phones is 1080P, the video is converted into a 1080 × 1920 video by calling the command in the FFmpeg service, so that the labor cost is further saved, and the video display effect is ensured.
S22: and storing the plurality of vertical screen videos to be cut in a preset folder.
The preset folder may be pre-established by a factory program of the video clip application, or may be established by a user according to a requirement of the user, or may be adaptively established by the video clip application according to an optimal storage path of the electronic device in which the video clip application is installed, without limitation.
The plurality of vertical screen videos to be cut are stored in the preset folder in advance, so that the application program interface can be directly called to traverse and read the plurality of vertical screen videos under the preset folder, the method is simple and easy to implement, the vertical screen videos do not need to be read from different paths when each vertical screen video is cut, and the computing resource consumption of the system is saved.
S23: and determining a key frame of each vertical screen video in the plurality of vertical screen videos to be cut based on the attribute values of the video frames.
S24: and determining the corresponding time point of each key frame.
S25: and writing the time point of the key frame into a preset file.
S26: and storing the preset file.
In an embodiment of the present invention, for each vertical screen video to be cut, the key frames included in the vertical screen video may be determined first.
The key frame refers to a frame where a key action in the movement or change of the character or the object is located, that is, the key frame is a transition frame between two adjacent shots in the vertical screen video.
It is understood that at least one key frame may be included in a vertical screen video, and accordingly, each key frame corresponds to a time point, and the attribute value of the key frame is different from that of other frames in the vertical screen video.
For example, the attribute value of each frame in the portrait video can be read by using the command in the ffprobe service, which is as follows:
"ffprobe-show_frames"+input.mp4+"output1.txt";
then, of the read attribute values of each frame, a frame corresponding to the attribute value whose key _ frame is 1 is taken as a key frame, and the time point of the key frame is stored in a preset file.
The preset file may be pre-established by a factory program of the video clip application, or may be established by a user according to a requirement of the user, or may be adaptively established by the video clip application according to an optimal storage path of the electronic device in which the video clip application is installed, without limitation.
By writing the time points of the key frames into the preset file in advance, the time points corresponding to the key frames can be read from the preset file directly in the follow-up process, the video frames of the vertical screen video do not need to be analyzed, the computing resource consumption of the system is saved, the shearing efficiency of batch vertical screen videos is improved, and the accuracy of obtaining the key frames and the corresponding time points is guaranteed by directly reading the time points corresponding to the key frames from the preset file due to the fact that the preset file is configured in advance.
S12: and judging whether the time difference value between the corresponding time points of the two adjacent key frames in the vertical screen video to be cut is within the time range.
Optionally, judging whether a time difference between time points corresponding to two adjacent key frames in the currently to-be-cut vertical screen video is within a time range includes:
judging whether each time difference value in the plurality of time difference values is within a time range;
or, it may also be determined whether the time difference values of the preset number are within the time range, which is not limited herein.
It can be understood that due to the characteristics of the key frames, the video content between two adjacent key frames belongs to the same shot, and the video content between non-adjacent key frames belongs to different shots.
Therefore, in the embodiment of the present invention, in order to ensure the continuity of the video obtained by clipping and avoid the occurrence of the cross-shot phenomenon, the time difference between the time points corresponding to the two adjacent key frames in the vertical screen video to be clipped may be compared with the time range in the clipping instruction, and if the time difference is within the time range, it indicates that the video obtained by clipping the vertical screen video based on the two adjacent key frames corresponding to the time difference has continuity and is the video within the same shot.
Or, if the time difference is smaller than the lower limit of the time range, the video content between the two frames of key frames corresponding to the time difference may not be cut.
Or, if the time difference is greater than the upper limit of the time range, any time value (for example, 8s) may be determined from the time range, and the video content of 8s is cut from between two adjacent key frames corresponding to the time difference based on the time value of 8 s.
Optionally, in some embodiments, referring to fig. 3, before S12, the method may further include:
s31: scanning the time points recorded in the preset file.
S32: and acquiring a time difference value between time points corresponding to two adjacent key frames in the current vertical screen video to be cut to obtain a plurality of time difference values.
In the embodiment of the present invention, time points recorded in a preset file may be scanned, and a time difference between time points corresponding to two adjacent key frames may be calculated to obtain a plurality of time differences.
In the embodiment of the invention, the vertical screen video can be cut based on the time difference value by acquiring the time difference value between the time points corresponding to the two adjacent key frames, and because the video content between the two adjacent key frames belongs to the same shot due to the characteristics of the key frames, the vertical screen video is cut based on the time difference, so that the video content of a complete shot can be obtained, the cut video content has continuity, and the cutting effect of batch vertical screen videos is effectively improved.
S13: if so, extracting the video content between the adjacent key frames from the vertical screen video so as to cut the vertical screen video.
For example, assuming a small video with a time range of 6s to 20s, then, if a time difference between time points corresponding to two adjacent key frames in the vertical screen video to be currently cut is within the time range, a command in the FFmpeg service may be called to cut the vertical screen video, where the command is as follows:
mpmpeg-i input. mp4-vocodec copy-acodec copy-ss t 1-to t2 output. mp4-y. Optionally, in some embodiments, referring to fig. 4, after S13, the method may further include:
s41: and traversing and reading the next vertical screen video to be cut from the preset folder.
S42: and replacing the current vertical screen video to be cut by adopting the next vertical screen video to be cut.
In the embodiment of the invention, the preset folder is pre-established, so that an application program interface can be directly called to read a plurality of vertical screen videos under the preset folder in a traversing manner, and the vertical screen video to be cut next is adopted to replace the current vertical screen video to be cut, so that the batch vertical screen videos are automatically cut, the method is simple and easy to realize, the vertical screen videos do not need to be read from different paths when each vertical screen video is cut, and the consumption of the computing resources of the system is saved.
In the embodiment, the cutting instruction is received, the time range is analyzed from the cutting instruction, whether the time difference value between the corresponding time points of the two adjacent frames of key frames is within the time range or not in the vertical screen video to be cut at present is judged, if yes, the video content between the adjacent frames of key frames is extracted from the vertical screen video, the vertical screen video is cut, the cutting effect of the batch vertical screen video can be improved, the labor cost is saved, and the cutting efficiency is improved.
Fig. 5 is a schematic structural diagram of a batch vertical screen video cropping device according to an embodiment of the present invention.
Referring to fig. 5, the apparatus 500 includes:
the receiving module 501 is configured to receive a clipping instruction and parse a time range from the clipping instruction.
The determining module 502 is configured to determine whether a time difference between time points corresponding to two adjacent key frames in the vertical screen video to be currently cut is within a time range.
Optionally, in some embodiments, the determining module 502 is specifically configured to:
and judging whether each time difference value in the plurality of time difference values is within the time range.
And a cropping module 503, configured to extract video content between adjacent key frames from the vertical screen video when the time difference is within the time range, so as to crop the vertical screen video.
Optionally, in some embodiments, referring to fig. 6, the apparatus 500 further comprises:
the reading module 504 is configured to read a next vertical screen video to be cut from a preset folder in a traversal manner.
And a replacing module 505, configured to replace the currently to-be-cut vertical screen video with a next to-be-cut vertical screen video.
The first determining module 506 is configured to determine a key frame of each of the plurality of vertical screen videos to be cut based on the attribute value of the video frame.
A second determining module 507, configured to determine a time point corresponding to each key frame.
A writing module 508, configured to write the time point of the key frame into a preset file.
The storage module 509 is configured to store a preset file.
The scanning module 510 is configured to scan time points recorded in a preset file.
The obtaining module 511 is configured to obtain a time difference between time points corresponding to two adjacent key frames in the vertical screen video to be currently cut, so as to obtain a plurality of time differences.
The adjusting module 512 is configured to adjust the lengths and widths of the multiple horizontal screen videos based on a preset ratio value, so as to obtain multiple vertical screen videos to be cut.
The saving module 513 is configured to save the multiple vertical screen videos to be cut in a preset folder.
It should be noted that the explanation of the embodiment of the method for clipping batch vertical screen videos in the foregoing embodiments of fig. 1 to fig. 4 is also applicable to the device for clipping batch vertical screen videos in this embodiment, and the implementation principle is similar, and is not described herein again.
In the embodiment, the cutting instruction is received, the time range is analyzed from the cutting instruction, whether the time difference value between the corresponding time points of the two adjacent frames of key frames is within the time range or not in the vertical screen video to be cut at present is judged, if yes, the video content between the adjacent frames of key frames is extracted from the vertical screen video, the vertical screen video is cut, the cutting effect of the batch vertical screen video can be improved, the labor cost is saved, and the cutting efficiency is improved.
An embodiment of the present invention further provides an electronic device, and referring to fig. 7, the electronic device 700 may include one or more of the following components: a processor 701, a memory 702, a power circuit 703, a multimedia component 704, an audio component 705, an input/output (I/O) interface 706, a sensor component 707, and a communication component 708.
A power supply circuit 703 for supplying power to each circuit or device of the electronic apparatus; the memory 702 is used to store executable program code; the processor 701 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 702 for performing the steps of:
receiving a cutting instruction, and analyzing a time range from the cutting instruction;
judging whether the time difference value between the corresponding time points of two adjacent key frames in the vertical screen video to be cut is within the time range or not;
if so, extracting the video content between the adjacent key frames from the vertical screen video so as to cut the vertical screen video.
It should be noted that the foregoing explanation of the embodiment of the batch vertical screen video clipping method in the embodiments of fig. 1 to fig. 4 also applies to the electronic device 700 of the embodiment, and the implementation principle is similar and is not described herein again.
In the embodiment, the cutting instruction is received, the time range is analyzed from the cutting instruction, whether the time difference value between the corresponding time points of the two adjacent frames of key frames is within the time range or not in the vertical screen video to be cut at present is judged, if yes, the video content between the adjacent frames of key frames is extracted from the vertical screen video, the vertical screen video is cut, the cutting effect of the batch vertical screen video can be improved, the labor cost is saved, and the cutting efficiency is improved.
In order to implement the above embodiments, the present invention also provides a non-transitory computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of a terminal, enable the terminal to execute a method for clipping a batch of vertical screen videos, the method including:
receiving a cutting instruction, and analyzing a time range from the cutting instruction;
judging whether the time difference value between the corresponding time points of two adjacent key frames in the vertical screen video to be cut is within the time range or not;
if so, extracting the video content between the adjacent key frames from the vertical screen video so as to cut the vertical screen video.
The non-transitory computer-readable storage medium in this embodiment receives the cropping instruction, parses a time range from the cropping instruction, and determines whether a time difference between time points corresponding to two adjacent key frames in the vertical screen video to be currently cropped is within the time range, and if so, extracts video content between the adjacent key frames from the vertical screen video to crop the vertical screen video, so that the cropping effect of batch vertical screen videos can be improved, the labor cost is saved, and the cropping efficiency is improved.
In order to implement the foregoing embodiment, the present invention further provides a computer program product, wherein when instructions in the computer program product are executed by a processor, a method for clipping a batch of vertical screen videos is performed, and the method includes:
receiving a cutting instruction, and analyzing a time range from the cutting instruction;
judging whether the time difference value between the corresponding time points of two adjacent key frames in the vertical screen video to be cut is within the time range or not;
if so, extracting the video content between the adjacent key frames from the vertical screen video so as to cut the vertical screen video.
The computer program product in this embodiment analyzes the time range from the cropping instruction by receiving the cropping instruction, and determines whether the time difference between the time points corresponding to two adjacent key frames is within the time range in the vertical screen video to be cropped currently, and if so, extracts the video content between the adjacent key frames from the vertical screen video to crop the vertical screen video, so that the cropping effect of the batch vertical screen video can be improved, the labor cost is saved, and the cropping efficiency is improved.
It should be noted that the terms "first," "second," and the like in the description of the present invention are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
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.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A method for cutting batch vertical screen videos is characterized by comprising the following steps:
determining a key frame of each vertical screen video in a plurality of vertical screen videos to be cut based on the attribute values of the video frames;
determining a time point corresponding to each key frame;
writing the time point of the key frame into a preset file;
storing the preset file;
receiving a cutting instruction, and analyzing a time range from the cutting instruction;
scanning the time points recorded in the preset file;
acquiring time difference values between time points corresponding to two adjacent key frames in a current vertical screen video to be cut to obtain a plurality of time difference values;
judging whether the time difference value between the corresponding time points of two adjacent key frames in the current vertical screen video to be cut is within the time range;
if so, extracting the video content between the adjacent key frames from the vertical screen video so as to cut the vertical screen video.
2. The method for cropping batch of portrait screen video of claim 1, further comprising:
traversing and reading a next vertical screen video to be cut from a preset folder;
and replacing the current vertical screen video to be cut by adopting the next vertical screen video to be cut.
3. The method for cropping batch vertical screen videos according to claim 1, wherein the step of judging whether the time difference value between the time points corresponding to two adjacent key frames in the current vertical screen video to be cropped is within the time range comprises:
and judging whether each time difference value in the plurality of time difference values is within the time range.
4. The method for cropping batch of portrait video of claim 2, further comprising, prior to said receiving a cropping command:
adjusting the length and the width of the plurality of transverse screen videos based on a preset proportional value to obtain a plurality of vertical screen videos to be cut;
and storing the plurality of vertical screen videos to be cut in the preset folder.
5. A shearing device for batch vertical screen videos is characterized by comprising:
the first determining module is used for determining a key frame of each vertical screen video in a plurality of vertical screen videos to be cut based on the attribute values of the video frames;
a second determining module, configured to determine a time point corresponding to each key frame;
the writing module is used for writing the time point of the key frame into a preset file;
the storage module is used for storing the preset file;
the receiving module is used for receiving the cutting instruction and analyzing the time range from the cutting instruction;
the scanning module is used for scanning the time points recorded in the preset file;
the acquisition module is used for acquiring time difference values between corresponding time points of two adjacent key frames in the current vertical screen video to be cut to obtain a plurality of time difference values;
the judging module is used for judging whether a time difference value between time points corresponding to two adjacent key frames in the current vertical screen video to be cut is within the time range;
and the cutting module is used for extracting the video content between the adjacent key frames from the vertical screen video when the time difference value is within the time range so as to cut the vertical screen video.
6. The apparatus for cropping a batch of portrait screen video of claim 5, further comprising:
the reading module is used for reading the next vertical screen video to be cut in a traversing manner from the preset folder;
and the replacing module is used for replacing the current vertical screen video to be cut by adopting the next vertical screen video to be cut.
7. The batch of vertical screen video cropping device of claim 5, wherein the determination module is specifically configured to:
and judging whether each time difference value in the plurality of time difference values is within the time range.
8. The apparatus for cropping a batch of portrait screen video of claim 6, further comprising:
the adjusting module is used for adjusting the length and the width of the plurality of transverse screen videos based on a preset proportion value to obtain a plurality of vertical screen videos to be cut;
and the storage module is used for storing the plurality of vertical screen videos to be cut in the preset folder.
9. An electronic device, comprising the following components: a processor, a memory, a power circuit, a multimedia component, an audio component, an interface for input/output (I/O), a sensor component, and a communication component; wherein, the circuit board is arranged in the space enclosed by the shell, and the processor and the memory are arranged on the circuit board; the power supply circuit is used for supplying power to each circuit or device of the electronic equipment; 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:
determining a key frame of each vertical screen video in a plurality of vertical screen videos to be cut based on the attribute values of the video frames;
determining a time point corresponding to each key frame;
writing the time point of the key frame into a preset file;
storing the preset file;
receiving a cutting instruction, and analyzing a time range from the cutting instruction;
scanning the time points recorded in the preset file;
acquiring time difference values between time points corresponding to two adjacent key frames in a current vertical screen video to be cut to obtain a plurality of time difference values;
judging whether the time difference value between the corresponding time points of two adjacent key frames in the current vertical screen video to be cut is within the time range;
if so, extracting the video content between the adjacent key frames from the vertical screen video so as to cut the vertical screen video.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the program when executed by a processor implements the method for cropping a batch of portrait videos of any one of claims 1-4.
CN201710521560.5A 2017-06-30 2017-06-30 Method and device for shearing batch vertical screen videos and electronic equipment Active CN107197372B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710521560.5A CN107197372B (en) 2017-06-30 2017-06-30 Method and device for shearing batch vertical screen videos and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710521560.5A CN107197372B (en) 2017-06-30 2017-06-30 Method and device for shearing batch vertical screen videos and electronic equipment

Publications (2)

Publication Number Publication Date
CN107197372A CN107197372A (en) 2017-09-22
CN107197372B true CN107197372B (en) 2019-12-27

Family

ID=59881687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710521560.5A Active CN107197372B (en) 2017-06-30 2017-06-30 Method and device for shearing batch vertical screen videos and electronic equipment

Country Status (1)

Country Link
CN (1) CN107197372B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111277915B (en) * 2018-12-05 2022-08-12 阿里巴巴集团控股有限公司 Video conversion method and device
CN112165635A (en) * 2020-10-12 2021-01-01 北京达佳互联信息技术有限公司 Video conversion method, device, system and storage medium
CN112351308A (en) * 2020-10-30 2021-02-09 杭州当虹科技股份有限公司 Method for realizing rapid transcoding based on local transcoding technology

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104079981A (en) * 2013-03-25 2014-10-01 联想(北京)有限公司 Data processing method and data processing device
CN104185077A (en) * 2014-09-12 2014-12-03 飞狐信息技术(天津)有限公司 Video editing method and device
CN105323653A (en) * 2014-08-05 2016-02-10 方正国际软件(北京)有限公司 Method and equipment for playing video clip
CN105872675A (en) * 2015-12-22 2016-08-17 乐视网信息技术(北京)股份有限公司 Method and device for intercepting video animation
CN105933773A (en) * 2016-05-12 2016-09-07 青岛海信传媒网络技术有限公司 Video editing method and system
CN106803992A (en) * 2017-02-14 2017-06-06 北京时间股份有限公司 Video clipping method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2861213B2 (en) * 1990-03-13 1999-02-24 ソニー株式会社 Image display device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104079981A (en) * 2013-03-25 2014-10-01 联想(北京)有限公司 Data processing method and data processing device
CN105323653A (en) * 2014-08-05 2016-02-10 方正国际软件(北京)有限公司 Method and equipment for playing video clip
CN104185077A (en) * 2014-09-12 2014-12-03 飞狐信息技术(天津)有限公司 Video editing method and device
CN105872675A (en) * 2015-12-22 2016-08-17 乐视网信息技术(北京)股份有限公司 Method and device for intercepting video animation
CN105933773A (en) * 2016-05-12 2016-09-07 青岛海信传媒网络技术有限公司 Video editing method and system
CN106803992A (en) * 2017-02-14 2017-06-06 北京时间股份有限公司 Video clipping method and device

Also Published As

Publication number Publication date
CN107197372A (en) 2017-09-22

Similar Documents

Publication Publication Date Title
US10638166B2 (en) Video sharing method and device, and video playing method and device
US10834424B2 (en) Method and device for compressing image, and electronic device
CN107197372B (en) Method and device for shearing batch vertical screen videos and electronic equipment
US10601891B2 (en) Cloud streaming service system and cloud streaming service method for utilizing an optimal GPU for video decoding based on resource conditions, and apparatus for the same
CN105469381B (en) Information processing method and terminal
CN110166795B (en) Video screenshot method and device
WO2017202175A1 (en) Method and device for video compression and electronic device
US20190114989A1 (en) Systems and methods for image optimization
CN103702032A (en) Image processing method, device and terminal equipment
US20160026728A1 (en) Interaction Method And Device Between Browsers And Browser
KR20210090259A (en) Video decoding control method, apparatus, electronic device and storage medium
US20150256789A1 (en) Method, apparatus and terminal for playing multimedia content
US9380259B2 (en) Information processing device and information processing method
US20170161871A1 (en) Method and electronic device for previewing picture on intelligent terminal
US9076207B1 (en) Image processing method, system and electronic device
CN109660852B (en) Video preview method, storage medium, device and system before release of recorded video
KR100780057B1 (en) Device for detecting gradual shot conversion in moving picture and method for operating the device
CN110868632B (en) Video processing method and device, storage medium and electronic equipment
CN109710783B (en) Picture loading method and device, storage medium and server
CN103347151B (en) A kind of image processing method, device and terminal
US20150106697A1 (en) Method and electronic device for processing e-book document
CN106598371B (en) Information display method and equipment
US20170168662A1 (en) Display Method and Electronic Device for Rapidly Positioning Play Time Point
RU2690888C2 (en) Method, apparatus and computing device for receiving broadcast content
CN115690662B (en) Video material generation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant