Recording method and device of multimedia file, equipment, medium and program product

By obtaining the recording time and number of frames of the multimedia file, combining the preset time and number of frames, dynamically adjusting the recording frame rate, the playback time problem caused by unstable frame rate during recording of multimedia files is solved, and the accurate recording of multimedia files is achieved.

CN119254910APending Publication Date: 2025-01-03SOPHGO TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411382860.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The prior art is difficult to ensure the synchronization of image frames and audio frames when recording multimedia files, and the recorded file frame number cannot accurately meet the preset playback time, resulting in the file being unable to play at a fixed time.

Method used

By obtaining the recording time and number of recorded frames of the current multimedia file, and combining the preset recording time and number of frames, the recording frame rate is dynamically adjusted to ensure that the recorded file can be played within the preset time.

Benefits of technology

It improves the accuracy of multimedia file recording, ensures that the recorded files can be played according to the preset time, and solves the problem of error accumulation of unstable frame rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254910A_ABST
    Figure CN119254910A_ABST
Patent Text Reader

Abstract

The invention provides a recording method and device of a multimedia file, equipment, a medium and a program product. The method comprises the following steps: acquiring a first time when a current file frame is recorded by a current multimedia file and the number of recorded file frames in the current multimedia file; and determining to-be-recorded file frames in the current multimedia file in a preset recording duration based on the number of the file frames, the first time, the preset recording duration of a single multimedia file and the number of preset recording frames in the preset recording duration. Through the method, the number of recorded file frames in the current multimedia file can be dynamically adjusted, so that the preset recording duration can still be played when the recorded current multimedia file is played, and the recording accuracy of the multimedia file can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method and apparatus, device, medium and program product for recording multimedia files. Background Art

[0002] The recording function of multimedia files is becoming more and more stringent. For example, image file recording, video file recording or audio file recording, etc., all require the number of file frames in the recorded file to meet the preset playback duration of the file. Taking the recording of image frames as an example, it is usually required that each image file has a standard fixed duration, not one second more or less, and no frames are lost, so that the recorded image file can also be played at a fixed duration; in addition, for video files, image frames and audio frames are also required to be synchronized. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the present disclosure provides a method and apparatus for recording multimedia files, a device, a storage medium and a computer program product.

[0004] According to a first aspect of an embodiment of the present disclosure, a method for recording a multimedia file is provided, the method comprising:

[0005] Obtaining the first time when the current multimedia file records the current file frame, and the number of file frames recorded in the current multimedia file;

[0006] Based on the number of file frames, the first time, a preset recording duration of a single multimedia file, and the preset number of recording frames within the preset recording duration, the file frames to be recorded in the current multimedia file within the preset recording duration are determined.

[0007] In some embodiments, determining the file frames to be recorded in the current multimedia file within the preset recording duration based on the number of file frames, the first time, a preset recording duration of a single multimedia file, and the number of preset recording frames within the preset recording duration includes:

[0008] Based on the preset recording duration, determining an estimated duration from the first multimedia file to the completion of recording the current multimedia file;

[0009] In response to the number of file frames reaching the preset number of recording frames, and a first difference between the first time and a second time of the first file frame in the first multimedia file is less than the estimated duration, determining a file frame to be recorded in the current multimedia file within the preset recording duration based on the estimated duration;

[0010] In response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, the file frames to be recorded in the current multimedia file within the preset recording duration are determined based on the preset number of recording frames.

[0011] In some embodiments, in response to the number of file frames reaching the preset number of recording frames, and the difference between the first time and the second time of the first file frame in the first multimedia file is less than the estimated duration, determining the file frame to be recorded in the current multimedia file within the preset recording duration based on the estimated duration, includes:

[0012] In response to the number of file frames reaching the preset number of recording frames and the first difference between the first time and the second time being less than the estimated duration, the recording is stopped until the first difference reaches the estimated duration and the actual recording duration of the current multimedia file does not exceed the preset recording duration; wherein the actual recording duration is the time difference between the first time of recording the current file frame of the current multimedia file and the first file frame in the current multimedia file.

[0013] In some embodiments, in response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, determining the file frames to be recorded in the current multimedia file within the preset recording duration based on the preset number of recording frames includes:

[0014] In response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, the recording is stopped until the number of file frames in the current multimedia file reaches the preset number of recording frames and the actual recording duration of the current multimedia file does not exceed the preset recording duration; wherein the actual recording duration is the time difference between the first time when the current file frame of the current multimedia file is recorded and the first file frame in the current multimedia file.

[0015] In some embodiments, the method further comprises:

[0016] Based on the number of file frames, the preset number of recording frames, the first time, the second time, and the estimated duration, determine the time to request recording of the next multimedia file.

[0017] In some embodiments, determining the time to request recording of the next multimedia file based on the number of file frames, the first time, the second time, the preset number of recording frames, and the estimated duration includes:

[0018] In response to the number of file frames reaching the preset number of recording frames and a first difference between the first time and the second time being less than the estimated duration, requesting to record the next multimedia file after stopping recording the current multimedia file;

[0019] In response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, requesting to record the next multimedia file and then stopping recording the current multimedia file.

[0020] In some embodiments, in response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, requesting to record the next multimedia file and then stopping recording the current multimedia file includes:

[0021] In response to the number of file frames not reaching the preset number of recording frames, and the first difference between the first time and the second time reaching the estimated duration, after requesting to record the next multimedia file, the target file frames recorded after the first time are multiplexed in the current multimedia and the next multimedia file; wherein the sum of the number of target file frames and the number of file frames is equal to the preset number of recording frames.

[0022] In some embodiments, the frame multiplexed in the current multimedia file and the next multimedia file is an instant decoding refresh frame obtained after requesting to record the next multimedia file.

[0023] In some embodiments, the method further comprises:

[0024] Obtaining a recording instruction for a multimedia file; wherein the recording instruction is used to instruct to start recording a first multimedia file and multimedia files after the first multimedia file;

[0025] The step of determining an estimated duration from the first multimedia file to the completion of recording the current multimedia file based on the preset recording duration includes:

[0026] In response to the current multimedia file being the first multimedia file after the recording instruction is obtained, determining the preset recording duration after the second time of starting to obtain the first file frame as the estimated duration of the current multimedia file;

[0027] In response to the current multimedia file not being the first multimedia file, an estimated duration from the first multimedia file to the completion of recording the current multimedia file is determined based on the preset recording duration, the recording time of the previous multimedia file, and the acquisition time of the recording instruction.

[0028] In some embodiments, the determining the estimated duration from the first multimedia file to the completion of recording the current multimedia file based on the preset recording duration, the recording time of the previous multimedia file, and the acquisition time of the recording instruction includes:

[0029] Determine the time difference between the recording time of the last frame file in the previous multimedia file and the preset time until the previous multimedia file is recorded; wherein the preset time is determined based on the acquisition time of the recording instruction and the product of the number of files included in the first multimedia file to the current multimedia file and the preset recording time;

