CIFF DEVELOPMENT UPDATE

CIFF DEVELOPMENT UPDATE
March 18, 2010.
We developed fully functional demo application software based on proven CIFF codec technology:
 CIFF Capture graphic user interface (GUI)
 CIFF Player GUI
 DirectShow library CIFF.dll
The DirectShow library CIFF.dll comprises the following Multithreaded DirectShow Filters:
 AXIS Adapter Filter, for fixing wrong frame rate and frame resolution of Axis IP cameras
 HDYC Adapter Filter, for converting HDYC capture output of DeckLink card to UYVY output
 CIFF Video Decoder Filter, for decompressing CIFF video
 CIFF Multiplexer Filter, for multiplexing CIFF Container
 CIFF Demultiplexer Filter, for demultiplexing CIFF Container
 CIFF IPTV Sink Filter, for IPTV transmitting
 CIFF IPTV Source Filter, for IPTV receiving
 YUV File Source Filter, for reading YUV file from a HDD
 YUV Video Encoder Filter, for encoding (writing) YUV file
 YUV Video Decoder Filter, for decoding (reading) YUV file
 YUV Frame Pre Post Processing Filter, for frame preprocessing and postprocessing
 YUV Video Pre Post Processing Filter, for video preprocessing and postprocessing
 YUV Frame Copy Filter, for transcoding of any installed video format to YUV file,
as well as the following Multithreaded DirectShow Video Compressors:
 CIFF Video encoder ICM Class Manager
 CIFF Video Encoder Filter, for compressing CIFF video from any:
1) DirectShow compatible video capture card, such as DeckLink HD Extreme 3, DeckLink Studio
or Intensity Pro cards produced by BlackMagic, or XENA cards produced by AJA, connected to
digital camera outputs (HDMI, HD-SDI, SDI) or analog camera outputs (component, S-video,
composite)
2) DirectShow compatible IP network camera, such as those made by Axis, Sony, etc.
3) DirectShow compatible Web camera, such as those made by Logitech, Creative, etc.
4) HDD, by reading YUV file, with extension .yuv and the appropriate description text file with
the extension .txt, which should be in the same folder.
Smart Tee DirectShow Filter provides simultaneous video capture, video compression and video
preview with the priority on video capture and compression, which means that it can automatically skip
frames from video played in a preview window in case of less powerful PC, in order to compress all
frames.
In addition to that, it is possible to play CIFF Container format, with extension .cif, or YUV format,
with extension .yuv followed by the appropriate description text file with the extension .txt, using any
DirectShow compatible player, such as CIFFPlayer, Windows Media Player, Media Player Classic, etc.
1
Supported planar YUV file formats for encoding at this moment are YUV 4:2:2 and YUV 4:2:0, due to
Microsoft DirectShow limitations, which we plan to overcome in the near future by implementing our
own DirectShow filters for YUV 4:4:4 (full color) and YUV 4:0:0 (grayscale) formats for encoding.
All YUV filters are already supported for decoding and display using any graphics card.
CIFF Capture
CIFFCapture.exe is demo GUI for:
 Video capturing
 Reading video from a HDD
 Frame and Video Preprocesing
 CIFF video encoding (compression)
 CIFF multiplexing
 Encryption
 Forward error correction
 Writing video to a HDD
 UDP Streaming, according to the following instructions:
1)





Video Source can be chosen from the drop list of devices available in test PC, for example:
AXIS MJPEG Capture Driver,
DeckLink Video Capture,
File Source (Async.) Filter, wherein full path and file name can be browsed from “File Name” box,
Logitech Web Camera,
YUV File Source Filter, wherein full path and file name can be browsed from “File Name” box.
2
File Source (Async.) Filter enables transcoding from ANY video format, supported by preinstalled
Microsoft and installed 3rd party DirectShow decoder filters, into CIFF format. In other words, if a
video format can be played using Windows Media Player and Media Player Classic (for example,
available from K-Lite Codec Pack), it should be possible to transcode it to CIFF format.
Otherwise, Start and Stop keys in CIFF Capture will be disabled after the selection of the compressed
video file(s) that cannot be transcoded and/or played.
Transcoding to CIFF is made in such a manner that after manually selecting a video file to be
transcoded from a HDD using pop-up GUI window and subselection of All Files (*.*) instead of YUV
Files (*.yuv), DirectShow takes over the control, then automatically detects the video format and
selects the best installed Microsoft or 3rd party decoder to decode it, based on so-called “filter merit”.
CIFF Capture user does not have to know video format to be transcoded and played in order to perform
transcoding and playing of that file.
CIFF Capture was successfully checked with several free and commercially available codec packs.
Among them, K-Lite Codec Pack Mega (or any other K-Lite Codec Pack) provides practically all
decoders in the form of DirectShow filters, while being regularly updated and freely available from:
http://www.codecguide.com/download_kl.htm
During the installation of K-Lite codec pack, Media Player Classic should be selected instead of Media
Player Classic Home Cinema. The ffdshow video decoder configuration can select:
 “libavcodec” for the decoding of all video formats (including MPEG-2 and MPEG-4);
 “ffmpeg-mt” for the experimental multithreaded decoding of h.264 or
 “libavcodec” for the single-threaded decoding of h.264;
 disabled decoding of Microsoft formats: WMV1/7, WMV2/8, WMV3/9, VC-1, WMVP and
