Recherche avancée

Médias (0)

Mot : - Tags -/protocoles

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

Autres articles (70)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (4849)

  • Running ffmpeg command on Android results in "Unable to find a suitable output format for ' -map 0:v:0 -map 1:a:0'"

    5 juin 2017, par Akash Dubey

    I am using this command for replacing audio of video and genrate new video having new audio. Here file1 is my video.mp4, file2 is my audio.mp3 and output would be the output.mp4 :

    complexCommand = new String[]{"-y", "-i", file1.toString(), "-i", file2.toString(), "-c", "copy", " -map 0:v:0 -map 1:a:0", rootPath + "/output.mp4"};

    Below is My code :

       private void changeAudioofVideo(String selectedUri, String videoPath) {

       String[] complexCommand;


       File f = new File("/storage/emulated/0");
       if (!f.getParentFile().exists())
           f.getParentFile().mkdirs();
       if (!f.exists())
           try {
               f.createNewFile();
           } catch (IOException e) {
               e.printStackTrace();
           }

       file1 = new File(videoPath);
       if (file1.exists()) {
           Log.d("yes", "File 1 exists");
       } else {
           Log.d("no", "File 1 not exists");
       }

       file2 = new File(selectedUri);
       if (file2.exists()) {
           Log.d("yes", "File 1 exists");
       } else {
           Log.d("no", "File 1 not exists");
       }

       String rootPath = f.getPath();

       complexCommand = new String[]{"-y", "-i", file1.toString(), "-i", file2.toString(), "-c", "copy", " -map 0:v:0 -map 1:a:0", rootPath + "/output.mp4"};

       FFmpeg ffmpeg = FFmpeg.getInstance(this);

       try {
           //Load the binary
           ffmpeg.loadBinary(new LoadBinaryResponseHandler() {

               @Override
               public void onStart() {
               }

               @Override
               public void onFailure() {
               }

               @Override
               public void onSuccess() {
               }

               @Override
               public void onFinish() {
               }
           });
       } catch (FFmpegNotSupportedException e) {
           // Handle if FFmpeg is not supported by device
           Toast.makeText(getApplicationContext(), "Not Supported by Device", Toast.LENGTH_LONG).show();
       }

       try {

           final String finalRootPath = rootPath;
           ffmpeg.execute(complexCommand, new FFmpegExecuteResponseHandler() {
               @Override
               public void onSuccess(String message) {
                   Log.d("Success", message);

                   Toast.makeText(getApplicationContext(), "Successful" + finalRootPath.toString(), Toast.LENGTH_LONG).show();
                   Uri path = Uri.parse(finalRootPath + "/output.mp4");
                   playVideo(path.toString());

               }

               @Override
               public void onProgress(String message) {
                   Log.d("progress", message);
                   pd.show();
               }

               @Override
               public void onFailure(String message) {
                   Log.d("failure", message);
                   pd.dismiss();

               }

               @Override
               public void onStart() {
                   Log.d("Start", "merge started");
               }

               @Override
               public void onFinish() {
                   Log.d("finish", "merge finish");
                   pd.dismiss();
               }
           });
       } catch (FFmpegCommandAlreadyRunningException e) {
           e.printStackTrace();
       }


      }

    Below is my output :

      05-26 18:39:35.533 29188-29188/com.example.codal.videotm D/failure: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
                                                                     built with gcc 4.8 (GCC)
                                                                     configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-and    roid/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
                                                                     libavutil      55. 17.103 / 55. 17.103
                                                                     libavcodec     57. 24.102 / 57. 24.102
                                                                     libavformat    57. 25.100 / 57. 25.100
                                                                     libavdevice    57.  0.101 / 57.  0.101
                                                                     libavfilter     6. 31.100 /  6. 31.100
                                                                     libswscale      4.  0.100 /  4.  0.100
                                                                     libswresample   2.  0.101 /  2.  0.101
                                                                     libpostproc    54.  0.100 / 54.  0.100
                                                                   Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/videokit/out2.mp4':
                                                                     Metadata:
                                                                       major_brand     : isom
                                                                       minor_version   : 512
                                                                       compatible_brands: isomiso2mp41
                                                                       encoder         : Lavf56.23.100
                                                                       comment         : Courtesy of National Geographic.  Used by Permission.
                                                                     Duration: 00:00:04.20, start: 0.046440, bitrate: 577 kb/s
                                                                       Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 160x120 [SAR 9:16 DAR 3:4], 521 kb/s, 30 fps, 30 tbr, 15360 tbn, 30 tbc (default)
                                                                       Metadata:
                                                                         handler_name    : VideoHandler
                                                                       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, stereo, fltp, 50 kb/s (default)
                                                                       Metadata:
                                                                         handler_name    : SoundHandler
                                                                   [mp3 @ 0xb86ade60] Skipping 0 bytes of junk at 132692.
                                                                   [mjpeg @ 0xb86c9980] Changing bps to 8
                                                                   [mp3 @ 0xb86ade60] Estimating duration from bitrate, this may be inaccurate
                                                                   Input #1, mp3, from '/storage/emulated/0/Download/01 Kaari Kaari - Dobaara.mp3':
                                                                     Metadata:
                                                                       album           : Dobaara (SongsMp3.Co)
                                                                       artist          : Arko , Asees Kaur
                                                                       album_artist    : Arko & Asees Kaur
                                                                       composer        : Arko
                                                                       performer       : SongsMp3.Co
                                                                       copyright       : SongsMp3.Co
                                                                       disc            : 1/1
                                                                       encoded_by      : iTunes 12.6.0.100
                                                                       genre           : Bollywood
                                                                       TEXT            : SongsMp3.Co
                                                                       TPE4            : SongsMp3.Co
                                                                       TRSN            : SongsMp3.Co
                                                                       TOPE            : SongsMp3.Co
                                                                       TOLY            : SongsMp3.Co
                                                                       publisher       : SongsMp3.Co
                                                                       title           : Kaari Kaari (SongsMp3.Co)
                                                                       track           : 1/1
                                                                       date            : 2017
                                                                     Duration: 00:03:46.72, start: 0.000000, bitrate: 324 kb/s
                                                                       Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
                                                                       Stream #1:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 600x600 [SAR 96:96 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
                                                                       Metadata:
                                                                         comment         : Cover (front)
                                                                   [NULL @ 0xb86cab70] Unable to find a suitable output format for ' -map 0:v:0 -map 1:a:0'
                                                                    -map 0:v:0 -map 1:a:0: Invalid argument
    05-26 18:39:35.543 29188-29188/com.example.codal.videotm D/ViewRootImpl: #3 mView = null
    05-26 18:39:35.543 29188-29188/com.example.codal.videotm D/finish: merge finish
  • Why when recording video using ffmpeg command line when playing the video it's running very fast ?

    31 mai 2013, par Revuen Ben Dror

    This is my code in Form1 :

    private void StartRecording_Click(object sender, EventArgs e)
           {

               ffmp.Start("test.avi", 25);
               timer1.Enabled = true;
           }

    The timer tick event :

    private void timer1_Tick(object sender, EventArgs e)
           {
               using (bitmap = (Bitmap)ScreenCapture.CaptureScreen(true))//(Bitmap)ScreenCapture.CaptureScreen(true))
               {
               ffmp.PushFrame(bitmap);
               }  

           }

    Then the code in the ffmpeg class i did :

    namespace ScreenVideoRecorder
    {
       class Ffmpeg
       {
           NamedPipeServerStream p;
           String pipename = "mytestpipe";
           byte[] b;
           //int i, j;
           System.Diagnostics.Process process;
           //IAsyncResult ar;

           public Ffmpeg()
           {

           }

           public void Start(string FileName, int BitmapRate)
           {
               p = new NamedPipeServerStream(pipename, PipeDirection.Out, 1, PipeTransmissionMode.Byte);
               b = new byte[1920 * 1080 * 3]; // some buffer for the r g and b of pixels of an image of size 720p
               process = new System.Diagnostics.Process();
               //process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
               process.StartInfo.FileName = @"D:\pipetest\pipetest\ffmpegx86\ffmpeg.exe";
               process.EnableRaisingEvents = false;
               process.StartInfo.WorkingDirectory = @"D:\pipetest\pipetest\ffmpegx86";
               process.StartInfo.Arguments = @"-f rawvideo -pix_fmt bgr0 -video_size 1920x1080 -i \\.\pipe\mytestpipe -map 0 -c:v libx264 -r " + BitmapRate + " " + FileName;
               process.Start();
               process.StartInfo.UseShellExecute = false;
               process.StartInfo.CreateNoWindow = false;
               //ar = p.BeginWaitForConnection(EndWait,null);
               p.WaitForConnection();
           }

           public void PushFrame(Bitmap bmp)
           {

               int length;
               // Lock the bitmap's bits.
               //bmp = new Bitmap(1920, 1080);
               Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
               //Rectangle rect = new Rectangle(0, 0, 1280, 720);
               System.Drawing.Imaging.BitmapData bmpData =
                   bmp.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadOnly,
                   bmp.PixelFormat);

               int absStride = Math.Abs(bmpData.Stride);
               // Get the address of the first line.
               IntPtr ptr = bmpData.Scan0;

               // Declare an array to hold the bytes of the bitmap.
               //length = 3 * bmp.Width * bmp.Height;
               length = absStride * bmpData.Height;
               byte[] rgbValues = new byte[length];

               //Marshal.Copy(ptr, rgbValues, 0, length);
               int j = bmp.Height - 1;
               for (int i = 0; i < bmp.Height; i++)
               {
                   IntPtr pointer = new IntPtr(bmpData.Scan0.ToInt32() + (bmpData.Stride * j));
                   System.Runtime.InteropServices.Marshal.Copy(pointer, rgbValues, absStride * (bmp.Height - i - 1), absStride);
                   j--;
               }

               p.Write(rgbValues, 0, length);

               bmp.UnlockBits(bmpData);

    The ffmpeg command line is :

    process.StartInfo.Arguments = @"-f rawvideo -pix_fmt bgr0 -video_size 1920x1080 -i \\.\pipe\mytestpipe -map 0 -c:v libx264 -r " + BitmapRate + " " + FileName;

    And i checked with a breakpoint and saw that the variable BitmapRate is 25 .
    And the timer interval is 40 .

    So it should fit for 25 frames per seconds.
    But when i'm running the video file using MPC Media Player Class everything in the video is running very fast. I mean the video is 2,326KB size the video Length is 16 seconds .

    And everything in the video seems to mvoe very fast if i opend a new window or dragged a window somewhere in the screen i see it moving very fast and as it i moved and did everything in real .

    I see on the video file details that : length 16 seconds. 1920x1080 and 25 frames per second.

    So where is the problem ? i can't figure out.

  • 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 ?