[0030] The difference between the preset duration until the current multimedia file is recorded and the time difference is determined as the estimated duration from the first multimedia file to the completion of recording the current multimedia file; wherein the preset duration is the product of the number of files included from the first multimedia file to the current multimedia file and the preset recording duration.

[0031] In some embodiments, the method further comprises:

[0032] Obtaining a recording instruction for a multimedia file; wherein the recording instruction is used to instruct to start recording a first multimedia file and multimedia files after the first multimedia file;

[0033] In response to the current multimedia file being the first multimedia file, naming the current multimedia file based on the acquisition time of the recording instruction;

[0034] In response to the current multimedia file not being the first multimedia file, the current multimedia file is named based on the acquisition time of the first frame file in the current multimedia file.

[0035] In some embodiments, the current multimedia file is a file recorded in one channel of multi-channel recording, and the recording of each multimedia file included in each channel is synchronized.

[0036] According to a second aspect of an embodiment of the present disclosure, a device for recording a multimedia file is provided, the device comprising:

[0037] A first acquisition module is configured to acquire a first time when a current multimedia file records a current file frame, and a number of file frames that have been recorded in the current multimedia file;

[0038] The first determination module is configured to determine the file frames to be recorded in the current multimedia file within the preset recording duration based on the number of file frames, the first time, a preset recording duration of a single multimedia file, and the number of preset recording frames within the preset recording duration.

[0039] In some embodiments, the first determination module is further configured to determine an estimated duration from the first multimedia file to the completion of recording the current multimedia file based on the preset recording duration; in response to the number of file frames reaching the preset number of recording frames, and a first difference between the first time and the second time of the first file frame in the first multimedia file is less than the estimated duration, determine the file frames to be recorded in the current multimedia file within the preset recording duration based on the estimated duration; in response to the number of file frames not reaching the preset number of recording frames, and a first difference between the first time and the second time reaching the estimated duration, determine the file frames to be recorded in the current multimedia file within the preset recording duration based on the preset number of recording frames.

[0040] In some embodiments, the first determination module is further configured to stop recording in response to the number of file frames reaching the preset number of recording frames and the first difference between the first time and the second time being less than the estimated duration, until the first difference reaches the estimated duration and the actual recording duration of the current multimedia file does not exceed the preset recording duration; wherein the actual recording duration is the time difference between the first time of recording the current file frame of the current multimedia file and the first file frame in the current multimedia file.

[0041] In some embodiments, the first determination module is further configured to stop recording in response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, until the number of file frames in the current multimedia file reaches the preset number of recording frames and the actual recording duration of the current multimedia file does not exceed the preset recording duration; wherein the actual recording duration is the time difference between the first time of recording the current file frame of the current multimedia file and the first file frame in the current multimedia file.

[0042] In some embodiments, the apparatus further comprises:

[0043] The second determination module is configured to determine the time to request recording of the next multimedia file based on the number of file frames, the preset number of recording frames, the first time, the second time, and the estimated duration.

[0044] In some embodiments, the second determination module is further configured to, in response to the number of file frames reaching the preset number of recording frames and the first difference between the first time and the second time being less than the estimated duration, request to record the next multimedia file after stopping recording the current multimedia file; and in response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, request to record the next multimedia file before stopping recording the current multimedia file.

[0045] In some embodiments, the second determination module is further configured to, in response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, multiplex the target file frames recorded after the first time in the current multimedia and the next multimedia file after requesting to record the next multimedia file; wherein the sum of the number of target file frames and the number of file frames is equal to the preset number of recording frames.

[0046] In some embodiments, the frame multiplexed in the current multimedia file and the next multimedia file is an instant decoding refresh frame obtained after requesting to record the next multimedia file.

[0047] In some embodiments, the apparatus further comprises:

[0048] A second acquisition module is configured to acquire a recording instruction of a multimedia file; wherein the recording instruction is used to instruct to start recording a first multimedia file and multimedia files after the first multimedia file;

[0049] The first determination module is further configured to, in response to the current multimedia file being the first multimedia file after the recording instruction is obtained, determine the preset recording duration after the second time of starting to obtain the first file frame as the estimated duration of the current multimedia file; in response to the current multimedia file not being the first multimedia file, determine the estimated duration from the first multimedia file to the completion of recording the current multimedia file based on the preset recording duration, the recording time of the previous multimedia file and the acquisition time of the recording instruction.

[0050] In some embodiments, the first determination module is further configured to determine the time difference between the recording time of the last frame file in the previous multimedia file and the preset time until the previous multimedia file is recorded; wherein the preset time is determined based on the acquisition time of the recording instruction and the product of the number of files included in the first multimedia file to the current multimedia file and the preset recording time; the difference between the preset time until the current multimedia file is recorded and the time difference is determined as the estimated time from the first multimedia file to the recording of the current multimedia file; wherein the preset time is the product of the number of files included in the first multimedia file to the current multimedia file and the preset recording time.

[0051] In some embodiments, the apparatus further comprises:

[0052] A third acquisition module is configured to acquire a recording instruction of a multimedia file; wherein the recording instruction is used to instruct to start recording a first multimedia file and multimedia files after the first multimedia file;

[0053] A first naming module, configured to name the current multimedia file based on the acquisition time of the recording instruction in response to the current multimedia file being the first multimedia file;

[0054] The second naming module is configured to name the current multimedia file based on the acquisition time of the first frame file in the current multimedia file in response to the current multimedia file not being the first multimedia file.

[0055] In some embodiments, the current multimedia file is a file recorded in one channel of multi-channel recording, and the recording of each multimedia file included in each channel is synchronized.

[0056] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including: a processor;

[0057] Memory for storing computer programs or instructions;

[0058] The processor executes the computer program or instructions to implement the steps of the method described in the first aspect above.

[0059] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, wherein the storage medium stores a computer program or instructions. When the computer program or instructions in the storage medium are executed by a processor, the steps of the method described in the first aspect above are implemented.

[0060] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program or instructions, which, when executed by a processor, implements the steps of the method described in the first aspect above.

[0061] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0062] In the embodiment of the present disclosure, based on the first time of the current file frame that can reflect the actual recording frame rate and the number of recorded file frames in the current multimedia file recording process, combined with the preset recording time of a single multimedia file that can reflect the preset frame rate and the preset number of recording frames within the preset recording time, the file frame to be recorded within the preset recording time and after the first time is determined. Compared with the method of recording each multimedia file only according to a single indicator of the preset recording time or the preset number of recording frames, the solution of the embodiment of the present disclosure can dynamically adjust the number of file frames recorded in the current multimedia file through the actual recording frame rate and the preset recording frame rate, so that when the current multimedia file is played after recording is completed, the preset recording time can still be played. That is, in this way, the accuracy of multimedia file recording can be improved.

[0063] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0065] Figure 1 Record a sample image for one file;

[0066] Figure 2 An example diagram of error accumulation shown in an embodiment of the present disclosure;