MSS1/2, which means that they will be decoded using Microsoft video decoders from Windows
operating system (OS). These formats can be decoded by either “libavcodec” or “wmv9”;
 disabled Raw video decoders, since CIFF provides all necessary support with filter merits
recommended by Microsoft, instead of increased filter merits, provided by K-Lite Codec Pack.
CIFF Capture operates with ANY codec pack, and has no programming relation with Microsoft or 3rd
parity video decoders, since they are automatically selected by DirectShow part of Windows operating
system (OS) and not CIFF Capture. Therefore, no royalties to patent owners of used video decoders are
covered, since the owner/user of PC is responsible for the installation of 3rd party codec packs, while
Microsoft codec pack is already included in Windows OS.
However, we can provide the advice to CIFF Capture users related to possible royalty payments to 3rd
parties after obtaining the list of desired video formats to be transcoded.
2) Format can be chosen from the drop list of formats available for the particular Video Capture Card
(for example, 2K, 1080p, 1080i, 720p, PAL and NTSC formats for BlackMagic DeckLink cards).
3) Preview size can be chosen between Auto size (Fit to the monitor) and Original size (1 monitor pixel
corresponding to 1 file pixel). Reset size returns to the default (Auto in this case). This is helpful for
showing UDTV fitted to the monitor size or each pixel of UDTV.
3
4)




Video Encoding can be chosen from the drop list of available methods:
CIFF Fixed Average Bitrate (preferable for better quality of CIFF Container file)
CIFF Fixed Peak Bitrate (preferable for limited bandwidth IPTV streaming)
CIFF Fixed Quality (preferable for best quality)
CIFF Lossless (preferable for CIFF Container file providing decompressed video mathematically
identical to the input video).
5) Average Bitrate in Mb/s, Bitrate Tolerance in % and Peak Quality [1..3999], can be freely inserted
into the appropriate edit boxes, with limitation info.
6) 2 out of 3 Video Scalabilities are already implemented:
 Quality scalability with chosen number: 0 = max quality, 1 = reduced quality, 2 = more reduced
quality, etc.
 Temporal scalability (frame dropping) with values in the range [1..100] for selection of the output
frame rate as the percentage of input frame rate. For example, temporal scalability of 100% provides
full frame rate, while 50% provides half frame rate, by dropping each second frame.
 Spatial (resolution) scalability is already supported in CIFF Container format, but its implementation
requires slight changes in the decoding filter in order to stop decoding at chosen reduced resolution.
7)



Output Device can be chosen from the drop list of available devices:
CIFF Container File (compressed)
CIFF Container IPTV (compressed)
YUV File (uncompressed), wherein full path and file name can be browsed from “File Name” box.
8) IPTV Setup can stream video using unicast or multicast protocol, depending on the chosen address
range, so you can define client target address in unicast (for example: 169.254.170.104) or a multicast
group address range (for example: 234.5.6.7).
The additional controls are:
 Announce port (for initial TCP communication)
 Stream port (for UDP streaming)
 Packet Size in bytes
 TTL (Time to Live)
9) AES-GCM-AEAD encryption with enabled tick box. 256-bit long hexadecimal key (64-digits
chosen from: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F) is entered manually for testing purposes in
both CIFFCapture and CIFFPlayer. If less than 64-digits are entered, the other digits will be considered
zero. Device Id is used for entering 32-bit “salt” part of nonce (number used only once), while 64-bit iv
part of nonce is generated automatically, according to NSA and NIST recommendations.
10) Packet forward error correction (FEC) can be chosen between:
 No FEC
 Row FEC
 Column FEC
 Matrix FEC
wherein number of packets in each row is entered using Columns box in Row and Matrix FEC modes,
and the number of packets in each column is entered using Rows box in Column and Matrix FEC
modes. FEC overhead bitrate should be added to video bitrate chosen in 5).
4
11) Preprocessing (denoising) filters perform:
 Video Preprocessing (interframe processing, usually deflickering)
 Frame Preprocessing (intraframe processing, usually blurring) of the types listed in the next figure.
