Giter Club home page Giter Club logo

icamerasrc's Introduction

#
#  GStreamer
#  Copyright (C) 2016-2017 Intel Corporation
#
#  Permission is hereby granted, free of charge, to any person obtaining a
#  copy of this software and associated documentation files (the "Software"),
#  to deal in the Software without restriction, including without limitation
#  the rights to use, copy, modify, merge, publish, distribute, sublicense,
#  and/or sell copies of the Software, and to permit persons to whom the
#  Software is furnished to do so, subject to the following conditions:
#
#  The above copyright notice and this permission notice shall be included in
#  all copies or substantial portions of the Software.
#
#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
#  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
#  DEALINGS IN THE SOFTWARE.
#
#  Alternatively, the contents of this file may be used under the
#  GNU Lesser General Public License Version 2.1 (the "LGPL"), in
#  which case the following provisions apply instead of the ones
#  mentioned above:
#
#  This library is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Library General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  This library is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Library General Public License for more details.
#
#  You should have received a copy of the GNU Library General Public
#  License along with this library; if not, write to the
#  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
#  Boston, MA 02111-1307, USA.
#

User Guide
        1. Setup environment
        2. Configure icamerasrc
        3. Build icamerasrc with Makefile
        4. Build and install icamerasrc RPM
        5. Run Gstreamer pipeline with icamerasrc

Important Notes:
    1. The icamerasrc can't be compiled without some dependancy packages
    2. Please get the dependacy packages from your correct contacts.
        See "Prerequisite packages:" for more information.
    3. Match the "RPM" with the source code in this repo.
        For example, this is the commit message.
            Update for 17WW23 release
            Release for 17WW23: icamerasrc-1.0.0-912.9fb2898.x86_64.rpm
        It means the code of this commit match the RPM release of "9fb2898".
        So if your RPM is "9fb2898", you can use this commit code to build.

Setup environment
=============

    System requirements:
        Ubuntu 14.04 or 16.04
        glib-2.0
        gobject-2.0
        gstreamer-1.0(Version 1.7.9 is preferred)
        autoconf
        libtool

    Prerequisite packages:
        aiqb
        libiaaiq
        libiacss
        libcamhal

    Install prerequisite prerequisite packages:
        sudo rpm -ivh *.rpm --nodeps

    Source toolchain:
        source <abs path of your toolchain script>

Configure icamerasrc
=============

        autoreconf --install

    Strongly recommend to assign location to 'LIBCAMHAL_INSTALL_DIR' and 'ICAMERASRC_INSTALL_DIR',
    otherwise icamerasrc will find header files and libs of libcamhal in default location:
        "/usr/include" and  "/usr/lib"
    which might be unsafe locations for certain toolchain that cause configure failure.
    (e.g. export LIBCAMHAL_INSTALL_DIR=<abs_path>/libcamhal,
     the subdirectory of $LIBCAMHAL_INSTALL_DIR should be including:
      1.include/
      2.include/api
      3.include/utils
      4.include/lib)

    then start configuring:
        CPPFLAGS="-I$LIBCAMHAL_INSTALL_DIR/include/ -I$LIBCAMHAL_INSTALL_DIR/include/api -I$LIBCAMHAL_INSTALL_DIR/include/utils " LDFLAGS="-L$LIBCAMHAL_INSTALL_DIR/lib/" CFLAGS="-O2" CXXFLAGS="-O2" ./configure ${CONFIGURE_FLAGS} --prefix=$ICAMERASRC_INSTALL_DIR DEFAULT_CAMERA=0

Build icamerasrc with Makefile
=============

        make clean

        make -j

        sudo make install

Build and install icamerasrc RPM
=============

    This step is taken after building successed

    Build RPM:
        make rpm (RPM package is generated in rpm/)

    Install RPM:
        rpm -ivh icamerasrc-*.rpm

Run Gstreamer pipeline with icamerasrc
=============

    To capture from tpg @YUYV_1080p:
        gst-launch-1.0 icamerasrc device-name=tpg ! video/x-raw,format=YUY2,width=1920,height=1080 ! vaapipostproc ! vaapisink

    To capture from mondello @UYVY_1080p:
        gst-launch-1.0 icamerasrc device-name=mondello ! video/x-raw,format=UYVY,width=1080,height=1080 ! vaapipostproc ! vaapisink

    To capture from mondello @UYVY_1080i:
        gst-launch-1.0 icamerasrc device-name=mondello interlace-mode=alternate deinterlace_method=sw_bob ! video/x-raw,format=UYVY,width=1920,height=1080 ! vaapipostproc ! vaapisink

    To capture from imx185 @NV12_1080p:
        gst-launch-1.0 icamerasrc device-name=imx185 ! video/x-raw,format=NV12,width=1920,height=1080 ! vaapipostproc ! vaapisink

    To capture from Dual mondello @UYVY_1080P + @UYVY_720p:
        gst-launch-1.0 icamerasrc device-name=mondello ! video/x-raw,format=UYVY,width=1920,height=1080 ! filesink location=stream1_1080p \
                       icamerasrc device-name=mondello-2 ! video/x-raw,format=UYVY,width=1280,height=720 ! filesink location=stream2_720p

    To capture from Virtual Channel @UYVY_1080P + @UYVY_720P + @UYVY_576p + @UYVY_640x480p
        gst-launch-1.0 icamerasrc num-vc=4 device-name=aggregator ! video/x-raw,format=UYVY,width=1920,height=1080 ! filesink location=stream1_1080p \
                       icamerasrc num-vc=4 device-name=aggregator-2 ! video/x-raw,format=UYVY,width=1280,height=720 ! filesink location=stream2_720p \
                       icamerasrc num-vc=4 device-name=aggregator-3 ! video/x-raw,format=UYVY,width=720,height=576 ! filesink location=stream3_576p \
                       icamerasrc num-vc=4 device-name=aggregator-4 ! video/x-raw,format=UYVY,width=640,height=480 ! filesink location=stream4_vga

    To capture from multi-stream(start multiple streams with one sensor) @NV12_1080p + @NV12_1080p
        gst-launch-1.0 icamerasrc device-name=imx185 name=t t.src ! queue ! video/x-raw,format=NV12,width=1920,height=1080 ! vaapipostproc ! vaapisink \
                                                     t.video ! queue ! video/x-raw,format=NV12,width=1920,height=1080 ! vaapipostproc ! vaapisink

icamerasrc's People

Contributors

ghu3 avatar mengwei-intel avatar mengweix1 avatar wli58 avatar zhuhaiyang avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

caoxi0820 xhaihao

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.