streaming video : Java Glossary
- streaming video
Let’s say you wanted to broadcast images to the planet. How might you go about
it. Here are some techniques starting with simple and slow working up to expensive
Frequently upload changed images embedded in a web page.
Every time you users view the page, they will see the latest image.
Attach a webcam to your server. It takes a snapshot ever few
seconds or every few minutes and replaced the jpg image it has been serving.
Every time users view the page, they see the latest image. Users might employ
software such as NetworkCam to probe the server every few seconds
to download a fresh image. The server does not inform the user when a new image
is ready. Users must poll for it. This scheme is intended for images that change
every 5 seconds to 5 minutes.
You use software to prepare a compressed MP4 or proprietary file
containing your entire event. You upload this to an ordinary server. People can
download it and play it on the corresponding player. Often they cannot see
anything until they have completely downloaded the giant file. You can use
BitTorrent protocol if you expect
many viewers and you don’t have a powerful server. Users can pause the
video and replay it as many times as they like. This technique will not work for
live events or when you want real-time information such as continuous video
If your clients are viewing the feed on cellphones, you want to
look into JavaFX.
If you wanted to broadcast a live event to a large audience,
you might talk the RealPlayer
people. They might advise installing their proprietary server software, to
compress and efficiently broadcast the live video feed. Or they might advice
hosting the feed on
their server farm. Everyone watching watches in sync. They can’t pause the
feed or fast forward. To find other companies that provide this service:
search live video hosting. The most heavy-duty commercial
broadcasters tend to use Octoshape. It is a proprietary protocol in which
end-users not only receive data, but also act as sending servers towards other
nodes as well; this is similar to how P2P networks operate. This allows the
system to handle millions of viewers.
JMF (Java Media Framework)
A custom application based around the
JMF library of
streaming protocols. The advantage here is platform specific optimisations to
process decompress the images, giving a fast frame rate.
I wrote a security camera system for a client that allowed
multiple users to monitor hundreds of security cameras. The user could schedule a
display of several cameras at once that switched cameras automatically. Further,
the user could pause, rewind, fast forward, single frame etc, like a digital
VCR (Videocassette Recorder) any of the camera feeds which were permanently
recorded in the serve database. It used a custom high-speed robust protocol that
automatically restarted if the connection were lost. It was interactive with
messages going back and forth between server and clients on dedicated sockets
using multiple threads. These are the sorts of features you might put into a
custom system. You can get intelligent cameras that communicate digitally with
TCP/IP (Transmission Control Protocol/Internet Protocol) that can detect motion and that can pre-compress
the stream. This offloads much of the computational work from your server.