File acquisition method and device and medium
By obtaining the performance parameters of the terminal device and adjusting the acquisition parameters of the image file, the image file format matching problem between the USB camera and the terminal device is solved, ensuring that the image file parameters match the hardware performance of the terminal device, improving the user experience.
Patent Information
- Application Number
- CN202411140954.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-12-10
AI Technical Summary
In the prior art, the transmission bandwidth or encoding and decoding capabilities between the USB camera and the terminal device are insufficient, resulting in the image file format that cannot automatically match the hardware performance of the terminal device, increasing the user's workload and reducing the user experience.
By identifying the external camera connection signal, obtain the performance parameters of the terminal device, determine the initial acquisition parameters, including resolution, frame rate and media format, and adjust the acquisition parameters according to the frame rate of the current image file to ensure the image file parameters and the terminal device's hardware Performance matching.
It avoids waste of resources caused by high-performance terminal devices to obtain low-quality image files and performance overload caused by low-performance terminal devices to process high-quality image files, improving the user experience.
Smart Images

Figure CN119110157A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and in particular to a file acquisition method, device and medium. Background Art
[0002] As an image acquisition device, Universal Serial Bus (USB) cameras have become a common accessory for terminal devices such as computers, tablets, and mobile phones due to their convenience and flexibility. USB cameras support the output of image files in two formats: YUV and MJPEG. Image files in YUV format have a higher image clarity, but they place higher demands on the transmission bandwidth between the USB camera and the terminal device and the encoding and decoding capabilities of the terminal device. In contrast, although image files in MJPEG format have a slightly lower image clarity, they are more suitable for terminal devices with limited hardware performance.
[0003] Currently, when a USB camera is connected to a terminal device with better performance, it can smoothly transmit image files in YUV format, providing users with high-quality preview, video recording, and photo taking service experiences. However, when a USB camera is transferred to a terminal device with poor performance, service jams may occur when transmitting image files in YUV format due to insufficient transmission bandwidth between the USB camera and the terminal device or limited encoding and decoding capabilities of the terminal device. On the contrary, if the USB camera is initially connected to a terminal device with poor performance and transmits image files in MJPEG format, when the USB camera is transferred to a terminal device with better performance, the USB camera will continue to transmit image files in MJPEG format, but this fails to fully utilize the performance of the terminal device. Therefore, users usually need to manually adjust the format of the image file according to the performance of the terminal device so that the terminal device can obtain image files that match its own performance.
[0004] However, this manual adjustment increases the user's workload and is difficult to automate and intelligentize, resulting in a poor user experience. Summary of the invention
[0005] Based on the above problems, the present application provides a file acquisition method, device and medium, which can ensure that the parameters of the image file acquired by the terminal device match the actual hardware performance of the terminal device, thereby enhancing the user experience.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] In a first aspect, the present application discloses a file acquisition method, which is applied to a terminal device, and the method comprises:
[0008] When an external camera connection signal is identified, the performance parameters of the terminal device are obtained, and initial acquisition parameters are determined according to the performance parameters, wherein the initial acquisition parameters include resolution, frame rate and media format;
[0009] According to the initial acquisition parameters, a current image file is acquired, where the current image file is acquired and generated by the external camera;
[0010] Acquiring the frame rate of the current image file, and if the frame rate of the current image file is less than or equal to a first preset frame rate threshold, adjusting the initial acquisition parameters;
[0011] Obtain image files based on the adjusted acquisition parameters.
[0012] Optionally, if the frame rate of the current image file is less than or equal to a first preset frame rate threshold, adjusting the initial acquisition parameters includes:
[0013] If the frame rate of the current image file is less than or equal to a first preset frame rate threshold, and the media format of the current image file is a first format, then the resolution in the initial acquisition parameters is reduced.
[0014] Optionally, if the frame rate of the current image file is less than or equal to a first preset frame rate threshold, adjusting the initial acquisition parameters includes:
[0015] If the frame rate of the current image file is less than or equal to a first preset frame rate threshold, and the media format of the current image file is the second format, the media format in the initial acquisition parameters is adjusted to the first format, wherein the amount of data transmitted by the first format is less than the amount of data transmitted by the second format.
[0016] Optionally, the method further comprises:
[0017] If the frame rate of the current image file is greater than a first preset frame rate threshold and less than or equal to a second preset frame rate threshold, and the media format of the current image file is the second format, then the resolution in the initial acquisition parameters is reduced.
[0018] Optionally, after acquiring the image file according to the adjusted acquisition parameters, the method further includes:
[0019] The frame rate of the image file after the acquisition parameters are adjusted is obtained, and if the frame rate of the image file is greater than a first preset frame rate threshold, the acquisition parameters are saved as initial acquisition parameters.
[0020] Optionally, after performing the step of acquiring the adjusted image file according to the adjusted acquisition parameters, the method further includes:
[0021] Performing image services on the adjusted image file, wherein the image services include one or more of editing, speeding up, slowing down, and adding filters.
[0022] Optionally, acquiring the current image file according to the initial acquisition parameters includes:
[0023] When the terminal device is in an adaptive configuration state, the current image file is acquired according to the initial acquisition parameters.
[0024] Optionally, when the terminal device is in an adaptive configuration state, acquiring the current image file according to the initial acquisition parameters includes:
[0025] When the terminal device receives an adaptive configuration state instruction triggered by a user, or when the external camera corresponding to the terminal device is in a target business scenario, the current image file is acquired according to the initial acquisition parameters.
[0026] In a second aspect, the present application discloses a terminal device, the terminal device comprising: a memory and a processor;
[0027] The memory is used to store programs;
[0028] The processor is used to execute the program to implement the various steps of the method described in the first aspect.
[0029] In a third aspect, the present application discloses a computer-readable storage medium for storing a computer program. When the computer program is executed, it is specifically used to implement the various steps of the method described in the first aspect.
[0030] Compared with the prior art, this application has the following beneficial effects:
[0031] The present application discloses a file acquisition method, device and medium, the file acquisition method comprising: obtaining the performance parameters of the terminal device when an external camera connection signal is identified, and determining the initial acquisition parameters according to the performance parameters; obtaining the current image file according to the initial acquisition parameters, the current image file is generated by the external camera acquisition; obtaining the frame rate of the current image file, if the frame rate of the current image file is less than or equal to the first preset frame rate threshold, adjusting the initial acquisition parameters; obtaining the image file according to the adjusted acquisition parameters. Thus, it can be ensured that the parameters of the image file acquired by the terminal device match the actual hardware performance of the terminal device, avoiding the waste of resources caused by the high-performance terminal device acquiring low-quality image files due to improper setting of the image file parameters, and the performance overload caused by the low-performance terminal device processing high-quality image files, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0033] Figure 1 A schematic diagram of connecting a USB camera to a terminal device;
[0034] Figure 2 A flowchart of a file acquisition method provided in an embodiment of the present application;
[0035] Figure 3 A flowchart of another file acquisition method provided in an embodiment of the present application;
[0036] Figure 4 A schematic diagram of a file acquisition device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] See also Figure 1 , which is a schematic diagram of a USB camera connected to a terminal device. When the USB camera is connected to a terminal device with better performance, it can smoothly transmit image files in YUV format, providing users with high-quality preview, recording, and photo taking service experiences. However, when the USB camera is transferred to a terminal device with poorer performance, service jams may occur when transmitting YUV format image files due to insufficient transmission bandwidth between the USB camera and the terminal device or limited encoding and decoding capabilities of the terminal device. On the contrary, if the USB camera is initially connected to a terminal device with poor performance and transmits image files in MJPEG format, when the USB camera is transferred to a terminal device with better performance, the USB camera will continue to transmit image files in MJPEG format, but this fails to fully utilize the performance of the terminal device.
[0038] Therefore, users usually need to manually adjust the format of the image file according to the performance of the terminal device so that the terminal device can obtain the image file that matches its own performance.
[0039] However, this manual adjustment increases the user's workload and is difficult to automate and intelligentize, resulting in a poor user experience.
[0040] After research, the inventor proposed a file acquisition method, device and medium, the file acquisition method comprising: obtaining the performance parameters of the terminal device when an external camera connection signal is identified, and determining the initial acquisition parameters according to the performance parameters; obtaining the current image file according to the initial acquisition parameters, the current image file is generated by the external camera acquisition; obtaining the frame rate of the current image file, if the frame rate of the current image file is less than or equal to the first preset frame rate threshold, adjusting the initial acquisition parameters; obtaining the image file according to the adjusted acquisition parameters. Thus, it can be ensured that the parameters of the image file acquired by the terminal device match the actual hardware performance of the terminal device, avoiding the waste of resources caused by the high-performance terminal device acquiring low-quality image files due to improper setting of the image file parameters, and the performance overload caused by the low-performance terminal device processing high-quality image files, thereby improving the user experience.
[0041] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0042] See also Figure 2 , which is a flow chart of a file acquisition method provided in an embodiment of the present application. The method is applied to a terminal device, which may be a mobile phone, a computer, a law enforcement recorder, or other device.
[0043] This application does not limit this. The method for obtaining the file includes:
[0044] S201: When an external camera connection signal is identified, performance parameters of the terminal device are obtained, and initial acquisition parameters are determined according to the performance parameters.
[0045] Performance parameters include the maximum encoding size (Maximum Encoding Size) and the media formats (Supported MediaFormats) supported by the terminal device.
[0046] The maximum encoding size refers to the maximum image resolution that the terminal device can process during the encoding process, and the maximum encoding size limits the highest definition that the terminal device can support when processing images. For example, if the maximum encoding size of the terminal device is 1920x1080, then when the terminal device encodes images, any attempt to encode at a higher resolution (such as 4K) will be restricted and must be adjusted to 1920x1080 or lower resolution.
[0047] The media format supported by the terminal device refers to the file type of the image file. Different terminal devices may support different media formats. For example, the terminal device may support two media formats: YUV format and MJPEG format.
[0048] It should be noted that this application does not limit the maximum encoding size of a specific terminal device and the media format supported by the terminal device.
[0049] After obtaining the performance parameters of the terminal device, the terminal device will determine the initial acquisition parameters according to the performance parameters, wherein the initial acquisition parameters include resolution, frame rate and media format.
[0050] S202: Acquire a current image file according to initial acquisition parameters, where the current image file is acquired by an external camera.
[0051] According to the resolution, frame rate and media format, the current image file generated by the external camera can be obtained from the external camera. For example, if the media format in the initial acquisition parameters is the target format (such as YUV format), the media format of the current image file obtained is also the target format (such as YUV format).
[0052] S203: Obtain the frame rate of the current image file, and if the frame rate of the current image file is less than or equal to a first preset frame rate threshold, adjust the initial acquisition parameters.
[0053] After obtaining the current image file, the terminal device needs to read or calculate the frame rate of the current image file. The frame rate refers to the number of image frames displayed per second and is an important indicator for measuring the smoothness of the image file.
[0054] If the frame rate of the current image file is less than or equal to the first preset frame rate threshold, it indicates that the image file is not smooth enough and cannot meet user expectations or cause image file playback to freeze. At this time, the terminal device needs to improve the frame rate of the current image file by adjusting the initial acquisition parameters.
[0055] It should be noted that if the frame rate of the current image file is greater than the first preset frame rate threshold, it indicates that the current image file has a good fluency and no subsequent adjustment is required.
[0056] S204: Acquire an image file according to the adjusted acquisition parameters.
[0057] After adjusting the initial acquisition parameters to obtain the adjusted acquisition parameters, the adjusted image file can be obtained according to the adjusted acquisition parameters. It can be understood that the parameters of the adjusted image file match the actual hardware performance of the terminal device, thereby avoiding the waste of resources caused by the high-performance terminal device obtaining low-quality image files due to improper setting of the image file parameters, and the overload caused by the low-performance terminal device processing high-quality image files.
[0058] To summarize, the embodiments of the present application provide a file acquisition method, which can ensure that the parameters of the image file acquired by the terminal device match the actual hardware performance of the terminal device, avoiding the waste of resources caused by high-performance terminal devices acquiring low-quality image files due to improper setting of image file parameters, and the overload caused by low-performance terminal devices processing high-quality image files, thereby improving the user experience.
[0059] See also Figure 3 , which is a flow chart of another file acquisition method provided by an embodiment of the present application. The method is applied to a terminal device, which may be a mobile phone, a computer, a law enforcement recorder, or other device. The method includes:
[0060] S301: When an external camera connection signal is identified, the terminal device obtains performance parameters and determines initial acquisition parameters based on the performance parameters, wherein the performance parameters include a maximum encoding size of the terminal device, a media format supported by the terminal device, an interface standard of the external camera connected to the terminal device, and a data transmission bandwidth between the terminal device and the external camera.
[0061] The performance parameters include the interface standard of the external camera connected to the terminal device. Taking the external camera as a USB camera as an example, the interface standards of the USB camera include the USB2.0 standard and the USB3.0 standard. Compared with the USB2.0 standard, the USB 3.0 standard provides a higher data transmission speed and a larger data throughput, which is crucial for the transmission of high-definition image streams. In some specific implementations, for the interface standard of the external camera connected to the terminal device in the performance parameters, if the interface standard of the external camera connected to the terminal device is the USB2.0 standard, then the media format in the initial acquisition parameters is the MJPEG format. If the interface standard of the external camera connected to the terminal device is the USB3.0 standard, then the media format in the initial acquisition parameters is the YUV format.
[0062] Performance parameters include the data transmission bandwidth between the terminal device and the external camera. Transmission bandwidth refers to the bandwidth occupied in the process of transmitting image files between the terminal device and the external camera. The size of the bandwidth is directly related to the clarity of the image file. The higher the resolution of the image file, the larger the amount of data that needs to be transmitted, so a larger transmission bandwidth is required to ensure smooth playback of the image file.
[0063] It is understandable that the maximum encoding size of the above-mentioned terminal device, the media format supported by the terminal device, the interface standard of the external camera connected to the terminal device, and the data transmission bandwidth between the terminal device and the external camera will all affect the subsequent selection of the resolution of the current image file.
[0064] It should be noted that the application framework layer of the terminal device includes a performance collection module. After the terminal device is turned on, the performance collection module of the terminal device can obtain the above performance parameters by calling the relevant application programming interface (Application Programming Interface, API) or library function, and integrate them together to determine the initial collection parameters according to the performance parameters, which is convenient for users or developers to use.
[0065] S302: After opening the imaging software, the terminal device determines whether it is in an adaptive configuration state. If not, execute S303; if so, execute S304.
[0066] The adaptive configuration state means that the terminal device can automatically adjust the initial acquisition parameters according to its own hardware performance, so as to obtain the image file that best matches the terminal device.
[0067] If the terminal device is not in the adaptive configuration state, the terminal device will execute S303, that is, obtain the current image file from the external camera according to the default preset acquisition parameters between the external camera and the terminal device.
[0068] If the terminal device is in the adaptive configuration state, the parameter adaptive module of the terminal device will execute S304, that is, obtain the current image file from the external camera according to the initial acquisition parameters. And the initial acquisition parameters can be automatically adjusted according to the hardware performance of the terminal device itself, so as to obtain the image file that best matches the terminal device.
[0069] It should be noted that when the terminal device receives an adaptive configuration state instruction triggered by the user, or when the external camera corresponding to the terminal device is in the target business scenario (such as video conferencing, high-definition photography, professional image recognition, etc.), the terminal device can turn on the adaptive configuration state and execute the following S304 step.
[0070] S303: The terminal device acquires the current image file according to the default preset acquisition parameters. Then, S307 is executed.
[0071] The preset acquisition parameters refer to the image file parameters set by the terminal device when installing or configuring the imaging software, or the default image file parameters of the external camera.
[0072] If the terminal device is not in the adaptive configuration state, the terminal device will use the preset acquisition parameters to capture the current image file of the preset acquisition parameters from the external camera.
[0073] S304: The terminal device obtains the current image file according to the initial acquisition parameters. Then, S305 is executed.
[0074] If the terminal device is in an adaptive configuration state, the terminal device will obtain the current image file from the external camera according to the initial acquisition parameters.
[0075] In some specific implementations, for the resolution in the initial acquisition parameters, if the resolution in the initial acquisition parameters is 1080P, then the resolution of the current image file acquired by the terminal device is also 1080P; if the resolution in the initial acquisition parameters is 720P, then the resolution of the current image file acquired by the terminal device is also 720P. It should be noted that this application does not limit the specific resolution value.
[0076] In other specific implementations, for the media format in the initial acquisition parameters, if the media format in the initial acquisition parameters is the YUV format, then the media format of the current image file acquired by the terminal device is also the YUV format; if the media format in the initial acquisition parameters is the MJPEG format, then the media format of the current image file acquired by the terminal device is also the MJPEG format.
[0077] In some other specific implementations, for the frame rate in the initial acquisition parameters, if the frame rate in the initial acquisition parameters is 30fps, then the frame rate of the current image file is also 30fps. It should be noted that this application does not limit the specific frame rate value.
[0078] S305: Obtain the frame rate of the current image file. If the frame rate of the current image file is less than or equal to a preset frame rate threshold, the terminal device adjusts the initial acquisition parameters.
[0079] If the media format of the current image file is YUV format, the terminal device can perform the following parameter adaptive adjustment:
[0080] In a specific implementation, if the media format of the current image file is the YUV format and the frame rate of the current image file is less than or equal to a first preset frame rate threshold (e.g., 10fps), the media format supported by the terminal device is adjusted from the YUV format to the MJPEG format. It is understandable that the amount of data transmitted by the MJPEG format is less than the amount of data transmitted by the YUV format.
[0081] In another specific implementation, if the media format of the current image file is the YUV format and the frame rate of the current image file is greater than the first preset frame rate threshold (e.g., 10fps) and less than or equal to the second preset frame rate threshold (e.g., 20fps), the resolution of the image file can be reduced within the acceptable range of the terminal device. For example, when the resolution of the image file is 1080P, the resolution can be reduced to 720P; when the resolution of the image file is 720P, the resolution can be reduced to 480P; when the resolution of the image file is 480P, the resolution can be reduced to CIF.
[0082] It should be noted that if the frame rate of the current image file is greater than the second preset frame rate threshold (e.g., 20fps) and less than or equal to the third preset frame rate threshold (e.g., 30fps), it is generally considered that the current image file is sufficiently smooth and the user viewing experience is relatively good. Within this frame rate range, the terminal device does not need to perform additional format or resolution conversion, because the conversion itself may introduce additional computing overhead, thereby affecting the real-time and smoothness of the image to the current image file.
[0083] It should be noted that if the frame rate of the current image file is greater than the third preset frame rate threshold (for example, 30fps), the resolution of the image file can be increased within the acceptable range of the terminal device. For example, when the resolution of the image file is CIF, the resolution can be increased to 480P; when the resolution of the image file is 480P, the resolution can be increased to 720P; when the resolution of the image file is 720P, the resolution can be increased to 1080P. Increasing the resolution can increase the details and clarity of the image file, making the picture more delicate, thereby improving the user's viewing experience.
[0084] If the media format of the current image file is MJPEG, the terminal device can perform the following parameter adaptive adjustment:
[0085] In a specific implementation, if the media format of the current image file is MJPEG format and the frame rate of the current image file is less than or equal to a first preset frame rate threshold (e.g., 20fps), the resolution of the image file can be reduced within the acceptable range of the terminal device. For example, when the resolution of the image file is 1080P, the resolution can be reduced to 720P; when the resolution of the image file is 720P, the resolution can be reduced to 480P; when the resolution of the image file is 480P, the resolution can be reduced to CIF.
[0086] It should be noted that if the frame rate of the current image file is greater than the first preset frame rate threshold (for example, 20fps) and less than or equal to the second preset frame rate threshold (for example, 30fps), it is generally considered that the current image file is sufficiently smooth and the user viewing experience is relatively good. Within this frame rate range, the terminal device does not need to perform additional format or resolution conversion, because the conversion itself may introduce additional computing overhead, thereby affecting the real-time and smoothness of the image to the current image file.
[0087] It should be noted that if the frame rate of the current image file is greater than the second preset frame rate threshold (for example, 30fps), the resolution of the image file can be increased within the acceptable range of the terminal device. For example, when the resolution of the image file is CIF, the resolution can be increased to 480P; when the resolution of the image file is 480P, the resolution can be increased to 720P; when the resolution of the image file is 720P, the resolution can be increased to 1080P. Increasing the resolution can increase the details and clarity of the image file, making the picture more delicate, thereby improving the user's viewing experience.
[0088] S306: The terminal device obtains the adjusted image file according to the adjusted acquisition parameters. Then, S307 is executed.
[0089] After the acquisition parameters are adjusted to obtain the adjusted acquisition parameters, the adjusted image file can be obtained according to the adjusted acquisition parameters. It can be understood that the parameters of the adjusted image file match the actual hardware performance of the terminal device, thereby avoiding the waste of resources caused by the high-performance terminal device obtaining low-quality image files due to improper setting of the image file parameters, and the overload caused by the low-performance terminal device processing high-quality image files.
[0090] It should be noted that after obtaining the adjusted image file according to the adjusted acquisition parameters, the frame rate of the adjusted image file can also be obtained, and it is determined whether the frame rate is greater than the first preset frame rate threshold. If so, the adjusted acquisition parameters are saved as initial acquisition parameters. This means that this set of parameters can be used for subsequent image acquisition work while ensuring image quality (including frame rate). The saved adjusted acquisition parameters can be used as a template and quickly applied when needed, reducing the time and workload of repeated adjustments.
[0091] S307: The terminal device executes the image service according to the image file.
[0092] Regardless of whether the terminal device obtains the current image file according to the default preset acquisition parameters or obtains the adjusted image file according to the adjusted acquisition parameters, it can perform image services according to the image file, such as editing, speeding up, slowing down, adding filters, etc. This application does not limit the specific image services.
[0093] In summary, the present application discloses a file acquisition method, which can ensure that the parameters of the image file acquired by the terminal device match the actual hardware performance of the terminal device, avoiding the waste of resources caused by the acquisition of low-quality image files by high-performance terminal devices due to improper setting of image file parameters, and the performance overload caused by the processing of high-quality image files by low-performance terminal devices, thereby improving the user experience. In addition, the terminal device selects matching image files according to the hardware capabilities of the terminal device, which can reduce the need for later processing such as transcoding and scaling of image files, thereby reducing the cost and complexity of later image service processing.
[0094] See also Figure 4 , which is a schematic diagram of a file acquisition device provided in an embodiment of the present application. The file acquisition device 400 is applied to a terminal device and includes: a parameter acquisition module 401, a file acquisition module 402, a parameter adjustment module 403 and a file adjustment module 404.
[0095] Specifically, the parameter acquisition module 401 is used to acquire the performance parameters of the terminal device when an external camera connection signal is identified, and determine the initial acquisition parameters according to the performance parameters, wherein the initial acquisition parameters include resolution, frame rate and media format;
[0096] The file acquisition module 402 is used to acquire the current image file according to the initial acquisition parameters. The current image file is generated by the external camera;
[0097] The parameter adjustment module 403 is used to obtain the frame rate of the current image file, and if the frame rate of the current image file is less than or equal to the first preset frame rate threshold, adjust the initial acquisition parameters;
[0098] The file adjustment module 404 is used to obtain the image file according to the adjusted acquisition parameters.
[0099] To summarize, the embodiments of the present application provide a file acquisition device that can ensure that the parameters of the image file acquired by the terminal device match the actual hardware performance of the terminal device, thereby avoiding the waste of resources caused by high-performance terminal devices acquiring low-quality image files due to improper setting of image file parameters, and the overload of low-performance terminal devices due to processing high-quality image files, thereby improving the user experience.
[0100] The embodiment of the present application also provides corresponding electronic equipment and computer storage media for implementing the file acquisition method provided in the embodiment of the present application.
[0101] The electronic device includes a memory and a processor, the memory is used to store instructions or codes, and the processor is used to execute instructions or codes so that the device executes a file acquisition method of any embodiment of the present application.
[0102] The computer storage medium stores codes, and when the codes are executed, the device executing the codes implements the file acquisition method described in any embodiment of the present application.
[0103] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0104] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0105] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0106] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A file acquisition method, characterized in that: Applied to a terminal device, the method comprises: When an external camera connection signal is identified, the performance parameters of the terminal device are obtained, and initial acquisition parameters are determined according to the performance parameters, wherein the initial acquisition parameters include resolution, frame rate and media format; According to the initial acquisition parameters, a current image file is acquired, where the current image file is acquired and generated by the external camera; Acquiring the frame rate of the current image file, and if the frame rate of the current image file is less than or equal to a first preset frame rate threshold, adjusting the initial acquisition parameters; Obtain image files based on the adjusted acquisition parameters.
2. The method according to claim 1, characterized in that If the frame rate of the current image file is less than or equal to a first preset frame rate threshold, adjusting the initial acquisition parameters includes: If the frame rate of the current image file is less than or equal to a first preset frame rate threshold, and the media format of the current image file is a first format, then the resolution in the initial acquisition parameters is reduced.
3. The method according to claim 1, characterized in that If the frame rate of the current image file is less than or equal to a first preset frame rate threshold, adjusting the initial acquisition parameters includes: If the frame rate of the current image file is less than or equal to a first preset frame rate threshold, and the media format of the current image file is the second format, the media format in the initial acquisition parameters is adjusted to the first format, wherein the amount of data transmitted by the first format is less than the amount of data transmitted by the second format.
4. The method according to claim 1, characterized in that: The method further comprises: If the frame rate of the current image file is greater than a first preset frame rate threshold and less than or equal to a second preset frame rate threshold, and the media format of the current image file is the second format, then the resolution in the initial acquisition parameters is reduced.
5. The method according to claim 1, characterized in that After acquiring the image file according to the adjusted acquisition parameters, the method further includes: The frame rate of the image file after the acquisition parameters are adjusted is obtained, and if the frame rate of the image file is greater than a first preset frame rate threshold, the acquisition parameters are saved as initial acquisition parameters.
6. The method according to claim 1, characterized in that After acquiring the image file according to the adjusted acquisition parameters, the method further includes: Perform image services on the adjusted image file, wherein the image services include one or more of editing, speeding up, slowing down, and adding filters.
7. The method according to claim 1, characterized in that The step of acquiring the current image file according to the initial acquisition parameters includes: When the terminal device is in an adaptive configuration state, the current image file is acquired according to the initial acquisition parameters.
8. The method according to claim 7, characterized in that When the terminal device is in the adaptive configuration state, acquiring the current image file according to the initial acquisition parameters includes: When the terminal device receives an adaptive configuration state instruction triggered by a user, or when the external camera corresponding to the terminal device is in a target business scenario, the current image file is acquired according to the initial acquisition parameters.
9. A terminal device, characterized in that: The terminal device includes: a memory and a processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed, is specifically used to implement each step of the method according to any one of claims 1 to 8.
Citation Information
Cited By
File acquisition method, device, and medium
WO2026040807A1
