WO2018019237A1 - Video transmitting method and device, and electronic equipment - Google Patents

Video transmitting method and device, and electronic equipment Download PDF

Info

Publication number
WO2018019237A1
WO2018019237A1 PCT/CN2017/094369 CN2017094369W WO2018019237A1 WO 2018019237 A1 WO2018019237 A1 WO 2018019237A1 CN 2017094369 W CN2017094369 W CN 2017094369W WO 2018019237 A1 WO2018019237 A1 WO 2018019237A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
network
video data
image data
transmitted
Prior art date
Application number
PCT/CN2017/094369
Other languages
French (fr)
Chinese (zh)
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 WO2018019237A1 publication Critical patent/WO2018019237A1/en

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/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234363Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the spatial resolution, e.g. for clients with a lower screen resolution
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams

Definitions

  • the present application relates to the field of video processing technologies, and in particular, to a method, an apparatus, and an electronic device for transmitting video.
  • devices such as smartphones and tablets can transmit video through QQ and WeChat.
  • QQ and WeChat the Internet and mobile Internet technologies
  • the embodiments of the present invention provide a method, a device, and an electronic device for transmitting video, which solve the problem that the existing video transmission consumes large traffic, has a large cost, and has a long transmission time.
  • a method of transmitting video comprising:
  • the video data after reducing the video resolution is transmitted.
  • the method further includes: before the acquiring the current network type, when the video data to be transmitted is transmitted, the method further includes:
  • the captured video data is acquired, and the captured video data is taken as video data to be transmitted.
  • the determining whether the current network type obtained by the network is a charging type network includes:
  • the type of network is a fee-based network
  • the current network type obtained is a wireless fidelity network. If it is a wireless fidelity network, the current network type is not a charging network.
  • the performing the reducing video resolution on the video data includes:
  • the interpolation algorithm based on the fractional form performs row compression or column compression operation on the primary compressed image data corresponding to each frame image data, and obtains secondary compressed image data corresponding to the primary compressed image of each frame;
  • the secondary compressed image data corresponding to the primary compressed image of each frame constitutes the compressed video data.
  • a device for transmitting video comprising:
  • a network acquisition module configured to acquire a current network type when transmitting video data to be transmitted
  • a network judging module configured to determine whether the acquired current network type is a charging type network
  • a video compression module configured to perform a operation of reducing video resolution on the video data if it is a charging type network
  • a video transmission module for transmitting video data after reducing the video resolution.
  • the device further includes: a video acquisition module; the video acquisition module includes:
  • a first acquiring unit configured to acquire video data to be transmitted from a pre-stored video file set
  • a second acquiring unit configured to acquire the captured video data, and use the captured video data as the video data to be transmitted.
  • the network judgment module includes:
  • the first determining unit is configured to determine whether the acquired current network type is a network that charges by traffic, and if the network is charged by traffic, the current network type is a charging network;
  • the second determining unit is configured to determine whether the acquired current network type is a wireless fidelity network, and if it is a wireless fidelity network, the current network type is not a charging type network.
  • the video compression module includes:
  • An image obtaining unit configured to acquire image data of each frame in the video data
  • a first compression unit configured to perform a column compression or a row compression operation on the acquired image data of each frame based on an interpolation algorithm in a fractional form to obtain primary compressed image data corresponding to each frame image data;
  • a second compression unit configured to calculate a number of compressed images corresponding to each frame image data based on an interpolation algorithm in a fractional form Performing a row compression or a column compression operation to obtain secondary compressed image data corresponding to one compressed image of each frame;
  • the video framing unit is configured to compose the compressed video data by the secondary compressed image data corresponding to the one-time compressed image of each frame.
  • An electronic device comprising: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed inside a space enclosed by the housing, the processor and the memory are disposed on the circuit board; and the power circuit is configured to Providing power to each circuit or device of the electronic device; the memory is configured to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, and is configured to execute the foregoing transmission video Methods.
  • the method, the device, and the electronic device for transmitting video acquire the current network type when transmitting the video data to be transmitted, and if the current network type is a charging network, the video to be transmitted.
  • the data performs an operation of reducing the video resolution to reduce the resolution of the video data, and then the video data after reducing the video resolution is transmitted, thereby reducing the traffic, cost, and transmission time consumed by the video data transmission under the charging type network.
  • a storage medium storing one or more programs, when the one or more programs are executed by a device, causing the device to perform the following steps:
  • the video data after reducing the video resolution is transmitted.
  • the video data after reducing the video resolution is transmitted.
  • FIG. 1 is a schematic flowchart of a method for transmitting video according to an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of an apparatus for transmitting video according to an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of an embodiment of an electronic device according to the present application.
  • FIG. 1 is a schematic flowchart of a method for transmitting a video according to an embodiment of the present disclosure. As shown in FIG. 1 , the method in this embodiment may include:
  • Step 101 Acquire a current network type when transmitting video data to be transmitted.
  • step 102 is performed to determine whether the current network type is a charging network.
  • the transmitting the video data to be transmitted refers to transmitting by using instant communication software, and assuming that the same instant messaging software is installed on the first device and the second device respectively, for example, WeChat, of course, the instant messaging software It can also be other instant messaging software such as QQ, Yixin, Fetion, Momo or Wangxin, which is not limited in this embodiment.
  • the user A of the first device may send one or more video files stored on the first device to the user B of the second device by using WeChat; the user A may also perform video chat with the user B through WeChat.
  • the WeChat installed on the first device may be pre-stored from the first device.
  • one or more video files are obtained as video data to be transmitted; when user A performs video chat with user B through WeChat, the WeChat installed on the first device and the second device can obtain real-time shooting.
  • the video is the video data to be transmitted.
  • the method before the current network type is obtained, when the video data to be transmitted is transmitted, the method further includes:
  • the captured video data is acquired, and the captured video data is taken as video data to be transmitted.
  • Step 102 Determine whether the acquired current network type is a charging type network.
  • the preset charging type network table may be queried. If the current network type obtained is included in the preset charging type network table, the current network type obtained may be determined to be a charging type network; otherwise, Can judge when The pre-network type is a free-type network; wherein the charging network in the preset charging type network table may include, but is not limited to, a 2G network, a 3G network, and a 4G network, where the 2G network includes but is not limited to: global mobile Communication system network; 3G network includes, but is not limited to, general packet radio service network, universal mobile communication system network, long term evolution network, code division multiple access network, wideband code division multiple access network, and time division synchronous code division multiple access network; 4G network Including but not limited to: time-sharing long-term evolution network and long-term evolution frequency division duplex network.
  • the charging standard of the 2G network, the 3G network, or the 4G network may include, but is not limited to, charging by time or by flow metering.
  • determining whether the current network type obtained by the charging network is:
  • the current network type obtained is a wireless fidelity network. If it is a wireless fidelity network, the current network type is not a charging network.
  • step 103 is performed; if the current network type obtained is a Traffic-based network, step 103 is performed; if the current network type obtained is a Wireless Fidelity (WIFI) network, the current network type is free.
  • the network may directly send the video data without performing step 103.
  • WIFI Wireless Fidelity
  • the free-type network may include, but is not limited to, a WIFI network.
  • a wired network connected through a network cable is also a free-type network.
  • the current network type of the smart phone may be obtained. If the current network type is a WIFI network, the current network type is determined to be a free network, and the video resolution may not be reduced. Rate of operation.
  • Step 103 If it is a charging type network, perform an operation of reducing video resolution on the video data.
  • the operation of reducing the video resolution is performed on the video to be transmitted.
  • the operation of reducing the video resolution may be performed on the acquired video data by the instant messaging software, for example, WeChat, thereby reducing the size of the video data to be transmitted.
  • the size of the video data to be transmitted is 100 MB, and the resolution is 1080*1902; After the operation of reducing the video resolution is performed on the acquired video data, the resolution of the video data to be transmitted is reduced from 1080*1920 to 720*1080, and the size of the video data to be transmitted is from 100 MB. Down to 60MB, which means you can save 40MB of traffic and the corresponding cost.
  • the method of reducing the video resolution is not limited, that is, the instant messaging software can perform the operation of reducing the video resolution on the video data by any existing method of reducing the video resolution.
  • the performing the operation of reducing the video resolution on the acquired video data may include:
  • the interpolation algorithm based on the fractional form performs row compression or column compression operation on the primary compressed image data corresponding to each frame image data, and obtains secondary compressed image data corresponding to the primary compressed image of each frame;
  • the secondary compressed image data corresponding to the primary compressed image of each frame constitutes the compressed video data.
  • the image data of each frame in the video data to be transmitted may be obtained by using WeChat, and the column compression operation is performed on the acquired image data of each frame based on an interpolation algorithm in a fractional form to obtain a compression corresponding to each frame image data.
  • the secondary compressed image data constitutes compressed video data.
  • the resolution of the primary compressed image data can be expressed as n ⁇ q
  • the resolution of the secondary compressed image data can be expressed as w ⁇ q, where q satisfies: q ⁇ m, w satisfies: w ⁇ n.
  • the image data of each frame in the video data to be transmitted may be obtained by using a micro-letter, and performing a row compression operation on the acquired image data of each frame based on an interpolation algorithm in a fractional form to obtain a corresponding image data of each frame. Compressing the image data; performing a column compression operation on the primary compressed image data corresponding to each frame image data based on the interpolation algorithm in the fractional form to obtain secondary compressed image data corresponding to the primary compressed image of each frame; and finally, correspondingly compressing the image once for each frame
  • the secondary compressed image data constitutes compressed video data.
  • the resolution of the primary compressed image data can be expressed as w ⁇ m
  • the resolution of the secondary compressed image data can be expressed as w ⁇ q, where w satisfies: w ⁇ n,q satisfies:q ⁇ m.
  • Step 104 The video data after the video resolution is reduced is transmitted.
  • the size of the video data to be transmitted is reduced to 60 MB, and the video data to be transmitted before transmitting the reduced video resolution is Compared, sending video data with reduced video resolution can save 40MB of traffic and corresponding cost, and reduce the transmission time of video data.
  • the method for transmitting video obtained in this embodiment obtains the current network type when transmitting the video data to be transmitted, and if the current network type is a charging type network, performing the operation of reducing the video resolution on the video data to be transmitted.
  • the video data after reducing the video resolution is transmitted, thereby reducing the traffic, cost and transmission time consumed by the video data transmission under the charging type network.
  • the apparatus of this embodiment may include: a network obtaining module 11, a network determining module 12, a video compressing module 13, and a video transmitting module 14, wherein
  • the network obtaining module 11 is configured to acquire a current network type when transmitting video data to be transmitted.
  • the network determining module 12 determines whether the current network type is a charging network.
  • the transmitting the video data to be transmitted refers to transmitting by using instant communication software, and assuming that the same instant messaging software is installed on the first device and the second device respectively, for example, WeChat, of course, the instant messaging software It can also be other instant messaging software such as QQ, Yixin, Fetion, Momo or Wangxin, which is not limited in this embodiment.
  • the user A of the first device may send one or more video files stored on the first device to the user B of the second device by using WeChat; the user A may also perform video chat with the user B through WeChat.
  • the WeChat installed on the first device may be pre-stored from the first device.
  • one or more video files are obtained as video data to be transmitted; when user A performs video chat with user B through WeChat, the WeChat installed on the first device and the second device can obtain real-time shooting.
  • the video is the video data to be transmitted.
  • the device further includes: a video acquiring module, where the video acquiring module includes:
  • a first acquiring unit configured to acquire video data to be transmitted from a pre-stored video file set
  • a second acquiring unit configured to acquire the captured video data, and use the captured video data as the video data to be transmitted.
  • the network determining module 12 is configured to determine whether the acquired current network type is a charging type network.
  • the preset charging type network table may be queried. If the current network type obtained is included in the preset charging type network table, the current network type obtained may be determined to be a charging type network; otherwise, The current network type may be a free-type network.
  • the charging network in the preset charging type network table may include, but is not limited to, a 2G network, a 3G network, and a 4G network, where the 2G network includes but is not limited to: Global mobile communication system network; 3G networks include, but are not limited to, general packet radio service networks, universal mobile communication system networks, long term evolution networks, code division multiple access networks, wideband code division multiple access networks, and time division synchronous code division multiple access networks; 4G networks include, but are not limited to, time-sharing long-term evolution networks and long-term evolution frequency division duplex networks.
  • the charging standard of the 2G network, the 3G network, or the 4G network may include, but is not limited to, charging by time or by flow metering.
  • the network determining module 12 includes:
  • the first determining unit is configured to determine whether the acquired current network type is a network that charges by traffic, and if the network is charged by traffic, the current network type is a charging network;
  • the second determining unit is configured to determine whether the acquired current network type is a wireless fidelity network, and if it is a wireless fidelity network, the current network type is not a charging type network.
  • step 103 is performed; if the current network type obtained is a wireless fidelity WIFI network, the current network type is a free network, which can be directly The video data is sent out.
  • the free-type network may include, but is not limited to, a WIFI network.
  • a wired network connected through a network cable is also a free-type network.
  • the current network type of the smart phone may be obtained. If the current network type is a WIFI network, the current network type is determined to be a free network, and the video resolution may not be reduced. Rate of operation.
  • the video compression module 13 is configured to perform an operation of reducing video resolution on the video data if it is a charging type network.
  • the operation of reducing the video resolution is performed on the video to be transmitted.
  • the operation of reducing the video resolution may be performed on the acquired video data by the instant messaging software, for example, WeChat, thereby reducing the size of the video data to be transmitted.
  • the size of the video data to be transmitted is 100 MB, and the resolution is 1080*1902; after performing the operation of reducing the video resolution by using the video data obtained by the WeChat, the video data to be transmitted is While the resolution is reduced from 1080*1920 to 720*1080, the size of the video data to be transmitted is reduced from 100MB to 60MB, which means that 40MB of traffic and corresponding cost can be saved.
  • the method for reducing the video resolution is not limited, that is, the instant messaging software can perform the operation of reducing the video resolution on the acquired video data by using any existing method for reducing the video resolution.
  • the video compression module may include:
  • An image obtaining unit configured to acquire image data of each frame in the video data
  • a first compression unit configured to perform a column compression or a row compression operation on the acquired image data of each frame based on an interpolation algorithm in a fractional form to obtain primary compressed image data corresponding to each frame image data;
  • a second compression unit configured to perform a row compression or a column compression operation on the primary compressed image data corresponding to each frame image data based on the interpolation algorithm in a fractional form, to obtain secondary compressed image data corresponding to the primary compressed image of each frame;
  • the video framing unit is configured to compose the compressed video data by the secondary compressed image data corresponding to the one-time compressed image of each frame.
  • the image data of each frame in the video data to be transmitted may be obtained by using WeChat, and the column compression operation is performed on the acquired image data of each frame based on an interpolation algorithm in a fractional form to obtain a compression corresponding to each frame image data.
  • the secondary compressed image data constitutes compressed video data.
  • the resolution of the primary compressed image data can be expressed as n ⁇ q
  • the resolution of the secondary compressed image data can be expressed as w ⁇ q, where q satisfies: q ⁇ m, w satisfies: w ⁇ n.
  • the image data of each frame in the video data to be transmitted can be obtained through WeChat, and is based on the fractal shape first.
  • the interpolation algorithm performs a row compression operation on the acquired image data of each frame to obtain primary compressed image data corresponding to each frame image data; and then performs a column on the primary compressed image data corresponding to each frame image data based on the interpolation algorithm in fractional form.
  • the compression operation obtains the second compressed image data corresponding to the primary compressed image of each frame; finally, the secondary compressed image data corresponding to the primary compressed image of each frame constitutes the compressed video data.
  • the resolution of the primary compressed image data can be expressed as w ⁇ m
  • the resolution of the secondary compressed image data can be expressed as w ⁇ q, where w satisfies: w ⁇ n,q satisfies:q ⁇ m.
  • the video transmission module 14 is configured to transmit video data after the video resolution is reduced.
  • the size of the video data to be transmitted is reduced to 60 MB, and the video data to be transmitted before transmitting the reduced video resolution is Compared, sending video data with reduced video resolution can save 40MB of traffic and corresponding cost, and reduce the transmission time of video data.
  • the device for transmitting video obtained by the embodiment obtains the current network type when the network acquisition module transmits the video data to be transmitted. If the current network type is a charging network, the video data to be transmitted is reduced by the video compression module. The resolution, and then the video data after the video resolution is reduced by the video transmission module, can reduce the traffic, cost and transmission time consumed by the video data transmission under the charging network.
  • An embodiment of the present application further provides an electronic device.
  • 3 is a schematic structural diagram of an embodiment of an electronic device according to the present application, which can implement the process of the embodiment shown in FIG. 1-2 of the present application.
  • the electronic device may include: a housing 41, a processor 42, and a memory. 43.
  • the circuit board 44 and the power supply circuit 45 wherein the circuit board 44 is disposed inside the space surrounded by the housing 41, the processor 42 and the memory 43 are disposed on the circuit board 44, and the power supply circuit 45 is used for the electronic device
  • the memory 43 is configured to store executable code
  • the processor 42 executes a program corresponding to the executable code by reading the executable program code stored in the memory 43 for performing any of the foregoing embodiments The method of transmitting video.
  • the electronic device exists in a variety of forms including, but not limited to:
  • Mobile communication devices These devices are characterized by mobile communication functions and are mainly aimed at providing voice and data communication.
  • Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
  • Ultra-mobile personal computer equipment This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has mobile Internet access.
  • Such terminals include: PDAs, MIDs, and UMPC devices, such as the iPad.
  • Portable entertainment devices These devices can display and play multimedia content. Such devices include: audio, video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
  • the server consists of a processor, a hard disk, a memory, a system bus, etc.
  • the server is similar to a general-purpose computer architecture, but because of the need to provide highly reliable services, processing power and stability High reliability in terms of reliability, security, scalability, and manageability.
  • the present application also proposes a storage medium.
  • the storage medium stores one or more programs, and when the one or more programs are executed by one device, the method for video transmission in the embodiment of the present application is performed, where the method includes:
  • the video data after reducing the video resolution is transmitted.
  • the application further provides an application, where the application is used to perform the method for transmitting video in the embodiment of the present application, where the method for transmitting video includes:
  • the video data after reducing the video resolution is transmitted.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • portions of the application can be implemented in hardware, software, firmware, or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
  • the disclosed apparatus may be implemented in other ways.
  • the device embodiments described above are schematic, for example, the division of the unit is only a logical function division, and the actual implementation may have another division manner, for example, multiple units or components may be combined or may be integrated. Go to another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • a computer readable storage medium A number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

