1. Technical Field
Embodiments of the present disclosure relate to data transmission, and more particularly to a server and a method for transmitting videos.
2. Description of Related Art
Nowadays, terminal devices, such as computers, tablets, smart phones and TVs are widely used to watch online videos on the Internet. Unlike videos that are downloaded and played at any time in the future, streaming videos are played immediately after a small amount of video frames are received, and the video is not stored permanently in the terminal devices.
However, due to the encode rate of an online video server that generates and encodes video frames, network bandwidth, and the decode rate of the terminal devices, video qualities of the online videos may be poor. Therefore, there is room for improvement in the art.
The disclosure is illustrated by way of example and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one.” The references “a plurality of ” and “a number of” mean “at least two.
In general, the word “module,” as used hereinafter, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, for example, Java, C, or Assembly. One or more software instructions in the modules may be embedded in firmware. It will be appreciated that modules may comprised connected logic units, such as gates and flip-flops, and may comprise programmable units, such as programmable gate arrays or processors. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of computer-readable medium or other computer storage device.
The video frame transmitting system 11 includes a number of function modules (depicted in
The storage device 12 comprises some type(s) of computer-readable storage medium, such as a hard disk drive, a compact disc, a digital video disc, or a tape drive.
The control device 13 may include a processor, a microprocessor, an application-specific integrated circuit (ASIC), and a field programmable gate array, (FPGA) for example.
In step S10, the frame capture module 110 captures a frame of a video, and records a capture time of the frame into the storage device 12 of the server 1. As mentioned above, the frame update module 100 of the VM 10 outputs the video and the frame storing module 101 of the VM 10 stores each frame of the video into a storage space of the VM 10. The frame capture module 110 captures a frame of the video from the storage space of the VM 10, and records the capture time. In one embodiment, if the frame update module 100 of the VM 10 outputs a video 30 frames per second, namely FPS=30, then the capture time of a frame is 1/30 second.
In step S11, the record module 111 obtains an encode time of encoding a previous frame in the server 1, a transmitting time of transmitting the previous frame to the client device 2, and a decode time of decoding the previous frame by the client device 2, from the storage device 12. As described below, every time when the server 1 encodes a frame, transmits a frame to the client device 2, and the client device 2 decodes the frame, the encode time, the transmitting time, and the decode time of the frame are recorded in the storage device 12 of the server 1. It may be understood that, when there is no previous frame, the encode time, the transmitting time, and the decode time are all equal to zero.
In step S12, the encode module 112 determines if the capture time of the frame is greater than all of the encode time, the transmitting time, and the decode time of the previous frame. If the capture time of the frame is greater than all of the encode time, the transmitting time, and the decode time of the previous frame, step S13 is implemented. Otherwise, if the capture time of the frame is equal to or less than any of the encode time, the transmitting time, and the decode time of the previous frame, step S14 is implemented.
In step S13, the encode module 112 adjusts a bit rate of encoding the frame to decrease a size of the frame, and encodes the frame according to the adjusted bit rate. In one embodiment, the encode module 112 adjusts the bit rate of encoding the frame to a predetermined value.
In step S14, the encode module 112 encodes the frame normally, namely encodes the frame according to an original bit rate.
In step S15, after encoding, the record module 111 records an encode time of the frame into the storage device 12.
In step S16, the communication module 113 transmits the frame to the client device 2.
In step S17, the computation module 114 receives a feedback from the client device 2 comprising a decode time of decoding the frame by the client device 2, and computes a transmitting time of transmitting the frame to the client device 2. In one embodiment, the transmitting time of the frame is computed according to a time of transmitting the frame to the client device 2, a time of receiving the feedback from the client device 2 and the decode time of the frame in the client device 2. For example, when the communication module 113 transmits the frame to the client device 2 at 9:00, and receives the feedback from the client device 2 at 9:05, and a decode time of the frame in the client device 2 is 1 second, then the transmitting time of the frame is [(9:05−9:00)−1]/2, namely 2 seconds.
In step S18, the frame capture module 110 determines if there are other frames to be transmitted in the storage space of the VM 10. If there are other frames to be transmitted, the procedure goes back to step 10. If there is no frame to be transmitted, the procedure ends.
It should be emphasized that the above-described embodiments of the present disclosure, particularly, any embodiments, are merely possible examples of implementations, merely set forth for a clear understanding of the principles of the disclosure. Many variations and modifications may be made to the above-described embodiment(s) of the disclosure without departing substantially from the spirit and principles of the disclosure. All such modifications and variations are intended to be included herein within the scope of this disclosure and the present disclosure and protected by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
102101287 | Jan 2013 | TW | national |