1. Technical Field
Embodiments of the present disclosure relate to video management technology, and particularly to a system and a method for playing and transmitting network videos using an electronic device and a web server.
2. Description of Related Art
An Internet Protocol (IP) camera may include functions of a camera and a computer. The IP camera can capture videos and transmit these videos through a local area network, the Internet, or a wireless network. However, if the videos generated by the IP camera are played in an electronic device (e.g. a personal computer, a mobile phone or a panel computer), specific video playing software (e.g. media player software or television software) is required to be used. Therefore, different kinds of video playing software need to be developed and tested for different kinds of electronic devices, which is inconvenient.
The disclosure, including the accompanying drawings, is illustrated by way of examples and not by way of limitation. 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.”
In general, the word “module,” as used herein, refers to logic embodied in hardware or firmware unit, or to a collection of software instructions, written in a programming language. One or more software instructions in the modules may be embedded in firmware unit, such as in an EPROM. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media may include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives.
The first storage system 13 and the second storage system 22 may be memories, or external storage cards, such as a smart media card, or a secure digital card. The first processor 12 executes one or more computerized codes and other applications for the electronic device 1, to provide the functions of the video playing system 11. The second processor 21 executes one or more computerized codes and other applications for the web server 2, to provide the functions of the video transmission system 20.
As shown in
In step S1, the first acquisition module 110 acquires a web address of the network video in an address column of the browser 10. The web address is an address of a video source.
In step S2, the first parsing module 111 parses the browser 10 and detects a layout engine of the browser 10. The first parsing module 111 detects the layout engine according to JavaScript of the browser 10. For example, if the browser 10 is the IE browser 10, the first parsing module 111 detects that the layout engine of the browser 10 uses the Trident layout engine.
In step S3, the first parsing module 111 determines whether the browser 10 supports a Motion Joint Photographic Experts Group (MJPEG) format according to the layout engine of the browser 10. In some embodiments, some layout engines support the MJPEG format, such as the Gecko layout engine and the Webkit layout engine, and some layout engines do not support the MJPEG format, for example the Trident layout engine. If the browser 10 supports the MJPEG format,
As shown in
In step S5, the transmission module 113 transmits the acquired web address from the browser 10 to the web server 2, and requests the transmission of the network video from the web server 2.
In step S6, the receiving module 114 receives video streams having the MJPEG format of the network video.
In step S7, the playing module 115 generates a video file having the MJPEG format and including a by adding the received video streams into the established MJPEG image frame.
In step S8, the playing module 115 plays the plurality of video streams of the video file in the browser 10.
In one embodiment, the video streams having the MJPEG format includes a sequence of images, step S6 to step S8 are executed repeatedly until all of the video streams of the network video have been played. In step S9, the playing module 115 determines whether all of the video streams of the network video have been played. If there is one video stream of the network video that has not been played, step S6 is repeated. If all of the video streams of the network video have been played, the procedure ends.
During step S5 to step S8, the monitoring module 116 monitors a connection status of the network 4 in real-time, and determines whether the network 4 is disconnected. The monitoring module 116 determines a disconnection of the network 4 according to a connection record table recorded in the web server 2. When the network 4 is disconnected, the monitoring module 114 reconnects to the network 4 automatically, until all the video streams of the network video have been played.
As shown in
In step S11, the transmission module 113 transmits the acquired web address from the browser 10 to the web server 2, and requests the transmission of each single static image of the network video from the web server 2.
In step S12, the receiving module 114 receives each single static image from the web server 2.
In step S13, the playing module 115 generates a video file including a plurality of single static images by adding the received each single static image successively into the established static image frame.
In step S14, the playing module 115 displays the plurality of single static images successively of the video file in the browser 10.
If the received single static images do not form a completed and integrated video file, that is, the whole network video has not finished playing, step S11 to step S14 are executed repeatedly until all of the single static images of the network video are received to be displayed. In step S15, the playing module 115 determines whether all of the single static images of the network video have been played. If there is a single static image of the network video which has not been played, step S11 is repeated. If all of the single static images comprising the network video have been played, the procedure ends.
During step S11 to step S14, the monitoring module 116 monitors the connection status of the network 4 in real-time, and determines whether the network 4 is disconnected. The monitoring module 116 determines the disconnection of the network 4 according to the connection record table in the web server 2. When the network 4 is disconnected, the monitoring module 114 reconnects to the network 4 automatically, until all of the single static images of the network video have been received and played.
In step S20, the second acquisition module 200 receives the web address and a request from the electronic device 1, such as the request to transmit the network video or each single static image of the network video, for example.
In step S21, the second parsing module 201 requests the network video from the video source (e.g. one of the IP cameras 3) corresponding to the received web address.
In step S22, the second parsing module 201 parses the network video obtained from the video source, and receives each frame image of the network video. In one embodiment, the second parsing module 201 decomposes the network video into separate frame images by decoding the network video using a predetermined decoder applicable to the network video.
In step S23, the encoding module 202 determines whether the network video is the MJPEG format. If the network video is the MJPEG format, step 24 is implemented. If the network video is not the MJPEG format, step S25 is implemented.
In step S24, the encoding module 202 encodes the received frame images into MJPEG format video streams, and transmits the video streams to the electronic device 1.
In step S25, the encoding module 202 encodes each of the received frame images as the plurality of single static images as mentioned above, and transmits the plurality of single static images to the electronic device 1. During step S22 to step S25, the recording module 203 records a connection status of the network between the electronic device 1 and the web server 2 when receiving each frame image from the video source, into the connection record table.
All of the processes described above may be embodied in, and be fully automated via, functional code modules executed by one or more general-purpose processors. The code modules may be stored in any type of non-transitory computer-readable medium or other storage device. Some or all of the methods may alternatively be embodied in specialized hardware. Depending on the embodiment, the non-transitory computer-readable medium may be a hard disk drive, a compact disc, a digital video disc, a tape drive or other suitable storage medium.
The described embodiments are merely possible examples of implementations, set forth for a clear understanding of the principles of the present disclosure. Many variations and modifications may be made without departing substantially from the spirit and principles of the present disclosure. All such modifications and variations are intended to be included herein within the scope of this disclosure and the described inventive embodiments, and the present disclosure is protected by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
101125782 | Jul 2012 | TW | national |