WO2017202175A1 - 一种视频压缩方法、装置及电子设备 - Google Patents

一种视频压缩方法、装置及电子设备 Download PDF

Info

Publication number
WO2017202175A1
WO2017202175A1 PCT/CN2017/082280 CN2017082280W WO2017202175A1 WO 2017202175 A1 WO2017202175 A1 WO 2017202175A1 CN 2017082280 W CN2017082280 W CN 2017082280W WO 2017202175 A1 WO2017202175 A1 WO 2017202175A1
Authority
WO
WIPO (PCT)
Prior art keywords
resolution
electronic device
video file
display screen
target video
Prior art date
Application number
PCT/CN2017/082280
Other languages
English (en)
French (fr)
Inventor
白斌
Original Assignee
北京金山安全软件有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京金山安全软件有限公司 filed Critical 北京金山安全软件有限公司
Publication of WO2017202175A1 publication Critical patent/WO2017202175A1/zh

Links

Images

Classifications

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

Definitions

  • the present invention relates to the field of electronic technologies, and in particular, to a video compression method, apparatus, and electronic device.
  • the functions of electronic devices are increasingly perfect. For example, a user can use an electronic device to access external data network resources for viewing video files and the like.
  • the resolution of the video file is fixed, that is, the resolution of the video file in the external network data resource is large. It is also displayed at this resolution when displayed on an electronic device.
  • the embodiment of the invention provides a video compression method, device and electronic device, which can reduce the traffic loss of the user electronic device while ensuring the display effect of the video file in the electronic device display process.
  • an embodiment of the present invention discloses a video compression method, including:
  • the resolution of the target video file is compressed to a target resolution according to a resolution of the display screen, the target resolution and the display screen
  • the difference in resolution is within the preset resolution range, including:
  • the embodiment of the present invention further discloses a video compression device, where the device is disposed on an electronic device, where the electronic device is configured with a display screen, and the device includes:
  • An acquiring module configured to acquire a resolution of the target video file and a resolution of a display screen of the electronic device when the electronic device plays the target video file online;
  • a detecting module configured to detect whether a resolution of the target video file is higher than a resolution of the display screen
  • a compression module configured to compress a resolution of the target video file to a target resolution according to a resolution of the display screen, if the detection module detects that the target video file is higher than a resolution of the display screen, The difference between the target resolution and the resolution of the display screen is within a preset resolution range.
  • the acquiring module is further configured to acquire a current network status of the electronic device, where the network status includes a tariff status or a non-contribution status;
  • the specific implementation manner of the acquisition module acquiring the resolution of the target video file and the resolution of the display screen of the electronic device is to acquire the target video if the current network status of the electronic device is the tariff status The resolution of the file and the resolution of the display of the electronic device.
  • the acquiring module is further configured to acquire a data transmission amount of the electronic device per unit time
  • the detecting module is further configured to detect whether the data transmission amount is lower than a preset data amount threshold
  • the specific implementation manner of the acquiring module acquiring the resolution of the target video file and the resolution of the display screen of the electronic device is: if the detecting module detects that the data transmission amount is lower than the preset data amount threshold, And obtaining a resolution of the target video file and a resolution of a display screen of the electronic device.
  • the acquiring module is further configured to acquire a remaining storage space value of the electronic device
  • the detecting module is further configured to detect whether the remaining storage space value is lower than a preset storage space threshold
  • the specific implementation manner of the acquiring module acquiring the resolution of the target video file and the resolution of the display screen of the electronic device, if the detecting module detects that the remaining storage space value is lower than the preset storage space threshold, And obtaining a resolution of the target video file and a resolution of a display screen of the electronic device.
  • the compression module compresses the resolution of the target video file to a target resolution according to the resolution of the display screen, and the resolution of the display screen is Decoding the target video file and compressing the target video file.
  • an embodiment of the present invention further discloses an electronic device, including: a housing, a processor, a memory, a display screen, a circuit board, and a power supply circuit, wherein the circuit board is disposed in the housing Inside the space, the processor and the memory are disposed on the circuit board, the display screen is externally embedded on the housing and connected to the circuit board; and the power supply circuit is configured to be the electronic device
  • the memory is for storing executable program code and data
  • the processor is operative to read a program corresponding to the executable program code by reading the executable program code stored in the memory for use Perform the following steps:
  • the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, Also used to perform the following steps:
  • the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, Also used to perform the following steps:
  • the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, You can also perform the following steps:
  • the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory.
  • Performing a step of compressing a resolution of the target video file to a target resolution according to a resolution of the display screen, wherein a difference between the target resolution and a resolution of the display screen is within a preset resolution range include:
  • the electronic device when the electronic device plays the target video file online, the resolution of the target video file and the resolution of the display screen of the electronic device are acquired; whether the resolution of the target video file is higher than the resolution of the display screen; The detection target video file is higher than the resolution of the display, and the resolution of the target video file is compressed to the target resolution according to the resolution of the display, and the difference between the target resolution and the resolution of the display is at a preset resolution.
  • the electronic device may compress the resolution of the target video file to the target resolution according to the resolution of the display screen, and the target resolution and the resolution of the display screen.
  • the difference is within the preset resolution range, so that the difference between the resolution of the target video file and the resolution of the display screen is large, and the flow loss of the electronic device is caused and the display effect is poor during the display process. . It can be seen that implementing the embodiment of the invention can guarantee The video file reduces the traffic loss of the user's electronic device while displaying the effect during the display of the electronic device.
  • an embodiment of the present invention provides a computer program product, when the instruction processor in the computer program product executes, performing a video compression method, where the method includes:
  • an embodiment of the present invention provides a storage medium, when the instructions in the storage medium are executed by a processor of a mobile terminal, to enable the mobile device to perform a video compression method, where the method includes:
  • FIG. 1 is a schematic flowchart of a video compression method according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of another video compression method according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a video compression apparatus according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • the embodiment of the invention provides a video compression method, device and electronic device.
  • the electronic device when the electronic device plays the target video file online, the electronic device can set the resolution of the target video file according to the resolution of the display screen. Compressed to the target resolution, and the difference between the target resolution and the resolution of the display is within a preset resolution range, thereby avoiding a large difference between the resolution of the target video file and the resolution of the display screen.
  • the problem that leads to loss of flow of the electronic device and poor display performance during display can be seen that the implementation of the embodiment of the invention can reduce the traffic loss of the user electronic device while ensuring the display effect of the video file in the electronic device display process. The details are described below separately.
  • FIG. 1 is a schematic flowchart of a video compression method according to an embodiment of the present invention; wherein the video compression method shown in FIG. 1 can be applied to a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer. , handheld computers, and mobile Internet devices (MID) and other electronic devices with display screens.
  • the video compression method may include the following steps:
  • the electronic device plays the target video file online, that is, the electronic device is accessing the external data network resource.
  • the electronic device accesses an external network data resource through a video playback application for video playback.
  • the display screen of the electronic device is a screen for displaying display content that the electronic device needs to display.
  • the display content may include, but is not limited to, text, pictures, and symbols.
  • the size of the display of the electronic device is fixed, but the size of the display area for displaying the content is adjustable.
  • the user may adjust according to the needs, or the electronic device may adjust according to the history of the user to adjust the record; or the information of the electronic device according to the content to be displayed, such as the size of the content to be displayed,
  • the information is adjusted according to the size of the storage space occupied by the content, and the electronic device adjusts according to the hardware information of the electronic device, such as the battery information of the electronic device, the resolution of the display of the electronic device, and the like.
  • the function consumption of the electronic device can be reduced to a certain extent, and the utilization rate of power consumption is improved.
  • the resolution of the display screen of the electronic device refers to the number of display pixels per unit area of the display screen of the electronic device, which is measured by horizontal and vertical pixels.
  • the resolution of the display of the electronic device is low, for example, 640 ⁇ 480, the number of pixels displayed on the display of the electronic device is small; when the resolution of the display of the electronic device is high, for example, 1400 ⁇ 1200, on the display of the electronic device There are more pixels displayed on it.
  • the resolution of the display of the electronic device of 1400 ⁇ 1200 means that the number of pixels in the horizontal direction is 1400, and the number of pixels in the vertical direction is 1200.
  • a display with a resolution of 1400 ⁇ 1200 has a finer and more detailed display than a display with a resolution of 640 ⁇ 480.
  • the target video file is composed of images of one frame and one frame, that is, the resolution of the target video file.
  • the rate is also the resolution of the image that makes up the target video file.
  • the resolution of the image is the width and high pixel value of the image.
  • Image resolution is a parameter used to measure the amount of data within an image, usually expressed in pixels per inch.
  • the resolution of image A is 1400 ⁇ 1200, which means that it is effective pixels in the horizontal and vertical directions.
  • the pixel value per inch is higher and looks clear; when the size of the display area is large, there is no So many effective pixels fill the display area, and the pixel value per inch of the effective pixel decreases, which is blurred when displayed.
  • the electronic device may detect whether the resolution of the target video file is higher than the resolution of the display screen.
  • the resolution of the target video file is compressed to the target resolution according to the resolution of the display screen, and the difference between the target resolution and the resolution of the display screen is preset. Within the resolution range.
  • the resolution of the target video file after compression that is, the target resolution, and the resolution of the display screen are within a preset resolution range, and the preset resolution range is smaller, and the image is smaller.
  • the better the display quality when the difference between the target resolution and the resolution of the display is zero, that is, when the resolution of the display is the same as the resolution of the target video file, the display of the target video file in the display. The best results, because even if the resolution of the target video file is adjusted to a higher value, the display effect of the target video file in the display will not change.
  • the electronic device can compress the resolution of the target video file to the target resolution according to the resolution of the display screen, and the target resolution and the resolution of the display screen.
  • the difference is within the preset resolution range.
  • the resolution of the target video file may be compressed to 720 ⁇ 1280 by 1080 ⁇ 1920.
  • Such a compression process can occupy less than 180 MB of storage space, and the display quality of the target video file is not significantly affected when displayed on the display of the electronic device.
  • the resolution of acquiring the target video file and the resolution of the display screen of the electronic device when the electronic device plays the target video file online is described in detail; whether the resolution of the target video file is higher than the resolution of the display screen is detected. If the detection target video file is higher than the resolution of the display, the resolution of the target video file is compressed to the target resolution according to the resolution of the display, and the difference between the target resolution and the resolution of the display is preset. Within the resolution range. In the embodiment of the present invention, when the electronic device plays the target video file online, the electronic device may compress the resolution of the target video file to the target resolution according to the resolution of the display screen, and the target resolution and the resolution of the display screen.
  • the embodiment of the invention can be implemented Reduce the loss of traffic of the user's electronic device while ensuring that the video file displays the effect during the display of the electronic device.
  • FIG. 2 is a schematic flowchart diagram of another video compression method according to an embodiment of the present invention. As shown in FIG. 2, the video compression method may include the following steps:
  • the electronic device plays the target video file online, that is, the electronic device is accessing the external data network resource.
  • the electronic device accesses an external network data resource through a video playback application for video playback.
  • the electronic device may acquire the current network status of the electronic device before acquiring the resolution of the target video file and the resolution of the display screen of the electronic device, where the network status includes a tariff status or a non-contribution status.
  • the step of acquiring the resolution of the target video file and the resolution of the display screen of the electronic device is performed.
  • the manner in which the electronic device acquires the current network state of the target electronic device is diverse.
  • the electronic device may send a network status acquisition request for the electronic device to the binding server, and after receiving the network status acquisition request, the binding server may query the latest network status of the electronic device and send the electronic device to the electronic device.
  • the binding server and the electronic device should establish a corresponding binding relationship.
  • the network status includes a tariff status or a non-contribution status.
  • the status of the tariff mainly includes the state of generating the corresponding fee through the ordered data flow package;
  • the non-tariff status is mainly the network state mainly based on WIFI. For example, if the package ordered by the electronic device A is a 5 yuan 30M package, the data traffic used by the electronic device A is within 30M, and the network state corresponding to the electronic device A is the tariff state, when the data traffic used by the electronic device A exceeds 30M, the network status corresponding to the electronic device A is also the tariff status.
  • the functions of electronic devices are increasingly perfect, and data devices can be shared between electronic devices and electronic devices, that is, electronic device A can turn on hotspots.
  • the electronic device B is connected and can access the webpage; that is, when the electronic device A connects to the shared hotspot of the electronic device B, the current network state of the electronic device A is also the tariff state.
  • the resolution of the target video file is higher than the resolution of the display screen, and detect that the resolution of the target video file is higher than the resolution of the display screen.
  • the resolution of the display screen is used as the target resolution to perform a resolution compression operation on the target video file.
  • the resolution compression operation on the target video file is mainly for improving the display effect of the target video file during the display process, and can increase the cache efficiency of the cache process.
  • the electronic device may also acquire the data transmission amount of the electronic device per unit time; and detect whether the data transmission amount is Below the preset data volume threshold.
  • the step of acquiring the resolution of the target video file and the resolution of the display screen of the electronic device is performed.
  • the data transmission amount of the electronic device per unit time is used to describe the current data transmission speed of the electronic device, that is, the greater the data transmission amount per unit time, the speed of the current data transmission of the electronic device. The faster the data transmission amount per unit time, the slower the current data transmission speed of the electronic device.
  • the data amount threshold may be preset in the electronic device, where the setting of the data amount threshold may be set by the user according to requirements; or the electronic device may perform setting according to the history setting record of the user; It is also possible that the electronic device is set according to the current network state of the electronic device; the invention is not limited.
  • the detected data transmission amount is lower than the preset data amount threshold, the current data transmission speed of the electronic device is slow. If the resolution of the target video file is high, the data transmission amount per unit time is caused. It is small and cannot properly buffer the video file, causing playback to be interrupted. It can be seen that it is particularly important to determine the data transmission speed of the electronic device before acquiring the resolution of the target video file and the resolution of the display screen of the electronic device and performing compression processing on the target video file.
  • the electronic device may acquire the remaining storage space value of the electronic device before acquiring the resolution of the target video file and the resolution of the display screen of the electronic device; and detecting whether the remaining storage space value is low.
  • the default storage space threshold may be used to determine whether the remaining storage space value is low.
  • the step of acquiring the resolution of the target video file and the resolution of the display screen of the electronic device is performed if the detected remaining storage space value is lower than the preset storage space threshold.
  • a preset storage space threshold may be preset in the electronic device, where the preset storage space threshold may be set by the user according to requirements, or may be performed by the electronic device according to the user's historical setting record.
  • the setting may be performed by the electronic device according to the total storage space of the user, or may be set by the electronic device according to the available storage space of the electronic device, which is not limited in the embodiment of the present invention.
  • the electronic device can obtain the remaining storage space value of the electronic device in real time, and can detect whether the remaining storage space value is lower than the preset storage space threshold; if it is detected that the remaining storage space value is lower than the preset storage space threshold, It indicates that the current storage space of the electronic device is small, and the resolution of the display screen and the resolution of the target video file can be obtained, and the target video file is compressed and processed, thereby achieving the purpose of saving storage space.
  • the resolution of the display screen is the target resolution
  • the target video file is compressed.
  • the electronic device after detecting that the target video file is higher than the resolution of the display screen, in order to ensure that the display effect of the target video file is optimal and the traffic loss of the user electronic device is reduced, the electronic device may be distinguished by the display screen.
  • the target resolution is the target resolution, and the target video file is compressed.
  • the target video when the target video file is compressed, the target video can be targeted at 720 ⁇ 1280.
  • the resolution of the file is compressed from 1080 ⁇ 1920 to 720 ⁇ 1280.
  • Such a compression process can occupy less than 180 MB of storage space, and the display quality of the target video file is not significantly affected when displayed on the display of the electronic device.
  • the compression method used in the compression process may include, but is not limited to, a Huffman compression method, a linear prediction coding method, and a lossless compression coding method.
  • the electronic device can acquire the current network state of the electronic device before acquiring the resolution of the target video file and the resolution of the display screen of the electronic device, and when the current network state of the electronic device is the tariff state.
  • the resolution and the resolution of the display of the electronic device acquire the resolution of the target video file and the resolution of the display of the electronic device to perform compression processing on the target video file; and may also detect that the remaining storage space value is lower than the pre- When the storage space threshold is set, the resolution of the target video file and the resolution of the display of the electronic device are obtained. It can be seen that, by implementing the embodiment of the present invention, whether the target video file is compressed or not can be determined in various aspects, thereby increasing the judgment basis of whether to perform compression processing on the target video file.
  • FIG. 3 is a schematic structural diagram of a video compression apparatus according to an embodiment of the present invention, for performing the above video compression method.
  • the device shown in FIG. 3 is disposed on an electronic device, where the electronic device may include, but is not limited to, a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, and a mobile Internet device (Mobile Internet Devices, MID). ) Electronic devices with displays.
  • the device may include: an obtaining module 301, a detecting module 302, and a compressing module 303, where
  • the obtaining module 301 is configured to acquire a resolution of the target video file and a resolution of the display screen of the electronic device when the electronic device plays the target video file online.
  • the electronic device plays the target video file online, that is, the electronic device is accessing the external data network resource.
  • the electronic device accesses an external network data resource through a video playback application for video playback.
  • the display screen of the electronic device is a screen for displaying display content that the electronic device needs to display.
  • the display content may include, but is not limited to, text, pictures, and symbols.
  • the size of the display of the electronic device is fixed However, the size of the display area for displaying content can be adjusted.
  • the user may adjust according to the needs, or the electronic device may adjust according to the history of the user to adjust the record; or the information of the electronic device according to the content to be displayed, such as the size of the content to be displayed,
  • the information is adjusted according to the size of the storage space occupied by the content, and the electronic device adjusts according to the hardware information of the electronic device, such as the battery information of the electronic device, the resolution of the display of the electronic device, and the like.
  • the function consumption of the electronic device can be reduced to a certain extent, and the utilization rate of power consumption is improved.
  • the resolution of the display screen of the electronic device refers to the number of display pixels per unit area of the display screen of the electronic device, which is measured by horizontal and vertical pixels.
  • the resolution of the display of the electronic device is low, for example, 640 ⁇ 480, the number of pixels displayed on the display of the electronic device is small; when the resolution of the display of the electronic device is high, for example, 1400 ⁇ 1200, on the display of the electronic device There are more pixels displayed on it.
  • the resolution of the display of the electronic device of 1400 ⁇ 1200 means that the number of pixels in the horizontal direction is 1400, and the number of pixels in the vertical direction is 1200.
  • a display with a resolution of 1400 ⁇ 1200 has a finer and more detailed display than a display with a resolution of 640 ⁇ 480.
  • the target video file is composed of an image of one frame and one frame, that is, the resolution of the target video file is the resolution of the image constituting the target video file.
  • the resolution of the image is the width and high pixel value of the image.
  • Image resolution is a parameter used to measure the amount of data within an image, usually expressed in pixels per inch.
  • the resolution of image A is 1400 ⁇ 1200, which means that it is effective pixels in the horizontal and vertical directions.
  • the pixel value per inch is higher and looks clear; when the size of the display area is large, there is no So many effective pixels fill the display area, and the pixel value per inch of the effective pixel decreases, which is blurred when displayed.
  • the detecting module 302 is configured to detect whether the resolution of the target video file is higher than the resolution of the display screen.
  • the detecting module 302 can detect whether the resolution of the target video file is higher than the resolution of the display screen. .
  • the compression module 303 is configured to: if the detection module 302 detects that the target video file is higher than the resolution of the display screen, compress the resolution of the target video file to the target resolution according to the resolution of the display screen, and distinguish the target resolution from the display screen.
  • the difference in rate is within the preset resolution range.
  • the difference between the resolution (target resolution) of the target video file and the resolution of the display screen is within a preset resolution range, and the smaller the preset resolution range, the image display quality.
  • the difference between the target resolution and the resolution of the display is zero, that is, the resolution of the display is the same as the resolution of the target video file, the target video file is displayed best in the display. Because even if the resolution of the target video file is adjusted to a higher value, the display effect of the target video file in the display will not change.
  • the standard video file is higher than the resolution of the display, and the electronic device can compress the resolution of the target video file to the target resolution according to the resolution of the display screen, and the difference between the target resolution and the resolution of the display screen is preset. Within the resolution range.
  • the compression module 303 can compress the resolution of the target video file by 1080 ⁇ 1920 to 720 ⁇ 1280.
  • Such a compression process can occupy less than 180 MB of storage space, and the display quality of the target video file is not significantly affected when displayed on the display of the electronic device.
  • the obtaining module 301 is further configured to acquire a current network status of the electronic device, where the network status includes a tariff status or a non-contribution status.
  • the specific implementation manner of the acquisition module 301 acquiring the resolution of the target video file and the resolution of the display screen of the electronic device is to obtain the resolution of the target video file and the display of the electronic device if the current network state of the electronic device is the tariff status.
  • the resolution of the screen is to obtain the resolution of the target video file and the display of the electronic device if the current network state of the electronic device is the tariff status.
  • the obtaining module 301 is further configured to acquire the data transmission amount of the electronic device per unit time.
  • the detecting module 302 is further configured to detect whether the data transmission amount is lower than a preset data amount threshold.
  • the specific implementation manner of the acquisition module 301 acquiring the resolution of the target video file and the resolution of the display screen of the electronic device is to obtain the resolution of the target video file and the electronic device if the detection module detects that the data transmission amount is lower than the preset data amount threshold.
  • the resolution of the display is to obtain the resolution of the target video file and the electronic device if the detection module detects that the data transmission amount is lower than the preset data amount threshold.
  • the obtaining module 301 is further configured to acquire a remaining storage space value of the electronic device.
  • the detecting module 302 is further configured to detect whether the remaining storage space value is lower than a preset storage space threshold.
  • the compression module 303 compresses the resolution of the target video file to the target resolution according to the resolution of the display screen.
  • the specific implementation manner is that the resolution of the display screen is the target resolution, and the target video file is compressed.
  • the obtaining module 301 acquires the resolution of the target video file and the resolution of the display screen of the electronic device; and the detecting module 302 detects whether the resolution of the target video file is high.
  • the resolution of the display screen if the detection module 302 detects that the target video file is higher than the resolution of the display screen, the compression module 303 compresses the resolution of the target video file to the target resolution according to the resolution of the display screen, and the target resolution and The difference in resolution of the display is within the preset resolution range.
  • the electronic device when the electronic device plays the target video file online, the electronic device may compress the resolution of the target video file to the target resolution according to the resolution of the display screen, and the target resolution and the resolution of the display screen.
  • the difference is within the preset resolution range, so that the difference between the resolution of the target video file and the resolution of the display screen is large, and the flow loss of the electronic device is caused and the display effect is poor during the display process.
  • the implementation of the embodiment of the invention can reduce the traffic loss of the user electronic device while ensuring the display effect of the video file in the electronic device display process.
  • FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, for performing the above video compression method.
  • the electronic device may include components such as a housing 401, a processor 402, a memory 403, a display screen 404, a circuit board 405, and a power supply circuit 406.
  • the circuit board 405 is disposed inside the space enclosed by the housing 401.
  • the processor 402 and the memory 403 are disposed on the circuit board 405.
  • the display screen 404 is externally mounted on the housing 401 and connected to the circuit board 405. It can be understood by those skilled in the art that the structure of the electronic device shown in FIG. 4 does not constitute a limitation on the embodiment of the present invention. It may be a bus-shaped structure or a star-shaped structure, and may also include more than the illustration. Or fewer parts, or combine some parts, or different parts. among them:
  • the processor 402 is a control center for an electronic device that connects various portions of the entire electronic device using various interfaces and lines, by running or executing programs and/or modules stored in the memory 403, and recalling data stored in the memory 403, To perform various functions and process data of the electronic device.
  • the processor 402 may be composed of an integrated circuit (IC), for example, may be composed of a single packaged IC, or may be composed of a plurality of packaged ICs that have the same function or different functions.
  • the processor 402 may include only a central processing unit (CPU), or may be a CPU, a digital signal processor (DSP), or a graphics processing unit (GPU). And a combination of various control chips.
  • the CPU may be a single operation core, and may also include multiple operation cores.
  • the display screen 404 can include a touch panel, a touch screen, and the like, and can be used to output information such as a reminder message, a picture, and the like, and can also receive various touch operations triggered by the user.
  • the power circuit 406 is configured to supply power to various circuits or devices of the electronic device.
  • the memory 403 can be used to store software programs and modules, and the processor 402 executes various functional applications of the electronic device and implements data processing by calling software programs and modules stored in the memory 403.
  • the memory 403 mainly includes a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, and the like; the data storage area can store data created according to usage of the electronic device and the like.
  • the operating system may be an Android system, an iOS system, a Windows operating system, or the like.
  • the processor 402 calls an application stored in the memory 403 for performing the following operations:
  • the resolution of the target video file is compressed to the target resolution according to the resolution of the display screen, and the difference between the target resolution and the resolution of the display screen is at a preset resolution. Within the rate range.
  • the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory, and is further configured to perform the following steps:
  • the network status includes a tariff status or a non-tariff status
  • the step of acquiring the resolution of the target video file and the resolution of the display screen of the electronic device is performed.
  • the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory, and is further configured to perform the following steps:
  • the step of acquiring the resolution of the target video file and the resolution of the display screen of the electronic device is performed.
  • the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory, and may also perform the following steps:
  • the step of acquiring the resolution of the target video file and the resolution of the display screen of the electronic device is performed.
  • the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory.
  • the execution step compresses the resolution of the target video file to the target resolution according to the resolution of the display, and the difference between the target resolution and the resolution of the display is within a preset resolution range, including:
  • the target video file is compressed by the resolution of the display screen as the target resolution.
  • the user electronic device introduced in the embodiment of the present invention may implement some or all of the processes in the embodiment of the video compression method introduced in conjunction with FIG. 1 and FIG.
  • modules or sub-modules in all the embodiments of the present invention may be implemented by a general-purpose integrated circuit, such as a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit).
  • a general-purpose integrated circuit such as a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit).
  • units in the user electronic device may be combined, divided, and deleted according to actual needs.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

