Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (32)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

  • Soumettre améliorations et plugins supplémentaires

    10 avril 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

Sur d’autres sites (6121)

  • Image to MPEG on Linux works, same code on Android = green video

    27 novembre 2014, par JScoobyCed

    EDIT
    I have check the execution and found that the error is not (yet) at the swscale point. My current issue is that the JPG image is not found :
    No such file or directory
    when doing the avformat_open_input(&pFormatCtx, imageFileName, NULL, NULL);
    Before you tell me I need to register anything, I can tell I already did (I updated the code below).
    I also added the Android permission to access the external storage (I don’t think it is related to Android since I can already write to the /mnt/sdcard/ where the image is also located)
    END EDIT

    I have been through several tutorials (including the few posted from SO, i.e. http://dranger.com/ffmpeg/, how to compile ffmpeg for Android...,been through dolphin-player source code). Here is what I have :
    . Compiled ffmpeg for android
    . Ran basic tutorials using NDK to create a dummy video on my android device
    . been able to generate a MPEG2 video from images on Ubuntu using a modified version of dummy video code above and a lot of Googling
    . running the new code on Android device gives a green screen video (duration 1 sec whatever the number of frames I encode)

    I saw another post about iPhone in a similar situation that mentioned the ARM processor optimization could be the culprit. I tried a few ldextra-flags (-arch armv7-a and similar) to no success.

    I include at the end the code that loads the image. Is there something different to do on Android than on linux ? Is my ffmpeg build not correct for Android video encoding ?

    void copyFrame(AVCodecContext *destContext, AVFrame* dest,
               AVCodecContext *srcContext, AVFrame* source) {
    struct SwsContext *swsContext;
    swsContext = sws_getContext(srcContext->width, srcContext->height, srcContext->pix_fmt,
                   destContext->width, destContext->height, destContext->pix_fmt,
                   SWS_FAST_BILINEAR, NULL, NULL, NULL);
    sws_scale(swsContext, source->data, source->linesize, 0, srcContext->height, dest->data, dest->linesize);
    sws_freeContext(swsContext);
    }

    int loadFromFile(const char* imageFileName, AVFrame* realPicture, AVCodecContext* videoContext) {
    AVFormatContext *pFormatCtx = NULL;
    avcodec_register_all();
    av_register_all();

    int ret = avformat_open_input(&pFormatCtx, imageFileName, NULL, NULL);
    if (ret != 0) {
       // ERROR hapening here
       // Can't open image file. Use strerror(AVERROR(ret))) for details
       return ERR_CANNOT_OPEN_IMAGE;
    }

    AVCodecContext *pCodecCtx;

    pCodecCtx = pFormatCtx->streams[0]->codec;
    pCodecCtx->width = W_VIDEO;
    pCodecCtx->height = H_VIDEO;
    pCodecCtx->pix_fmt = PIX_FMT_YUV420P;

    // Find the decoder for the video stream
    AVCodec *pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
    if (!pCodec) {
       // Codec not found
       return ERR_CODEC_NOT_FOUND;
    }

    // Open codec
    if (avcodec_open(pCodecCtx, pCodec) < 0) {
       // Could not open codec
       return ERR_CANNOT_OPEN_CODEC;
    }

    //
    AVFrame *pFrame;

    pFrame = avcodec_alloc_frame();

    if (!pFrame) {
       // Can't allocate memory for AVFrame
       return ERR_CANNOT_ALLOC_MEM;
    }

    int frameFinished;
    int numBytes;

    // Determine required buffer size and allocate buffer
    numBytes = avpicture_get_size(PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height);
    uint8_t *buffer = (uint8_t *) av_malloc(numBytes * sizeof (uint8_t));

    avpicture_fill((AVPicture *) pFrame, buffer, PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height);
    AVPacket packet;
    int res = 0;
    while (av_read_frame(pFormatCtx, &packet) >= 0) {
       if (packet.stream_index != 0)
           continue;

       ret = avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);
       if (ret > 0) {
           // now, load the useful info into realPicture
           copyFrame(videoContext, realPicture, pCodecCtx, pFrame);
           // Free the packet that was allocated by av_read_frame
           av_free_packet(&packet);
           return 0;
       } else {
           // Error decoding frame. Use strerror(AVERROR(ret))) for details
           res = ERR_DECODE_FRAME;
       }
    }
    av_free(pFrame);

    // close codec
    avcodec_close(pCodecCtx);

    // Close the image file
    av_close_input_file(pFormatCtx);

    return res;
    }

    Some ./configure options :
    --extra-cflags="-O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 -mfloat-abi=softfp -mfpu=vfp -marm -march=armv7-a -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"

    --extra-ldflags="-Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib -lc -lm -ldl -llog"

    --arch=armv7-a --enable-armv5te --enable-armv6 --enable-armvfp --enable-memalign-hack

  • Opencv crosscompile with ffmpeg and other 3rdparty for arm board

    16 juin 2017, par Little Tooth

    After buliding Qt5.5.1 for my arm board sucessfully, I am taking up to crosscompile opencv. Here are the steps :

    First, I crosscompile 3rdparty :

    a.libz

    lmk@lmk-virtual-machine:/home/newdisk$ sudo tar -zvxf zlib-1.2.8.tar.gz
    lmk@lmk-virtual-machine:/home/newdisk$ cd zlib-1.2.8
    lmk@lmk-virtual-machine:/home/newdisk/zlib-1.2.8$ sudo ./configure --prefix=/home/newdisk/optnew/opencv-rely -shared
    lmk@lmk-virtual-machine:/home/newdisk/zlib-1.2.8$ sudo vi Makefile

    and etit Makefile in some details :

    #Makefile
    CC=/home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-gcc
    LDSHARED= /home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map
    AR=/home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-ar
    RANLIB=arm-linux-ranlib

    the last step is run make and make install :

    lmk@lmk-virtual-machine:/home/newdisk/zlib-1.2.8$ sudo make
    lmk@lmk-virtual-machine:/home/newdisk/zlib-1.2.8$ sudo make install

    b.libjpeg

    lmk@lmk-virtual-machine:/home/newdisk$ sudo tar -zvxf jpegsrc.v9.tar.gz
    lmk@lmk-virtual-machine:/home/newdisk$ cd jpeg-9
    lmk@lmk-virtual-machine:/home/newdisk/jpeg-9$ sudo CC=/home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-gcc ./configure --host=arm-linux --prefix=/home/newdisk/optnew/opencv-rely --enable-shared --enable-static
    lmk@lmk-virtual-machine:/home/newdisk/jpeg-9$ sudo make
    lmk@lmk-virtual-machine:/home/newdisk/jpeg-9$ sudo make install

    c.libpng

    lmk@lmk-virtual-machine:/home/newdisk$ sudo xz -d libpng-1.6.29.tar.xz
    lmk@lmk-virtual-machine:/home/newdisk$ sudo tar -xvf libpng-1.6.29.tar
    lmk@lmk-virtual-machine:/home/newdisk$ cd libpng-1.6.29
    lmk@lmk-virtual-machine:/home/newdisk/libpng-1.6.29$ sudo CC=/home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-gcc ./configure --host=arm-linux --prefix=/home/newdisk/optnew/opencv-rely --enable-shared --enable-static
    lmk@lmk-virtual-machine:/home/newdisk/libpng-1.6.29$ sudo make
    lmk@lmk-virtual-machine:/home/newdisk/libpng-1.6.29$ sudo make install

    d.yasm

    lmk@lmk-virtual-machine:/home/newdisk$ sudo tar -zvxf yasm-1.3.0.tar.gz
    lmk@lmk-virtual-machine:/home/newdisk$ cd yasm-1.3.0
    lmk@lmk-virtual-machine:/home/newdisk/yasm-1.3.0$ sudo CC=/home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-gcc ./configure --prefix=/home/newdisk/optnew/opencv-rely --host=arm-linux
    lmk@lmk-virtual-machine:/home/newdisk/yasm-1.3.0$ sudo make
    lmk@lmk-virtual-machine:/home/newdisk/yasm-1.3.0$ sudo make install

    e.libx264

    lmk@lmk-virtual-machine:/home/newdisk$ sudo tar -jxvf last_x264.tar.bz2
    lmk@lmk-virtual-machine:/home/newdisk$ cd x264-snapshot-20170612-2245
    lmk@lmk-virtual-machine:/home/newdisk/x264-snapshot-20170612-2245$ sudo CC=/home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-gcc ./configure --enable-shared --host=arm-linux --disable-asm --prefix=/home/newdisk/optnew/opencv-rely
    lmk@lmk-virtual-machine:/home/newdisk/x264-snapshot-20170612-2245$ sudo make
    lmk@lmk-virtual-machine:/home/newdisk/x264-snapshot-20170612-2245$ sudo make install

    f.libxvid

    lmk@lmk-virtual-machine:/home/newdisk$ cd xvidcore-1.3.3
    lmk@lmk-virtual-machine:/home/newdisk/xvidcore-1.3.3$ cd build/generic
    lmk@lmk-virtual-machine:/home/newdisk/xvidcore-1.3.3/build/generic$ sudo CC=/home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-gcc ./configure --prefix=/home/newdisk/optnew/opencv-rely --host=arm-linux  --disable-assembly
    lmk@lmk-virtual-machine:/home/newdisk/xvidcore-1.3.3/build/generic$ sudo make
    lmk@lmk-virtual-machine:/home/newdisk/xvidcore-1.3.3/build/generic$ sudo make install

    g.ffmpeg

    lmk@lmk-virtual-machine:/home/newdisk$ sudo tar -jvxf ffmpeg-3.3.2.tar.bz2
    lmk@lmk-virtual-machine:/home/newdisk$ cd ffmpeg-3.3.2
    lmk@lmk-virtual-machine:/home/newdisk/ffmpeg-3.3.2$
    sudo ./configure --prefix=/home/newdisk/optnew/opencv-rely --enable-shared --disable-static --enable-gpl --enable-cross-compile  --arch=arm --disable-stripping --target-os=linux --enable-libx264 --enable-libxvid --cc=/home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-gcc --enable-swscale --extra-ldflags=-L/home/newdisk/optnew/opencv-rely/lib --extra-cflags=-I/home/newdisk/optnew/opencv-rely/include
    lmk@lmk-virtual-machine:/home/newdisk/ffmpeg-3.3.2$ sudo make
    lmk@lmk-virtual-machine:/home/newdisk/ffmpeg-3.3.2$ sudo make install

    There is no problem in 3rdparty crosscompile.
    Next, opencv crosscompile :

    lmk@lmk-virtual-machine:/home/newdisk$ sudo unzip opencv-3.1.0.zip
    lmk@lmk-virtual-machine:/home/newdisk$ cd opencv-3.1.0
    lmk@lmk-virtual-machine:/home/newdisk/opencv-3.1.0$ sudo mkdir BuildOpencv
    lmk@lmk-virtual-machine:/home/newdisk/opencv-3.1.0$ cd BuildOpencv
    lmk@lmk-virtual-machine:/home/newdisk/opencv-3.1.0/BuildOpencv$ sudo vim toolchain.cmake
    #toolchain.cmake
    ###########user defined#############
    set( CMAKE_SYSTEM_NAME Linux )
    set( CMAKE_SYSTEM_PROCESSOR arm )
    set( CMAKE_C_COMPILER /home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-gcc )
    set( CMAKE_CXX_COMPILER /home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-g++ )
    ###########user defined#############
    set( CMAKE_FIND_ROOT_PATH /home/newdisk/optnew/opencv-rely)
    set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
    set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
    set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
    ######################################

    Then I run cmake :

    lmk@lmk-virtual-machine:/home/newdisk/opencv-3.1.0/BuildOpencv$ sudo cmake -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake ../

    Here is the result:

    -- Detected version of GNU GCC: 45 (405)
    -- Found ZLIB: /home/newdisk/optnew/opencv-rely/lib/libz.so (found suitable version "1.2.8", minimum required is "1.2.3")
    -- Could NOT find TIFF (missing:  TIFF_LIBRARY TIFF_INCLUDE_DIR)
    -- Could NOT find Jasper (missing:  JASPER_LIBRARIES) (found version "1.900.1")
    -- Found ZLIB: /home/newdisk/optnew/opencv-rely/lib/libz.so (found version "1.2.8")
    -- checking for module 'gtk+-3.0'
    --   package 'gtk+-3.0' not found
    -- checking for module 'gstreamer-base-1.0'
    --   package 'gstreamer-base-1.0' not found
    -- checking for module 'gstreamer-video-1.0'
    --   package 'gstreamer-video-1.0' not found
    -- checking for module 'gstreamer-app-1.0'
    --   package 'gstreamer-app-1.0' not found
    -- checking for module 'gstreamer-riff-1.0'
    --   package 'gstreamer-riff-1.0' not found
    -- checking for module 'gstreamer-pbutils-1.0'
    --   package 'gstreamer-pbutils-1.0' not found
    -- checking for module 'gstreamer-base-0.10'
    --   package 'gstreamer-base-0.10' not found
    -- checking for module 'gstreamer-video-0.10'
    --   package 'gstreamer-video-0.10' not found
    -- checking for module 'gstreamer-app-0.10'
    --   package 'gstreamer-app-0.10' not found
    -- checking for module 'gstreamer-riff-0.10'
    --   package 'gstreamer-riff-0.10' not found
    -- checking for module 'gstreamer-pbutils-0.10'
    --   package 'gstreamer-pbutils-0.10' not found
    -- Looking for linux/videodev.h
    -- Looking for linux/videodev.h - found
    -- Looking for linux/videodev2.h
    -- Looking for linux/videodev2.h - found
    -- Looking for sys/videoio.h
    -- Looking for sys/videoio.h - not found
    -- checking for module 'libavresample'
    --   package 'libavresample' not found
    -- Looking for libavformat/avformat.h
    -- Looking for libavformat/avformat.h - not found
    -- Looking for ffmpeg/avformat.h
    -- Looking for ffmpeg/avformat.h - not found
    -- checking for module 'libgphoto2'
    --   package 'libgphoto2' not found
    -- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
    -- To enable PlantUML support, set PLANTUML_JAR environment variable or pass -DPLANTUML_JAR=<filepath> option to cmake
    -- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.6", minimum required is "2.7")
    -- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES) (found suitable version "2.7.6", minimum required is "2.7")
    -- Cannot probe for Python/Numpy support (because we are cross-compiling OpenCV)
    -- If you want to enable Python/Numpy support, set the following variables:
    --   PYTHON2_INCLUDE_PATH
    --   PYTHON2_LIBRARIES
    --   PYTHON2_NUMPY_INCLUDE_DIRS
    --   PYTHON3_INCLUDE_PATH
    --   PYTHON3_LIBRARIES
    --   PYTHON3_NUMPY_INCLUDE_DIRS
    -- Found PythonInterp: /usr/bin/python3.4 (found suitable version "3.4.3", minimum required is "3.4")
    -- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES) (Required is at least version "3.4")
    -- Cannot probe for Python/Numpy support (because we are cross-compiling OpenCV)
    -- If you want to enable Python/Numpy support, set the following variables:
    --   PYTHON2_INCLUDE_PATH
    --   PYTHON2_LIBRARIES
    --   PYTHON2_NUMPY_INCLUDE_DIRS
    --   PYTHON3_INCLUDE_PATH
    --   PYTHON3_LIBRARIES
    --   PYTHON3_NUMPY_INCLUDE_DIRS
    -- Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
    -- Could NOT find Matlab (missing:  MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)
    --
    -- General configuration for OpenCV 3.1.0
    =====================================
    --   Version control:               unknown
    --
    --   Platform:
    --     Host:                        Linux 3.16.0-77-generic i686
    --     Target:                      Linux arm
    --     CMake:                       2.8.12.2
    --     CMake generator:             Unix Makefiles
    --     CMake build tool:            /usr/bin/make
    --     Configuration:               Release
    --
    --   C/C++:
    --     Built as dynamic libs?:      YES
    --     C++ Compiler:                /home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-g++  (ver 4.5.1)
    --     C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    --     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    --     C Compiler:                  /home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-gcc
    --     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    --     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    --     Linker flags (Release):      
    --     Linker flags (Debug):        
    --     Precompiled headers:         YES
    --     Extra dependencies:          /home/newdisk/optnew/opencv-rely/lib/libjpeg.so /home/newdisk/optnew/opencv-rely/lib/libpng.so /home/newdisk/optnew/opencv-rely/lib/libz.so gtk-x11-2.0 gdk-x11-2.0 atk-1.0 gio-2.0 pangoft2-1.0 pangocairo-1.0 gdk_pixbuf-2.0 cairo pango-1.0 fontconfig gobject-2.0 freetype gthread-2.0 glib-2.0 dc1394 v4l1 v4l2 avcodec avformat avutil swscale dl m pthread rt
    --     3rdparty dependencies:       libwebp libtiff libjasper IlmImf
    --
    --   OpenCV modules:
    --     To be built:                 core flann imgproc ml photo video imgcodecs shape videoio highgui objdetect superres ts features2d calib3d stitching videostab
    --     Disabled:                    world
    --     Disabled by dependency:      -
    --     Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 viz
    --
    --   GUI:
    --     QT:                          NO
    --     GTK+ 2.x:                    YES (ver 2.24.23)
    --     GThread :                    YES (ver 2.40.2)
    --     GtkGlExt:                    NO
    --     OpenGL support:              NO
    --     VTK support:                 NO
    --
    --   Media I/O:
    --     ZLib:                        /home/newdisk/optnew/opencv-rely/lib/libz.so (ver 1.2.8)
    --     JPEG:                        /home/newdisk/optnew/opencv-rely/lib/libjpeg.so (ver 90)
    --     WEBP:                        build (ver 0.3.1)
    --     PNG:                         /home/newdisk/optnew/opencv-rely/lib/libpng.so (ver 1.6.29)
    --     TIFF:                        build (ver 42 - 4.0.2)
    --     JPEG 2000:                   build (ver 1.900.1)
    --     OpenEXR:                     build (ver 1.7.1)
    --     GDAL:                        NO
    --
    --   Video I/O:
    --     DC1394 1.x:                  NO
    --     DC1394 2.x:                  YES (ver 2.2.1)
    --     FFMPEG:                      YES
    --       codec:                     YES (ver 54.35.1)
    --       format:                    YES (ver 54.20.4)
    --       util:                      YES (ver 52.3.0)
    --       swscale:                   YES (ver 2.1.1)
    --       resample:                  NO
    --       gentoo-style:              YES
    --     GStreamer:                   NO
    --     OpenNI:                      NO
    --     OpenNI PrimeSensor Modules:  NO
    --     OpenNI2:                     NO
    --     PvAPI:                       NO
    --     GigEVisionSDK:               NO
    --     UniCap:                      NO
    --     UniCap ucil:                 NO
    --     V4L/V4L2:                    Using libv4l1 (ver 0.8.8) / libv4l2 (ver 0.8.8)
    --     XIMEA:                       NO
    --     Xine:                        NO
    --     gPhoto2:                     NO
    --
    --   Parallel framework:            pthreads
    --
    --   Other third-party libraries:
    --     Use IPP:                     NO
    --     Use VA:                      NO
    --     Use Intel VA-API/OpenCL:     NO
    --     Use Eigen:                   NO
    --     Use Cuda:                    NO
    --     Use OpenCL:                  YES
    --     Use custom HAL:              NO
    --
    --   OpenCL:
    --     Version:                     dynamic
    --     Include path:                /home/newdisk/opencv-3.1.0/3rdparty/include/opencl/1.2
    --     Use AMDFFT:                  NO
    --      Use AMDBLAS:                 NO
    --
    --   Python 2:
    --     Interpreter:                 /usr/bin/python2.7 (ver 2.7.6)
    --
    --   Python 3:
    --     Interpreter:                 /usr/bin/python3.4 (ver 3.4.3)
    --
    --   Python (for build):            /usr/bin/python2.7
    --
    --   Java:
    --     ant:                         NO
    --     JNI:                         NO
    --     Java wrappers:               NO
    --     Java tests:                  NO
    --
    --   Matlab:                        Matlab not found or implicitly disabled
    --
    --   Documentation:
    --     Doxygen:                     NO
    --     PlantUML:                    NO
    --
    --   Tests and samples:
    --     Tests:                       YES
    --     Performance tests:           YES
    --     C/C++ Examples:              NO
    --
    --   Install path:                  /home/newdisk/opencv-3.1.0/BuildOpencv/install
    --
    --   cvconfig.h is in:              /home/newdisk/opencv-3.1.0/BuildOpencv
    -- -----------------------------------------------------------------
    --
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/newdisk/opencv-3.1.0/BuildOpencv
    </filepath>

    After configuring and generating, run cmake-gui :

    lmk@lmk-virtual-machine:/home/newdisk/opencv-3.1.0/BuildOpencv$ sudo cmake-gui

    Src:/home/newdisk/opencv-3.1.0
    Build:/home/newdisk/opencv-3.1.0/BuildOpencv

    CMAKE_INSTALL_PREFIX:/home/newdisk/optnew/opencv-arm

    Don't choose these items:
    WITH_CUDA
    WITH_GTK
    WITH_1394
    WITH_GSTREAMER
    WITH_LIBV4L
    WITH_TIFF
    BUILD_OPENEXR
    WITH_OPENEXR
    WITH_OPENCL

    Configure and generate.

    lmk@lmk-virtual-machine:/home/newdisk/opencv-3.1.0/BuildOpencv$ sudo vi CMakeCache.txt
    #CMakeCache.txt
    //Flags used by the linker.
    CMAKE_EXE_LINKER_FLAGS:STRING=-lpthread -lrt

    lmk@lmk-virtual-machine:/home/newdisk/opencv-3.1.0/BuildOpencv$ sudo make

    Fianlly,I got these errors :

    [ 27%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_decoder.cpp.o
    [ 27%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_v4l.cpp.o
    [ 27%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o
    In file included from /home/newdisk/opencv-3.1.0/modules/videoio/src/cap_ffmpeg_impl.hpp:65:0,
                from /home/newdisk/opencv-3.1.0/modules/videoio/src/cap_ffmpeg.cpp:45:
    /home/newdisk/opencv-3.1.0/modules/videoio/src/ffmpeg_codecs.hpp:77:36: fatal error: libavformat/avformat.h: No such file or directory
    compilation terminated.
    make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o] Error 1
    make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
    make: *** [all] Error 2

    While the file libavformat/avformat.h does exits in my directory
    /home/newdisk/optnew/opencv-rely/include

    Why can cmake find lib directory

    -- Found ZLIB: /home/newdisk/optnew/opencv-rely/lib/libz.so (found suitable version "1.2.8", minimum required is "1.2.3")

    but cannot find include directory ?

    /home/newdisk/optnew/opencv-rely/include

    Do you have any idea ?

  • How to capture image from Imaging device using FFmpeg on Windows7

    8 juin 2017, par Amol

    I am trying to capture an image from Imaging device using FFmpeg command line tool on windows platform, but no way found to do this using FFmpeg.

    I am using following :

    • Version of FFmpeg : ffmpeg-3.3.1-win32-static
    • O/S : Windows7 32 bit
    • Imaging device : QP0204 USB

    Any help would be appreciated.