[0067] Figure 3 Record a sample image for one file;

[0068] Figure 4 is a flow chart of a method for recording a multimedia file according to an exemplary embodiment;

[0069] Figure 5 This is an example diagram of a multimedia file recording result when the frame rate is high in an embodiment of the present disclosure;

[0070] Figure 6 This is an example diagram of a multimedia file recording result when the frame rate is low in an embodiment of the present disclosure;

[0071] Figure 7This is an example diagram of recording a multimedia file in an embodiment of the present disclosure;

[0072] Figure 8 This is an example diagram of multimedia file naming timing in an embodiment of the present disclosure;

[0073] Fig. 9 This is an example diagram of multi-channel recording in an embodiment of the present disclosure;

[0074] Fig.10 An example diagram of a multimedia file recording in an embodiment of the present disclosure;

[0075] Fig.11 is a block diagram of a multimedia file recording device according to an exemplary embodiment;

[0076] Fig.12 The present invention is a structural block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0077] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices consistent with some aspects of the present disclosure as detailed in the appended claims.

[0078] In terminal devices, there is a need to generate video files, such as dashcams and other devices, which capture image frames through cameras and then record and store them in separate files. In related technologies, for example, if the recording frame rate requested by the device is 25 frames per second (fps), and it is required to save separate video files (i.e., gaps) every 1 minute (60 seconds), there is a solution to achieve this by counting the number of frames, then count to 1500 frames to break the gap; another solution is to use a 1-minute system time to break the gap, record a recording start time, poll the current time, and break the gap when 1 minute is reached.

[0079] However, when counting the video stream frame rate on the device side, it is found that there will be certain errors. Figure 1 Record a sample image for a file, such as Figure 1As shown in the figure, when the device records image frames through one camera L1, the frame rate requested by the device is 25fps, while the actual acquisition frame rate of camera L1 is 24.99fps or 25.01fps; when the device records image frames through two cameras L2 and L3, the actual acquisition frame rate of camera L2 is lower than the frame rate requested by the device, and the actual acquisition frame rate of camera L3 is higher than the frame rate requested by the device. The problem caused by the above reasons is that the camera captures unstable images or the encoding of image frames after transmission will also cause delays. In addition, operating system task scheduling and card writing delays will also cause errors. For example, it is impossible to save the interruption exactly at one minute (60 seconds), or the card writing timeout occurs in the first few frames when the interruption moment is reached, resulting in interruption delays.

[0080] If the actual acquisition frame rate of the camera is not completely consistent with the value requested by the device, there will be a cumulative error in the recording process over time. The longer the recording time, the greater the error.

[0081] Figure 2 This is an error accumulation example diagram of an embodiment of the present disclosure. Assuming that the set video stream frame rate is f1, and the actual received video stream frame rate is f2, the error is ε = (|f2-f1| / f1)*100%. Then after N = f2 / |f2-f1| frames, there will be a cumulative error of 1 frame. Taking the requested frame rate of the device as 25fps, if the frame rate of the received video stream (that is, the actual acquisition frame rate of the camera) is 25.01fps and the error is 0.04%, then Figure 2 As shown in L4 in the figure, an error of one frame will occur at 100 seconds; after 100 seconds (s)*25 (about 0.7 hours), the actual received video frame will be 25 frames more than the set value; and if the frame rate of the received video stream is 24.99fps and the error is 0.04%, then Figure 2 As shown in L5 in , an error of one frame less will occur at 100 seconds; after 100s*25 (about 0.7 hours), the actual received video frames will be 25 frames less than the set calculated value.

[0082] If the interruption is performed based on the two solutions in the aforementioned related technologies, the first solution can meet the requirements when the frame rate is stable, but if the frame rate is unstable, it will cause time errors. For example, the recording time is very different from 1 minute, resulting in the inability to play the recorded video file according to a fixed length of time; the second solution, since the time of each process of program running is uncertain, such as the frame rate is unstable and / or the task scheduling interval brings errors, the accumulated errors make the number of file frames actually recorded in 1 minute very different from 1500 frames, and it cannot meet the demand for playing the recorded video file according to a fixed length of time.

[0083] In addition, based on the difference between the actual acquisition frame rate and the requested frame rate, when saving the video file, assuming that every 1 minute of video frame is required to be saved as a file, and the file name is named after the time (such as the file name format is: year-month-day_hour-minute-second.mov), then in the case of long-term recording, the file name may be inconsistent with the acquisition time of the first file frame in the file. Figure 3 Record a sample image for a file, such as Figure 3 As shown, the time indicated by the video file name corresponding to L6 is earlier than the system acquisition time of the first video frame, and the time indicated by the video file name corresponding to L7 is later than the system acquisition time of the first video frame.

[0084] Based on this, the present disclosure discloses a method for recording a multimedia file. Figure 4 FIG. 1 is a flowchart of a method for recording a multimedia file according to an exemplary embodiment. Figure 4 As shown, the method mainly includes the following steps:

[0085] S41, obtaining the first time when the current multimedia file records the current file frame, and the number of file frames recorded in the current multimedia file;

[0086] S42: Determine the file frames to be recorded in the current multimedia file within the preset recording duration based on the number of file frames, the first time, a preset recording duration of a single multimedia file, and the number of preset recording frames within the preset recording duration.

[0087] In the embodiments of the present disclosure, the method for recording multimedia files can be applied to terminal devices, such as user equipment (UE), mobile devices, user terminals, mobile phones, tablet computers, personal digital assistants (PDAs), handheld devices, computing devices, vehicle-mounted devices, wearable devices and other terminal devices. The method for recording multimedia files can also be applied to cloud devices, such as physical servers, virtualized servers, virtual machine managers, etc. The embodiments of the present disclosure do not limit the executor of the method for recording multimedia files. In the subsequent description of the embodiments of the present disclosure, the electronic device is used as the executor for description. In addition, the multimedia file can be a video file, an audio file, an image file, etc., and the corresponding file frame can be an image frame or an audio frame, etc.

[0088] In step S41, the electronic device obtains the first time when the current multimedia file records the current file frame, and the number of file frames recorded in the current multimedia file, wherein the first time is the system time when the electronic device records the current file frame, and the number of file frames recorded includes the sum of the number of file frames belonging to the current multimedia file recorded before the first time and the number of file frames currently being recorded.

[0089] In step S42, the electronic device determines the file frame to be recorded in the current multimedia file based on the first time of recording the current file frame and the number of file frames recorded in the current multimedia file, combined with the preset recording duration of the single multimedia file and the preset number of recorded frames within the preset recording duration. The preset recording duration is, for example, the aforementioned 1 minute, the preset number of recorded frames within the preset recording duration is, for example, the aforementioned 1500 frames, and the preset recording duration and the preset number of recorded frames are associated with a preset recording frame rate.

