Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.
halleyzhao edited this page Oct 15, 2014 · 97 revisions

Yet Another Media Infrastructure.

It is YUMMY to your video experience on Linux like platform.

Yami is core building block for media solution. it parses video stream and decodes them leverage hardware acceleration. one usage is to encapsulate yami into openMAX component, to be used on Chromeos, Android or Linux (by gst-omx).

related links:

Coding style

  • we general follows WebKit coding style in C++ code (common/, vaapi/, decoder/, encoder/ and v4l2/, tests/): http://www.webkit.org/coding/coding-style.html
  • codecparsers keeps the existing style from gst
  • you can apply the style check by "cp pre-commit .git/hooks/"; it is applied after git commit. so you can check/accept/reject the suggest coding style after initial commit.

Code Review Process

  1. start work on libyami by 'fork' it to your home
  2. enable coding style check by: cp pre-commit .git/hooks/
    then follows by prompt.
  3. commit/push to your home's repo, test it on chromeos/ubuntu
  4. create 'pull requests'
  5. wait for other's review
  6. update your home's repo following feedbacks
    we recommend force update to avoid unnecessary commit history, your pull requests get update automatically.
  7. repeat the above two steps until no disagree
  8. you can integrate your patch (home repo) with the condition met:
  • 1+ member flags ok when patches are less than 50 lines.
  • 2+ members flag ok when patches are more than 50 lines
  • at least one work day passed after latest patch update
  1. integrate the patches manually (NOT the button on web page)
  • git push git@github.com/01org/libyami.git HEAD:master

we do not use the 'Merge pull request' button on web page, because:

  • it creates redundant commit log.
  • it creates unclear parent-child relation between commits when two merge requests basing on unique commit id.
  1. now, the pull request is automatically close on web page.

Build & Run

related git repos

  1. git clone git://anongit.freedesktop.org/vaapi/libva
  2. git clone git://anongit.freedesktop.org/vaapi/intel-driver
  3. git clone https://github.com/01org/libyami.git

environments:

  1. there is no special requirement to build libyami core library.
  2. if you want to build yami decode tests with texture-video support, additional EGL/GLES2 packages are required. (sudo apt-get install libgles2-mesa-dev libegl1-mesa-dev)

we don't find special requirement up to now

my sample build env

#!/bin/sh
export YAMI_ROOT_DIR="/opt/yami"

export VAAPI_PREFIX="${YAMI_ROOT_DIR}/vaapi"
export LIBYAMI_PREFIX="${YAMI_ROOT_DIR}/libyami"
ADD_PKG_CONFIG_PATH="${VAAPI_PREFIX}/lib/pkgconfig/:${LIBYAMI_PREFIX}/lib/pkgconfig/"
ADD_LD_LIBRARY_PATH="${VAAPI_PREFIX}/lib/:${LIBYAMI_PREFIX}/lib/"
ADD_PATH="${VAAPI_PREFIX}/bin/"

PLATFORM_ARCH_64=`uname -a | grep x86_64`
if [ -n "$PKG_CONFIG_PATH" ]; then
    export PKG_CONFIG_PATH="${ADD_PKG_CONFIG_PATH}:$PKG_CONFIG_PATH"
elif [ -n "$PLATFORM_ARCH_64" ]; then
    export PKG_CONFIG_PATH="${ADD_PKG_CONFIG_PATH}:/usr/lib/pkgconfig/:/usr/lib/i386-linux-gnu/pkgconfig/"
else 
    export PKG_CONFIG_PATH="${ADD_PKG_CONFIG_PATH}:/usr/lib/pkgconfig/:/usr/lib/x86_64-linux-gnu/pkgconfig/"
fi

export LD_LIBRARY_PATH="${ADD_LD_LIBRARY_PATH}:$LD_LIBRARY_PATH"

export PATH="${ADD_PATH}:$PATH"

echo "*======================current configuration============================="
echo "* VAAPI_PREFIX:               $VAAPI_PREFIX"
echo "* LIBYAMI_PREFIX:             ${LIBYAMI_PREFIX}"
echo "* LD_LIBRARY_PATH:            ${LD_LIBRARY_PATH}"
echo "* PATH:                       $PATH"
echo "*========================================================================="

echo "* vaapi:      git clean -dxf && ./autogen.sh --prefix=\$VAAPI_PREFIX && make -j8 && make install"
echo "* libyami:    git clean -dxf && ./autogen.sh --prefix=\$LIBYAMI_PREFIX --enable-tests --enable-tests-gles && make -j8 && make install"

run the unit test

  • video playback

     ./decode -i test.h264 [-m 0/1/2/3/4]
    
  • h264 encoder

     ./h264encode -i raw.yuv -s IYUV -W width_value -H height_value -c AVC -o out.h264
     ./h264encode -i /home/halley/media/video/raw/bear_320x192_40frames.yuv -s IYUV -W 320 -H 192 -c AVC -o out.h264
    
  • encode with camera

     ./h264encode -i /dev/video0 -s YUY2 -W 640 -H 480 -c AVC -o out.h264
    

Quick Links

in progress features

  1. VP8 encoder
  2. V4L2 wrapper for yami

TODO

  • unify encode input frame and decode output frame; they can be unique and should be unique (transcoding)
  • jpegenc & test
  • test for: camera + jpegdec; camera+jpegdec+h264enc
  • coded buffer pool, support mmap of coded data
  • h264 decode optimization to avoid scan start code again for nalu input (use VideoDecodeBuffer.flag to indicate buffer type)
  • get hw aligned width/height after start()
  • B frame h264 encoder support
  • dma_buf support for encode input
  • try to use yami in ffmpeg
  • move copyRawFrameData to yami
  • vp9 decoder
  • h265 decoder
  • legacy codec: mpeg2 decoder/encoder, vc1 decoder, mpeg4/h263 decoder/encoder
  • vasink on ubuntu

supported feature

  • decode: h264, vp8, jpeg
  • encode: h264
  • pure C language interface, both API and data structure
  • va drm backend support. (in chrome v4l2vda/vea, there is no X display)
  • test: h264/vp8/jpeg decode test; h264 encode test; c-api decoder/encoder test; v4l2 encoder test
  • support camera input for encode test
  • EGLImage support for decoded surface: getImage with RGBX first, then multiple-eglImage support
  • more fourcc/format support for encode input frame

Clone this wiki locally