本发明实施例公开了一种视频压缩方法、装置及电子设备,包括:当电子设备在线播放目标视频文件时,获取目标视频文件的分辨率以及电子设备的显示屏的分辨率;检测目标视频文件的分辨率是否高于显示屏的分辨率;若检测目标视频文件高于显示屏的分辨率,则根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率,目标分辨率与显示屏的分辨率的差值在预设的分辨率范围内。实施该发明实施例,能够在保证视频文件在电子设备显示过程中显示效果的同时,降低用户电子设备的流量损耗。

Description

一种视频压缩方法、装置及电子设备
相关申请的交叉引用
本申请要求北京金山安全软件有限公司于2016年05月27日提交的、发明名称为“一种视频压缩方法、装置及电子设备”的、中国专利申请号“201610366140.X”的优先权。
技术领域
本发明涉及电子技术领域,尤其涉及一种视频压缩方法、装置及电子设备。
背景技术
随着电子技术的快速发展以及电子设备的迅速普及,电子设备的功能日益完善。例如,用户可以利用电子设备访问外部数据网络资源,以进行视频文件的观看等。在实际应用中发现,当利用电子设备访问外部网络数据资源,以进行视频文件的观看时,视频文件的分辨率是固定的,也即,外部网络数据资源中视频文件的分辨率有多大,则在电子设备上显示时也是以该分辨率进行显示。然而,在实践中证明,当视频文件的分辨率与电子设备的分辨率相等时,视频文件在电子设备显示过程中显示效果最佳,当视频文件的分辨率高于电子设备的分辨率时,非但不会提高该视频文件在电子设备显示过程中显示效果,反而会增加视频文件缓冲过程中用户电子设备的流量损耗的情况发生。由此可见,如何在保证视频文件在电子设备显示过程中显示效果的同时,降低用户电子设备的流量损耗尤为重要。
发明内容
本发明实施例提供了一种视频压缩方法、装置及电子设备,能够在保证视频文件在电子设备显示过程中显示效果的同时,降低用户电子设备的流量损耗。
第一方面,本发明实施例公开了一种视频压缩方法,包括:
当所述电子设备在线播放目标视频文件时,获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率;
检测所述目标视频文件的分辨率是否高于所述显示屏的分辨率;
若检测所述目标视频文件高于所述显示屏的分辨率,则根据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率,所述目标分辨率与所述显示屏的分辨率的差值在预设的分辨率范围内。
结合第一方面的实现方式,在第一方面的第一种可能的实现方式中,还可以执行以下步骤:
获取所述电子设备的当前网络状态,所述网络状态包括资费状态或者非资费状态;
若所述电子设备的当前网络状态为所述资费状态,则执行所述获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的步骤。
结合第一方面的实现方式,在第一方面的第二种可能的实现方式中,还可以执行以下步骤:
获取所述电子设备单位时间内的数据传输量;
检测所述数据传输量是否低于预设数据量阈值;
若检测所述数据传输量低于所述预设数据量阈值,则执行所述获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的步骤。
结合第一方面的实现方式,在第一方面的第三种可能的实现方式中,还可以执行以下步骤:
获取所述电子设备的剩余存储空间值;
检测所述剩余存储空间值是否低于预设存储空间阈值;
若检测所述剩余存储空间值低于所述预设存储空间阈值,则执行所述获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的步骤。
结合第一方面的实现方式、第一方面的第一种可能的实现方式、第一方面的第二种可能的实现方式以及第一方面的第三种可能的实现方式中的任意一种实现方式,在第一方面的第四种可能的实现方式中,所述根据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率,所述目标分辨率与所述显示屏的分辨率的差值在预设的分辨率范围内,包括:
以所述显示屏的分辨率为所述目标分辨率,对所述目标视频文件进行压缩处理。
第二方面,本发明实施例还公开了一种视频压缩装置,装置设置在电子设备上,所述电子设备配置有显示屏,所述装置包括:
获取模块,用于当所述电子设备在线播放目标视频文件时,获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率;
检测模块,用于检测所述目标视频文件的分辨率是否高于所述显示屏的分辨率;
压缩模块,用于若所述检测模块检测所述目标视频文件高于所述显示屏的分辨率,则根据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率,所述目标分辨率与所述显示屏的分辨率的差值在预设的分辨率范围内。
结合第二方面的装置,在第二方面的第一种可能的装置中,所述获取模块,还用于获取所述电子设备的当前网络状态,所述网络状态包括资费状态或者非资费状态;
所述获取模块获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的具体实施方式为若所述电子设备的当前网络状态为所述资费状态,则获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率。
结合第二方面的装置,在第二方面的第二种可能的装置中,所述获取模块,还用于获取所述电子设备单位时间内的数据传输量;
所述检测模块,还用于检测所述数据传输量是否低于预设数据量阈值;
所述获取模块获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的具体实施方式为若所述检测模块检测所述数据传输量低于所述预设数据量阈值,则获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率。
结合第二方面的装置,在第二方面的第三种可能的装置中,所述获取模块,还用于获取所述电子设备的剩余存储空间值;
所述检测模块,还用于检测所述剩余存储空间值是否低于预设存储空间阈值;
所述获取模块获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的具体实施方式若所述检测模块检测所述剩余存储空间值低于所述预设存储空间阈值,则获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率。
结合第二方面的装置、第二方面的第一种可能的装置、第二方面的第二种可能的装置以及第二方面的第三种可能的装置中的任意一种装置,在第二方面的第四种可能的装置中,所述压缩模块根据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率的具体实施方式为以所述显示屏的分辨率为所述目标分辨率,对所述目标视频文件进行压缩处理。
第三方面,本发明实施例还公开了一种电子设备,包括:壳体、处理器、存储器、显示屏、电路板和电源电路,其中,所述电路板安置在所述壳体围成的空间内部,所述处理器和所述存储器设置在所述电路板上,所述显示屏外嵌于所述壳体上且连接所述电路板;所述电源电路,用于为所述电子设备的各个电路或器件供电;所述存储器用于存储可执行程序代码和数据;所述处理器通过读取所述存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,以用于执行以下步骤:
当所述电子设备在线播放目标视频文件时,获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率;
检测所述目标视频文件的分辨率是否高于所述显示屏的分辨率;
若检测所述目标视频文件高于所述显示屏的分辨率,则根据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率,所述目标分辨率与所述显示屏的分辨率的差值在预设的分辨率范围内。
结合第三方面的电子设备,在第三方面的第一种可能的电子设备中,所述处理器通过读取所述存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,还用于执行以下步骤:
获取所述电子设备的当前网络状态,所述网络状态包括资费状态或者非资费状态;
若所述电子设备的当前网络状态为所述资费状态,则执行所述获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的步骤。
结合第三方面的电子设备,在第三方面的第二种可能的电子设备中,所述处理器通过读取所述存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,还用于执行以下步骤:
获取所述电子设备单位时间内的数据传输量;
检测所述数据传输量是否低于预设数据量阈值;
若检测所述数据传输量低于所述预设数据量阈值,则执行所述获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的步骤。
结合第三方面的电子设备,在第三方面的第三种可能的电子设备中,所述处理器通过读取所述存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,还可以执行以下步骤:
获取所述电子设备的剩余存储空间值;
检测所述剩余存储空间值是否低于预设存储空间阈值;
若检测所述剩余存储空间值低于所述预设存储空间阈值,则执行所述获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的步骤。
结合第三方面的电子设备、第三方面的第一种可能的电子设备、第三方面的第二种可能的电子设备以及第三方面的第三种可能的电子设备中的任意一种电子设备,在第三方面的第四种可能的电子设备中,所述处理器通过读取所述存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序。执行步骤根据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率,所述目标分辨率与所述显示屏的分辨率的差值在预设的分辨率范围内,包括:
以所述显示屏的分辨率为所述目标分辨率,对所述目标视频文件进行压缩处理。
本发明实施例中,当电子设备在线播放目标视频文件时,获取目标视频文件的分辨率以及电子设备的显示屏的分辨率;检测目标视频文件的分辨率是否高于显示屏的分辨率;若检测目标视频文件高于显示屏的分辨率,则根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率,目标分辨率与显示屏的分辨率的差值在预设的分辨率范围内。在本发明实施例中,当电子设备在线播放目标视频文件时,电子设备可以根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率,且目标分辨率与显示屏的分辨率的差值在预设的分辨率范围内,从而可以避免因目标视频文件的分辨率与显示屏的分辨率的差值较大,而导致电子设备流量损耗且在显示过程中显示效果较差的问题。由此可见,实施该发明实施例,能够在保 证视频文件在电子设备显示过程中显示效果的同时,降低用户电子设备的流量损耗。
第四方面,本发明实施例提供一种计算机程序产品,当所述计算机程序产品中的指令处理器执行时,执行一种视频压缩方法,所述方法包括:
当所述电子设备在线播放目标视频文件时,获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率;
检测所述目标视频文件的分辨率是否高于所述显示屏的分辨率;
若检测所述目标视频文件高于所述显示屏的分辨率,则根据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率,所述目标分辨率与所述显示屏的分辨率的差值在预设的分辨率范围内。
第五方面,本发明实施例提供一种存储介质,当所述存储介质中的指令由移动终端的处理器被执行时,使得移动设备能够执行一种视频压缩方法,所述方法包括:
当所述电子设备在线播放目标视频文件时,获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率;
检测所述目标视频文件的分辨率是否高于所述显示屏的分辨率;
若检测所述目标视频文件高于所述显示屏的分辨率,则根据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率,所述目标分辨率与所述显示屏的分辨率的差值在预设的分辨率范围内。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本发明实施例公开的一种视频压缩方法的流程示意图;
图2是本发明实施例公开的另一种视频压缩方法的流程示意图;
图3是本发明实施例公开的一种视频压缩装置的结构示意图;
图4是本发明实施例公开的一种电子设备的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例提供了一种视频压缩方法、装置及电子设备,在本发明实施例中,当电子设备在线播放目标视频文件时,电子设备可以根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率,且目标分辨率与显示屏的分辨率的差值在预设的分辨率范围内,从而可以避免因目标视频文件的分辨率与显示屏的分辨率的差值较大,而导致电子设备流量损耗且在显示过程中显示效果较差的问题。由此可见,实施该发明实施例,能够在保证视频文件在电子设备显示过程中显示效果的同时,降低用户电子设备的流量损耗。以下分别进行详细描述。
请参阅图1,图1是本发明实施例公开的一种视频压缩方法的流程示意图;其中,图1所示的视频压缩方法可以适用于智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)等具有显示屏的电子设备中。如图1所示,该视频压缩方法可以包括以下步骤:
101、当电子设备在线播放目标视频文件时,获取目标视频文件的分辨率以及电子设备的显示屏的分辨率。
本发明实施例中,电子设备在线播放目标视频文件也即是电子设备正在访问外部数据网络资源。举例来说,电子设备通过视频播放应用程序访问外部网络数据资源,以进行视频播放。
本发明实施例中,电子设备的显示屏是用于显示电子设备需要显示的显示内容的屏幕。该显示内容可以包括但不限于文字、图片以及符号等内容。电子设备的显示屏的尺寸是固定的,但用于显示内容的显示区域的尺寸是可以调整的。在调整显示区域的尺寸时,可以是用户根据需要进行调整,也可以是电子设备根据用户的历史调整记录进行调整;还可以是电子设备根据待显示内容的信息,如待显示内容的尺寸、待显示内容所占存储空间的大小等信息,进行调整;还可以是电子设备根据电子设备的硬件信息,如电子设备的电池信息、电子设备显示屏的分辨率等信息,进行调整,本发明实施例不作限定。通过实施该发明实施例可以在一定程度上降低电子设备的功能消耗,提高功耗的利用率。
本发明实施例中,电子设备的显示屏的分辨率是指电子设备的显示屏的单位面积显示像素的数量,以水平和垂直像素来衡量。电子设备的显示屏的分辨率低时,例如640×480,在电子设备的显示屏上显示的像素少;电子设备的显示屏的分辨率高时,例如1400×1200,在电子设备的显示屏上显示的像素多。举例来说,电子设备的显示屏的分辨率1400×1200的意思是水平方向含有像素数为1400个,垂直方向像素数1200个。在电子设备的显示屏的尺寸一样的情况下,显示屏的分辨率越高,显示效果就越精细和细腻。如同样大小的显示屏,分辨率为1400×1200的显示屏比分辨率为640×480的显示屏的显示效果要精细和细腻。
本发明实施例中,目标视频文件是由一帧一帧的图像组成,也即,目标视频文件的分辨 率也即是组成该目标视频文件的图像的分辨率。
其中,图像的分辨率是图像的宽和高像素值。图像分辨率是用于度量图像内数据量的一个参数,通常表示成每英寸像素。图像A的分辨率为1400×1200,是指它在横向和纵向上的有效像素,显示区域的尺寸较小时,每英寸像素值较高,看起来清晰;显示区域的尺寸较大时,由于没有那么多有效像素填充显示区域,有效像素的每英寸像素值下降,显示时就模糊了。
102、检测目标视频文件的分辨率是否高于所述显示屏的分辨率。
本发明实施例中,电子设备在获取目标视频文件的分辨率以及电子设备的显示屏的分辨率之后,则可以检测目标视频文件的分辨率是否高于所述显示屏的分辨率。
103、若检测目标视频文件高于显示屏的分辨率,则根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率,目标分辨率与显示屏的分辨率的差值在预设的分辨率范围内。
本发明实施例中,目标视频文件压缩后的分辨率,也即,目标分辨率,与显示屏的分辨率的差值在预设的分辨率范围内,预设的分辨率范围越小,图像的显示质量越好,当目标分辨率与显示屏的分辨率的差值为零时,也即显示屏的分辨率与目标视频文件的分辨率相同时,目标视频文件在该显示屏中的显示效果最佳,因为即使将目标视频文件的分辨率调整到较高的值,目标视频文件在该显示屏中的显示效果也不会有任何变化。因此,若电子设备检测到目标视频文件高于显示屏的分辨率,则电子设备可以根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率,目标分辨率与显示屏的分辨率的差值在预设的分辨率范围内。
举例来说,若电子设备的显示屏的分辨率为720×1280,目标视频文件的分辨率为1080×1920,则可以将目标视频文件的分辨率1080×1920压缩到720×1280。这样的压缩处理既可以少占用存储空间180MB,且目标视频文件的在电子设备显示屏上显示时,显示质量也不会受到明显的影响。
在图1中,详细描述了当电子设备在线播放目标视频文件时,获取目标视频文件的分辨率以及电子设备的显示屏的分辨率;检测目标视频文件的分辨率是否高于显示屏的分辨率;若检测目标视频文件高于显示屏的分辨率,则根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率,目标分辨率与显示屏的分辨率的差值在预设的分辨率范围内。在本发明实施例中,当电子设备在线播放目标视频文件时,电子设备可以根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率,且目标分辨率与显示屏的分辨率的差值在预设的分辨率范围内,从而可以避免因目标视频文件的分辨率与显示屏的分辨率的差值较大,而导致电子设备流量损耗且在显示过程中显示效果较差的问题。由此可见,实施该发明实施例,能够 在保证视频文件在电子设备显示过程中显示效果的同时,降低用户电子设备的流量损耗。
请参阅图2,图2是本发明实施例公开的另一种视频压缩方法的流程示意图。如图2所示,该视频压缩方法可以包括以下步骤:
201、当电子设备在线播放目标视频文件时,获取目标视频文件的分辨率以及电子设备的显示屏的分辨率。
本发明实施例中,电子设备在线播放目标视频文件也即是电子设备正在访问外部数据网络资源。举例来说,电子设备通过视频播放应用程序访问外部网络数据资源,以进行视频播放。
作为一种可选的实施方式,电子设备在获取目标视频文件的分辨率以及电子设备的显示屏的分辨率之前,还可以获取电子设备的当前网络状态,网络状态包括资费状态或者非资费状态。
其中,若电子设备的当前网络状态为资费状态,则执行获取目标视频文件的分辨率以及电子设备的显示屏的分辨率的步骤。
本发明实施例中,电子设备获取目标电子设备的当前网络状态的方式具有多样性。例如,电子设备可以发送针对电子设备的网络状态获取请求至绑定服务器,绑定服务器在接收到该网络状态获取请求之后,则可以查询电子设备的最新网络状态,并发送至电子设备。其中,要通过该方式检测电子设备的网络状态时,绑定服务器与电子设备应建立相应的绑定关系。
本发明实施例中,网络状态包括资费状态或者非资费状态。其中,资费状态主要包括通过订购的数据流量套餐而产生相应费用的状态;非资费状态主要是以WIFI为主的网络状态。举例来说,电子设备A订购的套餐为5元30M的套餐,则电子设备A使用的数据流量在30M之内,电子设备A对应的网络状态为资费状态,当电子设备A使用的数据流量超过30M,电子设备A对应的网络状态也为资费状态。
进一步,随着电子技术的快速发展以及电子设备的迅速普及,电子设备的功能日益完善,电子设备与电子设备之间也可以实现数据流量之间的共享,也即电子设备A可以通过开启热点,供电子设备B连接,并可以访问网页;也即,当电子设备A通过连接电子设备B的共享的热点时,电子设备A当前的网络状态也为资费状态。
进一步,若电子设备的当前网络状态为非资费状态,则也可以通过检测目标视频文件的分辨率是否高于显示屏的分辨率,并在检测到目标视频文件的分辨率高于显示屏的分辨率时,以显示屏的分辨率作为目标分辨率,以对目标视频文件进行分辨率压缩操作。在该实施例中,通过对目标视频文件进行分辨率压缩操作主要是为了提高目标视频文件在显示过程中的显示效果,且能够增加缓存过程的缓存效率。
作为另一种可选的实施方式,电子设备在获取目标视频文件的分辨率以及电子设备的显示屏的分辨率之前,还可以获取电子设备单位时间内的数据传输量;并检测数据传输量是否低于预设数据量阈值。
其中,若检测数据传输量低于预设数据量阈值,则执行获取目标视频文件的分辨率以及电子设备的显示屏的分辨率的步骤。
本发明实施例中,电子设备单位时间内的数据传输量是用于描述电子设备当前数据传输速度,也即,单位时间内的数据传输量越大,则意味着该电子设备当前数据传输的速度越快;单位时间内的数据传输量越小,则意味着该电子设备当前数据传输的速度越慢。
本发明实施例中,可以在电子设备预先设置数据量阈值,其中,该数据量阈值的设定可以是用户根据需要进行设定;也可以是电子设备根据用户的历史设定记录进行设定;还可以是电子设备根据电子设备当前所处的网络状态进行设定;本发明不作限定。
本发明实施例中,若检测数据传输量低于预设数据量阈值,则说明该电子设备当前数据传输速度较慢,若目标视频文件的分辨率高,则会因为单位时间内的数据传输量较小,而不能正常缓冲该视频文件,导致播放中断。由此可见,在获取目标视频文件的分辨率以及电子设备的显示屏的分辨率,并对目标视频文件进行压缩处理之前,确定电子设备的数据量传输速度,尤为重要。
作为又一种可选的实施方式,电子设备在获取目标视频文件的分辨率以及电子设备的显示屏的分辨率之前,还可以获取电子设备的剩余存储空间值;并检测剩余存储空间值是否低于预设存储空间阈值。
其中,若检测剩余存储空间值低于预设存储空间阈值,则执行获取目标视频文件的分辨率以及电子设备的显示屏的分辨率的步骤。
本发明实施例中,可以在电子设备中预先设置一个预设存储空间阈值,其中,该预设存储空间阈值可以是用户根据需要进行设定,也可以是电子设备根据用户的历史设定记录进行设定,还可以是电子设备根据用户的总的存储空间进行设定,还可以是电子设备根据电子设备的可用存储空间进行设定,本发明实施例不作限定。通过实施该发明实施例可以增加预设存储空间阈值的设定方式,使得该预设存储空间阈值设定得更为合理,从而提高用户体验。
本发明实施例中,电子设备可以实时获取电子设备的剩余存储空间值,并能够检测剩余存储空间值是否低于预设存储空间阈值;若检测到剩余存储空间值低于预设存储空间阈值,则说明电子设备当前存储空间较小,则可以获取显示屏的分辨率以及目标视频文件的分辨率,并执行压缩处理目标视频文件,从而达到节省存储空间的目的。
202、检测目标视频文件的分辨率是否高于显示屏的分辨率。
203、若检测目标视频文件高于显示屏的分辨率,以显示屏的分辨率为目标分辨率,对 目标视频文件进行压缩处理。
本发明实施例中,在检测目标视频文件高于显示屏的分辨率之后,为了在保证目标视频文件的显示效果最佳,且降低用户电子设备的流量损耗,则电子设备可以以显示屏的分辨率为目标分辨率,对目标视频文件进行压缩处理。
举例来说,若电子设备的显示屏的分辨率为720×1280,目标视频文件的分辨率为1080×1920,则在压缩目标视频文件时,可以以720×1280为目标分辨率,将目标视频文件的分辨率由1080×1920压缩至720×1280。这样的压缩处理既可以少占用存储空间180MB,且目标视频文件的在电子设备显示屏上显示时,显示质量也不会受到明显的影响。其中,在压缩过程中,采用的压缩方法可以包括但不限于哈夫曼压缩方法、线性预测编码方法以及无损压缩编码方法等。
在图2中,详细描述了电子设备在获取目标视频文件的分辨率以及电子设备的显示屏的分辨率之前,可以获取电子设备的当前网络状态,并在电子设备的当前网络状态为资费状态时,才获取目标视频文件的分辨率以及电子设备的显示屏的分辨率,以执行针对目标视频文件的压缩处理;也可以在检测数据传输量低于预设数据量阈值,则获取目标视频文件的分辨率以及电子设备的显示屏的分辨率才获取目标视频文件的分辨率以及电子设备的显示屏的分辨率,以执行针对目标视频文件的压缩处理;还可以在检测剩余存储空间值低于预设存储空间阈值时,则获取目标视频文件的分辨率以及电子设备的显示屏的分辨率。由此可见,实施该发明实施例,可以通过多方面来确定是否对目标视频文件进行压缩处理,从而可以增加是否对目标视频文件进行压缩处理的判断依据。
请参阅图3,图3是本发明实施例公开的一种视频压缩装置的结构示意图,用于执行上述视频压缩方法。其中,图3所示的装置设置在电子设备上,其中,电子设备可以包括但不限于智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)等具有显示屏的电子设备。如图3所示,该装置可以包括:获取模块301、检测模块302以及压缩模块303,其中,
获取模块301,用于当电子设备在线播放目标视频文件时,获取目标视频文件的分辨率以及电子设备的显示屏的分辨率。
本发明实施例中,电子设备在线播放目标视频文件也即是电子设备正在访问外部数据网络资源。举例来说,电子设备通过视频播放应用程序访问外部网络数据资源,以进行视频播放。
本发明实施例中,电子设备的显示屏是用于显示电子设备需要显示的显示内容的屏幕。该显示内容可以包括但不限于文字、图片以及符号等内容。电子设备的显示屏的尺寸是固定 的,但用于显示内容的显示区域的尺寸是可以调整的。在调整显示区域的尺寸时,可以是用户根据需要进行调整,也可以是电子设备根据用户的历史调整记录进行调整;还可以是电子设备根据待显示内容的信息,如待显示内容的尺寸、待显示内容所占存储空间的大小等信息,进行调整;还可以是电子设备根据电子设备的硬件信息,如电子设备的电池信息、电子设备显示屏的分辨率等信息,进行调整,本发明实施例不作限定。通过实施该发明实施例可以在一定程度上降低电子设备的功能消耗,提高功耗的利用率。
本发明实施例中,电子设备的显示屏的分辨率是指电子设备的显示屏的单位面积显示像素的数量,以水平和垂直像素来衡量。电子设备的显示屏的分辨率低时,例如640×480,在电子设备的显示屏上显示的像素少;电子设备的显示屏的分辨率高时,例如1400×1200,在电子设备的显示屏上显示的像素多。举例来说,电子设备的显示屏的分辨率1400×1200的意思是水平方向含有像素数为1400个,垂直方向像素数1200个。在电子设备的显示屏的尺寸一样的情况下,显示屏的分辨率越高,显示效果就越精细和细腻。如同样大小的显示屏,分辨率为1400×1200的显示屏比分辨率为640×480的显示屏的显示效果要精细和细腻。
本发明实施例中,目标视频文件是由一帧一帧的图像组成,也即,目标视频文件的分辨率也即是组成该目标视频文件的图像的分辨率。
其中,图像的分辨率是图像的宽和高像素值。图像分辨率是用于度量图像内数据量的一个参数,通常表示成每英寸像素。图像A的分辨率为1400×1200,是指它在横向和纵向上的有效像素,显示区域的尺寸较小时,每英寸像素值较高,看起来清晰;显示区域的尺寸较大时,由于没有那么多有效像素填充显示区域,有效像素的每英寸像素值下降,显示时就模糊了。
检测模块302,用于检测目标视频文件的分辨率是否高于显示屏的分辨率。
本发明实施例中,在获取模块301获取目标视频文件的分辨率以及电子设备的显示屏的分辨率之后,则检测模块302可以检测目标视频文件的分辨率是否高于所述显示屏的分辨率。
压缩模块303,用于若检测模块302检测目标视频文件高于显示屏的分辨率,则根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率,目标分辨率与显示屏的分辨率的差值在预设的分辨率范围内。
本发明实施例中,目标视频文件压缩后的分辨率(目标分辨率)与显示屏的分辨率的差值在预设的分辨率范围内,预设的分辨率范围越小,图像的显示质量越好,当目标分辨率与显示屏的分辨率的差值为零时,也即显示屏的分辨率与目标视频文件的分辨率相同时,目标视频文件在该显示屏中的显示效果最佳,因为即使将目标视频文件的分辨率调整到较高的值,目标视频文件在该显示屏中的显示效果也不会有任何变化。因此,若电子设备检测到目 标视频文件高于显示屏的分辨率,则电子设备可以根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率,目标分辨率与显示屏的分辨率的差值在预设的分辨率范围内。
举例来说,若电子设备的显示屏的分辨率为720×1280,目标视频文件的分辨率为1080×1920,则压缩模块303可以将目标视频文件的分辨率1080×1920压缩到720×1280。这样的压缩处理既可以少占用存储空间180MB,且目标视频文件的在电子设备显示屏上显示时,显示质量也不会受到明显的影响。
进一步,获取模块301,还用于获取电子设备的当前网络状态,网络状态包括资费状态或者非资费状态。
其中,获取模块301获取目标视频文件的分辨率以及电子设备的显示屏的分辨率的具体实施方式为若电子设备的当前网络状态为资费状态,则获取目标视频文件的分辨率以及电子设备的显示屏的分辨率。
获取模块301,还用于获取电子设备单位时间内的数据传输量。
检测模块302,还用于检测数据传输量是否低于预设数据量阈值。
获取模块301获取目标视频文件的分辨率以及电子设备的显示屏的分辨率的具体实施方式为若检测模块检测数据传输量低于预设数据量阈值,则获取目标视频文件的分辨率以及电子设备的显示屏的分辨率。
获取模块301,还用于获取电子设备的剩余存储空间值。
检测模块302,还用于检测剩余存储空间值是否低于预设存储空间阈值。
获取模块301获取目标视频文件的分辨率以及电子设备的显示屏的分辨率的具体实施方式若检测模块302检测剩余存储空间值低于预设存储空间阈值,则获取目标视频文件的分辨率以及电子设备的显示屏的分辨率。
压缩模块303根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率的具体实施方式为以显示屏的分辨率为目标分辨率,对目标视频文件进行压缩处理。
在图3中,详细描述了当电子设备在线播放目标视频文件时,获取模块301获取目标视频文件的分辨率以及电子设备的显示屏的分辨率;检测模块302检测目标视频文件的分辨率是否高于显示屏的分辨率;若检测模块302检测目标视频文件高于显示屏的分辨率,则压缩模块303根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率,目标分辨率与显示屏的分辨率的差值在预设的分辨率范围内。在本发明实施例中,当电子设备在线播放目标视频文件时,电子设备可以根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率,且目标分辨率与显示屏的分辨率的差值在预设的分辨率范围内,从而可以避免因目标视频文件的分辨率与显示屏的分辨率的差值较大,而导致电子设备流量损耗且在显示过程中显示效果较差的问题。由此可见,实施该发明实施例,能够在保证视频文件在电子设备显示过程中显示效果的同时,降低用户电子设备的流量损耗。
请参阅图4,,图4是本发明实施例公开的一种电子设备的结构示意图,用于执行上述视频压缩方法。其中,如图4所示,该电子设备可以包括:壳体401、处理器402,存储器403,显示屏404,电路板405和电源电路406等组件。其中,电路板405安置在壳体401围成的空间内部,处理器402和存储器403设置在电路板405上,显示屏404外嵌于壳体401上且连接电路板405。本领域技术人员可以理解,图4中示出的电子设备的结构并不构成对本发明实施例的限定,它既可以是总线形结构,也可以是星型结构,还可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:
处理器402为电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器403内的程序和/或模块,以及调用存储在存储器403内的数据,以执行电子设备的各种功能和处理数据。处理器402可以由集成电路(Integrated Circuit,简称IC)组成,例如可以由单颗封装的IC所组成,也可以由连接多颗相同功能或不同功能的封装IC而组成。举例来说,处理器402可以仅包括中央处理器(Central Processing Unit,简称CPU),也可以是CPU、数字信号处理器(digital signal processor,简称DSP)、图形处理器(Graphic Processing Unit,简称GPU)及各种控制芯片的组合。在本发明实施方式中,CPU可以是单运算核心,也可以包括多运算核心。
显示屏404可以包括触控面板、触摸屏等,可以用于输出提醒消息、图片等信息,也可以接收用户触发的各项触控操作。
电源电路406,用于为电子设备的各个电路或器件供电。
存储器403可用于存储软件程序以及模块,处理器402通过调用存储在存储器403中的软件程序以及模块,从而执行电子设备的各项功能应用以及实现数据处理。存储器403主要包括程序存储区和数据存储区,其中,程序存储区可存储操作系统、至少一个功能所需的应用程序等;数据存储区可存储根据电子设备的使用所创建的数据等。在本发明实施例中,操作系统可以是Android系统、iOS系统或Windows操作系统等等。
在图4所示的电子设备中,处理器402调用存储在存储器403中的应用程序,用于执行以下操作:
当电子设备在线播放目标视频文件时,获取目标视频文件的分辨率以及电子设备的显示屏的分辨率;
检测目标视频文件的分辨率是否高于显示屏的分辨率;
若检测目标视频文件高于显示屏的分辨率,则根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率,目标分辨率与显示屏的分辨率的差值在预设的分辨率范围内。
本发明实施例中,处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,还用于执行以下步骤:
获取电子设备的当前网络状态,网络状态包括资费状态或者非资费状态;
若电子设备的当前网络状态为资费状态,则执行获取目标视频文件的分辨率以及电子设备的显示屏的分辨率的步骤。
本发明实施例中,处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,还用于执行以下步骤:
获取电子设备单位时间内的数据传输量;
检测数据传输量是否低于预设数据量阈值;
若检测数据传输量低于预设数据量阈值,则执行获取目标视频文件的分辨率以及电子设备的显示屏的分辨率的步骤。
本发明实施例中,处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,还可以执行以下步骤:
获取电子设备的剩余存储空间值;
检测剩余存储空间值是否低于预设存储空间阈值;
若检测剩余存储空间值低于预设存储空间阈值,则执行获取目标视频文件的分辨率以及电子设备的显示屏的分辨率的步骤。
本发明实施例中,处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序。执行步骤根据显示屏的分辨率将目标视频文件的分辨率压缩至目标分辨率,目标分辨率与显示屏的分辨率的差值在预设的分辨率范围内,包括:
以显示屏的分辨率为目标分辨率,对目标视频文件进行压缩处理。
具体的,本发明实施例中介绍的用户电子设备可以实施本发明结合图1、图2介绍的视频压缩方法实施例中的部分或全部流程。
本发明所有实施例中的模块或子模块,可以通过通用集成电路,例如CPU(Central Processing Unit,中央处理器),或通过ASIC(Application Specific Integrated Circuit,专用集成电路)来实现。
本发明实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。
本发明实施例用户电子设备中的单元可以根据实际需要进行合并、划分和删减。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存取存储器(Random Access Memory,简称RAM)等。
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。

