library for Maxim MG1264 Crusher hardware H.264 encoder (beta)

This is a home page of crusher264 library, based on the reverse-engineered turbo.264/RDX-160-EF Crusher and CrusherCapture H264 Encoder stick. It created to implement linux driver for Maxim's MG1264/MG3500 chips.

Hardware:

Supported features:

  1. H264 Baseline profile (I & P frames only).
  2. Bitrate, framerate, width, height regulation.
  3. Gop size set.
  4. RC buffer size set.
  5. Deblocking filter flag (+alpha & beta values).
  6. Flag to create new gop on scene change.
  7. Real-time (or faster) conversion up to 640x480.
  8. Max image dimensions: 768x576.

News:

NEWS 2009-27-10:

  • previous code fully rewritten and publically released as crusher264
  • patch for ffmpeg added

Downloads:

crusher264-1.0.0.tar.gz (bzr branch)

ffmpeg-patch

Installation:

$ tar -xvzf  crusher264-1.0.0.tar.gz
$ cd crusher264-1.0.0/firmware
$ wget http://tipok.org.ua/downloads/hardware/crusher264/firmware/FX2Firmware.hex
$ wget http://tipok.org.ua/downloads/hardware/crusher264/firmware/qmmapp.seve1-...
$ cd ..
$ ./configure
$ make
$ sudo make install

 

FFmpeg patching:

(after installing crusher264)

$ git clone git://git.ffmpeg.org/ffmpeg/
$ cd ffmpeg
$ git clone git://git.ffmpeg.org/libswscale/
$ wget http://tipok.org.ua/downloads/hardware/crusher264/patch/libcrusher264.patch
$ patch -p1 < libcrusher264.patch
$ ./configure --enable-gpl --enable-libcrusher264
$ make
$ sudo make install

 

Usage:

Here we using patched ffmpeg:

$ ffmpeg -flags +loop -i test.mpg -f h264 -vcodec libcrusher264 -an -deinterlace -g 25 -sc_threshold 1 -b 1800k -s 720x576 -y test.h264
$ ffmpeg -flags +loop -i test.mpg -f mpegts -vcodec libcrusher264 -an -deinterlace -g 25 -sc_threshold 1 -b 600k -s 640x480 -y test.ts
$ ffmpeg -async 1 -flags +loop -i udp://239.102.1.2:5004 -f mpegts -vcodec libcrusher264 -acodec mp2 -ab 128k -deinterlace -g 25 \
> -sc_threshold 1 -b 500k -s 320x240 -y test.ts

Or use stand-alone application to encode uncompressed raw video (but first create it):

$ ffmpeg -i test.mpg -f rawvideo -an -deinterlace -s 720x576 -pix_fmt yuv420p -y test720x576.yuv
$ sample/crusher264 -i test720x576.yuv -s 720x576 -b 1500000 -o test.h264

TODO:

  1. Fix bug with codec hot-starting.
  2. Add pthreads flag to increase ffmpeg encoding speed (this is due long time, needed to sending uncompressed video over USB).
  3. Add SPS/PPS extradata extraction to ffmpeg patch (this needs to creating mp4 files).
  4. Add CrusherCapture support (Blackmagic Video recorder).
  5. Add MG3500 (H.264 HD Encoder) Support.
  6. Move some parts of code into v4l driver.

  More Info:

Crusher reference design consists from this IC's: