
JavaArt Chapter 7. Video Watermarking with Barcodes

From the website:

  Killer Game Programming in Java
  http://fivedots.coe.psu.ac.th/~ad/jg

  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat Yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th


If you use this code, please mention my name, and include a link
to the website.

Thanks,
  Andrew

============================

This directory contains 3 Java programs.

  * TimeStamper.java
        - a Xuggler-only program that timestamps the supplied video
          (no barcodes involved)

  * AddVideoMsg.java
          - this stores a message as barcodes inside a video

  * GetVideoMsg.java
          - this extracts a message hidden as barcodes in the
            supplied video


There are 2 subdirectories:
  * barcode-4j\    -- holds the Barcode4J libraries and a test program
  * zxing-1.5\     -- holds the ZXing libraries and a test program


There is 1 test video:
  * catbloopers.flv


There are 3 batch files:
  * compile.bat
  * run.bat
     - they assume that:
         1. xuggle-xuggler.jar is installed in XUGGLE_HOME (C:\Program Files\Xuggle)
              - details given below
         2. barcode4j-light.jar is installed in barcode-4j\
              - details given in barcode-4j\readme.txt
         3. core.jar and javase.jar are installed in zxing-1.5\
              - details given in zxing-1.5\readme.txt

  * testXuggler.bat
      - for testing if Xuggler is installed; see below

----------------------------
Compilation:

> compile *.java

----------------------------
Execution:

1) Timestamping a Video
Usage:
> run TimeStamper <video file>
e.g.
> run TimeStamper catbloopers.flv
    - adds timestamps to the frames saved in a new catbloopersOut.flv


2) Hiding a message
Usage:
> run AddVideoMsg "message string" <video file>
e.g.
> run AddVideoMsg "hello world" catbloopers.flv
         - this will hide the message as barcodes in catbloopersOut.flv

3) Extracting a message:
Usage:
> run GetVideoMsg <video file>
e.g
> run GetVideoMsg catbloopersOut.flv
         - will print the message "hello_world#"

----------------------------
Xuggler Installation

Download Xuggler from http://www.xuggle.com/xuggler/
(xuggle-xuggler-setup.exe; v.3.4, February 2010, or later)

It will probably install to C:\Program Files\Xuggle

Set the environment variable XUGGLE_HOME = C:\Program Files\Xuggle (or where ever)

Testing:
> testXuggler.bat <video file>
e.g.
> testXuggler catbloopers.flv
      - this uses the Xuggler demo example DecodeAndPlayAudioAndVideo
        (which is in xuggle-xuggler.jar) to play the supplied video

----------------------------
Playing Flash Movies

I use the KMPlayer (e.g. http://kmplayer.en.softonic.com/), 
which can play a wide range of video formats.

---------
Last updated: 22nd June 2010