Please notice that Frame Preprocessing has more filters, visible after using the slider on a right side.
None skips frame preprocessing calculation, but an applied filter will still copy frame. [3X3M] Filters
are non-optimized matrix 3x3 filters. [3x3S] filters with the same name as [3X3M] produce exactly the
same result but using completely different SKIPSM algorithm.
Some of these filters are not applicable to blurring, since they are used for sharpening or testing pieces
of code of other filters, such as: Sobel Horizontal, Sobel Vertical and Sobel Vertical & Horizontal.
Y gain and C gain are parameters for luminance and chrominance pre- or post-processing, having the
meaning of: don’t care (no gain) or gain [0..1000] depending on a filter.
gain = 512 provides very strong filtering operation (blurring or sharpening depending on a filter)
gain = 256 provides strong filtering operation
gain = 0 activates frame copy operation
The order of complexity of Blurring or Sharpening Frame Preprocessing filters from simplest to the
most complex is:
 None
 Square
 Box
 Gauss
5
 Smart
 Median
gain
no gain
wherein Square, Box and Gauss filters have 4 variants each with or without gain parameter, such as:
 Gauss
no gain
 Gauss Gain
gain
 Gauss Sobel
no gain
 Gauss Sobel Gain
gain
None skips video preprocessing calculation, but an applied filter will still copy frame.
Y Threshold and C Threshold are threshold parameters for luminance and chrominance pre- and postprocessing limited between 0 and 255.
The order of complexity of Video Preprocessing filters from simplest to the most complex is:
 None
 One Threshold Fixed Blending 4
 One Threshold Fixed Blending 3
 One Threshold Variable Blending
 Two Threshold Fixed Blending 4
 Two Threshold Fixed Blending 3
 Two Threshold Variable Blending
Threshold is typically relatively low.
The available Video Preprocessing filters are listed in the following figure.
6
The selection of any option from drop lists will also disable non-applicable controls.
Immediately after starting CIFFCapture.exe, one ActiveMovie Window will be open, so captured
uncompressed video BEFORE CIFF compression will be previewed.
Capture, preprocessing, compression, multiplexing, encryption, forward error correction and UDP
transmission or storage to a HDD will be started after pressing Start button and stopped after pressing
Stop button.
CIFF Player
CIFFPlayer.exe is demo GUI for:
 UDP Receiving
 Reading video from a HDD
 Decryption
 Forward error correction
 CIFF demultiplexing
 CIFF video decoding (decompression)
 Frame and Video Postprocessing
 Writing video to a HDD
 Playing video in a separate window, according to the following instructions:
7
1) Source can be chosen from the drop list of available devices:
 CIFF Container File (compressed)
 CIFF Container IPTV (compressed)
 YUV File (uncompressed),
wherein full path and file name can be browsed from “File Name” box or CIFF Capture IP address and
info port can be entered (for example: ciff://169.254.67.53:4000)
2) Output can be chosen from the drop list of available devices:
 Display only (without file output)
 CIFF Container File (compressed)
 YUV Uncompressed Video File (display with file output)
wherein full path and file name can be browsed from “File Name” box.
3) 1 out of 3 Video Scalabilities is already implemented:
 Temporal scalability (frame dropping) with values in the range [1..100] for selection of the output
frame rate as the percentage of source frame rate. For example, temporal scalability of 100%
provides full frame rate, while 50% provides half frame rate, by dropping each second frame.
 Quality scalability with chosen number: 0 = max quality, 1 = reduced quality, 2 = more reduced
quality, etc. is already supported in CIFF Container format on the encoding side, and will be
implemented on decoding side after slight decoding filter modifications, together with
 Spatial (resolution) scalability, which is also already supported in CIFF Container format.
4) Basic player controls are:
> Play forward
|| Pause
[] Stop
|< Go to first frame
x Auto repeat video on/off box
5) Additional controls, which will be implemented in the near future after the addition of the seek
dictionary are:
< Play backwards
>| Go to last frame
<< Go to previous frame
>> Go to next frame
<> Go to chosen frame with frame number entered in the box
6) Default size can be chosen between Auto scaling and Original size, while Reset size will provide the
default size (Auto).
7) Postprocessing filters perform:
 Frame Postprocessing (intraframe processing, usually sharpening)
 Video Postprocessing (interframe processing, usually deflickering)
Both postprocessing filters are identical to the appropriate preprocessing filters.
CIFF Player is very robust, even to “catastrophic events”, such as disconnection and subsequent
connection of the Ethernet cable during playing of IPTV stream.
8
During the disconnection phase, CIFF Player will (obviously) stop playing, while it will automatically
resume playing after reconnection of the Ethernet cable.
However, after pressing Stop in CIFF Capture, CIFF Player must be restarted (by pressing Pause then
Start, or pressing Stop then Start), since CIFF Capture must communicate all important parameters with
CIFF Player again, because CIFF Capture could change them after pressing Stop.
Zero Visual Latency
The recommended setup for testing zero visual latency during CIFF codec operation is:
 Camcorder (Canon, Sony) with live HDMI output or IP network camera or Analog camera
 HDMI-HDMI Cable or Ethernet cable or coaxial cable
 Video Capture Card for PC (for example, produced by BlackMagic or AJA)
 PC with Windows Vista or Windows XP
 graphedt.exe (Microsoft Filter Graph Editor program) installed on PC
 LATENCY2.GRF file on PC
 CIFF.dll library registered on PC.
After activating LATENCY2.GRF file using graphedt.exe, the following blocks are connected:
 Decklink Video Capture Filter
 Infinite Pin Tee Filter with 2 video signal branches:
1) video branch with:
CIFF Video Encoder Filter, performing CIFF compression,
CIFF Multiplexer Filter, performing CIFF Container multiplexing,
CIFF Demultiplexer Filter, performing CIFF Container demultiplexing,
CIFF Video Decoder Filter, performing CIFF decompression,
Video Renderer, performing playing of decompressed video,
2) video branch with:
HDYC Adapter Filter, performing conversion from HDYC to UYUV format
AVI Decompressor, performing pass-through operation,
Video Renderer, performing playing of captured uncompressed video.
LATENCY2.GRF is activated by pressing “Play the graph” button (>), which will open first video
window with captured uncompressed video and then open second video window with compressed,
multiplexed, demultiplexed and decompressed video. Video can be paused by pressing “Pause the
graph” button (||) or stopped by pressing “Stop the graph” button ([]). Encoding parameters can be
adjusted by clicking right mouse button over CIFF Video Encoder Filter.
The camcorder can look into HDTV screen or HD PC monitor playing video from BluRay disk or
DVD or TV channel or HDD, so it will be also possible to visually check CIFF latency between the
first video window with captured uncompressed video and the second video window with CIFF
compressed, multiplexed, demultiplexed and decompressed video, as well as total CIFF Display
System latency between HDTV screen or HD PC monitor and the second video window, which
depends on latency in the camera and the video capture card.
We would like to emphasize that both latencies are so small, even unnoticeable in practice, so we can
say that CIFF Codec has “Zero Visual Latency”.
9
The recommended setup for checking zero visual latency during streaming comprises:
 Camcorder (Canon, Sony) with live HDMI output or IP network camera or Analog camera
 HDMI-HDMI Cable or Ethernet cable or coaxial cable
 Video Capture Card for PC (for example, produced by BlackMagic or AJA)
 First PC with Windows Vista or Windows XP
 CIFFCapture.exe installed on the first PC
 CIFF.dll library registered on the first PC
 Ethernet cable or router with two cables or wireless router between the first and the second PC
 CIFFPlayer.exe installed on the second PC
 CIFF.dll library registered on the second PC
The camcorder can look into HDTV screen or HD PC monitor playing video from BluRay disk or
DVD or TV channel or HDD, so it will be also possible to visually check total streaming system
latency between the first video window on the first PC with captured uncompressed video and the
second video window on the second PC with CIFF compressed, multiplexed, encrypted, forward error
corrected, streamed, decrypted, forward error corrected, demultiplexed and decompressed video, as
well as total CIFF Streaming System latency between HDTV screen or HD PC monitor and the second
video window on the second PC, which depends on latency in the camera and the video capture card.
We would like to emphasize that even these latencies are so small for small FEC, mostly unnoticeable
in practice, so we can say that the whole CIFF Streaming System has “Zero Visual Latency”.
Planned Future Upgrades
While already developed software is fully functional and can be immediately used in immense number
of applications, we are in the process of adding other neat features as upgrades within next 6 weeks:
 Multiple video streams preprocessing, capturing, compression and multiplexing
 Multiple video streams demultiplexing, decompression, postprocessing and playing
 3D stereo video streams preprocessing, capturing, compression and multiplexing
 3D stereo video streams demultiplexing, decompression, postprocessing and playing
 Spatial (resolution) scalability in CIFF encoder
 Spatial (resolution) scalability in CIFF decoder
 Audio codec
After that we will provide fine tuning (optimization) and addition of other features:
 Optimization of preprocessing and postprocessing filters
 Multiple unicast addresses (besides already supported multicast and single unicast)
 Seek dictionary
 Subtitles
 Metadata
 Transcoding to other video formats (MJPEG, MJPEG2000, MPEG-2, MPEG-4 and H.264)
 Cross-platform support (Windows, Linux/X11, Mac OS X, Windows CE, Embedded Linux, S60)
 Interframe CIFF codec, providing low bitrates video.
10