[0090] Based on the first time the current file frame is recorded and the number of recorded file frames, the electronic device can actually calculate the actual recording frame rate of the current multimedia file. Then, based on the preset recording frame rate and the actual recording frame rate, the electronic device can determine whether the current recording meets expectations and make targeted adjustments. For example, when the actual recording frame rate is too high or too low, the number of frames written within the preset recording duration can be controlled to be not too far from the preset number of recording frames, so that when the current multimedia file is played after recording is completed, the preset recording duration can still be maintained.

[0091] It can be understood that in the embodiments of the present disclosure, based on the first time of the current file frame that can reflect the actual recording frame rate and the number of recorded file frames in the current multimedia file recording process, combined with the preset recording time of a single multimedia file that can reflect the preset frame rate and the preset number of recording frames within the preset recording time, the file frame to be recorded within the preset recording time and after the first time is determined. Compared with the method of recording each multimedia file only according to a single indicator of the preset recording time or the preset number of recording frames, the scheme of the embodiments of the present disclosure can dynamically adjust the number of file frames recorded in the current multimedia file through the actual recording frame rate and the preset recording frame rate, so that when the current multimedia file after recording is completed is played, the preset recording time can still be played. That is, in this way, the accuracy of multimedia file recording can be improved.

[0092] In some embodiments, determining the file frames to be recorded in the current multimedia file within the preset recording duration based on the number of file frames, the first time, a preset recording duration of a single multimedia file, and the number of preset recording frames within the preset recording duration includes:

[0093] Based on the preset recording duration, determining an estimated duration from the first multimedia file to the completion of recording the current multimedia file;

[0094] In response to the number of file frames reaching the preset number of recording frames, and a first difference between the first time and a second time of the first file frame in the first multimedia file is less than the estimated duration, determining a file frame to be recorded in the current multimedia file within the preset recording duration based on the estimated duration;

[0095] In response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, the file frames to be recorded in the current multimedia file within the preset recording duration are determined based on the preset number of recording frames.

[0096] In the embodiment of the present disclosure, the recording duration of each multimedia file is a preset recording duration, so the estimated duration from the first multimedia file to the completion of recording the current multimedia file can be the product of the preset recording duration and the number of multimedia files recorded after the completion of recording the current multimedia file; and as mentioned above, there may still be system errors. For example, after requesting to record a file, the system scheduling delay causes the file frame to be obtained later than the requested time. Therefore, the estimated duration in the embodiment of the present disclosure may also include system delays, etc., which are not limited in the embodiment of the present disclosure.

[0097] In the embodiment of the present disclosure, if the number of recorded file frames in the current multimedia file reaches the preset number of recorded frames, but the first difference between the first time of recording the current file frame and the second time of the first file frame in the first multimedia file is less than the estimated duration, then it means that the current actual recording frame rate is too high. In order to ensure that the duration of the recorded multimedia file when it is played is consistent with the preset recording duration when the frame rate is too high, the embodiment of the present disclosure determines the file frames to be recorded in the current multimedia file within the preset recording duration in combination with the estimated duration.

[0098] In the embodiment of the present disclosure, if the number of recorded file frames in the current multimedia file has not reached the preset number of recorded frames, but the first difference between the first time of recording the current file frame and the second time of the first file frame in the first multimedia file has reached the estimated duration, then it means that the current actual recording frame rate is low. In order to ensure that the duration of the recorded multimedia file when it is played is consistent with the preset recording duration when the frame rate is low, the embodiment of the present disclosure determines the file frames to be recorded in the current multimedia file within the preset recording duration in combination with the preset number of recorded frames.

[0099] It can be understood that in the embodiment of the present disclosure, the first time of obtaining the current file frame and the number of recorded file frames are compared with the corresponding preset values ​​based on the current multimedia file, that is, the current actual recording frame rate is compared with the preset frame rate, and then targeted recording control is performed according to the frame rate comparison, so that the playback duration of the recorded multimedia file can meet expectations, thereby improving the accuracy of the recording.

[0100] In some embodiments, in response to the number of file frames reaching the preset number of recording frames, and the difference between the first time and the second time of the first file frame in the first multimedia file is less than the estimated duration, determining the file frame to be recorded in the current multimedia file within the preset recording duration based on the estimated duration, includes:

[0101] In response to the number of file frames reaching the preset number of recording frames and the first difference between the first time and the second time being less than the estimated duration, the recording is stopped until the first difference reaches the estimated duration and the actual recording duration of the current multimedia file does not exceed the preset recording duration; wherein the actual recording duration is the time difference between the first time of recording the current file frame of the current multimedia file and the first file frame in the current multimedia file.

[0102] In an embodiment of the present disclosure, when the actual recording frame rate is greater than the preset frame rate, although the number of frames reaches the preset number of recording frames, the recording time is still insufficient, which may cause the playback time to be inconsistent with the preset recording time. Therefore, the embodiment of the present disclosure limits the number of file frames to be recorded based on the estimated time from the first multimedia file to the completion of recording the current multimedia file, and the preset recording time of a single multimedia file. In this way, not only the recording time of a single multimedia file is taken into account, but also the cumulative error caused by system scheduling error is integrated through the estimated time from the first multimedia file to the completion of recording the current multimedia file. Therefore, this method can improve the accuracy of single file recording.

[0103] It should be noted that in the disclosed embodiment, the electronic device may also obtain a recording instruction for a multimedia file, and determine the file frames to be recorded in the current multimedia file within the preset recording duration based on the difference between the current system time and the acquisition time of the recording instruction. Exemplarily, in response to the number of file frames reaching the preset number of recording frames, and the second difference between the current system time and the acquisition time of the recording instruction is less than the estimated duration, the recording is stopped until the second difference reaches the estimated duration and the actual recording duration of the current multimedia file does not exceed the preset recording duration. The recording instruction is used to indicate the start of recording the first multimedia file, as well as multimedia files after the first multimedia file.

[0104] In addition, in the embodiment of the present disclosure, when the frame rate is high, the file frames recorded within the preset recording duration are actually greater than the preset number of recording frames. However, since the actual recording frame rate and the preset recording frame rate are usually not too different, the number of file frames in the current multimedia file recorded based on the scheme of the present disclosure will not be too different from the preset number of recording frames. Usually, there will only be 1-2 more frames, and a few more frames will not cause the display duration to exceed the preset recording duration. Still taking the frame rate of 25fps and the preset recording duration of 1 minute as an example, as long as the extra recorded file frames do not exceed 12 frames, which is equivalent to 500 milliseconds, it will not be displayed as 1 minute and 1 second during playback. That is, based on the scheme of the embodiment of the present disclosure, when the frame rate is high, although the number of recorded file frames is greater than the preset number of recording frames, it is still played within the preset recording duration.

[0105] In some embodiments, in response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, determining the file frames to be recorded in the current multimedia file within the preset recording duration based on the preset number of recording frames includes:

[0106] In response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, the recording is stopped until the number of file frames in the current multimedia file reaches the preset number of recording frames and the actual recording duration of the current multimedia file does not exceed the preset recording duration; wherein the actual recording duration is the time difference between the first time when the current file frame of the current multimedia file is recorded and the first file frame in the current multimedia file.

