CN111554328A - Multimedia editing method and device - Google Patents

Multimedia editing method and device Download PDF

Info

Publication number
CN111554328A
CN111554328A CN202010247680.2A CN202010247680A CN111554328A CN 111554328 A CN111554328 A CN 111554328A CN 202010247680 A CN202010247680 A CN 202010247680A CN 111554328 A CN111554328 A CN 111554328A
Authority
CN
China
Prior art keywords
file
editing
multimedia
target
splicing
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.)
Granted
Application number
CN202010247680.2A
Other languages
Chinese (zh)
Other versions
CN111554328B (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 QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202010247680.2A priority Critical patent/CN111554328B/en
Publication of CN111554328A publication Critical patent/CN111554328A/en
Application granted granted Critical
Publication of CN111554328B publication Critical patent/CN111554328B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B27/00Editing; Indexing; Addressing; Timing or synchronising; Monitoring; Measuring tape travel
    • G11B27/02Editing, e.g. varying the order of information signals recorded on, or reproduced from, record carriers
    • G11B27/031Electronic editing of digitised analogue information signals, e.g. audio or video signals

Landscapes

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

Abstract

The embodiment of the invention provides a multimedia editing method and a multimedia editing device, wherein the method is applied to a browser and comprises the following steps: loading a preset executable file; calling the executable file to load a preset translation library file and generating a multimedia coding and decoding library example corresponding to the translation library file; the translation library file is obtained by translating a preset original library file; and responding to an editing instruction sent by a user, and editing the multimedia file corresponding to the editing instruction by adopting the multimedia coding and decoding library example. The multimedia editing method of the embodiment of the invention provides a multimedia editing function for a browser. And by responding to an editing instruction sent by a user, the multimedia file corresponding to the editing instruction is edited by adopting the multimedia coding and decoding library example, so that the multimedia file can be edited in a browser without additionally installing multimedia editing software, and the convenience of the user for editing the multimedia file is improved.

Description

Multimedia editing method and device
Technical Field
The present invention relates to the technical field of multimedia processing, and in particular, to a multimedia editing method and a multimedia editing apparatus.
Background
In recent years, with the development of mobile communication technology, the data transmission speed has been greatly upgraded. The user can conveniently adopt the mobile terminal equipment to transmit media data such as music, video and the like. In addition, the user can record music and shoot videos through the mobile terminal device, generate media data and share the media data to the network platform.
Generally, before sharing media data, a user generally performs editing operations such as cutting and splicing on the media data. In order to edit media data, a user needs to install software having a media editing function. If the user does not install software having a media editing function, the media data cannot be processed.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a multimedia editing method and a corresponding multimedia editing apparatus that overcome or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present invention discloses a multimedia editing method, which is applied to a browser, and the method includes:
loading a preset executable file;
calling the executable file to load a preset translation library file and generating a multimedia coding and decoding library example corresponding to the translation library file; the translation library file is obtained by translating a preset original library file;
and responding to an editing instruction sent by a user, and editing the multimedia file corresponding to the editing instruction by adopting the multimedia coding and decoding library example.
Optionally, the executable file comprises a file management function and an editing function;
the step of responding the editing instruction sent by the user and editing the multimedia file corresponding to the editing instruction by adopting the multimedia coding and decoding library instance comprises the following steps:
responding to an editing instruction sent by a user, and calling the file management function to acquire a multimedia file corresponding to the editing instruction;
and responding to the editing instruction, calling the editing function and editing the multimedia file by adopting the multimedia coding and decoding library example.
Optionally, the executable file further includes an interface generation function, and the method further includes:
calling the interface generating function to generate a user interface containing a time shaft assembly; the time axis component is used for displaying the duration information of the multimedia file by adopting a preset time axis and acquiring an editing instruction of a user.
Optionally, the executable file further includes a parsing function, and the method further includes:
and calling the analysis function to analyze the multimedia file to acquire the duration information of the multimedia file.
Optionally, the editing function comprises a clipping function;
the step of responding the editing instruction, calling an editing function and editing the multimedia file by adopting the multimedia coding and decoding library example comprises the following steps:
responding to the editing instruction, and determining a starting time point and an ending time point based on the duration information;
and calling a cutting function, cutting the multimedia file based on the starting time point and the ending time point by adopting the multimedia coding and decoding library example, and obtaining a target editing file.
Optionally, before the step of calling a clipping function, clipping the multimedia file based on the starting time point and the ending time point by using the multimedia coding and decoding library instance, and obtaining a target editing file, the method further includes:
modifying the starting time point and/or the ending time point in response to the editing instruction.
Optionally, the editing function further includes a splicing function;
the step of responding the editing instruction, calling an editing function, and editing the multimedia file by adopting the multimedia coding and decoding library instance further comprises:
responding to an editing instruction sent by a user, and generating editing record information; the editing record information comprises splicing start time point information and splicing end time point information of at least two target files; the target file is a target editing file and/or a multimedia file;
determining the time sequence of at least two target files based on the splicing start time point information and the splicing end time point information of the at least two target files;
and calling the splicing function, and splicing at least two target files into a spliced editing file according to the time sequence of at least two target files by adopting the multimedia coding and decoding library example.
Optionally, before the step of calling the splicing function, adopting the multimedia codec library instance, and splicing at least two target files into a spliced edited file according to the time sequence of the at least two target files, the method further includes:
determining whether splicing start time point information of at least one target file is earlier than splicing end time point information of other target files;
if the splicing start time point information of at least one target file is earlier than the splicing end time point information of other target files, overlapping exists between the target file and the other target files;
deleting the target files with the overlap, or deleting the other target files with the overlap.
Optionally, before the step of calling the splicing function, adopting the multimedia codec library instance, and splicing at least two target files into a spliced edited file according to the time sequence of the at least two target files, the method further includes:
determining whether a blank time segment without the target file exists or not by adopting the splicing start time point information and the splicing end time point information of the at least two target files in the editing record information;
and if the blank time segment without the target file exists, adjusting the splicing start time point information and the splicing end time point information of the target file in the editing record information until the blank time segment without the target file does not exist.
Optionally, the step of calling the splicing function, splicing at least two target files into a spliced edited file according to a time sequence of the at least two target files by using the multimedia codec library instance, includes:
determining the maximum height and the maximum width of the resolution in the at least two target files based on the height and the width of the resolution of the target files, and taking the maximum height and the maximum width as the target height and the target width of the resolution of the splicing editing file;
and calling the splicing function, adopting the multimedia coding and decoding library example, splicing at least two target files into a spliced editing file according to the time sequence of at least two target files and adopting the target height and the target width.
The embodiment of the invention also discloses a multimedia editing device, which is applied to a browser, and the device comprises:
the loading module is used for loading a preset executable file;
the calling module is used for calling the executable file to load a preset translation library file and generating a multimedia coding and decoding library instance corresponding to the translation library file; the translation library file is obtained by translating a preset original library file;
and the editing module is used for responding to an editing instruction sent by a user and editing the multimedia file corresponding to the editing instruction by adopting the multimedia coding and decoding library example.
Optionally, the executable file comprises a file management function and an editing function;
the editing module comprises:
the file acquisition submodule is used for responding to an editing instruction sent by a user and calling the file management function to acquire a multimedia file corresponding to the editing instruction;
and the editing submodule is used for responding to the editing instruction and calling the editing function to edit the multimedia file by adopting the multimedia coding and decoding library example.
Optionally, the executable file further includes an interface generating function, and the apparatus further includes:
the interface generation module is used for calling the interface generation function and generating a user interface containing a time shaft assembly; the time axis component is used for displaying the duration information of the multimedia file by adopting a preset time axis and acquiring an editing instruction of a user.
Optionally, the executable file further includes a parsing function, and the apparatus further includes:
and the duration acquisition module is used for calling the analysis function to analyze the multimedia file and acquiring the duration information of the multimedia file.
Optionally, the editing function comprises a clipping function;
the editing sub-module comprises:
the time point determining unit is used for responding to the editing instruction and determining a starting time point and an ending time point based on the duration information;
and the editing unit is used for calling a cutting function, cutting the multimedia file based on the starting time point and the ending time point by adopting the multimedia coding and decoding library example, and obtaining a target editing file.
Optionally, the editing sub-module further includes:
and the modifying unit is used for responding to the editing instruction and modifying the starting time point and/or the ending time point.
Optionally, the editing function further includes a splicing function;
the editing sub-module further comprises:
the record generating unit is used for responding to an editing instruction sent by a user and generating editing record information; the editing record information comprises splicing start time point information and splicing end time point information of at least two target files; the target file is a target editing file and/or a multimedia file;
the sequence determining unit is used for determining the time sequence of at least two target files based on the splicing start time point information and the splicing end time point information of the at least two target files;
and the splicing unit is used for calling the splicing function, adopting the multimedia coding and decoding library example, and splicing at least two target files into a spliced editing file according to the time sequence of the at least two target files.
Optionally, the editing sub-module further includes:
a splicing time point determining unit, configured to determine whether there is splicing start time point information of at least one of the target files that is earlier than splicing end time point information of other target files;
an overlap determining unit, configured to determine that there is an overlap between the target file and another target file if there is at least one piece of splicing start time point information of the target file that is earlier than splicing end time point information of another target file;
and the deleting unit is used for deleting the target file with the overlap or deleting the other target files with the overlap.
Optionally, the editing sub-module further includes:
a blank time period determining unit, configured to determine whether a blank time segment without the target file exists by using the splicing start time point information and the splicing end time point information of the at least two target files in the editing record information;
and the splicing time point adjusting unit is used for adjusting the splicing start time point information and the splicing end time point information of the target file in the editing record information if the blank time segment without the target file exists until the blank time segment without the target file does not exist.
Optionally, the splicing unit comprises:
a width and height determining subunit, configured to determine, based on the height and width of the resolution of the target file, a maximum height and a maximum width of the resolution in the at least two target files, and use the maximum height and the maximum width as a target height and a target width of the resolution of the splicing editing file;
and the splicing subunit is used for calling the splicing function, adopting the multimedia coding and decoding library example, and splicing at least two target files into a spliced editing file according to the time sequence of the at least two target files and adopting the target height and the target width.
The embodiment of the invention also discloses electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory finish mutual communication through the communication bus;
a memory for storing a computer program;
the processor is configured to implement the method steps of any of the embodiments of the present invention when executing the program stored in the memory.
Embodiments of the invention also disclose one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform one or more of the methods described in embodiments of the invention.
The embodiment of the invention has the following advantages:
according to the multimedia editing method provided by the embodiment of the invention, the preset original library file is translated to obtain the translation library file, the executable file is called to load the preset translation library file, and the multimedia coding and decoding library example corresponding to the translation library file is generated, so that the multimedia editing function is provided for the browser. And by responding to an editing instruction sent by a user, the multimedia file corresponding to the editing instruction is edited by adopting the multimedia coding and decoding library example, so that the multimedia file can be edited in a browser without additionally installing multimedia editing software, and the convenience of the user for editing the multimedia file is improved.
Drawings
FIG. 1 is a flow chart of steps of an embodiment of a method for editing multimedia according to the present invention;
FIG. 2 is a flow chart of steps in another embodiment of a method for editing multimedia in accordance with the present invention;
fig. 3 is a block diagram of an embodiment of a multimedia editing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a multimedia editing method according to an embodiment of the present invention is shown, where the method is applied to a browser. And under the condition that the terminal is not provided with editing software, the multimedia is edited through the browser.
The method may specifically comprise the steps of:
step 101, loading a preset executable file;
in the embodiment of the present invention, a browser may be preset in the electronic device, and the browser may acquire and display resources from the internet, a local area network, and a local file system. The electronic device may be a desktop computer, a notebook computer, a tablet computer, a mobile phone, a television, a smart watch, and the like, which is not limited in this respect.
In the embodiment of the present invention, the browser may obtain the executable file from the internet, or a local area network, or a local file system. Specifically, a network address of the internet or a local area network may be input in the browser, and the browser receives data returned by a network node corresponding to the network address, so as to obtain the executable file. Data in a local file system can also be opened in the browser, so that an executable file is obtained.
In the embodiment of the present invention, the browser may load the executable file. The executable file may be used to provide multimedia editing functions for the browser.
In the embodiment of the present invention, the multimedia file may include a video file and an audio file.
As an example of the present invention, the executable file may be a JavaScript execution file, and a network address of the internet may be input in the browser, so that the browser may obtain the JavaScript execution file from a network node corresponding to the network address, and the browser may load the JavaScript execution file.
Step 102, calling the executable file to load a preset translation library file and generating a multimedia coding and decoding library instance corresponding to the translation library file; the translation library file is obtained by translating a preset original library file;
in an embodiment of the present invention, the translation library file is a library file translated for multimedia codec. The translation library file is obtained by translating a preset original library file. The original library file is an untranslated library file for multimedia codec.
In the embodiment of the present invention, the browser cannot load the original library file, so that the browser cannot implement the function of multimedia coding by using the original library file. Therefore, the original library file can be translated, and the original library file is translated into a language form which can be understood by the executable file, so that the translation library file is obtained. The browser can call the executable file, and the executable file can load the translation library file and generate the multimedia codec library instance corresponding to the translation library file. So that the browser can use the multimedia editing function provided by the multimedia codec library instance.
In a specific implementation, the executable file may load the translation library file from the internet, or a local area network, or a local file system. Then, an instantiation function can be included in the executable file, and the instantiation function can generate a multimedia codec library instance corresponding to the translation library file in the browser by instantiating the translation library file.
In a specific implementation, when the browser obtains the executable file and the translation library file from the internet, the multimedia editing can be realized through the browser without installing different multimedia editing software in different types of electronic devices respectively, or without storing the executable file and the translation library file in the electronic devices in advance, so that a user can edit multimedia in various types of electronic devices simply and conveniently.
As an example of the present invention, the original library file may be an FFmpeg codec library file. The FFmpeg codec library file is written by adopting a C language or a C + + language. The JavaScript execution file cannot directly call the FFmpeg codec library file. Therefore, the FFmpeg codec library file can be translated by adopting a WebAssembly technology to obtain a translation library file. The translation library file may be a wasm file. The JavaScript execution file can comprise a JavaScript glue joint code (glue code), and can load the translation library file compiled based on WebAssembly through the JavaScript glue joint code, and generate a multimedia coding and decoding library instance corresponding to the translation library file in the browser by adopting an instantiation function. Therefore, the browser can edit the multimedia file by using the FFmpeg codec library in the browser by loading the JavaScript execution file.
And 103, responding to an editing instruction sent by a user, and editing the multimedia file corresponding to the editing instruction by using the multimedia coding and decoding library example.
In the embodiment of the present invention, the user may send an editing instruction to the browser. The editing instructions may be used to call a multimedia file and edit the multimedia file.
In the embodiment of the present invention, the browser may obtain the editing instruction sent by the user through an input device connected to the electronic device where the browser is located, such as a keyboard, a mouse, a camera, a microphone, and the like. For example, a user can input a preset character combination through a keyboard and send an editing instruction to a browser; a user can click a preset position in an interface of the browser through a mouse and send an editing instruction to the browser; the user can send an editing instruction to the browser by making a preset action in the shooting range of the camera. The user can input preset sentences through the microphone and send editing instructions to the browser.
In the embodiment of the present invention, the browser may also obtain the editing instruction through another electronic device in communication with the electronic device where the browser is located. The other electronic devices may be a server, a mobile phone, a tablet computer, a desktop computer, a television, a smart watch, and the like. The browser can acquire the editing instructions sent by the other electronic equipment in a wired network, a wireless network, a mobile communication network, Bluetooth communication, near field communication and other modes.
In the embodiment of the present invention, the browser may respond to the editing instruction, invoke the multimedia codec library instance, and perform editing actions such as cutting and splicing on the multimedia file corresponding to the editing instruction, thereby implementing editing on the multimedia file in the browser.
As an example of the present invention, the editing instruction may specifically include cutting the multimedia, splicing the multimedia file, and converting a format of the multimedia file, which is not limited by the present invention.
In the embodiment of the invention, after the browser finishes editing the multimedia file, the browser can also upload the edited multimedia file to the sharing server, and the user publishes the edited multimedia file from the sharing server, so that the user can finish editing and publishing the multimedia file in the browser, and the convenience of publishing the multimedia work by the user is improved.
According to the multimedia editing method provided by the embodiment of the invention, the preset original library file is translated to obtain the translation library file, the executable file is called to load the preset translation library file, and the multimedia coding and decoding library example corresponding to the translation library file is generated, so that the multimedia editing function is provided for the browser. And by responding to an editing instruction sent by a user, the multimedia file corresponding to the editing instruction is edited by adopting the multimedia coding and decoding library example, so that the multimedia file can be edited in a browser without additionally installing multimedia editing software, and the convenience of the user for editing the multimedia file is improved.
Referring to fig. 2, a flowchart illustrating steps of another embodiment of a multimedia editing method according to an embodiment of the present invention is shown, where the method is applied to a browser, and specifically includes the following steps:
step 201, loading a preset executable file;
in the embodiment of the present invention, a browser may be preset in the electronic device, and the browser may acquire and display resources from the internet, a local area network, and a local file system. The electronic device may be a desktop computer, a notebook computer, a tablet computer, a mobile phone, a television, a smart watch, and the like, which is not limited in this respect.
In the embodiment of the present invention, the browser may obtain the executable file from the internet, or a local area network, or a local file system. Specifically, a network address of the internet or a local area network may be input in the browser, and the browser receives data returned by a network node corresponding to the network address, so as to obtain the executable file. Data in a local file system can also be opened in the browser, so that an executable file is obtained.
In the embodiment of the present invention, the browser may load the executable file. The executable file may be used for multimedia editing. So that the browser can have a multimedia editing function.
In the embodiment of the present invention, the multimedia file may include a video file and an audio file.
In an optional embodiment of the present invention, the executable file further includes an interface generating function, and the method may further include:
substep S11, calling the interface generating function to generate a user interface containing a time shaft assembly; the time axis component is used for displaying the duration information of the multimedia file by adopting a preset time axis and acquiring an editing instruction of a user.
In an embodiment of the present invention, the interface generating function may be used to generate a user interface in a browser. The browser may call an interface generation function in the executable file to generate a user interface in the browser, where the user interface may be an interface for displaying a multimedia editing component.
In the embodiment of the present invention, the user interface may include a time axis module, and the time axis module may be configured to display the duration information of the multimedia file by using a preset time axis and obtain an editing instruction of a user.
In the embodiment of the invention, a user can load at least one multimedia file by using the browser. The loaded multimedia file may have duration information. The duration information may be used to indicate a length of time of the multimedia file. A time shaft assembly may be provided in the user interface. The time shaft assembly can be used for displaying the duration information of the multimedia file in a time shaft mode.
Optionally, when the multimedia file is a video, the time axis assembly may further select a frame image corresponding to at least one time point in the multimedia file, and display the frame image in the time axis assembly, so that a user can edit the video file more clearly.
In this embodiment of the present invention, the user interface may further include a multimedia adding/removing component for adding or deleting a multimedia file, a multimedia presentation component for presenting the multimedia file and attribute information of the multimedia file, and the like, which is not limited in this invention.
In the embodiment of the invention, a user can send an instruction to the browser by performing actions such as clicking and sliding on the user interface or inputting information on the user interface. The instructions may include multimedia loading instructions, editing instructions, removing instructions, etc., which are not limited in this respect.
Thus, the user performs an action on the timeline assembly on the user interface, thereby generating editing instructions for editing the multimedia file. The time shaft assembly can acquire the editing instruction, and the browser responds to the editing instruction to perform corresponding processing on the multimedia file.
Step 202, calling the executable file to load a preset translation library file and generating a multimedia coding and decoding library instance corresponding to the translation library file; the translation library file is obtained by translating a preset original library file;
in an embodiment of the present invention, the translation library file is a library file translated for multimedia codec. The translation library file is obtained by translating a preset original library file. The original library file is an untranslated library file for multimedia codec.
In the embodiment of the present invention, the browser cannot load the original library file, so that the browser cannot implement the function of multimedia coding by using the original library file. Therefore, the original library file can be translated, and the original library file is translated into a language form which can be understood by the executable file, so that the translation library file is obtained. The browser can call the executable file, and the executable file can load the translation library file and generate the multimedia codec library instance corresponding to the translation library file. So that the browser can use the multimedia editing function provided by the multimedia codec library instance.
In a specific implementation, the executable file may load the translation library file from the internet, or a local area network, or a local file system. Then, an instantiation function can be included in the executable file, and the instantiation function can generate a multimedia codec library instance corresponding to the translation library file in the browser by instantiating the translation library file.
In a specific implementation, when the browser obtains the executable file and the translation library file from the internet, the multimedia editing can be realized through the browser without installing different multimedia editing software in different types of electronic devices respectively, or without storing the executable file and the translation library file in the electronic devices in advance, so that a user can edit multimedia in various types of electronic devices simply and conveniently.
In particular implementations, a work process may be created while the executable file is loaded. The work processes may be used to process computationally intensive or high latency tasks. The working process may be employed to asynchronously load the multimedia codec library instances and handle the computationally intensive or highly delayed tasks resulting from subsequent editing operations of the multimedia file.
Step 203, responding to an editing instruction sent by a user, and calling the file management function to acquire a multimedia file corresponding to the editing instruction;
in the embodiment of the invention, the browser can acquire the editing instruction sent by the user. The editing instruction is used for calling a multimedia file and editing the multimedia file.
In the embodiment of the present invention, the browser may obtain the editing instruction sent by the user through an input device connected to the electronic device where the browser is located, such as a keyboard, a mouse, a camera, a microphone, and the like. For example, a user can input a preset character combination through a keyboard and send an editing instruction to a browser; a user can click a preset position in an interface of the browser through a mouse and send an editing instruction to the browser; the user can send an editing instruction to the browser by making a preset action in the shooting range of the camera. The user can input preset sentences through the microphone and send editing instructions to the browser.
In the embodiment of the present invention, the browser may also obtain the editing instruction through another electronic device in communication with the electronic device where the browser is located. The other electronic devices may be a server, a mobile phone, a tablet computer, a desktop computer, a television, a smart watch, and the like. The browser can acquire the editing instructions sent by the other electronic equipment in a wired network, a wireless network, a mobile communication network, Bluetooth communication, near field communication and other modes.
In an embodiment of the present invention, the browser may display a user interface, and the user interface may be an interface for displaying a multimedia editing component. The browser can call the multimedia file and edit the multimedia file in response to an editing instruction acted on the user interface by a user.
In an embodiment of the invention, the executable file comprises a file management function. The file management function can be used for managing multimedia files needing to be edited.
In the embodiment of the present invention, the browser may create a virtual workspace in a memory of the electronic device by using the file management function, where the virtual workspace may be used to store a multimedia file acquired from the outside and to store an edited file.
As an example of the present invention, the file management function may include fs.
In the embodiment of the invention, the browser can respond to the editing instruction sent by the user, call the file management function, acquire the multimedia file from the storage space of the electronic equipment or the internet and other positions, and store the multimedia file in the virtual working area, thereby realizing the acquisition of the multimedia file corresponding to the editing instruction.
As an example of the present invention, the file management function may include fs.
As an example of the present invention, the file management function may include fs.mount (files, path), where the file management function is used to copy the multimedia files in the designated folder to the virtual workspace with the path as path, so as to facilitate subsequent editing of the multimedia files.
And 204, responding to the editing instruction, calling the editing function and editing the multimedia file by adopting the multimedia coding and decoding library example.
In an embodiment of the present invention, the executable file may include an edit function. The editing function may be used to edit multimedia files.
In the embodiment of the present invention, the browser may respond to the editing instruction to call the editing function, and the editing function may be a function provided by the multimedia codec library instance. Therefore, the browser can edit the multimedia file by calling the editing function to adopt the multimedia coding and decoding library instance.
As an example of the present invention, the editing instruction may specifically include cutting the multimedia, splicing the multimedia file, and converting a format of the multimedia file, which is not limited by the present invention.
In an optional embodiment of the present invention, the executable file may further include a parsing function, and the method may further include:
and a substep S21, calling the analysis function to analyze the multimedia file, and acquiring the duration information of the multimedia file.
In this embodiment of the present invention, the parsing function may be used to obtain attribute information of a multimedia file, where the attribute information of the multimedia file may include duration information, media type information, average bit rate information, pixel format information, resolution information, sampling rate information, channel number information, and the like, which is not limited in this respect.
In the embodiment of the present invention, the parsing function may be a function provided by the multimedia codec library instance. The browser can then parse the multimedia file using the multimedia codec library instance by calling the parsing function. The browser can call the analysis function to analyze the multimedia file, and acquire the duration information of the multimedia file, so as to further edit the multimedia file based on the duration information.
As an example of the present invention, the parsing function may include FFmpeg. The instruction avformat _ open _ input () is used for acquiring a FormatCtx object of the multimedia file, analyzing the FormatCtx object into a JSON form as a return value of a function, and transmitting the return value to the JavaScript executable file for processing.
The format ctx object may include duration information (duration), a media type (codec _ type), and an average bit rate (bit _ rate), among others. If the multimedia file is a video, the FormatCtx object may further include a width (width), a height (height), and a pixel format (pix _ fmt). If the multimedia file is audio, the format ctx object may further include a sampling rate (sample _ rate) and a channel number (channels).
In an embodiment of the present invention, the browser may display a user interface, which may be an interface that presents components for multimedia editing. The user interface may present attribute information of the multimedia file. The user interface can comprise a time axis component, and the browser can adopt the time axis component to display the duration information of the multimedia file in a time axis form on the user interface after acquiring the duration information of the multimedia file.
Optionally, when the multimedia file is a video, the time axis assembly may further select a frame image corresponding to at least one time point in the multimedia file, and display the frame image in the time axis assembly, so that a user can edit the video file more clearly.
In an alternative embodiment of the invention, the editing function comprises a cut function;
the step of responding to the editing instruction, calling an editing function, and editing the multimedia file by using the multimedia coding and decoding library instance may include:
a substep S31, determining a starting time point and an ending time point based on the duration information in response to the editing instruction;
in the embodiment of the present invention, the editing instruction may be used to cut the multimedia file to obtain a target editing file. The browser may determine, in response to the edit instruction, based on the duration information, that the user wishes to obtain at least one target edit file of the at least one multimedia file, and determine a start time point and an end time point of the target edit file. The starting time point may be a starting time point of the target edit file in the multimedia file. The end time point may be an end time point of the target edit file in the multimedia file.
In the embodiment of the present invention, the browser may generate the editing log information through the executable file. The editing record information may include duration information, path information, start time point information, and end time point information of the target editing file, so that the multimedia file is cut by using the editing record information in the following.
In this embodiment of the present invention, the edit instruction may include a start time and an end time of the target edit file, so that the browser may directly determine the start time point and the end time point according to the edit instruction.
In an embodiment of the present invention, the browser may display a user interface, and the user interface may be an interface for displaying a multimedia editing component. The user interface may include a time axis component, and the browser may adopt the time axis component to display the duration information of the multimedia file in the form of a time axis on the user interface. The user can click, slide and the like on the timeline component to select the starting time and the ending time of the target editing file in the multimedia file. The browser can acquire an editing instruction acted on the timeline component by a user, and determine a starting time point and an ending time point based on the duration information.
And a substep S32 of calling a cutting function, cutting the multimedia file based on the starting time point and the ending time point by adopting the multimedia coding and decoding library example, and obtaining a target editing file.
In an embodiment of the present invention, the editing function may include a cropping function. The cropping function may be used to crop the multimedia file and output a target edit file.
In the embodiment of the present invention, the browser may call a clipping function in the executable file, clip the multimedia file based on the start time point information and the end time point information in the editing record information by using the multimedia codec library instance, and output a new multimedia file, thereby obtaining the target editing file.
In the embodiment of the present invention, the browser may store the target editing file in a virtual workspace, so as to facilitate a user to further process the target editing file. The browser can also store the target edit file to a path of a storage space in the electronic device specified by the user.
As an example of the present invention, the clipping function may be ffmpeg. The multimedia file can be cut and stored according to the specified start time and end time by calling an instruction 'FFmpeg-ivideoPath-vocodecopy-sstart-topdata' provided by an FFmpeg multimedia codec library. Wherein "videoPath" represents a file path of the multimedia file; "start" represents the start time of the multimedia file cut in the format "HH-mm-ss"; "end" represents the end time of the multimedia file cut in the format "HH-mm-ss"; "outputPath" represents a saving path of a target editing file generated after the multimedia file is cut.
In an optional embodiment of the present invention, before the step of calling a clipping function, using the multimedia codec library instance, and clipping the multimedia file based on the starting time point and the ending time point to obtain the target edit file, the method further includes:
and a substep S41 of modifying the start time point and/or the end time point in response to the edit command.
In the embodiment of the present invention, the edit instruction may be further configured to modify the start time point and/or the end time point.
In an embodiment of the present invention, the browser may display a user interface, and the user interface may be an interface for displaying a multimedia editing component. The user interface may include a time axis component, and the browser may adopt the time axis component to display the duration information of the multimedia file in the form of a time axis on the user interface. The user can click, slide, etc. on the timeline component to modify the start and end time points.
In the embodiment of the present invention, the edit instruction may include a modified start time point and/or an end time point. The browser may modify a start time point and/or an end time point in response to the modification instruction and record the new start time point and/or end time point in the edit recording information.
In an optional embodiment of the present invention, the editing function further includes a splicing function;
the step of responding the editing instruction, calling an editing function, and editing the multimedia file by adopting the multimedia coding and decoding library instance further comprises:
the method further comprises the following steps:
a substep S51 of generating edit record information in response to an edit instruction sent by a user; the editing record information comprises splicing start time point information and splicing end time point information of at least two target files; the target file is a target editing file and/or a multimedia file;
in an embodiment of the present invention, the editing instruction may be used to merge at least two target files. The target file may be a clipped target edit file, and/or an uncut multimedia file.
In an embodiment of the present invention, the browser may display a user interface, and the user interface may be an interface for displaying a multimedia editing component. The user interface may include a timeline assembly. The time axis assembly can comprise a splicing editing file time axis. The splicing editing file time axis can be used for displaying the duration information, the splicing start time point information and the splicing end time point information of the target file in the splicing editing file to be spliced, so that the user can preview the splicing editing file and adjust and modify the target file. And the user can operate the target file on the time shaft component. For example, a user may create a splicing editing file timeline in the user interface by clicking; a user can add a target file to the time axis of the spliced editing file through dragging operation or clicking operation; the splicing starting time point and the splicing ending time point of the target file can be adjusted through dragging operation; the target file on the time axis of the spliced editing file can be deleted through dragging operation or clicking operation.
In the embodiment of the present invention, the browser may generate the editing log information by using the executable file in response to the editing instruction. The editing record information may further include duration information, path information, splicing start time point information, and splicing end time point information of at least two of the target files. Therefore, the editing record information can be adopted to record the operation of the user on the target file, and the target file can be spliced conveniently by adopting the editing record information subsequently. The splicing start time point information may be a start time point of the target file in the spliced edited file after splicing is completed, and the splicing end time point information may be an end time point of the target file in the spliced edited file after splicing is completed.
In a specific implementation, the browser may respond to an editing instruction sent by a user after calling the parsing function to parse the multimedia file and obtain the duration information of the multimedia file, and generate editing record information by using the executable file; in this case, the edit recording information may include splicing start time point information and splicing end time point information of at least two of the multimedia files.
In a specific implementation, the browser may also generate editing record information by using the executable file in response to an editing instruction sent by a user after calling a cutting function, using the multimedia codec library instance, and cutting the multimedia file based on the start time point and the end time point to obtain a target editing file; the editing record information comprises splicing start time point information and splicing end time point information of at least two target files. In this case, the at least two object files may be at least two multimedia files, at least two object files, at least one multimedia file and at least one object file.
And a sub-step S51 of determining a time sequence of at least two of the target files based on the splicing start time point information and the splicing end time point information of at least two of the target files.
In the embodiment of the present invention, the time sequence of at least two target files may be determined by using the splicing start time point information and the splicing end time point information of at least two target files in the editing record information.
Specifically, if the splicing start time point information of a target file is earlier than the splicing start time point information of another target file, and/or the splicing end time point information of the target file is earlier than the splicing end time point information of another target file, the time sequence of the target file may be considered to be before the another target file. Thereby, a time-based sequence of the at least two object files can be obtained, thereby obtaining a time sequence of the at least two object files.
And a substep S52, calling the splicing function, and splicing at least two target files into a spliced editing file according to the time sequence of the at least two target files by using the multimedia coding and decoding library instance.
In the embodiment of the present invention, the splicing function may be configured to splice a plurality of target files, and merge the plurality of target files into one spliced editing file. The splicing function may be a function provided by the multimedia codec library instance. Therefore, the browser can adopt a multimedia coding and decoding library example to splice at least two target files by calling the splicing function to obtain a spliced editing file.
As an example of the present invention, the splicing function may be fft, generatevideo (video files, width, height, outputPath), which can splice at least two target files into one splicing editing file according to an array arrangement order. The array arrangement order may be determined based on the time order. Afterwards, a function FFmpeg-generatevideo (video files, width, height, outputPath) can call an instruction "FFmpeg-iconcat: 1.ts |2.ts |3.ts |. n.ts-swidthheight-acodec copy-absfac _ addtoscopitputpath" provided by the FFmpeg multimedia codec library to splice at least two target files to obtain a spliced editing file. Wherein, "1. ts |2.ts |3.ts |. | - | n.ts" represents a character string composed of paths of target files read in the virtual work area; the 'width' represents the resolution of the generated splicing editing file, and is formed by splicing the width and the height in the entry function parameter, and the 'outputPath' represents the saving path of the generated splicing editing file.
As an example of the present invention, before the target file is spliced by using the splicing function, the target file may be transcoded by using a video transcoding function ffmpeg. Codec video (video path, output path) may call an instruction "FFmpeg-ivideoPath-vocodecopy-acodec copy-vbsf h264_ mp4 toannexboutputPath" provided by an FFmpeg multimedia codec library to implement transcoding of a target file, wherein "video path" represents a file path of an un-transcoded target file; "outputPath" represents a save path of a new target file generated after transcoding.
In addition, according to actual needs, a video transcoding function may be adopted to transcode the spliced editing file, the target clip file, and the multimedia file into mp4, avi, flv, mov, and other formats, which is not limited in the present invention.
In an optional embodiment of the present invention, before the step of calling the splicing function, adopting the multimedia codec library instance, and splicing at least two target files into a spliced edited file according to a time sequence of the at least two target files, the method further includes:
a substep S61 of determining whether there is at least one of the target files having splicing start time point information earlier than splicing end time point information of other target files;
in the embodiment of the present invention, there may be a case where the target files overlap with each other, that is, the contents of two target files exist simultaneously in the same time period. If the target files are overlapped, when the target files are spliced into the spliced editing file, a splicing error occurs. Thus, it is possible to determine whether there are target files overlapping each other before splicing the target files into a spliced edit file.
In the embodiment of the present invention, it may be determined whether splicing start time point information of at least one of the target files is earlier than splicing end time point information of other target files, so as to determine whether at least one target file and other target files overlap with each other.
In the embodiment of the present invention, an object file may be sequentially selected from at least two object files, splicing start time point information of the object file and splicing end time point information of other object files are compared with each other, and it is determined whether the splicing start time point information of the object file is earlier than the splicing end time point information of the other object files, so as to determine whether the splicing start time point information of at least one object file is earlier than the splicing end time point information of the other object files in the at least two object files.
Substep S62, if there is at least one piece of splicing start time point information of the target file earlier than the splicing end time point information of other target files, there is overlap between the target file and other target files;
in the embodiment of the present invention, if there is an overlap between the target file and another target file, the contents of the target file and the other target file may exist simultaneously in a same time period. In this case, the splicing start time point information of the target file may be earlier than the splicing end time point information of the other target files, so that there is an overlap between the target file and the other target files in a period from the splicing start time point of the target file to the splicing end time points of the other target files.
Therefore, if the splicing start time point information of at least one target file is earlier than the splicing end time point information of other target files, the target files are overlapped with the other target files.
And a substep S63 of deleting the object file having the overlap, or deleting the other object files having the overlap.
In the embodiment of the invention, the condition that splicing errors occur subsequently due to the fact that the target file is overlapped with other target files is avoided. According to actual needs, the target file overlapped with other target files can be deleted, or other target files overlapped with the target file can be deleted, so that the at least two target files needing to be spliced are not overlapped with each other.
In the embodiment of the present invention, after it is determined that there is an overlap between the at least two target files, an overlap prompt message may also be presented on the user interface. The overlap prompting message is used for prompting a user that the at least two target files are overlapped, so that the user can operate the target files, delete the overlapped target files, or adjust the splicing start time information and the splicing end time of the target files.
In an optional embodiment of the present invention, before the step of calling the splicing function, adopting the multimedia codec library instance, and splicing at least two target files into a spliced edited file according to a time sequence of the at least two target files, the method further includes:
substep S71, determining whether there is a blank time segment without the target file by using the splicing start time point information and the splicing end time point information of the at least two target files in the editing record information;
in the embodiment of the present invention, if there is no target file in a time period, the time period may be a blank time slice. At this time, if the target files are adopted for splicing, a splicing editing file is generated. A situation of stitching error may occur. Therefore, the target files can be spliced to generate spliced editing files, and the blank time segments can be removed.
In this embodiment of the present invention, after the time sequence of the at least two target files is determined, it may be determined whether the splicing end time point information of the target file with the earlier time sequence in the two adjacent target files is the same as the splicing start time point information of the target file with the later time sequence according to the time sequence.
And if the splicing ending time point information of the target file with the earlier time sequence is the same as the splicing starting time point information of the target file with the later time sequence, a blank time segment without the target file does not exist between the two adjacent target files.
And if the splicing ending time point information of the target file with the earlier time sequence is later than the splicing starting time point information of the target file with the later time sequence. There is an overlap between two adjacent target files.
And if the splicing ending time point information of the target file with the earlier time sequence is earlier than the splicing starting time point information of the target file with the later time sequence. There is a blank time segment between two adjacent target files.
And a substep S72, if there is a blank time segment without the target file, adjusting the splicing start time point information and the splicing end time point information of the target file in the editing record information until there is no blank time segment without the target file.
In the embodiment of the present invention, if there is a blank time segment without the target file, the start time point information and the splicing end time point information of the target file in the editing record information may be adjusted until there is no blank time segment without the target file.
Specifically, the splicing start time point information and the splicing start time point information of the target file whose time sequence is after the blank time segment may be earlier than the duration of the blank time segment, so as to eliminate the blank time segment. And then, continuously determining whether other blank time segments exist or not, and adjusting the splicing start time point information and the splicing end time point information of the target file until no blank time segment without the target file exists.
In an optional embodiment of the present invention, the step of calling the splicing function, using the multimedia codec library instance, and splicing at least two target files into a spliced edited file according to a time sequence of the at least two target files includes:
a substep S81, determining a maximum height and a maximum width of the resolution in the at least two target files based on the height and the width of the resolution of the target files, and using the maximum height and the maximum width as a target height and a target width of the resolution of the spliced editing file;
in the embodiment of the present invention, the browser may analyze the target file by calling the analysis function to use a multimedia codec library instance, so as to obtain the attribute information of the target file. The attribute information may include duration information, media type information, average bit rate information, pixel format information, resolution information, sampling rate information, channel number information, and the like, which is not limited in the present invention.
In the embodiment of the present invention, the resolution information may include a width and a height of the target file. Therefore, the browser can analyze the multimedia file by calling the analysis function to determine the width and the height of the target file.
And a substep S82, calling the splicing function, and splicing at least two target files into a spliced editing file by using the multimedia coding and decoding library instance and the target height and the target width according to the time sequence of the at least two target files.
In the embodiment of the invention, the heights and the widths of the target files can be different. The browser can select the maximum width with the largest numerical value from the widths of the target files, and simultaneously select the maximum height with the largest numerical value from the heights of the target files as the target height and the target width of the resolution of the spliced and edited file. And then, the splicing function can be called, the target files are spliced by adopting the multimedia coding and decoding library example according to the time sequence of at least two target files and the target height and the target width, and spliced and edited files with uniform width and height are obtained.
According to the multimedia editing method provided by the embodiment of the invention, the preset original library file is translated to obtain the translation library file, the executable file is called to load the preset translation library file, and the multimedia coding and decoding library example corresponding to the translation library file is generated, so that the multimedia editing function is provided for the browser. Calling the file management function to acquire a multimedia file corresponding to an editing instruction by responding to the editing instruction sent by a user; and responding to the editing instruction, calling the editing function, editing the multimedia file by adopting the multimedia coding and decoding library example, realizing that the multimedia file corresponding to the editing instruction is edited by calling the multimedia coding and decoding library example by adopting the editing function according to the editing instruction of the user, realizing that the multimedia file is edited in a browser without additionally installing multimedia editing software, and improving the convenience of the user for editing the multimedia file.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 3, a block diagram of an embodiment of a multimedia editing apparatus according to an embodiment of the present invention is shown, which is applied to a browser, and specifically includes the following modules:
a loading module 301, configured to load a preset executable file;
a calling module 302, configured to call the executable file to load a preset translation library file, and generate a multimedia codec library instance corresponding to the translation library file; the translation library file is obtained by translating a preset original library file;
and the editing module 303 is configured to respond to an editing instruction sent by a user, and edit the multimedia file corresponding to the editing instruction by using the multimedia coding and decoding library example.
In one embodiment of the present invention, the executable file includes a file management function and an editing function;
the editing module comprises:
the file acquisition submodule is used for responding to an editing instruction sent by a user and calling the file management function to acquire a multimedia file corresponding to the editing instruction;
and the editing submodule is used for responding to the editing instruction and calling the editing function to edit the multimedia file by adopting the multimedia coding and decoding library example.
In an embodiment of the present invention, the executable file further includes an interface generating function, and the apparatus further includes:
the interface generation module is used for calling the interface generation function and generating a user interface containing a time shaft assembly; the time axis component is used for displaying the duration information of the multimedia file by adopting a preset time axis and acquiring an editing instruction of a user.
In an embodiment of the present invention, the executable file further includes an analytic function, and the apparatus further includes:
and the duration acquisition module is used for calling the analysis function to analyze the multimedia file and acquiring the duration information of the multimedia file.
In one embodiment of the invention, the editing function comprises a cut function;
the editing sub-module comprises:
the time point determining unit is used for responding to the editing instruction and determining a starting time point and an ending time point based on the duration information;
and the editing unit is used for calling a cutting function, cutting the multimedia file based on the starting time point and the ending time point by adopting the multimedia coding and decoding library example, and obtaining a target editing file.
In an embodiment of the present invention, the editing sub-module further includes:
and the modifying unit is used for responding to the editing instruction and modifying the starting time point and/or the ending time point.
In an embodiment of the present invention, the editing function further includes a splicing function;
the editing sub-module further comprises:
the record generating unit is used for responding to an editing instruction sent by a user and generating editing record information; the editing record information comprises splicing start time point information and splicing end time point information of at least two target files; the target file is a target editing file and/or a multimedia file;
the sequence determining unit is used for determining the time sequence of at least two target files based on the splicing start time point information and the splicing end time point information of the at least two target files;
and the splicing unit is used for calling the splicing function, adopting the multimedia coding and decoding library example, and splicing at least two target files into a spliced editing file according to the time sequence of the at least two target files.
In an embodiment of the present invention, the editing sub-module further includes:
a splicing time point determining unit, configured to determine whether there is splicing start time point information of at least one of the target files that is earlier than splicing end time point information of other target files;
an overlap determining unit, configured to determine that there is an overlap between the target file and another target file if there is at least one piece of splicing start time point information of the target file that is earlier than splicing end time point information of another target file;
and the deleting unit is used for deleting the target file with the overlap or deleting the other target files with the overlap.
In an embodiment of the present invention, the editing sub-module further includes:
a blank time period determining unit, configured to determine whether a blank time segment without the target file exists by using the splicing start time point information and the splicing end time point information of the at least two target files in the editing record information;
and the splicing time point adjusting unit is used for adjusting the splicing start time point information and the splicing end time point information of the target file in the editing record information if the blank time segment without the target file exists until the blank time segment without the target file does not exist.
In one embodiment of the present invention, the splicing unit includes:
a width and height determining subunit, configured to determine, based on the height and width of the resolution of the target file, a maximum height and a maximum width of the resolution in the at least two target files, and use the maximum height and the maximum width as a target height and a target width of the resolution of the splicing editing file;
and the splicing subunit is used for calling the splicing function, adopting the multimedia coding and decoding library example, and splicing at least two target files into a spliced editing file according to the time sequence of the at least two target files and adopting the target height and the target width.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention further provides an electronic device, as shown in fig. 4, including a processor 401, a communication interface 402, a memory 403, and a communication bus 404, where the processor 401, the communication interface 402, and the memory 403 complete mutual communication through the communication bus 404,
a memory 403 for storing a computer program;
the processor 401, when executing the program stored in the memory 403, implements the following steps:
loading a preset executable file;
calling the executable file to load a preset translation library file and generating a multimedia coding and decoding library example corresponding to the translation library file; the translation library file is obtained by translating a preset original library file;
and responding to an editing instruction sent by a user, and editing the multimedia file corresponding to the editing instruction by adopting the multimedia coding and decoding library example.
Optionally, the executable file comprises a file management function and an editing function;
the step of responding the editing instruction sent by the user and editing the multimedia file corresponding to the editing instruction by adopting the multimedia coding and decoding library instance comprises the following steps:
responding to an editing instruction sent by a user, and calling the file management function to acquire a multimedia file corresponding to the editing instruction;
and responding to the editing instruction, calling the editing function and editing the multimedia file by adopting the multimedia coding and decoding library example.
Optionally, the executable file further includes an interface generation function, and the method further includes:
calling the interface generating function to generate a user interface containing a time shaft assembly; the time axis component is used for displaying the duration information of the multimedia file by adopting a preset time axis and acquiring an editing instruction of a user.
Optionally, the executable file further includes a parsing function, and the method further includes:
and calling the analysis function to analyze the multimedia file to acquire the duration information of the multimedia file.
Optionally, the editing function comprises a clipping function;
the step of responding the editing instruction, calling an editing function and editing the multimedia file by adopting the multimedia coding and decoding library example comprises the following steps:
responding to the editing instruction, and determining a starting time point and an ending time point based on the duration information;
and calling a cutting function, cutting the multimedia file based on the starting time point and the ending time point by adopting the multimedia coding and decoding library example, and obtaining a target editing file.
Optionally, before the step of calling a clipping function, clipping the multimedia file based on the starting time point and the ending time point by using the multimedia coding and decoding library instance, and obtaining a target editing file, the method further includes:
modifying the starting time point and/or the ending time point in response to the editing instruction.
Optionally, the editing function further includes a splicing function;
the step of responding the editing instruction, calling an editing function, and editing the multimedia file by adopting the multimedia coding and decoding library instance further comprises:
responding to an editing instruction sent by a user, and generating editing record information; the editing record information comprises splicing start time point information and splicing end time point information of at least two target files; the target file is a target editing file and/or a multimedia file;
determining the time sequence of at least two target files based on the splicing start time point information and the splicing end time point information of the at least two target files;
and calling the splicing function, and splicing at least two target files into a spliced editing file according to the time sequence of at least two target files by adopting the multimedia coding and decoding library example.
Optionally, before the step of calling the splicing function and splicing at least two target files into a spliced edited file according to the time sequence of the at least two target files, the method further includes:
determining whether splicing start time point information of at least one target file is earlier than splicing end time point information of other target files;
if the splicing start time point information of at least one target file is earlier than the splicing end time point information of other target files, overlapping exists between the target file and the other target files;
deleting the target files with the overlap, or deleting the other target files with the overlap.
Optionally, before the step of calling the splicing function and splicing at least two target files into a spliced edited file according to the time sequence of the at least two target files, the method further includes:
determining whether a blank time segment without the target file exists or not by adopting the splicing start time point information and the splicing end time point information of the at least two target files in the editing record information;
and if the blank time segment without the target file exists, adjusting the splicing start time point information and the splicing end time point information of the target file in the editing record information until the blank time segment without the target file does not exist.
Optionally, the step of calling the splicing function, and splicing at least two target files into a spliced edited file according to the time sequence of the at least two target files includes:
determining the maximum height and the maximum width of the resolution in the at least two target files based on the height and the width of the resolution of the target files, and taking the maximum height and the maximum width as the target height and the target width of the resolution of the splicing editing file;
and calling the splicing function, and splicing at least two target files into a spliced editing file by adopting the target height and the target width according to the time sequence of at least two target files.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In another embodiment of the present invention, there is also provided a computer-readable storage medium having stored therein instructions, which when run on a computer, cause the computer to execute the method for editing multimedia as described in any one of the above embodiments.
In a further embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method for editing multimedia as described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal 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 terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The above describes in detail a multimedia editing method and a multimedia editing apparatus provided by the present invention, and a specific example is applied in the text to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A multimedia editing method applied to a browser, the method comprising:
loading a preset executable file;
calling the executable file to load a preset translation library file and generating a multimedia coding and decoding library example corresponding to the translation library file; the translation library file is obtained by translating a preset original library file;
and responding to an editing instruction sent by a user, and editing the multimedia file corresponding to the editing instruction by adopting the multimedia coding and decoding library example.
2. The method of claim 1, wherein the executable file comprises a file management function and an editing function;
the step of responding the editing instruction sent by the user and editing the multimedia file corresponding to the editing instruction by adopting the multimedia coding and decoding library instance comprises the following steps:
responding to an editing instruction sent by a user, and calling the file management function to acquire a multimedia file corresponding to the editing instruction;
and responding to the editing instruction, calling the editing function and editing the multimedia file by adopting the multimedia coding and decoding library example.
3. The method of claim 2, wherein the executable file further comprises an interface generation function, the method further comprising:
calling the interface generating function to generate a user interface containing a time shaft assembly; the time axis component is used for displaying the duration information of the multimedia file by adopting a preset time axis and acquiring an editing instruction of a user.
4. The method of claim 1 or 2, wherein the executable file further comprises a parsing function, the method further comprising:
and calling the analysis function to analyze the multimedia file to acquire the duration information of the multimedia file.
5. The method of claim 4, wherein the editing function comprises a clipping function;
the step of responding the editing instruction, calling an editing function and editing the multimedia file by adopting the multimedia coding and decoding library example comprises the following steps:
responding to the editing instruction, and determining a starting time point and an ending time point based on the duration information;
and calling a cutting function, cutting the multimedia file based on the starting time point and the ending time point by adopting the multimedia coding and decoding library example, and obtaining a target editing file.
6. The method according to claim 5, wherein before the step of calling the clipping function, using the multimedia codec library instance, and clipping the multimedia file based on the start time point and the end time point to obtain the target edited file, the method further comprises:
modifying the starting time point and/or the ending time point in response to the editing instruction.
7. The method of claim 5 or 6, wherein the editing functions further comprise a splicing function;
the step of responding the editing instruction, calling an editing function, and editing the multimedia file by adopting the multimedia coding and decoding library instance further comprises:
responding to an editing instruction sent by a user, and generating editing record information by adopting the executable file; the editing record information comprises splicing start time point information and splicing end time point information of at least two target files; the target file is a target editing file and/or a multimedia file;
determining the time sequence of at least two target files based on the splicing start time point information and the splicing end time point information of the at least two target files;
and calling the splicing function, and splicing at least two target files into a spliced editing file according to the time sequence of at least two target files by adopting the multimedia coding and decoding library example.
8. The method according to claim 7, wherein said step of calling said splicing function to splice at least two of said object files into a spliced edited file according to a time sequence of at least two of said object files using said instance of said codec library comprises:
determining the maximum height and the maximum width of the resolution in the at least two target files based on the height and the width of the resolution of the target files, and taking the maximum height and the maximum width as the target height and the target width of the resolution of the splicing editing file;
and calling the splicing function, adopting the multimedia coding and decoding library example, splicing at least two target files into a spliced editing file according to the time sequence of at least two target files and adopting the target height and the target width.
9. An apparatus for editing multimedia, which is applied in a browser, the apparatus comprising:
the loading module is used for loading a preset executable file;
the calling module is used for calling the executable file to load a preset translation library file and generating a multimedia coding and decoding library instance corresponding to the translation library file; the translation library file is obtained by translating a preset original library file;
and the editing module is used for responding to an editing instruction sent by a user and editing the multimedia file corresponding to the editing instruction by adopting the multimedia coding and decoding library example.
10. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 8 when executing a program stored in the memory.
CN202010247680.2A 2020-03-31 2020-03-31 Multimedia editing method and device Active CN111554328B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010247680.2A CN111554328B (en) 2020-03-31 2020-03-31 Multimedia editing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010247680.2A CN111554328B (en) 2020-03-31 2020-03-31 Multimedia editing method and device

Publications (2)

Publication Number Publication Date
CN111554328A true CN111554328A (en) 2020-08-18
CN111554328B CN111554328B (en) 2021-09-03

Family

ID=72003797

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010247680.2A Active CN111554328B (en) 2020-03-31 2020-03-31 Multimedia editing method and device

Country Status (1)

Country Link
CN (1) CN111554328B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112511897A (en) * 2020-10-26 2021-03-16 长沙市到家悠享网络科技有限公司 Video cover setting method, device, equipment and storage medium
CN113296774A (en) * 2021-06-16 2021-08-24 北京数科网维技术有限责任公司 OFD file processing method and system based on browser
CN113485968A (en) * 2021-08-02 2021-10-08 安徽文香科技有限公司 Editing method, device and equipment based on time line and storage medium
CN113938619A (en) * 2021-10-28 2022-01-14 稿定(厦门)科技有限公司 Video synthesis method, system and storage device based on browser
CN114598685A (en) * 2022-02-17 2022-06-07 阿里巴巴(中国)有限公司 Multimedia data processing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101740082A (en) * 2009-11-30 2010-06-16 孟智平 Method and system for clipping video based on browser
CN102929599A (en) * 2012-09-26 2013-02-13 广州市动景计算机科技有限公司 Method and device for modifying browser interface of mobile terminal, and mobile terminal
CN104267947A (en) * 2014-09-23 2015-01-07 广州金山网络科技有限公司 Method and device for editing popup picture
CN108965397A (en) * 2018-06-22 2018-12-07 中央电视台 Cloud video editing method and device, editing equipment and storage medium
CN110868625A (en) * 2019-11-22 2020-03-06 北京金山云网络技术有限公司 Video playing method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101740082A (en) * 2009-11-30 2010-06-16 孟智平 Method and system for clipping video based on browser
CN102929599A (en) * 2012-09-26 2013-02-13 广州市动景计算机科技有限公司 Method and device for modifying browser interface of mobile terminal, and mobile terminal
CN104267947A (en) * 2014-09-23 2015-01-07 广州金山网络科技有限公司 Method and device for editing popup picture
CN108965397A (en) * 2018-06-22 2018-12-07 中央电视台 Cloud video editing method and device, editing equipment and storage medium
CN110868625A (en) * 2019-11-22 2020-03-06 北京金山云网络技术有限公司 Video playing method and device, electronic equipment and storage medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112511897A (en) * 2020-10-26 2021-03-16 长沙市到家悠享网络科技有限公司 Video cover setting method, device, equipment and storage medium
CN113296774A (en) * 2021-06-16 2021-08-24 北京数科网维技术有限责任公司 OFD file processing method and system based on browser
CN113296774B (en) * 2021-06-16 2024-06-14 北京数科网维技术有限责任公司 Processing method and system of OFD file based on browser
CN113485968A (en) * 2021-08-02 2021-10-08 安徽文香科技有限公司 Editing method, device and equipment based on time line and storage medium
CN113485968B (en) * 2021-08-02 2024-06-07 安徽文香科技股份有限公司 Editing method, device, equipment and storage medium based on time line
CN113938619A (en) * 2021-10-28 2022-01-14 稿定(厦门)科技有限公司 Video synthesis method, system and storage device based on browser
CN114598685A (en) * 2022-02-17 2022-06-07 阿里巴巴(中国)有限公司 Multimedia data processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111554328B (en) 2021-09-03

Similar Documents

Publication Publication Date Title
CN111554328B (en) Multimedia editing method and device
CN108495192B (en) Page editing processing method and device
US10567701B2 (en) System and method for source script and video synchronization interface
CN106569800B (en) Front-end interface generation method and device
JP6794711B2 (en) How to generate web-based copies of documents, programs and equipment
US20160117159A1 (en) Embeddable Video Capturing, Processing And Conversion Application
US9514785B2 (en) Providing content item manipulation actions on an upload web page of the content item
US9563449B2 (en) Mobilizing a web application to take advantage of a native device capability
CN109325145B (en) Video thumbnail obtaining method, terminal and computer readable storage medium
WO2018130173A1 (en) Dubbing method, terminal device, server and storage medium
US20180046471A1 (en) Method and system for recording a browsing session
US11150864B2 (en) Displaying enhancement items associated with an audio recording
US20190245903A1 (en) Web-based content recording and adaptive streaming
US20120254759A1 (en) Browser-based recording of content
US20190310976A1 (en) Search Results Modulator
KR102353797B1 (en) Method and system for suppoting content editing based on real time generation of synthesized sound for video content
WO2010063070A1 (en) Method and system for displaying data on a mobile terminal
US11355155B1 (en) System and method to summarize one or more videos based on user priorities
RU2608873C2 (en) Method of binding metadata of digital content with digital content (versions), electronic device (versions), computer-readable medium (versions)
CN112052377B (en) Resource recommendation method, device, server and storage medium
EP2370905B1 (en) Media portability and compatibility for different destination platforms
WO2012162274A2 (en) Asynchronistic platform for real time collaboration and connection
CN113590564B (en) Data storage method, device, electronic equipment and storage medium
CN112596732B (en) Electronic teaching material manufacturing method and system
JP7424801B2 (en) Video editing output control device using text data, video editing output method using text data, and program

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