Norpix Directshow Codec
NorPix Codecs are DirectX based video encoders and decoders. Those codecs are based on Microsoft DirectX Media Object, allowing an excellent integration to all Windows based platforms.
NorPix decided to jump into the DirectShow codec arena for multiple reasons. First, many of our end users did not feel particularly satisfied with the codecs available on the market. Numerous times, customers reported poor efficiency and performance or stability issues when using third party codecs with StreamPix. Codec crashes would, for instance, lead to a StreamPix crash, resulting in a poor user experience. We felt that by having our own Codec, we would be better able to control any issues that came up and would be better equipped to fix the problem in a timely manner.
Current codec implementation provides two products:
- NorPix MJPEG codec.
- NorPix H.264 codec.
We may add more specific codecs in the future.
Our H.264 and MJPEG codec implementation is using low-level Intel libraries like IPP and Quick Sync Video, and therefore are fine-tuned for Intel multicore and multithreaded architecture. Latest revisions include support for the new Sandy Bridge processors that includes hardware accelerated H.264 encoding capability.
Our codec implementation was targeted to serve our end user, typically working with monochrome, color or raw Bayer sensor. The codecs include built-in functionalities to Bayer interpolate and color balance images before being compressed as well as a few other unique features. We have made sure the codecs support most of the StreamPix and TroublePix image formats the most natively as possible, reducing transcoding or image format conversion.
Codecs support concurrent multiple instance, so that when using multiple cameras, all streams can be compressed in parallel.
The H.264 codec is supported only with Window Vista or Windows 7 and 8 operating systems. It is not supported under Windows XP.
Example of H.264 codec performance:
|1920 x 1080 YUV422 to H264||1920 x 1080 Raw Bayer to H264|
|Core i3-2100T||Preprocessing (CPU)||10 ms||15 ms|
|Compression||Sandy Bridge CPU||Sandy Bridge GPU||Sandy Bridge CPU||Sandy Bridge GPU|
|39 ms||13 ms||39 ms||13 ms|
|Total processing time||49 ms||23 ms||54 ms||28 ms|
|Software Preprocessing||5.52 ms||6.82 ms|
|Compression||Ivy Bridge CPU||Ivy Bridge GPU||Ivy Bridge CPU||Ivy Bridge GPU|
|21.72 ms||11.55 ms||21.72 ms||11.55 ms|
|Total processing time||27.24 ms||17.07 ms||28.4 ms||18.37 ms|
Preprocessing includes image conversion to an intermediate image format compatible with H.264 compression.
Bayer interpolation and white balancing are performed during preprocessing
Example of MJPEG codec performance:
|Image size and type||Frame rate||CPU load|
|640x480 raw Bayer||200||55%|
|1920x1080 raw Bayer||30||80%|
CPU load while real time encoding at the specified frame rate including concurrent StreamPix load with image capture, display and streaming to disk. Bayer interpolation included for raw format. Intel core i5-850 processor.
Codecs are available in 32 bit or 64 bit mode, and will be maintained. That includes bug fixes, improvements and we will provide tech support.
The codecs support the following image formats natively:
|8bit RAW format.|
|12bit RAW format.|
|8bit Gray format.|
|12bit Gray format.|
|RGB with Alpha channel format.|
Codecs run identically with or without a license code. However, non-licensed versions will print a watermark on generated encoded images.
Using the codecs:
Codec Settings can be accessed via properties dialog of each application using the codec. In case the calling application does not provide any option to access the codec setting, you can run the following utility to access each codec setting:
"All Programs | Norpix | NpxCodec | Codec Settings":
Codecs include 4 setting pages:
H.264 Encoding Page:
- Encoding Profile:
- High Profile: Use YUV420 color coding.
- BaseLine: Recommended for monochrome image.
- Main Profile: Use YUV420 color coding.
- GOP size: The number of frames to be part of the same group of frames. The larger the GOP size is, the less key frames are inserted with the cost of longer seek time.
- Bit Rate: Stream bit rate per second of content.
- Number of Core for Encoding: Instruct the codec about the number of CPU core to use. It is not recommended to use all cores for real time encoding, since CPU resources may not be available to service other StreamPix capture and streaming threads.
MJPEG codec settings
- Quality: The jpeg compression quality. 100% quality will give best image quality with low compression factor.
Parameters for embedded raw to Bayer interpolation: Before encoding an image, raw Bayer image can be color interpolated. Note that if Bayer is enabled, monochrome image will be interpolated too.
- Enable/Disable conversion. Only useful if processing a raw Bayer image.
- Bayer Pattern: Select the Bayer pattern matching your sensor.
Following a Bayer interpolation, or if image format is RGB, codec can perform some automatic white balance correction. Furthermore, one can define a region on the image to be used as a reference for white balance calculation.
- Enable: Enable/Disable auto white balance.
- Mean Equalization
- Gray Word
- Standard Deviation
- Mean and Standard Deviation
- ROI: define WB area
Linear window leveling can be performed for pixel depth greater that 8 bits before encoding. By default, encoder will always keep the 8 most significant bits of captured images. Window leveling can be used to force the usage of other bit range:
As an example, a 10 bit image can be leveled in 3 ways:
- 8 most significant bits (bit 2 to 10, default)
- 8 middle significant bits (bit 1 to 9)
- 8 least significant bits (bit 0 to 7)
This can be used for remapping monochrome image to pseudo color. Currently, 2 predefined look up table functions are available. Please contact Norpix if you feel more LUT should be added.
Available predefined LUTs are:
- Inverted rainbow
Pseudo color cannot be used with true color RGB or YUV images.
NorPix Lookup table
A text file, comma separated that can be generated (save Excel file as a .csv format) and can be used to force pixel intensity remapping to pseudo color.
#Index, Blue, Green, Red Remapping value
0, 255, 0, 0 : gray level 0 will be Remapping as pure blue,
1, 10, 10, ,: gray level 1 will be Remapping as Blue = 10, Green = 10, Red default
[200,255], 255, 255, 255: gray levels 200 to 255 are Remapping to pure white
Correct image temperature.
The range is between 5000K-20000K.
Only useful for color images.
The American Society of Cinematographers Color Decision List (ASC CDL) has defined a format for the exchange of basic primary color grading information. A 3 parameters formula can be used to define most possible remapping and color correction.
The formula for ASC CDL color correction is:
out = (i*s +o)p
- out is the color graded pixel code value.
- i is the input pixel code value (0=black, 1=white).
- s is slope (any number 0 or greater, nominal value is 1.0).
- o is offset (any number, nominal value is 0).
- p is power (any number greater than 0, nominal value is 1.0).
Each codec is uniquely identified by a FourCC code. Mediaplayer application can identify what codec has been used to encode the video and search for a corresponding decoder.
By default, the codec will use standard FourCC name, to allow any MJPEG or H.264 compatible decoder to render the images. That means there is no need to install NorPix codec on playback computers when default FourCC names are used.
If you encounter playback issues, or prefer the end user to use the NorPix codec for decoding, set the FourCC to be either NPXJ for MJPEG or NPXH for H.264.
Licencing the codec
To avoid the watermark on encoded image, make sure to register the codec. Provide a user name and Norpix will send you a valid key.