Claims (17)

  1. 一种视频压缩方法,应用于具有显示屏的电子设备中,其特征在于,包括:
    当所述电子设备在线播放目标视频文件时,获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率;
    检测所述目标视频文件的分辨率是否高于所述显示屏的分辨率;
    若检测所述目标视频文件高于所述显示屏的分辨率,则根据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率,所述目标分辨率与所述显示屏的分辨率的差值在预设的分辨率范围内。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    获取所述电子设备的当前网络状态,所述网络状态包括资费状态或者非资费状态;
    若所述电子设备的当前网络状态为所述资费状态,则执行所述获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的步骤。
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    获取所述电子设备单位时间内的数据传输量;
    检测所述数据传输量是否低于预设数据量阈值;
    若检测所述数据传输量低于所述预设数据量阈值,则执行所述获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的步骤。
  4. 根据权利要求1-3中任意一项所述的方法,其特征在于,所述方法还包括:
    获取所述电子设备的剩余存储空间值;
    检测所述剩余存储空间值是否低于预设存储空间阈值;
    若检测所述剩余存储空间值低于所述预设存储空间阈值,则执行所述获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的步骤。
  5. 根据权利要求1~4中任意一项所述的方法,其特征在于,所述根据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率,所述目标分辨率与所述显示屏的分辨率的差值在预设的分辨率范围内,包括:
    以所述显示屏的分辨率为所述目标分辨率,对所述目标视频文件进行压缩处理。
  6. 一种视频压缩装置,其特征在于,所述装置设置在电子设备上,所述电子设备配置有显示屏,所述装置包括:
    获取模块,用于当所述电子设备在线播放目标视频文件时,获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率;
    检测模块,用于检测所述目标视频文件的分辨率是否高于所述显示屏的分辨率;
    压缩模块,用于若所述检测模块检测所述目标视频文件高于所述显示屏的分辨率,则根 据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率,所述目标分辨率与所述显示屏的分辨率的差值在预设的分辨率范围内。
  7. 根据权利要求6所述的装置,其特征在于,
    所述获取模块,还用于获取所述电子设备的当前网络状态,所述网络状态包括资费状态或者非资费状态;
    所述获取模块获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的具体实施方式为若所述电子设备的当前网络状态为所述资费状态,则获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率。
  8. 根据权利要求6或7所述的装置,其特征在于,
    所述获取模块,还用于获取所述电子设备单位时间内的数据传输量;
    所述检测模块,还用于检测所述数据传输量是否低于预设数据量阈值;
    所述获取模块获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的具体实施方式为若所述检测模块检测所述数据传输量低于所述预设数据量阈值,则获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率。
  9. 根据权利要求6-8中任意一项所述的装置,其特征在于,
    所述获取模块,还用于获取所述电子设备的剩余存储空间值;
    所述检测模块,还用于检测所述剩余存储空间值是否低于预设存储空间阈值;
    所述获取模块获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的具体实施方式若所述检测模块检测所述剩余存储空间值低于所述预设存储空间阈值,则获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率。
  10. 根据权利要求6~9中任意一项所述的装置,其特征在于,所述压缩模块根据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率的具体实施方式为以所述显示屏的分辨率为所述目标分辨率,对所述目标视频文件进行压缩处理。
  11. 一种电子设备,其特征在于,包括:壳体、处理器、存储器、显示屏、电路板和电源电路,其中,所述电路板安置在所述壳体围成的空间内部,所述处理器和所述存储器设置在所述电路板上,所述显示屏外嵌于所述壳体上且连接所述电路板;所述电源电路,用于为所述电子设备的各个电路或器件供电;所述存储器用于存储可执行程序代码和数据;所述处理器通过读取所述存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,以用于执行以下步骤:
    当所述电子设备在线播放目标视频文件时,获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率;
    检测所述目标视频文件的分辨率是否高于所述显示屏的分辨率;
    若检测所述目标视频文件高于所述显示屏的分辨率,则根据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率,所述目标分辨率与所述显示屏的分辨率的差值在预设的分辨率范围内。
  12. 根据权利要求11所述的电子设备,其特征在于,所述处理器通过读取所述存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,还用于执行以下步骤:
    获取所述电子设备的当前网络状态,所述网络状态包括资费状态或者非资费状态;
    若所述电子设备的当前网络状态为所述资费状态,则执行所述获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的步骤。
  13. 根据权利要求11或12所述的电子设备,其特征在于,所述处理器通过读取所述存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,还用于执行以下步骤:
    获取所述电子设备单位时间内的数据传输量;
    检测所述数据传输量是否低于预设数据量阈值;
    若检测所述数据传输量低于所述预设数据量阈值,则执行所述获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的步骤。
  14. 根据权利要求11-13中任意一项所述的电子设备,其特征在于,所述处理器通过读取所述存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,还可以执行以下步骤:
    获取所述电子设备的剩余存储空间值;
    检测所述剩余存储空间值是否低于预设存储空间阈值;
    若检测所述剩余存储空间值低于所述预设存储空间阈值,则执行所述获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率的步骤。
  15. 根据权利要求11~14中任意一项所述的电子设备,其特征在于,所述处理器通过读取所述存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序。执行步骤根据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率,所述目标分辨率与所述显示屏的分辨率的差值在预设的分辨率范围内,包括:
    以所述显示屏的分辨率为所述目标分辨率,对所述目标视频文件进行压缩处理。
  16. 一种计算机程序产品,其特征在于,当所述计算机程序产品中的指令处理器执行时,执行一种视频压缩方法,所述方法包括:
    当所述电子设备在线播放目标视频文件时,获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率;
    检测所述目标视频文件的分辨率是否高于所述显示屏的分辨率;
    若检测所述目标视频文件高于所述显示屏的分辨率,则根据所述显示屏的分辨率将所述 目标视频文件的分辨率压缩至目标分辨率,所述目标分辨率与所述显示屏的分辨率的差值在预设的分辨率范围内。
  17. 一种存储介质,其特征在于,当所述存储介质中的指令由移动终端的处理器被执行时,使得移动设备能够执行一种视频压缩方法,所述方法包括:
    当所述电子设备在线播放目标视频文件时,获取所述目标视频文件的分辨率以及所述电子设备的显示屏的分辨率;
    检测所述目标视频文件的分辨率是否高于所述显示屏的分辨率;
    若检测所述目标视频文件高于所述显示屏的分辨率,则根据所述显示屏的分辨率将所述目标视频文件的分辨率压缩至目标分辨率,所述目标分辨率与所述显示屏的分辨率的差值在预设的分辨率范围内。