Disclosed are a video transmitting method and device and electronic equipment, relating to the technical field of video processing and capable of reducing flow consumption in video transmission and shortening transmission time. The method comprises: when transmitting video data to be transmitted, acquiring a current network type; determining whether the acquired current network type is a payment type network; if so, carrying out an operation of reducing video resolution on the video data; and transmitting out the video data subjected to video resolution reduction. The device and the electronic equipment are provided with corresponding modules for realizing the method. The present application is applicable to video transmission operations on electronic equipment.

Description

一种传输视频的方法、装置及电子设备Method, device and electronic device for transmitting video
相关申请的交叉引用Cross-reference to related applications
本申请要求北京金山安全软件有限公司于2016年7月26日提交的、申请名称为“一种传输视频的方法、装置及电子设备”的、中国专利申请号“201610599551.3”的优先权。This application claims the priority of the Chinese Patent Application No. "201610599551.3" filed on July 26, 2016 by Beijing Jinshan Security Software Co., Ltd., entitled "A Method, Apparatus, and Electronic Device for Transmitting Video."
技术领域Technical field
本申请涉及视频处理技术领域,尤其涉及一种传输视频的方法、装置及电子设备。The present application relates to the field of video processing technologies, and in particular, to a method, an apparatus, and an electronic device for transmitting video.
背景技术Background technique
目前,智能手机、平板电脑等设备之间可以通过QQ、微信等传输视频。随着互联网及移动互联网技术发展的逐渐成熟,用户也不再满足于仅仅传输视频,而是对视频传输消耗的流量、费用及视频的传输速度有了更高的要求。At present, devices such as smartphones and tablets can transmit video through QQ and WeChat. With the gradual maturity of the development of the Internet and mobile Internet technologies, users are no longer satisfied with only transmitting video, but have higher requirements for the traffic, cost and video transmission speed consumed by video transmission.
现有技术中,在收费型网络下传输视频时,没有对待传输的视频进行压缩处理,而是直接将待传输的视频发送出去,会使得视频传输消耗的流量大、费用多且传输时间长。In the prior art, when a video is transmitted under a charging network, no video to be transmitted is compressed, but the video to be transmitted is directly sent out, which causes the video transmission to consume large traffic, cost, and long transmission time.
申请内容Application content
本申请实施例提供一种传输视频的方法、装置及电子设备,解决现有的视频传输消耗流量大、费用多且传输时间长的问题。The embodiments of the present invention provide a method, a device, and an electronic device for transmitting video, which solve the problem that the existing video transmission consumes large traffic, has a large cost, and has a long transmission time.
一种传输视频的方法,包括:A method of transmitting video, comprising:
在传输待传输的视频数据时,获取当前的网络类型;Obtain the current network type when transmitting the video data to be transmitted;
判断获取的当前网络类型是否是收费型网络;Determining whether the current network type obtained is a charging network;
若是收费型网络,则对所述视频数据执行降低视频分辨率的操作;If it is a charging type network, performing an operation of reducing video resolution on the video data;
将降低视频分辨率后的视频数据传输出去。The video data after reducing the video resolution is transmitted.
其中,所述在传输待传输的视频数据时,获取当前的网络类型之前,所述方法还包括:The method further includes: before the acquiring the current network type, when the video data to be transmitted is transmitted, the method further includes:
从预先存储的视频文件集中,获取待传输的视频数据;或,Obtaining video data to be transmitted from a pre-stored video file set; or
获取拍摄的视频数据,将拍摄的所述视频数据作为待传输的视频数据。The captured video data is acquired, and the captured video data is taken as video data to be transmitted.
其中,所述判断获取的当前网络类型是否是收费型网络包括:The determining whether the current network type obtained by the network is a charging type network includes:
判断获取的当前网络类型是否是按流量收费的网络,若是按流量收费的网络,则当前 的网络类型是收费型网络;Determine whether the current network type obtained is a network that charges by traffic, and if it is a network that charges by traffic, the current The type of network is a fee-based network;
判断获取的当前网络类型是否是无线保真网络,若是无线保真网络,则当前的网络类型不是收费型网络。Determine whether the current network type obtained is a wireless fidelity network. If it is a wireless fidelity network, the current network type is not a charging network.
其中,所述对所述视频数据执行降低视频分辨率的操作包括:The performing the reducing video resolution on the video data includes:
获取所述视频数据中的各帧图像数据;Obtaining each frame image data in the video data;
基于分数形式的插值算法对获取的所述各帧图像数据执行列压缩或行压缩操作,得到各帧图像数据对应的一次压缩图像数据;Performing a column compression or a row compression operation on the acquired image data of each frame according to an interpolation algorithm in a fractional form to obtain primary compressed image data corresponding to image data of each frame;
基于分数形式的插值算法对各帧图像数据对应的一次压缩图像数据执行行压缩或列压缩操作,得到各帧一次压缩图像对应的二次压缩图像数据;The interpolation algorithm based on the fractional form performs row compression or column compression operation on the primary compressed image data corresponding to each frame image data, and obtains secondary compressed image data corresponding to the primary compressed image of each frame;
将各帧一次压缩图像对应的二次压缩图像数据构成压缩后的视频数据。The secondary compressed image data corresponding to the primary compressed image of each frame constitutes the compressed video data.
一种传输视频的装置,包括:A device for transmitting video, comprising:
网络获取模块,用于在传输待传输的视频数据时,获取当前的网络类型;a network acquisition module, configured to acquire a current network type when transmitting video data to be transmitted;
网络判断模块,用于判断获取的当前网络类型是否是收费型网络;a network judging module, configured to determine whether the acquired current network type is a charging type network;
视频压缩模块,用于若是收费型网络,则对所述视频数据执行降低视频分辨率的操作;a video compression module, configured to perform a operation of reducing video resolution on the video data if it is a charging type network;
视频传输模块,用于将降低视频分辨率后的视频数据传输出去。A video transmission module for transmitting video data after reducing the video resolution.
其中,所述装置还包括:视频获取模块;所述视频获取模块包括:The device further includes: a video acquisition module; the video acquisition module includes:
第一获取单元,用于从预先存储的视频文件集中,获取待传输的视频数据;或,a first acquiring unit, configured to acquire video data to be transmitted from a pre-stored video file set; or
第二获取单元,用于获取拍摄的视频数据,将拍摄的所述视频数据作为待传输的视频数据。And a second acquiring unit, configured to acquire the captured video data, and use the captured video data as the video data to be transmitted.
其中,所述网络判断模块包括:The network judgment module includes:
第一判断单元,用于判断获取的当前网络类型是否是按流量收费的网络,若是按流量收费的网络,则当前的网络类型是收费型网络;The first determining unit is configured to determine whether the acquired current network type is a network that charges by traffic, and if the network is charged by traffic, the current network type is a charging network;
第二判断单元,用于判断获取的当前网络类型是否是无线保真网络,若是无线保真网络,则当前的网络类型不是收费型网络。The second determining unit is configured to determine whether the acquired current network type is a wireless fidelity network, and if it is a wireless fidelity network, the current network type is not a charging type network.
其中,所述视频压缩模块包括:The video compression module includes:
图像获取单元,用于获取所述视频数据中的各帧图像数据;An image obtaining unit, configured to acquire image data of each frame in the video data;
第一压缩单元,用于基于分数形式的插值算法对获取的所述各帧图像数据执行列压缩或行压缩操作,得到各帧图像数据对应的一次压缩图像数据;a first compression unit, configured to perform a column compression or a row compression operation on the acquired image data of each frame based on an interpolation algorithm in a fractional form to obtain primary compressed image data corresponding to each frame image data;
第二压缩单元,用于基于分数形式的插值算法对各帧图像数据对应的一次压缩图像数 据执行行压缩或列压缩操作,得到各帧一次压缩图像对应的二次压缩图像数据;a second compression unit, configured to calculate a number of compressed images corresponding to each frame image data based on an interpolation algorithm in a fractional form Performing a row compression or a column compression operation to obtain secondary compressed image data corresponding to one compressed image of each frame;
视频构成单元,用于将各帧一次压缩图像对应的二次压缩图像数据构成压缩后的视频数据。The video framing unit is configured to compose the compressed video data by the secondary compressed image data corresponding to the one-time compressed image of each frame.
一种电子设备,包括:壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为上述电子设备的各个电路或器件供电;存储器用于存储可执行程序代码;处理器通过读取存储器中存储的可进行程序代码来运行与可执行程序代码对应的程序,用于执行前述传输视频的方法。An electronic device comprising: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed inside a space enclosed by the housing, the processor and the memory are disposed on the circuit board; and the power circuit is configured to Providing power to each circuit or device of the electronic device; the memory is configured to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, and is configured to execute the foregoing transmission video Methods.
本申请实施例提供的一种传输视频的方法、装置及电子设备,在传输待传输的视频数据时,获取当前的网络类型,若当前的网络类型是收费型网络,则对待传输的所述视频数据执行降低视频分辨率的操作以降低所述视频数据的分辨率,再将降低视频分辨率后的视频数据传输出去,从而能够降低收费型网络下视频数据传输消耗的流量、费用及传输时间。The method, the device, and the electronic device for transmitting video provided by the embodiment of the present application acquire the current network type when transmitting the video data to be transmitted, and if the current network type is a charging network, the video to be transmitted The data performs an operation of reducing the video resolution to reduce the resolution of the video data, and then the video data after reducing the video resolution is transmitted, thereby reducing the traffic, cost, and transmission time consumed by the video data transmission under the charging type network.
一种存储介质,所述存储介质存储有一个或者多个程序,当所述一个或者多个程序被一个设备执行时,使得所述设备执行以下步骤:A storage medium storing one or more programs, when the one or more programs are executed by a device, causing the device to perform the following steps:
在传输待传输的视频数据时,获取当前的网络类型;Obtain the current network type when transmitting the video data to be transmitted;
判断获取的当前网络类型是否是收费型网络;Determining whether the current network type obtained is a charging network;
若是收费型网络,则对所述视频数据执行降低视频分辨率的操作;If it is a charging type network, performing an operation of reducing video resolution on the video data;
将降低视频分辨率后的视频数据传输出去。The video data after reducing the video resolution is transmitted.
一种应用程序,其中,所述应用程序用于在运行时执行以下步骤:An application, wherein the application is configured to perform the following steps at runtime:
在传输待传输的视频数据时,获取当前的网络类型;Obtain the current network type when transmitting the video data to be transmitted;
判断获取的当前网络类型是否是收费型网络;Determining whether the current network type obtained is a charging network;
若是收费型网络,则对所述视频数据执行降低视频分辨率的操作;If it is a charging type network, performing an operation of reducing video resolution on the video data;
将降低视频分辨率后的视频数据传输出去。The video data after reducing the video resolution is transmitted.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present application, and other drawings can be obtained according to the drawings without any creative work for those skilled in the art.
图1为本申请实施例传输视频的方法流程示意图;1 is a schematic flowchart of a method for transmitting video according to an embodiment of the present application;
图2为本申请实施例传输视频的装置结构示意图; 2 is a schematic structural diagram of an apparatus for transmitting video according to an embodiment of the present application;
图3为本申请电子设备一个实施例的结构示意图。FIG. 3 is a schematic structural diagram of an embodiment of an electronic device according to the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
图1为本申请实施例传输视频的方法流程示意图,如图1所示,本实施例的方法可以包括:FIG. 1 is a schematic flowchart of a method for transmitting a video according to an embodiment of the present disclosure. As shown in FIG. 1 , the method in this embodiment may include:
步骤101、在传输待传输的视频数据时,获取当前的网络类型。Step 101: Acquire a current network type when transmitting video data to be transmitted.
本实施例中,在传输待传输的视频数据时,需先检测终端设备当前的网络环境,即终端设备当前的网络类型,接着执行步骤102判断当前的网络类型是否是收费型网络。In this embodiment, when the video data to be transmitted is transmitted, the current network environment of the terminal device, that is, the current network type of the terminal device, is detected. Then, step 102 is performed to determine whether the current network type is a charging network.
本实施例中,所述传输待传输的视频数据是指通过即时通信软件进行传输,假设在第一设备、第二设备上分别安装同一即时通信软件,例如,微信,当然,所述即时通信软件也可以是QQ、易信、飞信、陌陌或旺信等其他即时通信软件,本实施例不作限定。In this embodiment, the transmitting the video data to be transmitted refers to transmitting by using instant communication software, and assuming that the same instant messaging software is installed on the first device and the second device respectively, for example, WeChat, of course, the instant messaging software It can also be other instant messaging software such as QQ, Yixin, Fetion, Momo or Wangxin, which is not limited in this embodiment.
本实施例中,第一设备的用户A可以通过微信将第一设备上已存储的一个或多个视频文件发送给第二设备的用户B;用户A还可以通过微信与用户B进行视频聊天。具体的,当用户A通过微信将第一设备上已存储的一个或多个视频文件发送给用户B时,安装在所述第一设备上的微信可以从所述第一设备上预先存储的视频文件集中,获取1个或多个视频文件作为待传输的视频数据;当用户A通过微信与用户B进行视频聊天时,安装在所述第一设备及第二设备上的微信可以获取实时拍摄的视频作为待传输的视频数据。In this embodiment, the user A of the first device may send one or more video files stored on the first device to the user B of the second device by using WeChat; the user A may also perform video chat with the user B through WeChat. Specifically, when the user A sends the one or more video files stored on the first device to the user B through the WeChat, the WeChat installed on the first device may be pre-stored from the first device. In the file set, one or more video files are obtained as video data to be transmitted; when user A performs video chat with user B through WeChat, the WeChat installed on the first device and the second device can obtain real-time shooting. The video is the video data to be transmitted.
本实施例中,作为一个可选实施例,在传输待传输的视频数据时,获取当前的网络类型之前,所述方法还包括:In this embodiment, as an optional embodiment, before the current network type is obtained, when the video data to be transmitted is transmitted, the method further includes:
从预先存储的视频文件集中,获取待传输的视频数据;或,Obtaining video data to be transmitted from a pre-stored video file set; or
获取拍摄的视频数据,将拍摄的所述视频数据作为待传输的视频数据。The captured video data is acquired, and the captured video data is taken as video data to be transmitted.
步骤102、判断获取的当前网络类型是否是收费型网络。Step 102: Determine whether the acquired current network type is a charging type network.
本实施例中,可以查询预设的收费型网络表,若获取的当前网络类型有包含在所述预设的收费型网络表中,则可以判断获取的当前网络类型是收费型网络,否则,可以判断当 前网络类型为免费型网络;其中,所述预设的收费型网络表中的收费型网络可以包括但不限于:2G网络、3G网络、4G网络,其中,2G网络包括但不限于:全球移动通信系统网络;3G网络包括但不限于:通用分组无线服务网络、通用移动通信系统网络、长期演进网络、码分多址网络、宽带码分多址网络以及时分同步码分多址网络;4G网络包括但不限于:分时长期演进网络以及长期演进频分双工网络。In this embodiment, the preset charging type network table may be queried. If the current network type obtained is included in the preset charging type network table, the current network type obtained may be determined to be a charging type network; otherwise, Can judge when The pre-network type is a free-type network; wherein the charging network in the preset charging type network table may include, but is not limited to, a 2G network, a 3G network, and a 4G network, where the 2G network includes but is not limited to: global mobile Communication system network; 3G network includes, but is not limited to, general packet radio service network, universal mobile communication system network, long term evolution network, code division multiple access network, wideband code division multiple access network, and time division synchronous code division multiple access network; 4G network Including but not limited to: time-sharing long-term evolution network and long-term evolution frequency division duplex network.
本实施例中,2G网络、3G网络或4G网络的计费标准可以包括但不限于:按时间计费或按流量计费。In this embodiment, the charging standard of the 2G network, the 3G network, or the 4G network may include, but is not limited to, charging by time or by flow metering.
本实施例中,作为一个可选实施例,所述判断获取的当前网络类型是否是收费型网络包括:In this embodiment, as an optional embodiment, determining whether the current network type obtained by the charging network is:
判断获取的当前网络类型是否是按流量收费的网络,若是按流量收费的网络,则当前的网络类型是收费型网络;Determining whether the current network type obtained is a network that charges by traffic; if the network is charged by traffic, the current network type is a charging network;
判断获取的当前网络类型是否是无线保真网络,若是无线保真网络,则当前的网络类型不是收费型网络。Determine whether the current network type obtained is a wireless fidelity network. If it is a wireless fidelity network, the current network type is not a charging network.
本实施例中,若获取的当前网络类型是按流量收费的网络,则执行步骤103;若获取的当前网络类型是无线保真(Wireless Fidelity,WIFI)网络时,则当前的网络类型是免费型网络,可以不执行步骤103,直接将所述视频数据发送出去。In this embodiment, if the current network type obtained is a traffic-based network, step 103 is performed; if the current network type obtained is a Wireless Fidelity (WIFI) network, the current network type is free. The network may directly send the video data without performing step 103.
本实施例中,所述免费型网络可以包括但不限于:WIFI网络,例如,通过网线连接的有线网络也是免费型网络。In this embodiment, the free-type network may include, but is not limited to, a WIFI network. For example, a wired network connected through a network cable is also a free-type network.
本实施例中,假设第一设备为智能手机,则可以获取该智能手机的当前网络类型,若获取的当前网络类型是WIFI网络,则判断当前网络类型为免费型网络,可以不执行降低视频分辨率的操作。In this embodiment, if the first device is a smart phone, the current network type of the smart phone may be obtained. If the current network type is a WIFI network, the current network type is determined to be a free network, and the video resolution may not be reduced. Rate of operation.
步骤103、若是收费型网络,则对所述视频数据执行降低视频分辨率的操作。Step 103: If it is a charging type network, perform an operation of reducing video resolution on the video data.
本实施例中,为了减小流量消耗,当第一设备的当前网络类型为收费型网络时,需对待传输的视频执行降低视频分辨率的操作。In this embodiment, in order to reduce the traffic consumption, when the current network type of the first device is a charging type network, the operation of reducing the video resolution is performed on the video to be transmitted.
本实施例中,可以通过即时通信软件,例如,微信对获取的所述视频数据执行降低视频分辨率的操作,从而降低待传输视频数据的大小。In this embodiment, the operation of reducing the video resolution may be performed on the acquired video data by the instant messaging software, for example, WeChat, thereby reducing the size of the video data to be transmitted.
本实施例中,例如,待传输的视频数据的大小为100MB,分辨率为1080*1902;通过 微信对获取的所述视频数据执行降低视频分辨率的操作后,所述待传输的视频数据的分辨率从1080*1920降至720*1080的同时,所述待传输的视频数据的大小从100MB降至60MB,也就是说,可以节省40MB的流量与相应的费用。In this embodiment, for example, the size of the video data to be transmitted is 100 MB, and the resolution is 1080*1902; After the operation of reducing the video resolution is performed on the acquired video data, the resolution of the video data to be transmitted is reduced from 1080*1920 to 720*1080, and the size of the video data to be transmitted is from 100 MB. Down to 60MB, which means you can save 40MB of traffic and the corresponding cost.
本实施例中,不对降低视频分辨率的方法进行限制,也就是说,即时通信软件可以采用任一现有的降低视频分辨率的方法对所述视频数据执行降低视频分辨率的操作。仅作为降低视频分辨率的一可选实施例,所述对获取的所述视频数据执行降低视频分辨率的操作可以包括:In this embodiment, the method of reducing the video resolution is not limited, that is, the instant messaging software can perform the operation of reducing the video resolution on the video data by any existing method of reducing the video resolution. As an optional embodiment of reducing the video resolution, the performing the operation of reducing the video resolution on the acquired video data may include:
获取所述视频数据中的各帧图像数据;Obtaining each frame image data in the video data;
基于分数形式的插值算法对获取的所述各帧图像数据执行列压缩或行压缩操作,得到各帧图像数据对应的一次压缩图像数据;Performing a column compression or a row compression operation on the acquired image data of each frame according to an interpolation algorithm in a fractional form to obtain primary compressed image data corresponding to image data of each frame;
基于分数形式的插值算法对各帧图像数据对应的一次压缩图像数据执行行压缩或列压缩操作,得到各帧一次压缩图像对应的二次压缩图像数据;The interpolation algorithm based on the fractional form performs row compression or column compression operation on the primary compressed image data corresponding to each frame image data, and obtains secondary compressed image data corresponding to the primary compressed image of each frame;
将各帧一次压缩图像对应的二次压缩图像数据构成压缩后的视频数据。The secondary compressed image data corresponding to the primary compressed image of each frame constitutes the compressed video data.
本实施例中,可以通过微信获取待传输视频数据中的各帧图像数据,并基于分数形式的插值算法对获取的所述各帧图像数据执行列压缩操作,得到各帧图像数据对应的一次压缩图像数据;再基于分数形式的插值算法对各帧图像数据对应的一次压缩图像数据执行行压缩操作,得到各帧一次压缩图像对应的二次压缩图像数据;最后,将各帧一次压缩图像对应的二次压缩图像数据构成压缩后的视频数据。假设,待传输的视频数据的分辨率为n×m,则一次压缩图像数据的分辨率可以表示为n×q,二次压缩图像数据的分辨率可以表示为w×q,其中,q满足:q<m,w满足:w<n。In this embodiment, the image data of each frame in the video data to be transmitted may be obtained by using WeChat, and the column compression operation is performed on the acquired image data of each frame based on an interpolation algorithm in a fractional form to obtain a compression corresponding to each frame image data. Image data; performing a row compression operation on the first compressed image data corresponding to each frame image data by an interpolation algorithm based on the fractional form, and obtaining secondary compressed image data corresponding to the primary compressed image of each frame; and finally, correspondingly compressing the image once for each frame The secondary compressed image data constitutes compressed video data. Assuming that the resolution of the video data to be transmitted is n×m, the resolution of the primary compressed image data can be expressed as n×q, and the resolution of the secondary compressed image data can be expressed as w×q, where q satisfies: q < m, w satisfies: w < n.
本实施例中,可以通过微信获取待传输视频数据中的各帧图像数据,并先基于分数形式的插值算法对获取的所述各帧图像数据执行行压缩操作,得到各帧图像数据对应的一次压缩图像数据;再基于分数形式的插值算法对各帧图像数据对应的一次压缩图像数据执行列压缩操作,得到各帧一次压缩图像对应的二次压缩图像数据;最后,将各帧一次压缩图像对应的二次压缩图像数据构成压缩后的视频数据。假设,待传输的视频数据的分辨率为n×m,则一次压缩图像数据的分辨率可以表示为w×m,二次压缩图像数据的分辨率可以表示为w×q,其中,w满足:w<n,q满足:q<m。 In this embodiment, the image data of each frame in the video data to be transmitted may be obtained by using a micro-letter, and performing a row compression operation on the acquired image data of each frame based on an interpolation algorithm in a fractional form to obtain a corresponding image data of each frame. Compressing the image data; performing a column compression operation on the primary compressed image data corresponding to each frame image data based on the interpolation algorithm in the fractional form to obtain secondary compressed image data corresponding to the primary compressed image of each frame; and finally, correspondingly compressing the image once for each frame The secondary compressed image data constitutes compressed video data. Assuming that the resolution of the video data to be transmitted is n×m, the resolution of the primary compressed image data can be expressed as w×m, and the resolution of the secondary compressed image data can be expressed as w×q, where w satisfies: w<n,q satisfies:q<m.
步骤104、将降低视频分辨率后的视频数据传输出去。Step 104: The video data after the video resolution is reduced is transmitted.
本实施例中,对获取的100MB的视频数据执行降低视频分辨率的操作后,所述待传输的视频数据的大小降至60MB,与发送降低视频分辨率前的所述待传输的视频数据相比,发送降低视频分辨率后的视频数据,不仅可以节省40MB的流量与相应的费用,还能降低视频数据的传输时间。In this embodiment, after performing the operation of reducing the video resolution on the acquired video data of 100 MB, the size of the video data to be transmitted is reduced to 60 MB, and the video data to be transmitted before transmitting the reduced video resolution is Compared, sending video data with reduced video resolution can save 40MB of traffic and corresponding cost, and reduce the transmission time of video data.
本实施例提供的传输视频的方法,在传输待传输的视频数据时,获取当前的网络类型,若当前的网络类型是收费型网络,则对待传输的所述视频数据执行降低视频分辨率的操作以降低所述视频数据的分辨率,再将降低视频分辨率后的视频数据传输出去,从而能够降低收费型网络下视频数据传输消耗的流量、费用及传输时间。The method for transmitting video provided in this embodiment obtains the current network type when transmitting the video data to be transmitted, and if the current network type is a charging type network, performing the operation of reducing the video resolution on the video data to be transmitted. In order to reduce the resolution of the video data, the video data after reducing the video resolution is transmitted, thereby reducing the traffic, cost and transmission time consumed by the video data transmission under the charging type network.
图2为本申请实施例传输视频的装置结构示意图,如图2所示,本实施例的装置可以包括:网络获取模块11、网络判断模块12、视频压缩模块13和视频传输模块14,其中,2 is a schematic structural diagram of an apparatus for transmitting video according to an embodiment of the present disclosure. As shown in FIG. 2, the apparatus of this embodiment may include: a network obtaining module 11, a network determining module 12, a video compressing module 13, and a video transmitting module 14, wherein
所述网络获取模块11,用于在传输待传输的视频数据时,获取当前的网络类型。The network obtaining module 11 is configured to acquire a current network type when transmitting video data to be transmitted.
本实施例中,在传输待传输的视频数据时,需先检测终端设备当前的网络环境,即终端设备当前的网络类型,接着通过网络判断模块12判断当前的网络类型是否是收费型网络。In this embodiment, when the video data to be transmitted is transmitted, the current network environment of the terminal device, that is, the current network type of the terminal device, needs to be detected first, and then the network determining module 12 determines whether the current network type is a charging network.
本实施例中,所述传输待传输的视频数据是指通过即时通信软件进行传输,假设在第一设备、第二设备上分别安装同一即时通信软件,例如,微信,当然,所述即时通信软件也可以是QQ、易信、飞信、陌陌或旺信等其他即时通信软件,本实施例不作限定。In this embodiment, the transmitting the video data to be transmitted refers to transmitting by using instant communication software, and assuming that the same instant messaging software is installed on the first device and the second device respectively, for example, WeChat, of course, the instant messaging software It can also be other instant messaging software such as QQ, Yixin, Fetion, Momo or Wangxin, which is not limited in this embodiment.
本实施例中,第一设备的用户A可以通过微信将第一设备上已存储的一个或多个视频文件发送给第二设备的用户B;用户A还可以通过微信与用户B进行视频聊天。具体的,当用户A通过微信将第一设备上已存储的一个或多个视频文件发送给用户B时,安装在所述第一设备上的微信可以从所述第一设备上预先存储的视频文件集中,获取1个或多个视频文件作为待传输的视频数据;当用户A通过微信与用户B进行视频聊天时,安装在所述第一设备及第二设备上的微信可以获取实时拍摄的视频作为待传输的视频数据。In this embodiment, the user A of the first device may send one or more video files stored on the first device to the user B of the second device by using WeChat; the user A may also perform video chat with the user B through WeChat. Specifically, when the user A sends the one or more video files stored on the first device to the user B through the WeChat, the WeChat installed on the first device may be pre-stored from the first device. In the file set, one or more video files are obtained as video data to be transmitted; when user A performs video chat with user B through WeChat, the WeChat installed on the first device and the second device can obtain real-time shooting. The video is the video data to be transmitted.
本实施例中,作为一可选实施例,所述装置还包括:视频获取模块,所述视频获取模块包括:In this embodiment, as an optional embodiment, the device further includes: a video acquiring module, where the video acquiring module includes:
第一获取单元,用于从预先存储的视频文件集中,获取待传输的视频数据;或, a first acquiring unit, configured to acquire video data to be transmitted from a pre-stored video file set; or
第二获取单元,用于获取拍摄的视频数据,将拍摄的所述视频数据作为待传输的视频数据。And a second acquiring unit, configured to acquire the captured video data, and use the captured video data as the video data to be transmitted.
所述网络判断模块12,用于判断获取的当前网络类型是否是收费型网络。The network determining module 12 is configured to determine whether the acquired current network type is a charging type network.
本实施例中,可以查询预设的收费型网络表,若获取的当前网络类型有包含在所述预设的收费型网络表中,则可以判断获取的当前网络类型是收费型网络,否则,可以判断当前网络类型为免费型网络;其中,所述预设的收费型网络表中的收费型网络可以包括但不限于:2G网络、3G网络、4G网络,其中,2G网络包括但不限于:全球移动通信系统网络;3G网络包括但不限于:通用分组无线服务网络、通用移动通信系统网络、长期演进网络、码分多址网络、宽带码分多址网络以及时分同步码分多址网络;4G网络包括但不限于:分时长期演进网络以及长期演进频分双工网络。In this embodiment, the preset charging type network table may be queried. If the current network type obtained is included in the preset charging type network table, the current network type obtained may be determined to be a charging type network; otherwise, The current network type may be a free-type network. The charging network in the preset charging type network table may include, but is not limited to, a 2G network, a 3G network, and a 4G network, where the 2G network includes but is not limited to: Global mobile communication system network; 3G networks include, but are not limited to, general packet radio service networks, universal mobile communication system networks, long term evolution networks, code division multiple access networks, wideband code division multiple access networks, and time division synchronous code division multiple access networks; 4G networks include, but are not limited to, time-sharing long-term evolution networks and long-term evolution frequency division duplex networks.
本实施例中,2G网络、3G网络或4G网络的计费标准可以包括但不限于:按时间计费或按流量计费。In this embodiment, the charging standard of the 2G network, the 3G network, or the 4G network may include, but is not limited to, charging by time or by flow metering.
本实施例中,作为一个可选实施例,所述网络判断模块12包括:In this embodiment, as an optional embodiment, the network determining module 12 includes:
第一判断单元,用于判断获取的当前网络类型是否是按流量收费的网络,若是按流量收费的网络,则当前的网络类型是收费型网络;The first determining unit is configured to determine whether the acquired current network type is a network that charges by traffic, and if the network is charged by traffic, the current network type is a charging network;
第二判断单元,用于判断获取的当前网络类型是否是无线保真网络,若是无线保真网络,则当前的网络类型不是收费型网络。The second determining unit is configured to determine whether the acquired current network type is a wireless fidelity network, and if it is a wireless fidelity network, the current network type is not a charging type network.
本实施例中,若获取的当前网络类型是按流量收费的网络,则执行步骤103;若获取的当前网络类型是无线保真WIFI网络时,则当前的网络类型是免费型网络,可以直接将所述视频数据发送出去。In this embodiment, if the current network type obtained is a traffic-based network, step 103 is performed; if the current network type obtained is a wireless fidelity WIFI network, the current network type is a free network, which can be directly The video data is sent out.
本实施例中,所述免费型网络可以包括但不限于:WIFI网络,例如,通过网线连接的有线网络也是免费型网络。In this embodiment, the free-type network may include, but is not limited to, a WIFI network. For example, a wired network connected through a network cable is also a free-type network.
本实施例中,假设第一设备为智能手机,则可以获取该智能手机的当前网络类型,若获取的当前网络类型是WIFI网络,则判断当前网络类型为免费型网络,可以不执行降低视频分辨率的操作。In this embodiment, if the first device is a smart phone, the current network type of the smart phone may be obtained. If the current network type is a WIFI network, the current network type is determined to be a free network, and the video resolution may not be reduced. Rate of operation.
所述视频压缩模块13,用于若是收费型网络,则对所述视频数据执行降低视频分辨率的操作。 The video compression module 13 is configured to perform an operation of reducing video resolution on the video data if it is a charging type network.
本实施例中,为了减小流量消耗,当第一设备的当前网络类型为收费型网络时,需对待传输的视频执行降低视频分辨率的操作。In this embodiment, in order to reduce the traffic consumption, when the current network type of the first device is a charging type network, the operation of reducing the video resolution is performed on the video to be transmitted.
本实施例中,可以通过即时通信软件,例如,微信对获取的所述视频数据执行降低视频分辨率的操作,从而降低待传输视频数据的大小。In this embodiment, the operation of reducing the video resolution may be performed on the acquired video data by the instant messaging software, for example, WeChat, thereby reducing the size of the video data to be transmitted.
本实施例中,例如,待传输的视频数据的大小为100MB,分辨率为1080*1902;通过微信对获取的所述视频数据执行降低视频分辨率的操作后,所述待传输的视频数据的分辨率从1080*1920降至720*1080的同时,所述待传输的视频数据的大小从100MB降至60MB,也就是说,可以节省40MB的流量与相应的费用。In this embodiment, for example, the size of the video data to be transmitted is 100 MB, and the resolution is 1080*1902; after performing the operation of reducing the video resolution by using the video data obtained by the WeChat, the video data to be transmitted is While the resolution is reduced from 1080*1920 to 720*1080, the size of the video data to be transmitted is reduced from 100MB to 60MB, which means that 40MB of traffic and corresponding cost can be saved.
本实施例中,不对降低视频分辨率的方法进行限制,也就是说,即时通信软件可以采用任一现有的降低视频分辨率的方法对获取的所述视频数据执行降低视频分辨率的操作。In this embodiment, the method for reducing the video resolution is not limited, that is, the instant messaging software can perform the operation of reducing the video resolution on the acquired video data by using any existing method for reducing the video resolution.
本实施例中,不对降低视频分辨率的方法进行限制,仅作为降低视频分辨率的一可选实施例,所述视频压缩模块可以包括:In this embodiment, the method for reducing the video resolution is not limited, and is only an optional embodiment for reducing the video resolution. The video compression module may include:
图像获取单元,用于获取所述视频数据中的各帧图像数据;An image obtaining unit, configured to acquire image data of each frame in the video data;
第一压缩单元,用于基于分数形式的插值算法对获取的所述各帧图像数据执行列压缩或行压缩操作,得到各帧图像数据对应的一次压缩图像数据;a first compression unit, configured to perform a column compression or a row compression operation on the acquired image data of each frame based on an interpolation algorithm in a fractional form to obtain primary compressed image data corresponding to each frame image data;
第二压缩单元,用于基于分数形式的插值算法对各帧图像数据对应的一次压缩图像数据执行行压缩或列压缩操作,得到各帧一次压缩图像对应的二次压缩图像数据;a second compression unit, configured to perform a row compression or a column compression operation on the primary compressed image data corresponding to each frame image data based on the interpolation algorithm in a fractional form, to obtain secondary compressed image data corresponding to the primary compressed image of each frame;
视频构成单元,用于将各帧一次压缩图像对应的二次压缩图像数据构成压缩后的视频数据。The video framing unit is configured to compose the compressed video data by the secondary compressed image data corresponding to the one-time compressed image of each frame.
本实施例中,可以通过微信获取待传输视频数据中的各帧图像数据,并基于分数形式的插值算法对获取的所述各帧图像数据执行列压缩操作,得到各帧图像数据对应的一次压缩图像数据;再基于分数形式的插值算法对各帧图像数据对应的一次压缩图像数据执行行压缩操作,得到各帧一次压缩图像对应的二次压缩图像数据;最后,将各帧一次压缩图像对应的二次压缩图像数据构成压缩后的视频数据。假设,待传输的视频数据的分辨率为n×m,则一次压缩图像数据的分辨率可以表示为n×q,二次压缩图像数据的分辨率可以表示为w×q,其中,q满足:q<m,w满足:w<n。In this embodiment, the image data of each frame in the video data to be transmitted may be obtained by using WeChat, and the column compression operation is performed on the acquired image data of each frame based on an interpolation algorithm in a fractional form to obtain a compression corresponding to each frame image data. Image data; performing a row compression operation on the first compressed image data corresponding to each frame image data by an interpolation algorithm based on the fractional form, and obtaining secondary compressed image data corresponding to the primary compressed image of each frame; and finally, correspondingly compressing the image once for each frame The secondary compressed image data constitutes compressed video data. Assuming that the resolution of the video data to be transmitted is n×m, the resolution of the primary compressed image data can be expressed as n×q, and the resolution of the secondary compressed image data can be expressed as w×q, where q satisfies: q < m, w satisfies: w < n.
本实施例中,可以通过微信获取待传输视频数据中的各帧图像数据,并先基于分数形 式的插值算法对获取的所述各帧图像数据执行行压缩操作,得到各帧图像数据对应的一次压缩图像数据;再基于分数形式的插值算法对各帧图像数据对应的一次压缩图像数据执行列压缩操作,得到各帧一次压缩图像对应的二次压缩图像数据;最后,将各帧一次压缩图像对应的二次压缩图像数据构成压缩后的视频数据。假设,待传输的视频数据的分辨率为n×m,则一次压缩图像数据的分辨率可以表示为w×m,二次压缩图像数据的分辨率可以表示为w×q,其中,w满足:w<n,q满足:q<m。In this embodiment, the image data of each frame in the video data to be transmitted can be obtained through WeChat, and is based on the fractal shape first. The interpolation algorithm performs a row compression operation on the acquired image data of each frame to obtain primary compressed image data corresponding to each frame image data; and then performs a column on the primary compressed image data corresponding to each frame image data based on the interpolation algorithm in fractional form. The compression operation obtains the second compressed image data corresponding to the primary compressed image of each frame; finally, the secondary compressed image data corresponding to the primary compressed image of each frame constitutes the compressed video data. Assuming that the resolution of the video data to be transmitted is n×m, the resolution of the primary compressed image data can be expressed as w×m, and the resolution of the secondary compressed image data can be expressed as w×q, where w satisfies: w<n,q satisfies:q<m.
所述视频传输模块14,用于将降低视频分辨率后的视频数据传输出去。The video transmission module 14 is configured to transmit video data after the video resolution is reduced.
本实施例中,对获取的100MB的视频数据执行降低视频分辨率的操作后,所述待传输的视频数据的大小降至60MB,与发送降低视频分辨率前的所述待传输的视频数据相比,发送降低视频分辨率后的视频数据,不仅可以节省40MB的流量与相应的费用,还能降低视频数据的传输时间。In this embodiment, after performing the operation of reducing the video resolution on the acquired video data of 100 MB, the size of the video data to be transmitted is reduced to 60 MB, and the video data to be transmitted before transmitting the reduced video resolution is Compared, sending video data with reduced video resolution can save 40MB of traffic and corresponding cost, and reduce the transmission time of video data.
本实施例提供的传输视频的装置,通过网络获取模块在传输待传输的视频数据时,获取当前的网络类型,若当前的网络类型是收费型网络,则通过视频压缩模块降低待传输视频数据的分辨率,再通过视频传输模块将降低视频分辨率后的视频数据传输出去,从而能够降低收费型网络下视频数据传输消耗的流量、费用及传输时间。The device for transmitting video provided by the embodiment obtains the current network type when the network acquisition module transmits the video data to be transmitted. If the current network type is a charging network, the video data to be transmitted is reduced by the video compression module. The resolution, and then the video data after the video resolution is reduced by the video transmission module, can reduce the traffic, cost and transmission time consumed by the video data transmission under the charging network.
本申请实施例还提供一种电子设备。图3为本申请电子设备一个实施例的结构示意图,可以实现本申请图1-2所示实施例的流程,如图3所示,上述电子设备可以包括:壳体41、处理器42、存储器43、电路板44和电源电路45,其中,电路板44安置在壳体41围成的空间内部,处理器42和存储器43设置在电路板44上;电源电路45,用于为上述电子设备的各个电路或器件供电;存储器43用于存储可进行程序代码;处理器42通过读取存储器43中存储的可进行程序代码来运行与可进行程序代码对应的程序,用于进行前述任一实施例所述的传输视频的方法。An embodiment of the present application further provides an electronic device. 3 is a schematic structural diagram of an embodiment of an electronic device according to the present application, which can implement the process of the embodiment shown in FIG. 1-2 of the present application. As shown in FIG. 3, the electronic device may include: a housing 41, a processor 42, and a memory. 43. The circuit board 44 and the power supply circuit 45, wherein the circuit board 44 is disposed inside the space surrounded by the housing 41, the processor 42 and the memory 43 are disposed on the circuit board 44, and the power supply circuit 45 is used for the electronic device Each circuit or device is powered; the memory 43 is configured to store executable code; the processor 42 executes a program corresponding to the executable code by reading the executable program code stored in the memory 43 for performing any of the foregoing embodiments The method of transmitting video.
处理器42对上述步骤的具体进行过程以及处理器42通过运行可进行程序代码来进一步进行的步骤,可以参见本申请图1-2所示实施例的描述,在此不再赘述。For the specific process of the foregoing steps of the processor 42 and the steps of the processor 42 for further performing the program code, refer to the description of the embodiment shown in FIG. 1-2 of the present application, and details are not described herein again.
该电子设备以多种形式存在,包括但不限于:The electronic device exists in a variety of forms including, but not limited to:
(1)移动通信设备:这类设备的特点是具备移动通信功能,并且以提供话音、数据通信为主要目标。这类终端包括:智能手机(例如iPhone)、多媒体手机、功能性手机,以及低端手机等。 (1) Mobile communication devices: These devices are characterized by mobile communication functions and are mainly aimed at providing voice and data communication. Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
(2)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设备等,例如iPad。(2) Ultra-mobile personal computer equipment: This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has mobile Internet access. Such terminals include: PDAs, MIDs, and UMPC devices, such as the iPad.
(3)便携式娱乐设备:这类设备可以显示和播放多媒体内容。该类设备包括:音频、视频播放器(例如iPod),掌上游戏机,电子书,以及智能玩具和便携式车载导航设备。(3) Portable entertainment devices: These devices can display and play multimedia content. Such devices include: audio, video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
(4)服务器:提供计算服务的设备,服务器的构成包括处理器、硬盘、内存、系统总线等,服务器和通用的计算机架构类似,但是由于需要提供高可靠的服务,因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面要求较高。(4) Server: A device that provides computing services. The server consists of a processor, a hard disk, a memory, a system bus, etc. The server is similar to a general-purpose computer architecture, but because of the need to provide highly reliable services, processing power and stability High reliability in terms of reliability, security, scalability, and manageability.
(5)其他具有数据交互功能的电子设备。(5) Other electronic devices with data interaction functions.
为了实现上述实施例,本申请还提出一种存储介质。其中,该存储介质存储有一个或者多个程序,该一个或者多个程序被一个设备执行时,执行本申请实施例的视频传输的方法,其中,该方法包括:In order to implement the above embodiments, the present application also proposes a storage medium. The storage medium stores one or more programs, and when the one or more programs are executed by one device, the method for video transmission in the embodiment of the present application is performed, where the method includes:
在传输待传输的视频数据时,获取当前的网络类型;Obtain the current network type when transmitting the video data to be transmitted;
判断获取的当前网络类型是否是收费型网络;Determining whether the current network type obtained is a charging network;
若是收费型网络,则对所述视频数据执行降低视频分辨率的操作;If it is a charging type network, performing an operation of reducing video resolution on the video data;
将降低视频分辨率后的视频数据传输出去。The video data after reducing the video resolution is transmitted.
需要说明的是,本实施例的存储介质中存储的程序被设备执行时,执行传输视频的方法的原理和实现方式与上述实施例的传输视频的方法类似,为了避免冗余,此处不再赘述。It should be noted that, when the program stored in the storage medium of the embodiment is executed by the device, the principle and implementation manner of the method for transmitting video is similar to the method for transmitting video in the foregoing embodiment. Narration.
为了实现上述实施例,本申请还提出一种应用程序,其中,该应用程序用于在运行时执行本申请实施例的传输视频的方法,其中,该传输视频的方法包括:In order to implement the foregoing embodiments, the application further provides an application, where the application is used to perform the method for transmitting video in the embodiment of the present application, where the method for transmitting video includes:
在传输待传输的视频数据时,获取当前的网络类型;Obtain the current network type when transmitting the video data to be transmitted;
判断获取的当前网络类型是否是收费型网络;Determining whether the current network type obtained is a charging network;
若是收费型网络,则对所述视频数据执行降低视频分辨率的操作;If it is a charging type network, performing an operation of reducing video resolution on the video data;
将降低视频分辨率后的视频数据传输出去。The video data after reducing the video resolution is transmitted.
需要说明的是,本实施例的应用程序执行传输视频的方法的原理和实现方式与上述实施例的传输视频的方法类似,为了避免冗余,此处不再赘述。It should be noted that the principle and implementation manner of the method for transmitting video in the application of the embodiment is similar to the method for transmitting video in the foregoing embodiment. To avoid redundancy, details are not described herein again.
对于装置、电子设备、存储介质及应用程序实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。For the device, the electronic device, the storage medium and the application embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
可以理解,本申请实施例所述的方法中的步骤可以根据实际需要进行顺序调整、合并和删减。相应地,本申请实施例所述的装置中的单元也可以根据实际需要进行合并、划分 和删减。It can be understood that the steps in the method described in the embodiments of the present application may be sequentially adjusted, combined, and deleted according to actual needs. Correspondingly, the units in the apparatus in the embodiment of the present application may also be combined and divided according to actual needs. And cuts down.
以上所揭露的仅为本申请的较佳实施例而已,当然不能以此来限定本申请的权利范围,本领域普通技术人员可以理解实现上述实施例的全部或部分流程,并依本申请权利要求所作的等同变化,仍属于申请所涵盖的范围。The above disclosure is only the preferred embodiment of the present application, and of course, the scope of the application should not be limited thereto, and those skilled in the art can understand all or part of the process of implementing the above embodiments, and according to the claims of the present application. The equivalent changes made are still within the scope of the application.
应当理解,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that portions of the application can be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of the present specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means a specific feature described in connection with the embodiment or example. A structure, material or feature is included in at least one embodiment or example of the application. In the present specification, the schematic representation of the above terms is not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, various embodiments or examples described in the specification, as well as features of various embodiments or examples, may be combined and combined.
尽管上面已经示出和描述了本申请的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施例进行变化、修改、替换和变型。While the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are illustrative and are not to be construed as limiting the scope of the present application. The embodiments are subject to variations, modifications, substitutions and variations.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply such entities or operations. There is any such actual relationship or order between them. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
值得说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。 It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should understand that the present application is not limited by the described action sequence. Because certain steps may be performed in other sequences or concurrently in accordance with the present application. In the following, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments, the descriptions of the various embodiments are different, and the details that are not detailed in a certain embodiment can be referred to the related descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided herein, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the device embodiments described above are schematic, for example, the division of the unit is only a logical function division, and the actual implementation may have another division manner, for example, multiple units or components may be combined or may be integrated. Go to another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical or otherwise.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application, in essence or the contribution to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .
以上所述,以上实施例仅用以说明本申请技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,其中,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。The above embodiments are only used to explain the technical solutions of the present application, and are not limited thereto; although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still The technical solutions described in the foregoing embodiments are modified, or some of the technical features are equivalently substituted; and the modifications or substitutions do not deviate from the technical solutions of the embodiments of the present application.
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。 The above description is only the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application are included in the scope of the present application.