[0107] In the embodiment of the present disclosure, when the actual recording frame rate is lower than the preset frame rate, although the total estimated duration is reached from the first file frame in the first multimedia file to the first time of the current file frame, the number of frames recorded in the current multimedia file is still too small due to the influence of the frame rate and the system scheduling error, which may also cause the playback duration to be inconsistent with the preset recording duration. Therefore, the embodiment of the present disclosure takes the preset number of recording frames as a target, and the preset recording duration of a single multimedia file limits the number of file frames to be recorded. In this way, file frames can be supplemented in real time when the frame rate is low, so that the playback duration of the recorded multimedia file meets expectations. In this way, the accuracy of single file recording can also be improved.

[0108] In some embodiments, the method further comprises:

[0109] The time for requesting to record the next multimedia file is determined based on the number of file frames, the preset number of recording frames, the first time, the second time, and the estimated duration.

[0110] In the disclosed embodiment, requesting to record the next multimedia file may refer to requesting the name of the next multimedia file or caching the file frame used to generate the next multimedia file. Since the electronic device needs to record and save the file frame separately, and the file recording (i.e. saving) in the current multimedia file and the request to record the next multimedia file both require the electronic device to schedule tasks for execution, by scheduling the above two tasks, the recording of each multimedia file can meet the requirements.

[0111] In some embodiments, determining the time to request recording of the next multimedia file based on the number of file frames, the preset number of recording frames, the first time, the second time, and the estimated duration includes:

[0112] In response to the number of file frames reaching the preset number of recording frames and a first difference between the first time and the second time being less than the estimated duration, requesting to record the next multimedia file after stopping recording the current multimedia file;

[0113] In response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, requesting to record the next multimedia file and then stopping recording the current multimedia file.

[0114] In an embodiment of the present disclosure, if the number of file frames reaches a preset number of recording frames, but the first difference between the first time and the second time is less than the estimated duration, that is, the actual recording frame rate is high, the electronic device may wait until the current multimedia file is recorded before requesting to record the next multimedia file, so that the file frames recorded in two adjacent multimedia files are not repeated; and if the number of file frames does not reach the preset number of recording frames, but the first difference between the first time and the second time reaches the estimated duration, that is, the actual recording frame rate is low, the electronic device may first request to record the next multimedia file and then stop recording the current multimedia file. In this way, its purpose is to supplement the number of file frames in the current multimedia file so that the preset recording duration can be reached during playback, while not affecting the writing of frames in the next multimedia file.

[0115] In some embodiments, in response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, requesting to record the next multimedia file and then stopping recording the current multimedia file includes:

[0116] In response to the number of file frames not reaching the preset number of recording frames, and the first difference between the first time and the second time reaching the estimated duration, after requesting to record the next multimedia file, the target file frames recorded after the first time are multiplexed in the current multimedia and the next multimedia file; wherein the sum of the number of target file frames and the number of file frames is equal to the preset number of recording frames.

[0117] In the disclosed embodiment, by first requesting to record the next multimedia file and then reusing the file frames in the next multimedia file into the current multimedia file, in this way, not only can the current multimedia file satisfy the preset recording duration after supplementing the file frames to the preset number of recording frames, but also in the case of naming with timestamps, such as the aforementioned requirement that the file name is named after the acquisition time of the first file frame in the file, the naming of the multimedia file meets the above naming requirements.

[0118] Figure 5 This is an example diagram of a multimedia file recording result when the frame rate is high in an embodiment of the present disclosure. Figure 6 This is an example diagram of multimedia file recording results in a case where the frame rate is low in an embodiment of the present disclosure. Figure 5 and Figure 6 In the example, each video file is 1 minute long. Figure 5 As shown in FIG. 1 , the total number of frames of the first video file is 1500 frames, while the actual number of frames recorded in the second multimedia file is 1501 frames, and the total number of frames of the third video file is 1500 frames; Figure 6 As shown, the number of frames of each video file is 1500 frames, but the second multimedia file and the third multimedia file actually multiplex one frame.

[0119] In some embodiments, the frame multiplexed in the current multimedia file and the next multimedia file is an instant decoding refresh frame obtained after requesting to record the next multimedia file.

[0120] In the disclosed embodiment, taking the recording of video images as an example, the instantaneous decoder refresh frame (IDR) frame is actually an I frame, which is the first frame in the group of pictures (GOP). Usually, the recording of image frames uses the group of pictures as the basic unit of access. GOP is composed of an I frame and several P frames. For example, a GOP includes an I frame and 14 P frames. In the disclosed embodiment, the next multimedia file requests an IDR frame (I frame). In this way, the next multimedia file can obtain image frames starting from the I frame, reducing the occurrence of P frame loss due to the lack of I frames.

[0121] In some embodiments, determining the estimated duration from the first multimedia file to the completion of recording the current multimedia file based on the preset recording duration includes:

[0122] In response to the current multimedia file being the first multimedia file after the recording instruction is obtained, determining the preset recording duration after the second time of starting to obtain the first file frame as the estimated duration of the current multimedia file;

[0123] In response to the current multimedia file not being the first multimedia file, an estimated duration from the first multimedia file to the completion of recording the current multimedia file is determined based on the preset recording duration, the recording time of the previous multimedia file, and the acquisition time of the recording instruction.

[0124] As mentioned above, the electronic device may also determine the estimated duration by considering the system task scheduling error. In the disclosed embodiment, the electronic device starts recording each multimedia file based on the recording instruction of the multimedia file, but the estimated duration is determined differently for recording different multimedia files. Among them, if the current multimedia file is the first multimedia file, the preset recording duration after the second time of starting to obtain the first file frame is determined as the estimated duration of the first multimedia file, that is, if the first file frame is obtained by a delay of T0 time relative to the acquisition time of the recording instruction, the first multimedia file is still recorded with the preset recording duration, so that the first multimedia file is recorded to a sufficient number of file frames.

[0125] If the current multimedia file is not the first multimedia file, the electronic device determines the estimated duration from the first multimedia file to the completion of recording the current multimedia file based on the preset recording duration, the recording time of the previous multimedia file and the acquisition time of the recording instruction.

[0126] In some embodiments, the determining the estimated duration from the first multimedia file to the completion of recording the current multimedia file based on the preset recording duration, the recording time of the previous multimedia file, and the acquisition time of the recording instruction includes:

[0127] Determine the time difference between the recording time of the last frame file in the previous multimedia file and the preset time until the previous multimedia file is recorded; wherein the preset time is determined based on the acquisition time of the recording instruction and the product of the number of files included in the first multimedia file to the current multimedia file and the preset recording time;

[0128] The difference between the preset duration until the current multimedia file is recorded and the time difference is determined as the estimated duration from the first multimedia file to the completion of recording the current multimedia file; wherein the preset duration is the product of the number of files included from the first multimedia file to the current multimedia file and the preset recording duration.

