MJpeg video
1. Jpeg images without a Huffman table.
Most cameras that produce MJPEG video provide frames as normal JPEG images. However, some cameras create JPEG images without a Huffman table (these images have an "AVI1" signature instead of "JFIF"). It is assumed that a default table is used. TJpegImage and other Delphi libraries cannot read such images as they are.
RVMedia 10.3 contains code that allows reading these images (currently, in VCL and Lazarus projects).
2. Ability to use Fast Jpeg Decoder.
Fast JPEG Decoder for Delphi is an open-source unit that enables reading JPEG images much faster than TJpegImage. Reading JPEGs is important for RVMedia because it is used in the following scenarios:
- When reading MJPEG streams (usually from IP cameras).
- When decoding data from local USB cameras that provide frames as JPEGs.
- In TRVCamReceiver, if TRVCamSender encodes frames as JPEGs (the default setting).
This unit can only be used in Delphi 32-bit VCL projects. It is not compatible with Lazarus or C++Builder, and RVMedia does not use it for FireMonkey projects.
I conducted some tests and found that the standard TJpegImage reads large JPEGs very fast in Win64 projects, but much slower in Win32 projects (at least, on my computer). Therefore, faster reading of JPEG images would be very useful. For example, on my computer, I was able to increase the FPS of a local camera in RVMedia with Fast Jpeg Decoder to the camera's maximum 30fps (frame size 1920x1080) from 7fps using TJpegImage.
Fast JPEG Decoder is open source, and RVMedia can use it under the MPL license. This license requires the distribution of the source code of
this unit with applications that use it. This is why it is not enabled by default (another reason is that it is not compatible with C++Builder, so it cannot be used in RVMedia packages that generate code for both Delphi and C++Builder).
To activate Fast JPEG Decoder, remove the dot from the line {.$DEFINE RVMUSEFASTJPEGDECODER} in Include\MRV_Defs.inc (a full source code version of RVMedia is required).
RVMedia's license has been updated to cover the use of Fast JPEG Decoder.