PCT/CN2017/082280 2016-05-27 2017-04-27 一种视频压缩方法、装置及电子设备 WO2017202175A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610366140.XA CN105959799A (zh) 2016-05-27 2016-05-27 一种视频压缩方法、装置及电子设备
CN201610366140.X 2016-05-27

Publications (1)

Publication Number Publication Date
WO2017202175A1 true WO2017202175A1 (zh) 2017-11-30

Family

ID=56910929

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/082280 WO2017202175A1 (zh) 2016-05-27 2017-04-27 一种视频压缩方法、装置及电子设备

Country Status (2)

Country Link
CN (1) CN105959799A (zh)
WO (1) WO2017202175A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112913267A (zh) * 2018-09-25 2021-06-04 深圳市欢太科技有限公司 资源处理方法、电子设备和计算机可读存储介质
CN115376437A (zh) * 2022-08-27 2022-11-22 亿慧云智能科技(深圳)股份有限公司 一种显示面板的显示方法及系统

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105959799A (zh) * 2016-05-27 2016-09-21 北京金山安全软件有限公司 一种视频压缩方法、装置及电子设备
CN108111920A (zh) * 2017-12-11 2018-06-01 北京小米移动软件有限公司 视频信息处理方法及装置
CN110533801A (zh) * 2019-07-12 2019-12-03 平安科技(深圳)有限公司 门禁系统通讯方法、装置、电子设备及存储介质
CN113596585A (zh) * 2021-08-16 2021-11-02 杭州华橙软件技术有限公司 视频处理方法和装置、存储介质及电子设备
CN113934500A (zh) * 2021-11-03 2022-01-14 杭州逗酷软件科技有限公司 渲染方法、装置、存储介质及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007306095A (ja) * 2006-05-09 2007-11-22 Matsushita Electric Ind Co Ltd インターネットセットトップボックスの映像出力装置
CN103618943A (zh) * 2013-11-27 2014-03-05 深圳创维-Rgb电子有限公司 一种显示终端的视频数据显示方法及显示终端
CN103763329A (zh) * 2014-02-18 2014-04-30 联想(北京)有限公司 一种数据传输的方法及装置
CN105100895A (zh) * 2014-05-07 2015-11-25 深圳Tcl新技术有限公司 无视频分辨率信息的视频与屏幕分辨率的匹配方法及装置
WO2015182912A1 (en) * 2014-05-27 2015-12-03 Samsung Electronics Co., Ltd. Method of controlling display and electronic device for providing the same
CN105959799A (zh) * 2016-05-27 2016-09-21 北京金山安全软件有限公司 一种视频压缩方法、装置及电子设备

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101848382A (zh) * 2010-05-31 2010-09-29 深圳市景阳科技股份有限公司 一种视频流图像分辨率和码流的调整方法及系统
US8587693B2 (en) * 2010-11-17 2013-11-19 International Business Machines Corporation Determination of storage availability for files to be stored at one or more device quality parameter settings
CN102595204A (zh) * 2012-02-28 2012-07-18 华为终端有限公司 一种流媒体传输方法、设备及系统
CN105263066A (zh) * 2014-06-13 2016-01-20 珠海全志科技股份有限公司 移动设备视频流传输控制方法及系统
CN104133649A (zh) * 2014-07-24 2014-11-05 可牛网络技术(北京)有限公司 一种图片显示方法、装置及终端

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007306095A (ja) * 2006-05-09 2007-11-22 Matsushita Electric Ind Co Ltd インターネットセットトップボックスの映像出力装置
CN103618943A (zh) * 2013-11-27 2014-03-05 深圳创维-Rgb电子有限公司 一种显示终端的视频数据显示方法及显示终端
CN103763329A (zh) * 2014-02-18 2014-04-30 联想(北京)有限公司 一种数据传输的方法及装置
CN105100895A (zh) * 2014-05-07 2015-11-25 深圳Tcl新技术有限公司 无视频分辨率信息的视频与屏幕分辨率的匹配方法及装置
WO2015182912A1 (en) * 2014-05-27 2015-12-03 Samsung Electronics Co., Ltd. Method of controlling display and electronic device for providing the same
CN105959799A (zh) * 2016-05-27 2016-09-21 北京金山安全软件有限公司 一种视频压缩方法、装置及电子设备

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112913267A (zh) * 2018-09-25 2021-06-04 深圳市欢太科技有限公司 资源处理方法、电子设备和计算机可读存储介质
CN115376437A (zh) * 2022-08-27 2022-11-22 亿慧云智能科技(深圳)股份有限公司 一种显示面板的显示方法及系统
CN115376437B (zh) * 2022-08-27 2023-07-25 亿慧云智能科技(深圳)股份有限公司 一种显示面板的显示方法及系统

Also Published As

Publication number Publication date
CN105959799A (zh) 2016-09-21

Similar Documents

Publication Publication Date Title
WO2017202175A1 (zh) 一种视频压缩方法、装置及电子设备
AU2020201023B2 (en) Adaptive transfer function for video encoding and decoding
US10834424B2 (en) Method and device for compressing image, and electronic device
WO2022037251A1 (zh) 视频数据处理方法及装置
CN110888521B (zh) 一种移动终端及其运行应用程序的方法
CN111163345A (zh) 一种图像渲染方法及装置
EP4002281A1 (en) Layer composition method and apparatus, electronic device, and storage medium
KR102528877B1 (ko) 비디오 디코딩 제어 방법, 장치, 전자 기기 및 저장 매체
WO2021008427A1 (zh) 图像合成方法、装置、电子设备及存储介质
CN114051145B (zh) 一种视频压缩处理方法、装置及介质
CN105827484A (zh) 一种测试画面同步显示方法及系统
US11562772B2 (en) Video processing method, electronic device, and storage medium
CN111918098A (zh) 视频处理方法、装置、电子设备、服务器及存储介质
CN109587561B (zh) 视频处理方法、装置、电子设备及存储介质
WO2020038071A1 (zh) 视频增强控制方法、装置、电子设备及存储介质
CN111447439B (zh) 图像编码方法、图像编码装置及移动终端
CN108235144B (zh) 播放内容获取方法、装置及计算设备
EP2530640A1 (en) Image copying method and device
CN112328351A (zh) 动画显示方法、动画显示装置及终端设备
WO2022061723A1 (zh) 一种图像处理方法、设备、终端及存储介质
CN117409113A (zh) 动画播放方法、装置、电子设备及计算机存储介质
TWI502999B (zh) 影像處理方法及應用該方法之電子裝置
CN113411589A (zh) 解码方法、装置、电子设备及存储介质
CN112073726A (zh) 压缩方法及装置、计算机可读存储介质及电子设备
CN113114955A (zh) 一种视频的生成方法、装置及电子设备

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17802021

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17802021

Country of ref document: EP

Kind code of ref document: A1