[0129] Figure 7 FIG. 1 is an example diagram of recording a multimedia file in an embodiment of the present disclosure, taking recording to the second multimedia file as an example. Figure 7 As shown, the recording time of the last frame of the first multimedia file is actually the sum of the acquisition time of the recording instruction, the preset recording time (60s) and T0, and the preset time for recording the previous multimedia file (i.e., the first multimedia file) is the sum of the acquisition time of the recording instruction and the number of files 1*preset recording time (60s), wherein the recording time of the last frame is the actual gap time, and the preset time for recording the previous multimedia file is the theoretical gap time, then the time difference between the two is T0. In addition, the preset time until the current multimedia file is recorded is 2*60s, i.e., 120s, then the difference between the preset time until the current multimedia file is recorded is determined as the estimated time from the first multimedia file to the current multimedia file, i.e., 120-T0. It can be understood that in the embodiment of the present disclosure, based on the difference between the actual gap time and the theoretical gap time, the gap time of the next multimedia file is adjusted to control the frame recording of the next multimedia file, and the accuracy of multimedia file recording can be improved by considering the system scheduling error.

[0130] In some embodiments, the method further comprises:

[0131] Obtaining a recording instruction for a multimedia file; wherein the recording instruction is used to instruct to start recording a first multimedia file and multimedia files after the first multimedia file;

[0132] In response to the current multimedia file being the first multimedia file, naming the current multimedia file based on the acquisition time of the recording instruction;

[0133] In response to the current multimedia file not being the first multimedia file, the current multimedia file is named based on the acquisition time of the first frame file in the current multimedia file.

[0134] As mentioned above, multimedia file recording also requires naming files by time. In the disclosed embodiment, for the first multimedia file, the first multimedia file is named according to the time when the recording instruction is obtained, so that the file name can indicate the start time of recording; and each file after the first multimedia file is named based on the time when the first frame file is obtained. In this way, the file name can indicate the recording time, which is more intelligent.

[0135] Figure 8 FIG. 1 is an example diagram of a multimedia file naming opportunity in an embodiment of the present disclosure, such as Figure 8 As shown, based on the T0 second delay of the previous multimedia file, the next multimedia file name is named in advance, that is, the next multimedia file is requested to be recorded in advance, and the name of the next multimedia file is, for example, the time of the requested naming. In this way, as mentioned above, the current multimedia file and the next multimedia file can reuse frames, and the problem of inconsistent file names caused by system scheduling errors is reduced.

[0136] In some embodiments, the current multimedia file is a file recorded in one channel of multi-channel recording, and the recording of each multimedia file included in each channel is synchronized.

[0137] In the disclosed embodiment, the electronic device can obtain the recording requirements of multiple files at the same time. For example, in a community monitoring scenario, multiple cameras can simultaneously collect images from different directions. In this regard, in the disclosed embodiment, based on the recording of the current multimedia file, the recording of other multimedia files is directly synchronized. In the multimedia files of each channel, the number of file frames written in each multimedia file of each channel is consistent, and the recording duration is consistent. Therefore, when naming by time, the time represented by the name is also consistent. Through this synchronization method, the accuracy of recording of various multimedia files can be easily improved.

[0138] Fig. 9 This is an example diagram of a multi-channel recording in an embodiment of the present disclosure. Fig. 9 As shown, in the embodiment of the present disclosure, when the second recording is started, the system time T2 is no longer obtained, but the acquisition time T1 of the recording instruction in the first recording is directly used.

[0139] Fig.10 This is an example diagram of a multimedia file recording in an embodiment of the present disclosure, such as Fig.10 As shown, the following steps are included:

[0140] S1001. Obtain recording instructions.

[0141] In the disclosed embodiment, the recording instruction is used to instruct to start recording a multimedia file.

[0142] S1002: Write file frame.

[0143] In the embodiment of the present disclosure, writing a file frame means writing a frame in the current multimedia file so that the multimedia file can be recorded completely.

[0144] S1003: Has the preset number of recording frames been reached? If so, execute step S1005; if not, execute step S1004.

[0145] In the disclosed embodiment, the electronic device determines whether the number of recorded file frames in the current multimedia file reaches a preset number of recorded frames, so as to perform a corresponding operation.

[0146] S1004: Has the interruption time been reached? If so, execute step S1005; if not, execute step S1002.

[0147] In the disclosed embodiment, the duration of the interruption is the aforementioned estimated duration.

[0148] S1005, file break determination.

[0149] In the embodiment of the present disclosure, if the number of recorded file frames in the current multimedia file has reached the preset number of recorded frames, the method of the embodiment of the present disclosure starts to determine the file frames to be recorded in the current multimedia file, that is, to determine whether to interrupt the recording. For scenes with high and low frame rates, the interruption determination method is referred to above.

[0150] S1006: Request to record the next multimedia file.

[0151] In this embodiment, a low frame rate scenario is taken as an example. In this scenario, a request is made to record the next multimedia file before the current multimedia file is recorded. The purpose is to enable the current multimedia file to reuse the file frames in the next multimedia file. It should be noted that for a high frame rate scenario, S1008-S1010 may be executed first, and then S1006-S1007 may be executed.

[0152] S1007 : Request instant decoding refresh frame.

[0153] In the disclosed embodiment, the next multimedia file will request an IDR frame.

[0154] S1008: Whether the preset recording time is reached; if so, execute step S1010; if not, execute step S1009.

[0155] In the embodiment of the present disclosure, whether the preset recording time is reached refers to whether the actual recording time of the current multimedia file reaches the preset recording time for further processing.

[0156] S1009: Write file frame.

[0157] In an embodiment of the present disclosure, if the actual recording duration of the current multimedia file does not reach the preset recording duration, and the number of file frames in the current multimedia file does not reach the preset number of recording frames, the file frames continue to be written.

[0158] S1010, the interruption ends.

[0159] In the embodiment of the present disclosure, if the actual recording time of the current multimedia file reaches the preset recording time, the recording of file frames in the current multimedia file is stopped, that is, the interruption is completed. It can be understood that in the embodiment of the present disclosure, the number of file frames recorded in the current multimedia file is dynamically adjusted, so that the current multimedia file after recording is completed can still play the preset recording time when it is played, which can improve the accuracy of multimedia file recording.

[0160] Fig.11 FIG. 1 is a block diagram of a multimedia file recording device according to an exemplary embodiment. Fig.11 As shown, the device mainly includes:

[0161] The first acquisition module 1101 is configured to acquire the first time when the current multimedia file records the current file frame, and the number of file frames recorded in the current multimedia file;

[0162] The first determination module 1102 is configured to determine the file frames to be recorded in the current multimedia file within the preset recording duration based on the number of file frames, the first time, a preset recording duration of a single multimedia file, and the number of preset recording frames within the preset recording duration.