Claims (11)

  1. 一种传输视频的方法,其特征在于,包括:A method for transmitting video, comprising:
    在传输待传输的视频数据时,获取当前的网络类型;Obtain the current network type when transmitting the video data to be transmitted;
    判断获取的当前网络类型是否是收费型网络;Determining whether the current network type obtained is a charging network;
    若是收费型网络,则对所述视频数据执行降低视频分辨率的操作;If it is a charging type network, performing an operation of reducing video resolution on the video data;
    将降低视频分辨率后的视频数据传输出去。The video data after reducing the video resolution is transmitted.
  2. 根据权利要求1所述的传输视频的方法,其特征在于,在传输待传输的视频数据时,获取当前的网络类型之前,所述方法还包括:The method for transmitting video according to claim 1, wherein the method further comprises: before acquiring the current network type when transmitting the video data to be transmitted;
    从预先存储的视频文件集中,获取待传输的视频数据;或,Obtaining video data to be transmitted from a pre-stored video file set; or
    获取拍摄的视频数据,将拍摄的所述视频数据作为待传输的视频数据。The captured video data is acquired, and the captured video data is taken as video data to be transmitted.
  3. 根据权利要求1所述的传输视频的方法,其特征在于,所述判断获取的当前网络类型是否是收费型网络包括:The method for transmitting video according to claim 1, wherein the determining whether the acquired current network type is a charging type network comprises:
    判断获取的当前网络类型是否是按流量收费的网络,若是按流量收费的网络,则当前的网络类型是收费型网络;Determining whether the current network type obtained is a network that charges by traffic; if the network is charged by traffic, the current network type is a charging network;
    判断获取的当前网络类型是否是无线保真网络,若是无线保真网络,则当前的网络类型不是收费型网络。Determine whether the current network type obtained is a wireless fidelity network. If it is a wireless fidelity network, the current network type is not a charging network.
  4. 根据权利要求1所述的传输视频的方法,其特征在于,所述对所述视频数据执行降低视频分辨率的操作包括:The method of transmitting video according to claim 1, wherein the performing the operation of reducing video resolution on the video data comprises:
    获取所述视频数据中的各帧图像数据;Obtaining each frame image data in the video data;
    基于分数形式的插值算法对获取的所述各帧图像数据执行列压缩或行压缩操作,得到各帧图像数据对应的一次压缩图像数据;Performing a column compression or a row compression operation on the acquired image data of each frame according to an interpolation algorithm in a fractional form to obtain primary compressed image data corresponding to image data of each frame;
    基于分数形式的插值算法对各帧图像数据对应的一次压缩图像数据执行行压缩或列压缩操作,得到各帧一次压缩图像对应的二次压缩图像数据;The interpolation algorithm based on the fractional form performs row compression or column compression operation on the primary compressed image data corresponding to each frame image data, and obtains secondary compressed image data corresponding to the primary compressed image of each frame;
    将各帧一次压缩图像对应的二次压缩图像数据构成压缩后的视频数据。The secondary compressed image data corresponding to the primary compressed image of each frame constitutes the compressed video data.
  5. 一种传输视频的装置,其特征在于,包括:An apparatus for transmitting video, comprising:
    网络获取模块,用于在传输待传输的视频数据时,获取当前的网络类型;a network acquisition module, configured to acquire a current network type when transmitting video data to be transmitted;
    网络判断模块,用于判断获取的当前网络类型是否是收费型网络; a network judging module, configured to determine whether the acquired current network type is a charging type network;
    视频压缩模块,用于若是收费型网络,则对所述视频数据执行降低视频分辨率的操作;a video compression module, configured to perform a operation of reducing video resolution on the video data if it is a charging type network;
    视频传输模块,用于将降低视频分辨率后的视频数据传输出去。A video transmission module for transmitting video data after reducing the video resolution.
  6. 根据权利要求5所述的传输视频的装置,其特征在于,所述装置还包括:视频获取模块;所述视频获取模块包括:The device for transmitting video according to claim 5, wherein the device further comprises: a video acquisition module; the video acquisition module comprises:
    第一获取单元,用于从预先存储的视频文件集中,获取待传输的视频数据;或,a first acquiring unit, configured to acquire video data to be transmitted from a pre-stored video file set; or
    第二获取单元,用于获取拍摄的视频数据,将拍摄的所述视频数据作为待传输的视频数据。And a second acquiring unit, configured to acquire the captured video data, and use the captured video data as the video data to be transmitted.
  7. 根据权利要求5所述的传输视频的装置,其特征在于,所述网络判断模块包括:The apparatus for transmitting video according to claim 5, wherein the network determining module comprises:
    第一判断单元,用于判断获取的当前网络类型是否是按流量收费的网络,若是按流量收费的网络,则当前的网络类型是收费型网络;The first determining unit is configured to determine whether the acquired current network type is a network that charges by traffic, and if the network is charged by traffic, the current network type is a charging network;
    第二判断单元,用于判断获取的当前网络类型是否是无线保真网络,若是无线保真网络,则当前的网络类型不是收费型网络。The second determining unit is configured to determine whether the acquired current network type is a wireless fidelity network, and if it is a wireless fidelity network, the current network type is not a charging type network.
  8. 根据权利要求5所述的传输视频的装置,其特征在于,所述视频压缩模块包括:The apparatus for transmitting video according to claim 5, wherein the video compression module comprises:
    图像获取单元,用于获取所述视频数据中的各帧图像数据;An image obtaining unit, configured to acquire image data of each frame in the video data;
    第一压缩单元,用于基于分数形式的插值算法对获取的所述各帧图像数据执行列压缩或行压缩操作,得到各帧图像数据对应的一次压缩图像数据;a first compression unit, configured to perform a column compression or a row compression operation on the acquired image data of each frame based on an interpolation algorithm in a fractional form to obtain primary compressed image data corresponding to each frame image data;
    第二压缩单元,用于基于分数形式的插值算法对各帧图像数据对应的一次压缩图像数据执行行压缩或列压缩操作,得到各帧一次压缩图像对应的二次压缩图像数据;a second compression unit, configured to perform a row compression or a column compression operation on the primary compressed image data corresponding to each frame image data based on the interpolation algorithm in a fractional form, to obtain secondary compressed image data corresponding to the primary compressed image of each frame;
    视频构成单元,用于将各帧一次压缩图像对应的二次压缩图像数据构成压缩后的视频数据。The video framing unit is configured to compose the compressed video data by the secondary compressed image data corresponding to the one-time compressed image of each frame.
  9. 一种电子设备,其特征在于,所述电子设备包括:壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为上述电子设备的各个电路或器件供电;存储器用于存储可进行程序代码;处理器通过读取存储器中存储的可进行程序代码来运行与可进行程序代码对应的程序,用于进行前述任一权利要求1-4所述的传输视频的方法。An electronic device, comprising: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed inside a space enclosed by the housing, and the processor and the memory are disposed in the circuit a power supply circuit for supplying power to each circuit or device of the electronic device; a memory for storing program code; and a processor for reading program code corresponding to the executable code by reading the executable code stored in the memory A program for performing the method of transmitting video according to any of the preceding claims 1-4.
  10. 一种存储介质,其特征在于,所述存储介质存储有一个或者多个程序,所述一个或者多个程序被一个设备执行权利要求1-4任一项所述的传输视频的方法。A storage medium, characterized in that the storage medium stores one or more programs, and the one or more programs are executed by a device to perform the method of transmitting video according to any one of claims 1 to 4.
  11. 一种应用程序,其特征在于,所述应用程序用于在运行时,执行权利要求1-4任一项所述的传输视频的方法。 An application, characterized in that the application is for performing the method of transmitting video according to any one of claims 1 to 4 at runtime.
