CN108228829B - Method and apparatus for generating information - Google Patents

Method and apparatus for generating information Download PDF

Info

Publication number
CN108228829B
CN108228829B CN201810004717.1A CN201810004717A CN108228829B CN 108228829 B CN108228829 B CN 108228829B CN 201810004717 A CN201810004717 A CN 201810004717A CN 108228829 B CN108228829 B CN 108228829B
Authority
CN
China
Prior art keywords
index file
parameter
recording
index
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810004717.1A
Other languages
Chinese (zh)
Other versions
CN108228829A (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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810004717.1A priority Critical patent/CN108228829B/en
Publication of CN108228829A publication Critical patent/CN108228829A/en
Application granted granted Critical
Publication of CN108228829B publication Critical patent/CN108228829B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/41Indexing; Data structures therefor; Storage structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The embodiment of the application discloses a method and a device for generating information. When the interruption of stream media recording and the restart of the recording are detected, determining whether to merge a new index file generated when the recording is restarted and a stored first index file based on preset configuration information related to the stream media recording, wherein the first index file is the index file stored when the recording is interrupted for the last time, and the index file comprises index information of at least one media fragment file; and if so, acquiring the first index file, and combining the index information in the first index file and the new index file to generate a second index file. The embodiment realizes the integration of the index information.

Description

Method and apparatus for generating information
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to the technical field of internet, and particularly relates to a method and a device for generating information.
Background
Streaming media may be referred to as streaming media, which is a media that is played while being transmitted, and is a kind of multimedia. Streaming media may include, for example, audio, video, and so forth.
During the recording of streaming media, the recording is usually interrupted due to network abnormality or other various reasons, and after each interruption of recording, the user usually restarts the recording. During such recording, a plurality of media segment file groups and a plurality of index files are generally generated. Wherein, the different index files comprise index information of the media fragment files in different media fragment file groups. Thus, when there are many index files, it is inconvenient to manage and analyze later.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating information.
In a first aspect, an embodiment of the present application provides a method for generating information, where the method includes: when the interruption of the stream media recording and the restart of the recording are detected, determining whether to merge a new index file generated when the recording is restarted and a stored first index file based on preset configuration information related to the stream media recording, wherein the first index file is an index file stored when the recording is interrupted for the last time, and the index file comprises index information of at least one media fragment file; if so, acquiring the first index file, merging the index information in the first index file and the new index file, and generating a second index file.
In some embodiments, the configuration information comprises at least one of: the device comprises a first parameter, a second parameter and a third parameter, wherein the first parameter is used for indicating a time length threshold value, the second parameter is used for indicating an index file stored when the recording of the streaming media is interrupted last time, the third parameter is used for indicating whether a always-combining function is started or not, the parameter value of the third parameter is a first value or a second value, the first value is used for indicating that the always-combining function is not started, and the second value is used for indicating that the always-combining function is started.
In some embodiments, determining whether to perform a merge operation on a new index file generated when recording is restarted and a stored first index file based on preset configuration information related to recording of streaming media includes: and determining whether the parameter value of the third parameter is a second value, and if so, determining to perform merging operation on the new index file and the first index file.
In some embodiments, determining whether to perform a merge operation on a new index file generated when recording is restarted and a stored first index file based on preset configuration information related to recording of streaming media further includes: and in response to determining that the parameter value of the third parameter is not the second value, further determining whether the recording interruption duration is greater than the parameter value of the first parameter, and if not, determining to merge the new index file and the first index file.
In some embodiments, merging the index information in the first index file and the new index file to generate a second index file includes: and writing the index information in the first index file into the new index file to obtain a second index file.
In some embodiments, the index information has a corresponding recording time; and writing the index information in the first index file into a new index file, including: and extracting the index information arranged according to the recording time sequence from the first index file, and writing the extracted index information above the index information recorded firstly in the new index file.
In some embodiments, the index file has a corresponding file identifier, and the parameter value of the second parameter is set by the following setting steps: and when the streaming media recording is interrupted, setting the parameter value of the second parameter as the file identifier of the newly generated index file.
In some embodiments, obtaining the first index file comprises: and acquiring a first index file based on the parameter value of the second parameter.
In a second aspect, an embodiment of the present application provides an apparatus for generating information, where the apparatus includes: the device comprises a determining unit, a judging unit and a judging unit, wherein the determining unit is configured to determine whether to merge a new index file generated when the recording is restarted and a stored first index file based on preset configuration information related to the recording of the streaming media when the recording interruption of the streaming media is detected, wherein the first index file is the index file stored when the recording is interrupted most recently, and the index file comprises index information of at least one media fragment file; and the processing unit is configured to acquire the first index file if the first index file is the new index file, merge the index information in the first index file and the new index file, and generate a second index file.
In some embodiments, the configuration information comprises at least one of: the device comprises a first parameter, a second parameter and a third parameter, wherein the first parameter is used for indicating a time length threshold value, the second parameter is used for indicating an index file stored when the recording of the streaming media is interrupted last time, the third parameter is used for indicating whether a always-combining function is started or not, the parameter value of the third parameter is a first value or a second value, the first value is used for indicating that the always-combining function is not started, and the second value is used for indicating that the always-combining function is started.
In some embodiments, the determining unit comprises: and the first determining subunit is configured to determine whether a parameter value of the third parameter is a second value, and if so, determine to perform merging operation on the new index file and the first index file.
In some embodiments, the determining unit further comprises: and the second determining subunit is configured to, in response to determining that the parameter value of the third parameter is not the second value, further determine whether the recording interruption duration is greater than the parameter value of the first parameter, and if not, determine to perform a merging operation on the new index file and the first index file.
In some embodiments, the processing unit comprises: and the writing subunit is configured to write the index information in the first index file into the new index file to obtain a second index file.
In some embodiments, the index information has a corresponding recording time; and the write subunit is further configured to: and extracting the index information arranged according to the recording time sequence from the first index file, and writing the extracted index information above the index information recorded firstly in the new index file.
In some embodiments, the index file has a corresponding file identification, and the parameter value of the second parameter is set by the following setting steps: and when the streaming media recording is interrupted, setting the parameter value of the second parameter as the file identifier of the newly generated index file.
In some embodiments, the processing unit comprises: and the obtaining subunit is configured to obtain the first index file based on the parameter value of the second parameter.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any implementation manner of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
According to the method and the device for generating information, when interruption of streaming media recording and restart of recording are detected, whether a merging operation is performed on a new index file generated during the re-recording and a stored first index file is determined based on preset configuration information related to the streaming media recording, so that when the merging operation is determined, the first index file is obtained, index information in the first index file and the new index file is merged, a second index file is generated, and integration of the index information is achieved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for generating information according to the present application;
FIG. 3 is a schematic illustration of an application scenario of a method for generating information according to the present application;
FIG. 4 is a flow diagram of yet another embodiment of a method for generating information according to the present application;
FIG. 5 is a schematic block diagram illustrating one embodiment of an apparatus for generating information according to the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing an electronic device according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the method for generating information or the apparatus for generating information of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, and 103 to interact with the server 105 through the network 104, for example, the terminal devices 101, 102, and 103 may be used to store information (e.g., an index file) generated during the recording of the streaming media to the server 105, and may also obtain required information from the server 105 during the recording of the streaming media. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, an instant messaging tool, a live application, and the like.
The terminal devices 101, 102, 103 may be various electronic devices including, but not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server that provides various services, such as a server for storing information (e.g., index files, etc.) generated during the recording of streaming media by the terminal apparatuses 101, 102, 103. Here, the server 105 may be a cloud server.
It should be noted that the method for generating information provided in the embodiments of the present application is generally executed by the terminal devices 101, 102, and 103, and accordingly, the apparatus for generating information is generally disposed in the terminal devices 101, 102, and 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for generating information in accordance with the present application is shown. The process 200 of the method for generating information comprises the following steps:
step 201, when detecting that the recording of the streaming media is interrupted and restarted, determining whether to merge a new index file generated when the recording is restarted and a stored first index file based on preset configuration information related to the recording of the streaming media.
In this embodiment, when a user to which an electronic device (for example, terminal devices 101, 102, and 103 shown in fig. 1) on which the method for generating information operates belongs uses the electronic device to record streaming media, the electronic device may detect a streaming media recording status in real time. The streaming media may be called streaming media, which is a media that is played while being transmitted, and is a kind of multimedia. Streaming media may include, for example, audio, video, and so forth.
When the electronic device detects that the recording of the streaming media is interrupted and the recording is restarted, the electronic device may determine whether to merge a new index file generated when the recording is restarted and a stored first index file based on preset configuration information related to the recording of the streaming media. The first index file may be an index file stored when recording was last interrupted. The index file may include index information of at least one media slice file. The index information may include, for example, location information of the media slice file. The media segment file may be a file generated by cutting the media stream during the recording process of the streaming media.
It should be noted that the media segment file may be a file in a TS (collectively referred to as MPEG2-TS) format, for example. MPEG2-TS is mainly applied to programs transmitted in real time, such as television programs broadcast in real time and the like. The index file may be, for example, a file in M3U8 format. The file in the M3U8 format is a text file in the UTF-8 encoding format.
Generally, an index file is generated each time a streaming media recording is performed (including a resumed streaming media recording), so as to record index information of the generated media segment file. When the recording of the streaming media is interrupted and the recording of the streaming media is completed, the generated index file is generally stored, for example, to a server (for example, the server 105 shown in fig. 1) connected to the electronic device.
It should be noted that the configuration information may include, for example, a first parameter used for indicating the duration threshold, and a unit of a parameter value of the first parameter may be, for example, seconds. The configuration information may be set manually or automatically by the electronic device, and this embodiment does not limit this aspect at all. When the electronic device detects that the recording of the streaming media is interrupted and the recording is restarted, the electronic device may compare the recording interruption duration with the parameter value of the first parameter to determine whether the recording interruption duration is greater than the parameter value, and if not, the electronic device may determine to merge a new index file generated when the recording is restarted and the stored first index file. Here, the electronic apparatus may determine the recording interruption duration by calculating a difference between a start time point when the recording is restarted and an interruption time point when the recording is interrupted.
It should be noted that, during the recording of the streaming media, a log describing the recording status of the streaming media may be recorded, and the electronic device may analyze the log to determine whether the recording is interrupted. In addition, the user generally performs streaming media recording through a corresponding recording interface, and the electronic device may monitor a click operation of the user on the recording interface to determine whether the user restarts streaming media recording. Certainly, the electronic device may be pre-deployed with a thread for monitoring a recording status of the streaming media, and the electronic device may detect whether the recording of the streaming media is interrupted and whether the recording is restarted after the interruption by using the thread.
In some optional implementations of this embodiment, the configuration information may include at least one of: the first parameter, the second parameter and the third parameter. The second parameter may be used to indicate an index file stored when the recording of the streaming media was last interrupted. The third parameter may be used to indicate whether a always merge function has been turned on. Wherein, the parameter value of the third parameter can be the first value or the second value. The first value may be used to indicate that a always merge function is not turned on. The second value may be used to indicate that a always merge function has been turned on.
Here, if the parameter value of the third parameter is the second value, the electronic device may determine that a merge function has been turned on, and the electronic device may not be limited by a time length threshold, and may perform a merge operation on the new index file and the first index file.
In some optional implementations of this embodiment, the index file may have a corresponding file identifier, and the parameter value of the second parameter may be set by the following setting steps: and when the streaming media recording is interrupted, setting the parameter value of the second parameter as the file identifier of the newly generated index file.
Step 202, in response to determining that the new index file and the first index file are merged, acquiring the first index file, merging the index information in the first index file and the new index file, and generating a second index file.
In this embodiment, if the electronic device determines to perform a merge operation on the new index file and the first index file, the electronic device may acquire the first index file, merge index information in the first index file and the new index file, and generate a second index file.
As an example, the electronic device may acquire a latest stored index file from a designated storage location in the server as the first index file. Then, the electronic device may recreate an index file. Then, the electronic device may extract index information from the first index file and the new index file, write the extracted index information into the newly created index file, and use the newly created index file as a second index file.
It should be noted that, combining the index information in different index files generated in the process of recording the streaming media can facilitate management and later analysis.
In some optional implementation manners of this embodiment, the electronic device may write the index information in the first index file into the new index file to obtain a second index file, for example, determine the new index file written into the index information in the first index file as the second index file.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for generating information according to the present embodiment. In the application scenario of fig. 3, a user may use a terminal device owned by the user to perform live video and audio broadcasting, where live video and audio need to be recorded in a live broadcasting process, and an index file generated in the recording process is uploaded to a cloud server connected to the terminal device. In addition, the user sets configuration information in advance, and the configuration information includes a parameter a for indicating the duration threshold. After the audio and video live broadcast starts, the terminal equipment can detect the audio and video recording condition in real time. As shown by reference numeral 301, in response to the terminal device detecting that the audio/video recording is interrupted and recording is resumed, the terminal device may first determine whether the recording interruption duration is greater than the parameter value of the parameter a. Thereafter, as indicated by reference numeral 302, in response to the terminal device determining that the recording interruption duration is not greater than the parameter value, the terminal device may determine to merge a new index file generated when recording is resumed with a stored first index file, where the first index file is an index file stored when recording was last interrupted. Then, as indicated by reference numeral 303, the terminal device may obtain the first index file from the cloud server. Finally, as shown by reference numeral 304, the terminal device may recreate an index file, write the index information in the first index file and the new index file into the recreated index file, and use the recreated index file as a second index file.
In the method provided by the above embodiment of the present application, when it is detected that recording of a streaming media is interrupted and recording is resumed, based on preset configuration information related to recording of the streaming media, it is determined whether to perform a merge operation on a new index file generated during re-recording and a stored first index file, so that when it is determined to perform the merge operation, the first index file is obtained, and the index information in the first index file and the new index file is merged to generate a second index file, thereby implementing integration of index information.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for generating information is shown. The flow 400 of the method for generating information comprises the steps of:
step 401, when detecting that the recording of the streaming media is interrupted and the recording is restarted, determining whether a parameter value of a third parameter in preset configuration information related to the recording of the streaming media is a second value.
In this embodiment, when a user to which an electronic device (for example, terminal devices 101, 102, and 103 shown in fig. 1) on which the method for generating information operates belongs uses the electronic device to record streaming media, the electronic device may detect a streaming media recording status in real time. The streaming media may be called streaming media, which is a media that is played while being transmitted, and is a kind of multimedia. Streaming media may include, for example, audio, video, and so forth. When the electronic device detects that the recording of the streaming media is interrupted and the recording is restarted, the electronic device may determine whether a parameter value of a third parameter in preset configuration information related to the recording of the streaming media is a second value.
Here, the electronic device may locally store the configuration information in advance. The configuration information may include a first parameter, a second parameter, and a third parameter. Wherein the first parameter may be used to indicate a duration threshold. The second parameter may be used to indicate an index file stored when the recording of the streaming media was last interrupted, where a parameter value of the second parameter may be a file identifier of the index file indicated by the second parameter. The third parameter may be used to indicate whether a always merge function has been turned on. The parameter value of the third parameter may be a first value or a second value, and the first value may be used to indicate that the always-on merge function is not turned on. The second value may be used to indicate that a always merge function has been turned on.
Wherein, the index file may include index information of at least one media fragment file. The index information may include, for example, location information of the media slice file. The media segment file may be a file generated by cutting the media stream during the recording process of the streaming media. In addition, the index information may have a corresponding recording time.
Step 402, in response to determining that the parameter value of the third parameter is not the second value, further determining whether the recording interruption duration is greater than the parameter value of the first parameter in the configuration information.
In this embodiment, in response to the electronic device determining that the parameter value of the third parameter is not the second value, the electronic device may compare the recording interruption duration with the parameter value of the first parameter to determine whether the recording interruption duration is greater than the parameter value of the first parameter.
Step 403, in response to determining that the recording interruption duration is not greater than the parameter value of the first parameter, determining to perform a merging operation on the new index file generated when the recording is restarted and the stored first index file.
In this embodiment, in response to the electronic device determining that the recording interruption duration is not greater than the parameter value of the first parameter, the electronic device may determine to merge a new index file generated when recording is restarted and a stored first index file. The first index file may be an index file stored when recording was last interrupted.
Step 404, obtaining a first index file based on the parameter value of the second parameter in the configuration information.
In this embodiment, the electronic device may obtain the first index file based on a parameter value of the second parameter. As an example, the electronic device may first find a specific storage location of the first index file according to the parameter value of the second parameter, and then obtain the first index file from the storage location.
Step 405, extracting the index information arranged according to the recording time sequence from the first index file, writing the extracted index information above the index information recorded first in the new index file, and using the new index file as a second index file.
In this embodiment, the electronic device may extract the index information arranged in the order of the recording time from the first index file, write the extracted index information above the index information recorded first in the new index file, and use the new index file as the second index file.
The extracted index information is written above the index information recorded first in the new index file, so that the index information in the obtained second index file can be arranged according to the recording time sequence. Therefore, when the streaming media is played, the media fragment files corresponding to the index information can be sequentially read according to the sequence of the index information in the second index file for playing, and the integrity of the played streaming media can be ensured. Moreover, the index information in different index files is merged, so that the management and the later analysis can be facilitated.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for generating information in the present embodiment highlights the step of determining whether to perform the merging operation on the new index file generated when recording is restarted and the stored first index file (i.e., step 401 and step 403), the step of acquiring the first index file (i.e., step 404), and the step of merging the index information (i.e., step 405). Therefore, the scheme described in the embodiment can realize diversity of information processing, and can realize effective integration of index information.
With further reference to fig. 5, as an implementation of the method shown in the above figures, the present application provides an embodiment of an apparatus for generating information, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 5, the apparatus 500 for generating information shown in the present embodiment includes: the determining unit 501 is configured to, when it is detected that recording of a streaming media is interrupted and recording is restarted, determine whether to merge a new index file generated when recording is restarted and a stored first index file based on preset configuration information related to recording of the streaming media, where the first index file may be an index file stored when recording is interrupted last time, and the index file may include index information of at least one media fragment file; the processing unit 502 is configured to, if yes, obtain the first index file, merge the index information in the first index file and the new index file, and generate the second index file.
In the present embodiment, in the apparatus 500 for generating information: the specific processing of the determining unit 501 and the processing unit 502 and the technical effects thereof can refer to the related descriptions of step 201 and step 202 in the corresponding embodiment of fig. 2, which are not repeated herein.
In some optional implementations of this embodiment, the configuration information may include at least one of: a first parameter, a second parameter, and a third parameter. The first parameter may be used to indicate a duration threshold. The second parameter may be used to indicate an index file stored when the recording of the streaming media was last interrupted. A third parameter may be used to indicate whether a always merge function has been turned on. Wherein, the parameter value of the third parameter can be the first value or the second value. The first value may be used to indicate that a always merge function is not turned on. The second value may be used to indicate that the always merge function has been turned on.
In some optional implementations of this embodiment, the determining unit 501 may include: a first determining subunit (not shown in the figure), configured to determine whether a parameter value of the third parameter is the second value, and if so, determine to perform a merging operation on the new index file and the first index file.
In some optional implementation manners of this embodiment, the determining unit 501 may further include: a second determining subunit (not shown in the figure), configured to, in response to determining that the parameter value of the third parameter is not the second value, further determine whether the recording interruption duration is greater than the parameter value of the first parameter, and if not, determine to perform a merging operation on the new index file and the first index file.
In some optional implementations of this embodiment, the processing unit 502 may include: and a writing subunit (not shown in the figure) configured to write the index information in the first index file into the new index file to obtain a second index file.
In some optional implementations of this embodiment, the index information may have a corresponding recording time; and the writing subunit may be further configured to: and extracting the index information arranged according to the recording time sequence from the first index file, and writing the extracted index information above the index information recorded firstly in the new index file.
In some optional implementations of this embodiment, the index file may have a corresponding file identifier, and the parameter value of the second parameter may be set by the following setting steps: and when the streaming media recording is interrupted, setting the parameter value of the second parameter as the file identifier of the newly generated index file.
In some optional implementations of this embodiment, the processing unit 502 may include: an obtaining subunit (not shown in the figure) configured to obtain the first index file based on the parameter value of the second parameter.
The apparatus provided in the foregoing embodiment of the present application, when it is detected that recording of a streaming media is interrupted and recording is resumed, determines whether to perform a merge operation on a new index file generated during recording and a stored first index file based on preset configuration information related to recording of the streaming media, so that when it is determined to perform the merge operation, the first index file is obtained, and the first index file and index information in the new index file are merged to generate a second index file, thereby implementing integration of index information.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present application are executed when the computer program is executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a determination unit and a processing unit. The names of these units do not in some cases constitute a limitation to the unit itself, and for example, the determination unit may also be described as a unit that determines whether to perform a merge operation on a new index file generated when recording is restarted and a stored first index file.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to include: when the interruption of the stream media recording and the restart of the recording are detected, determining whether to merge a new index file generated when the recording is restarted and a stored first index file based on preset configuration information related to the stream media recording, wherein the first index file is an index file stored when the recording is interrupted for the last time, and the index file comprises index information of at least one media fragment file; if so, acquiring the first index file, merging the index information in the first index file and the new index file, and generating a second index file.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (16)

1. A method for generating information, comprising:
when the interruption of the stream media recording and the recording restart are detected, determining whether to perform a merging operation on a new index file generated when the recording restart and a stored first index file based on preset configuration information related to the stream media recording, including: determining whether a parameter value of a third parameter is a second value, if so, determining to perform a merge operation on the new index file and the first index file, where the first index file is an index file stored when recording is interrupted last time, the index file includes index information of at least one media fragment file, and the configuration information includes: a third parameter, configured to indicate whether an always merge function is turned on, where a parameter value of the third parameter is a first value or a second value, the first value is used to indicate that the always merge function is not turned on, and the second value is used to indicate that the always merge function is turned on;
and if so, acquiring the first index file, merging the index information in the first index file and the new index file, and generating a second index file.
2. The method of claim 1, wherein the configuration information comprises at least one of: the device comprises a first parameter and a second parameter, wherein the first parameter is used for indicating a time length threshold value, and the second parameter is used for indicating an index file stored when the recording of the stream media is interrupted last time.
3. The method of claim 2, wherein the determining whether to perform a merge operation on the new index file generated when the recording is restarted and the stored first index file based on preset configuration information related to the recording of the streaming media further comprises:
and in response to determining that the parameter value of the third parameter is not the second value, further determining whether the recording interruption duration is longer than the parameter value of the first parameter, and if not, determining to merge the new index file and the first index file.
4. The method of claim 1, wherein merging the index information in the first index file and the new index file to generate a second index file comprises:
and writing the index information in the first index file into the new index file to obtain the second index file.
5. The method of claim 4, wherein the index information has a corresponding recording time; and
the writing the index information in the first index file into the new index file includes:
and extracting index information arranged according to the recording time sequence from the first index file, and writing the extracted index information above the index information recorded firstly in the new index file.
6. The method of claim 2, wherein the index file has a corresponding file identification, and the parameter value of the second parameter is set by the following setting steps: and when the streaming media recording is interrupted, setting the parameter value of the second parameter as the file identifier of the newly generated index file.
7. The method of claim 2, wherein the obtaining the first index file comprises:
and acquiring the first index file based on the parameter value of the second parameter.
8. An apparatus for generating information, comprising:
the determining unit is configured to, when it is detected that recording of the streaming media is interrupted and restarted, determine whether to perform a merging operation on a new index file generated when recording is restarted and a stored first index file based on preset configuration information related to recording of the streaming media, and includes: determining whether a parameter value of a third parameter is a second value, if so, determining to perform a merge operation on the new index file and the first index file, where the first index file is an index file stored when recording is interrupted last time, the index file includes index information of at least one media fragment file, and the configuration information includes: a third parameter, configured to indicate whether an always merge function is turned on, where a parameter value of the third parameter is a first value or a second value, the first value is used to indicate that the always merge function is not turned on, and the second value is used to indicate that the always merge function is turned on;
and the processing unit is configured to acquire the first index file if the first index file is the new index file, merge the index information in the first index file and the new index file, and generate a second index file.
9. The apparatus of claim 8, wherein the configuration information comprises at least one of: the device comprises a first parameter and a second parameter, wherein the first parameter is used for indicating a time length threshold value, and the second parameter is used for indicating an index file stored when the recording of the stream media is interrupted last time.
10. The apparatus of claim 9, wherein the determining unit further comprises:
and the second determining subunit is configured to, in response to determining that the parameter value of the third parameter is not the second value, further determine whether the recording interruption duration is greater than the parameter value of the first parameter, and if not, determine to perform a merging operation on the new index file and the first index file.
11. The apparatus of claim 8, wherein the processing unit comprises:
and the writing subunit is configured to write the index information in the first index file into the new index file to obtain the second index file.
12. The apparatus of claim 11, wherein the index information has a corresponding recording time; and
the write subunit is further configured to:
and extracting index information arranged according to the recording time sequence from the first index file, and writing the extracted index information above the index information recorded firstly in the new index file.
13. The apparatus of claim 9, wherein the index file has a corresponding file identifier, and the parameter value of the second parameter is set by the following setting steps: and when the streaming media recording is interrupted, setting the parameter value of the second parameter as the file identifier of the newly generated index file.
14. The apparatus of claim 9, wherein the processing unit comprises:
and the obtaining subunit is configured to obtain the first index file based on the parameter value of the second parameter.
15. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
16. A computer-readable storage medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-7.
CN201810004717.1A 2018-01-03 2018-01-03 Method and apparatus for generating information Active CN108228829B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810004717.1A CN108228829B (en) 2018-01-03 2018-01-03 Method and apparatus for generating information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810004717.1A CN108228829B (en) 2018-01-03 2018-01-03 Method and apparatus for generating information

Publications (2)

Publication Number Publication Date
CN108228829A CN108228829A (en) 2018-06-29
CN108228829B true CN108228829B (en) 2022-01-11

Family

ID=62642795

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810004717.1A Active CN108228829B (en) 2018-01-03 2018-01-03 Method and apparatus for generating information

Country Status (1)

Country Link
CN (1) CN108228829B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115955581A (en) * 2023-03-15 2023-04-11 浪潮电子信息产业股份有限公司 Real-time video processing method, device, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1809143A (en) * 2005-01-21 2006-07-26 上海乐金广电电子有限公司 Duplication and recording apparatus and method in composite video device
CN105100912A (en) * 2014-05-12 2015-11-25 联想(北京)有限公司 Streaming media processing method and streaming media processing apparatus
CN105516485A (en) * 2015-12-04 2016-04-20 小米科技有限责任公司 Sound recording method and device
CN105592369A (en) * 2014-10-21 2016-05-18 中国移动通信集团公司 Video abstract processing method and device
CN106202157A (en) * 2016-06-23 2016-12-07 深圳市华域无线技术股份有限公司 Video method for quickly retrieving based on time stream
CN106886375A (en) * 2017-03-27 2017-06-23 百度在线网络技术(北京)有限公司 The method and apparatus of data storage
CN106982344A (en) * 2016-01-15 2017-07-25 阿里巴巴集团控股有限公司 video information processing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012150602A1 (en) * 2011-05-03 2012-11-08 Yogesh Chunilal Rathod A system and method for dynamically monitoring, recording, processing, attaching dynamic, contextual & accessible active links & presenting of physical or digital activities, actions, locations, logs, life stream, behavior & status

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1809143A (en) * 2005-01-21 2006-07-26 上海乐金广电电子有限公司 Duplication and recording apparatus and method in composite video device
CN105100912A (en) * 2014-05-12 2015-11-25 联想(北京)有限公司 Streaming media processing method and streaming media processing apparatus
CN105592369A (en) * 2014-10-21 2016-05-18 中国移动通信集团公司 Video abstract processing method and device
CN105516485A (en) * 2015-12-04 2016-04-20 小米科技有限责任公司 Sound recording method and device
CN106982344A (en) * 2016-01-15 2017-07-25 阿里巴巴集团控股有限公司 video information processing method and device
CN106202157A (en) * 2016-06-23 2016-12-07 深圳市华域无线技术股份有限公司 Video method for quickly retrieving based on time stream
CN106886375A (en) * 2017-03-27 2017-06-23 百度在线网络技术(北京)有限公司 The method and apparatus of data storage

Also Published As

Publication number Publication date
CN108228829A (en) 2018-06-29

Similar Documents

Publication Publication Date Title
KR102158557B1 (en) Method and device for determining response time
CN108897691B (en) Data processing method, device, server and medium based on interface simulation service
CN109857908B (en) Method and apparatus for matching videos
CN107943877B (en) Method and device for generating multimedia content to be played
CN106840209B (en) Method and apparatus for testing navigation applications
CN110213614B (en) Method and device for extracting key frame from video file
CN109862100B (en) Method and device for pushing information
US11800201B2 (en) Method and apparatus for outputting information
CN108521612B (en) Video abstract generation method, device, server and storage medium
CN109255035B (en) Method and device for constructing knowledge graph
CN109120954B (en) Video message pushing method and device, computer equipment and storage medium
CN109168012B (en) Information processing method and device for terminal equipment
CN112040312A (en) Split-screen rendering method, device, equipment and storage medium
CN110830823A (en) Play progress correction method and device, electronic equipment and readable storage medium
CN114629929B (en) Log recording method, device and system
CN113873288A (en) Method and device for generating playback in live broadcast process
CN109241344B (en) Method and apparatus for processing information
CN108228829B (en) Method and apparatus for generating information
CN108647284B (en) Method and device for recording user behavior, medium and computing equipment
CN110912948A (en) Method and device for reporting problems
CN110740138B (en) Data transmission method and device
CN110502486B (en) Log processing method and device, electronic equipment and computer readable storage medium
CN109542743B (en) Log checking method and device, electronic equipment and computer readable storage medium
CN109214846B (en) Information storage method and device
CN111385599A (en) Video processing method and device

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