[0163] In some embodiments, the first determination module 1102 is further configured to determine an estimated duration from the first multimedia file to the completion of recording the current multimedia file based on the preset recording duration; in response to the number of file frames reaching the preset number of recording frames, and a first difference between the first time and the second time of the first file frame in the first multimedia file is less than the estimated duration, determine the file frames to be recorded in the current multimedia file within the preset recording duration based on the estimated duration; in response to the number of file frames not reaching the preset number of recording frames, and a first difference between the first time and the second time reaching the estimated duration, determine the file frames to be recorded in the current multimedia file within the preset recording duration based on the preset number of recording frames.

[0164] In some embodiments, the first determination module 1102 is further configured to stop recording in response to the number of file frames reaching the preset number of recording frames and the first difference between the first time and the second time being less than the estimated duration, until the first difference reaches the estimated duration and the actual recording duration of the current multimedia file does not exceed the preset recording duration; wherein the actual recording duration is the time difference between the first time of recording the current file frame of the current multimedia file and the first file frame in the current multimedia file.

[0165] In some embodiments, the first determination module 1102 is further configured to stop recording in response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, until the number of file frames in the current multimedia file reaches the preset number of recording frames and the actual recording duration of the current multimedia file does not exceed the preset recording duration; wherein the actual recording duration is the time difference between the first time of recording the current file frame of the current multimedia file and the first file frame in the current multimedia file.

[0166] In some embodiments, the apparatus further comprises:

[0167] The second determination module is configured to determine the time to request recording of the next multimedia file based on the number of file frames, the preset number of recording frames, the first time, the second time, and the estimated duration.

[0168] In some embodiments, the second determination module is further configured to, in response to the number of file frames reaching the preset number of recording frames and the first difference between the first time and the second time being less than the estimated duration, request to record the next multimedia file after stopping recording the current multimedia file; and in response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, request to record the next multimedia file before stopping recording the current multimedia file.

[0169] In some embodiments, the second determination module is further configured to, in response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, multiplex the target file frames recorded after the first time in the current multimedia and the next multimedia file after requesting to record the next multimedia file; wherein the sum of the number of target file frames and the number of file frames is equal to the preset number of recording frames.

[0170] In some embodiments, the frame multiplexed in the current multimedia file and the next multimedia file is an instant decoding refresh frame obtained after requesting to record the next multimedia file.

[0171] In some embodiments, the apparatus further comprises:

[0172] A second acquisition module is configured to acquire a recording instruction of a multimedia file; wherein the recording instruction is used to instruct to start recording a first multimedia file and multimedia files after the first multimedia file;

[0173] The first determination module 1102 is further configured to, in response to the current multimedia file being the first multimedia file after the recording instruction is obtained, determine the preset recording duration after the second time of starting to obtain the first file frame as the estimated duration of the current multimedia file; in response to the current multimedia file not being the first multimedia file, determine the estimated duration from the first multimedia file to the completion of recording the current multimedia file based on the preset recording duration, the recording time of the previous multimedia file and the acquisition time of the recording instruction.

[0174] In some embodiments, the first determination module 1102 is further configured to determine the time difference between the recording time of the last frame file in the previous multimedia file and the preset time until the previous multimedia file is recorded; wherein the preset time is determined based on the acquisition time of the recording instruction and the product of the number of files included from the first multimedia file to the current multimedia file and the preset recording time; the difference between the preset time until the current multimedia file is recorded and the time difference is determined as the estimated time from the first multimedia file to the recording of the current multimedia file; wherein the preset time is the product of the number of files included from the first multimedia file to the current multimedia file and the preset recording time.

[0175] In some embodiments, the apparatus further comprises:

[0176] A third acquisition module is configured to acquire a recording instruction of a multimedia file; wherein the recording instruction is used to instruct to start recording a first multimedia file and multimedia files after the first multimedia file;

[0177] A first naming module, configured to name the current multimedia file based on the acquisition time of the recording instruction in response to the current multimedia file being the first multimedia file;

[0178] The second naming module is configured to name the current multimedia file based on the acquisition time of the first frame file in the current multimedia file in response to the current multimedia file not being the first multimedia file.

[0179] In some embodiments, the current multimedia file is a file recorded in one channel of multi-channel recording, and the recording of each multimedia file included in each channel is synchronized.

[0180] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0181] Fig.12 1 is a block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 1200 may be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, a server, etc.

[0182] Reference Fig.12 , the electronic device 1200 may include one or more of the following components: a processing component 1202 , a memory 1204 , a power component 1206 , a multimedia component 1208 , an audio component 1210 , an input / output (I / O) interface 1212 , a sensor component 1214 , and a communication component 1216 .

[0183] The processing component 1202 generally controls the overall operation of the electronic device 1200, such as operations associated with at least one of display, phone calls, data communications, camera operations, and recording operations. The processing component 1202 may include one or more processors 1220 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1202 may include one or more modules to facilitate the interaction between the processing component 1202 and other components. For example, the processing component 1202 may include a multimedia module to facilitate the interaction between the multimedia component 1208 and the processing component 1202.

[0184] The memory 1204 is configured to store various types of data to support operations on the electronic device 1200. Examples of such data include at least one of the following: instructions for any application or method operating on the electronic device 1200, contact data, phone book data, messages, pictures, and videos. The memory 1204 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, or an optical disk.

[0185] The power supply component 1206 provides power to various components of the electronic device 1200. The power supply component 1206 may include at least one of the following: a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 1200.

[0186] The multimedia component 1208 includes a screen that provides an output interface between the electronic device 1200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1208 includes a front camera and / or a rear camera. When the electronic device 1200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0187] The audio component 1210 is configured to output and / or input audio signals. For example, the audio component 1210 includes a microphone (MIC), and when the electronic device 1200 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1204 or sent via the communication component 1216. In some embodiments, the audio component 1210 also includes a speaker for outputting audio signals.

[0188] I / O interface 1212 provides an interface between processing component 1202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, a home button, a volume button, a start button, and a lock button.

[0189] The sensor assembly 1214 includes one or more sensors for providing various aspects of status assessment for the electronic device 1200. For example, the sensor assembly 1214 can detect the open / closed state of the electronic device 1200, the relative positioning of the components, such as the display and keypad of the electronic device 1200, and the sensor assembly 1214 can also detect the position change of the electronic device 1200 or a component in the electronic device 1200, the presence or absence of contact between the user and the electronic device 1200, the orientation or acceleration / deceleration of the electronic device 1200, and the temperature change of the electronic device 1200. The sensor assembly 1214 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1214 may also include a light sensor, such as a complementary metal oxide semiconductor (CMOS) or a charge coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1214 may also include, but is not limited to, at least one of the following: an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, and a temperature sensor.

[0190] The communication component 1216 is configured to facilitate communication between the electronic device 1200 and other devices in a wired or wireless manner. The electronic device 1200 can access a wireless network based on a communication standard, such as Wi-Fi, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 1216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (Ultra Wide Band, UWB) technology, Bluetooth (BT) technology and other technologies.

[0191] In an exemplary embodiment, the electronic device 1200 may be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components.