PCT/CN2017/094369 2016-07-26 2017-07-25 Video transmitting method and device, and electronic equipment WO2018019237A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610599551.3 2016-07-26
CN201610599551.3A CN106162224A (en) 2016-07-26 2016-07-26 Video transmission method and device and electronic equipment

Publications (1)

Publication Number Publication Date
WO2018019237A1 true WO2018019237A1 (en) 2018-02-01

Family

ID=58060300

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/094369 WO2018019237A1 (en) 2016-07-26 2017-07-25 Video transmitting method and device, and electronic equipment

Country Status (2)

Country Link
CN (1) CN106162224A (en)
WO (1) WO2018019237A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112788265A (en) * 2019-11-11 2021-05-11 浙江宇视科技有限公司 Video data storage method and device, image acquisition equipment and readable storage medium
CN113709490A (en) * 2021-07-30 2021-11-26 山东云海国创云计算装备产业创新中心有限公司 Video compression method, device, system and medium

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106162224A (en) * 2016-07-26 2016-11-23 北京金山安全软件有限公司 Video transmission method and device and electronic equipment
CN107734355A (en) * 2017-10-30 2018-02-23 广东欧珀移动通信有限公司 Video image quality adjustment method, device, terminal device and storage medium
CN108600624B (en) * 2018-04-23 2020-06-19 珠海格力电器股份有限公司 Terminal
CN110519618A (en) * 2018-05-22 2019-11-29 视联动力信息技术股份有限公司 A kind of processing method of video data and view networked terminals
CN109688465B (en) 2018-11-27 2020-12-29 Oppo广东移动通信有限公司 Video enhancement control method and device and electronic equipment
CN110062274A (en) * 2019-04-30 2019-07-26 深圳市迅雷网络技术有限公司 A kind of video file caching method, device, equipment and readable storage medium storing program for executing

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103313095A (en) * 2012-03-16 2013-09-18 腾讯科技(深圳)有限公司 Video transmission method, play method, terminal and server
US20140344882A1 (en) * 2013-05-20 2014-11-20 Verint Video Solutions Inc. System and Method of Video Quality Adaptation
CN104360847A (en) * 2014-10-27 2015-02-18 元亨利包装科技(上海)有限公司 Method and equipment for processing image
CN105049918A (en) * 2015-07-08 2015-11-11 成都西可科技有限公司 Method for separating local recorded video and network live video
CN106162224A (en) * 2016-07-26 2016-11-23 北京金山安全软件有限公司 Video transmission method and device and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103702061A (en) * 2013-12-23 2014-04-02 上海网达软件股份有限公司 Automatic adjustment method of resolution of video call of intelligent terminal
CN105263066A (en) * 2014-06-13 2016-01-20 珠海全志科技股份有限公司 Mobile equipment video stream transmission control method and system
CN104618680B (en) * 2015-01-21 2017-09-05 北京瀚景锦河科技有限公司 A kind of compression method of video resolution

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103313095A (en) * 2012-03-16 2013-09-18 腾讯科技(深圳)有限公司 Video transmission method, play method, terminal and server
US20140344882A1 (en) * 2013-05-20 2014-11-20 Verint Video Solutions Inc. System and Method of Video Quality Adaptation
CN104360847A (en) * 2014-10-27 2015-02-18 元亨利包装科技(上海)有限公司 Method and equipment for processing image
CN105049918A (en) * 2015-07-08 2015-11-11 成都西可科技有限公司 Method for separating local recorded video and network live video
CN106162224A (en) * 2016-07-26 2016-11-23 北京金山安全软件有限公司 Video transmission method and device and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112788265A (en) * 2019-11-11 2021-05-11 浙江宇视科技有限公司 Video data storage method and device, image acquisition equipment and readable storage medium
CN112788265B (en) * 2019-11-11 2024-02-02 浙江宇视科技有限公司 Video data storage method and device, image acquisition equipment and readable storage medium
CN113709490A (en) * 2021-07-30 2021-11-26 山东云海国创云计算装备产业创新中心有限公司 Video compression method, device, system and medium

Also Published As

Publication number Publication date
CN106162224A (en) 2016-11-23

Similar Documents

Publication Publication Date Title
WO2018019237A1 (en) Video transmitting method and device, and electronic equipment
US11025963B2 (en) Data processing method, apparatus, and system for live streaming page
US20190221045A1 (en) Interaction method between user terminals, terminal, server, system, and storage medium
CN108200170B (en) Message processing method and device and readable storage medium
US20190014076A1 (en) Method for Sending Message, Method for Reading and Notifying Message, Method for Receiving Message, and Apparatus
CN104935955B (en) A kind of methods, devices and systems transmitting live video stream
WO2015058623A1 (en) Multimedia data sharing method and system, and electronic device
WO2017219609A1 (en) Parking stall reservation method, related terminal, server, and device
WO2019052460A1 (en) Information pushing method, storage medium, terminal device, and server
CN106797336B (en) Method and device for displaying historical chat records
CN107634952B (en) Method and device for determining brushing amount resource, service equipment, mobile terminal and storage medium
CN106569910B (en) Data backup and transmission method and mobile terminal
WO2017197888A1 (en) Information sharing method, intelligent terminal, and system
US20150109210A1 (en) Control method, and input device of touch screen terminal
US10171543B2 (en) Media streaming method and electronic device thereof
CN106330681B (en) Method, system and related equipment for sharing film watching information
US20170171339A1 (en) Advertisement data transmission method, electrnoic device and system
US20170155690A1 (en) Video Communication Ending Method and Apparatus, and Storage Medium
CN108121583B (en) Screen capturing method and related product
CN104427118A (en) Method for recommending contents and mobile terminal
WO2015135457A1 (en) Method, apparatus, and system for sending and playing multimedia information
CN112888024B (en) Data processing method, data processing device, storage medium and electronic equipment
CN107823888B (en) Game team forming method and related product
CN107318129B (en) Data processing method and device and terminal
CN110771113B (en) Brushing amount terminal detection method and device

Legal Events

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

Ref document number: 17833540

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 10.05.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 17833540

Country of ref document: EP

Kind code of ref document: A1