[0192] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1204 including executable instructions or a computer program, which can be executed by a processor 1220 of the electronic device 1200 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0193] A non-temporary computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute any one of the above-mentioned multimedia file methods of the embodiments of the present disclosure.

[0194] The embodiment of the present disclosure provides a computer program product, which includes: a computer program or an executable instruction, which is stored in a computer-readable storage medium. The processor of the computer device reads the computer program or the executable instruction from the computer-readable storage medium, and the processor executes the computer program or the executable instruction, so that the computer device executes any one of the multimedia file recording methods of the embodiment of the present disclosure.

[0195] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0196] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for recording multimedia files, characterized in that: include: Obtaining the first time when the current multimedia file records the current file frame, and the number of file frames recorded in the current multimedia file; Based on the number of file frames, the first time, a preset recording duration of a single multimedia file, and the preset number of recording frames within the preset recording duration, the file frames to be recorded in the current multimedia file within the preset recording duration are determined.

2. The method according to claim 1, characterized in that The determining, based on the number of file frames, the first time, a preset recording duration of a single multimedia file, and the number of preset recording frames within the preset recording duration, the file frames to be recorded in the current multimedia file within the preset recording duration includes: Based on the preset recording duration, determining an estimated duration from the first multimedia file to the completion of recording the current multimedia file; In response to the number of file frames reaching the preset number of recording frames, and a first difference between the first time and a second time of the first file frame in the first multimedia file is less than the estimated duration, determining a file frame to be recorded in the current multimedia file within the preset recording duration based on the estimated duration; In response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, the file frames to be recorded in the current multimedia file within the preset recording duration are determined based on the preset number of recording frames.

3. The method according to claim 2, characterized in that In response to the number of file frames reaching the preset number of recording frames, and the difference between the first time and the second time of the first file frame in the first multimedia file is less than the estimated duration, determining the file frame to be recorded in the current multimedia file within the preset recording duration based on the estimated duration, comprising: In response to the number of file frames reaching the preset number of recording frames and the first difference between the first time and the second time being less than the estimated duration, the recording is stopped until the first difference reaches the estimated duration and the actual recording duration of the current multimedia file does not exceed the preset recording duration; wherein the actual recording duration is the time difference between the first time of recording the current file frame of the current multimedia file and the first file frame in the current multimedia file.

4. The method according to claim 2, characterized in that: In response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, determining the file frames to be recorded in the current multimedia file within the preset recording duration based on the preset number of recording frames, comprises: In response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, the recording is stopped until the number of file frames in the current multimedia file reaches the preset number of recording frames and the actual recording duration of the current multimedia file does not exceed the preset recording duration; wherein the actual recording duration is the time difference between the first time when the current file frame of the current multimedia file is recorded and the first file frame in the current multimedia file.

5. The method according to claim 2, characterized in that: The method further comprises: Based on the number of file frames, the preset number of recording frames, the first time, the second time, and the estimated duration, determine the time to request recording of the next multimedia file.

6. The method according to claim 5, characterized in that The determining, based on the number of file frames, the first time, the second time, the preset number of recording frames, and the estimated duration, a time for requesting to record a next multimedia file includes: In response to the number of file frames reaching the preset number of recording frames and a first difference between the first time and the second time being less than the estimated duration, requesting to record the next multimedia file after stopping recording the current multimedia file; In response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, requesting to record the next multimedia file and then stopping recording the current multimedia file.

7. The method according to claim 6, characterized in that In response to the number of file frames not reaching the preset number of recording frames and the first difference between the first time and the second time reaching the estimated duration, requesting to record the next multimedia file and then stopping recording the current multimedia file, comprises: In response to the number of file frames not reaching the preset number of recording frames, and the first difference between the first time and the second time reaching the estimated duration, after requesting to record the next multimedia file, the target file frames recorded after the first time are multiplexed in the current multimedia and the next multimedia file; wherein the sum of the number of target file frames and the number of file frames is equal to the preset number of recording frames.

8. The method according to claim 7, characterized in that The frame multiplexed in the current multimedia file and the next multimedia file is an instant decoding refresh frame obtained after requesting to record the next multimedia file.

9. The method according to any one of claims 2 to 8, characterized in that: The method further comprises: Obtaining a recording instruction for a multimedia file; wherein the recording instruction is used to instruct to start recording a first multimedia file and multimedia files after the first multimedia file; The step of determining an estimated duration from the first multimedia file to the completion of recording the current multimedia file based on the preset recording duration includes: In response to the current multimedia file being the first multimedia file after the recording instruction is obtained, determining the preset recording duration after the second time of starting to obtain the first file frame as the estimated duration of the current multimedia file; In response to the current multimedia file not being the first multimedia file, an estimated duration from the first multimedia file to the completion of recording the current multimedia file is determined based on the preset recording duration, the recording time of the previous multimedia file, and the acquisition time of the recording instruction.

10. The method according to claim 9, characterized in that The determining, based on the preset recording duration, the recording time of the previous multimedia file, and the acquisition time of the recording instruction, an estimated duration from the first multimedia file to the completion of recording the current multimedia file comprises: Determine the time difference between the recording time of the last frame file in the previous multimedia file and the preset time until the previous multimedia file is recorded; wherein the preset time is determined based on the acquisition time of the recording instruction and the product of the number of files included in the first multimedia file to the current multimedia file and the preset recording time; The difference between the preset duration until the current multimedia file is recorded and the time difference is determined as the estimated duration from the first multimedia file to the completion of recording the current multimedia file; wherein the preset duration is the product of the number of files included from the first multimedia file to the current multimedia file and the preset recording duration.

11. The method according to claim 1, characterized in that: The method further comprises: Obtaining a recording instruction for a multimedia file; wherein the recording instruction is used to instruct to start recording a first multimedia file and multimedia files after the first multimedia file; In response to the current multimedia file being the first multimedia file, naming the current multimedia file based on the acquisition time of the recording instruction; In response to the current multimedia file not being the first multimedia file, the current multimedia file is named based on the acquisition time of the first frame file in the current multimedia file.

12. The method according to claim 1, characterized in that The current multimedia file is a file recorded in one channel of the multi-channel recording, and the recording of each multimedia file included in each channel is synchronized.

13. A multimedia file recording device, characterized in that: include: A first acquisition module is configured to acquire a first time when a current multimedia file records a current file frame, and a number of file frames that have been recorded in the current multimedia file; The first determination module is configured to determine the file frames to be recorded in the current multimedia file within the preset recording duration based on the number of file frames, the first time, a preset recording duration of a single multimedia file, and the number of preset recording frames within the preset recording duration.

14. An electronic device, characterized in that: include: processor; Memory for storing computer programs or instructions; The processor executes the computer program or instructions to implement the steps of the method according to any one of claims 1 to 12.

15. A non-transitory computer-readable storage medium storing a computer program or instruction, characterized in that: When the computer program or instructions in the storage medium are executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

16. A computer program product, comprising a computer program or instructions, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.