Recherche avancée

Médias (1)

Mot : - Tags -/ogg

Autres articles (49)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Utilisation et configuration du script

    19 janvier 2011, par

    Informations spécifiques à la distribution Debian
    Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
    Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
    Récupération du script
    Le script d’installation peut être récupéré de deux manières différentes.
    Via svn en utilisant la commande pour récupérer le code source à jour :
    svn co (...)

Sur d’autres sites (8771)

  • OpenCV compile process fails

    12 septembre 2017, par bork

    So I’m following this post on how to install openCV for Python 3. And I’m running into some issues at the compile process. Running the make -j4 command goes fine up until it’s 28% through when I get this error message : error: use of undeclared identifier 'avcodec_free_frame'; did you mean 'avcodec_get_name'?

    I don’t even know where to start to solve this issue. I’ve got ffmpeg installed through brew.

    Complete list of commands :

    cd ~
    git clone https://github.com/Itseez/opencv.git
    cd opencv
    git checkout 3.0.0
    cd ~
    git clone https://github.com/Itseez/opencv_contrib.git
    cd opencv_contrib
    git checkout 3.0.0
    cd ~/opencv
    mkdir build
    cd build
    cmake CMAKE_BUILD_TYPE=RELEASE \
       -D CMAKE_INSTALL_PREFIX=/usr/local \
       -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
       -D PYTHON3_LIBRARY=/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/config-3.5m/libpython3.5.dylib \
       -D PYTHON3_INCLUDE_DIR=/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/include/python3.5m/ \
       -D PYTHON3_EXECUTABLE=$VIRTUAL_ENV/bin/python \
       -D BUILD_opencv_python2=OFF \
       -D BUILD_opencv_python3=ON \
       -D INSTALL_PYTHON_EXAMPLES=ON \
       -D INSTALL_C_EXAMPLES=OFF \
       -D BUILD_EXAMPLES=ON .. \
       -D FFMPEG_INCLUDE_DIR=/usr/local/Cellar/ffmpeg/3.3.4/include/
       -D FFMPEG_LIB_DIR=/usr/local/Cellar/ffmpeg/3.3.4/lib/
       -D WITH_FFMPEG=ON
    cmake
    make -j4

    I got the FFMPEG_INCLUDE_DIR, FFMPEG_LIB_DIR and WITH_FFMPEG from this post : http://blog.jiashen.me/2014/12/23/build-opencv-3-on-mac-os-x-with-python-3-and-ffmpeg-support/

    The full error log :

    [ 28%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_qtkit.mm.o
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:317:9: error: use of undeclared identifier
         'avcodec_free_frame'; did you mean 'avcodec_get_name'?
           avcodec_free_frame(&picture);
           ^~~~~~~~~~~~~~~~~~
           avcodec_get_name
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavcodec/avcodec.h:6289:13: note: 'avcodec_get_name' declared here
    const char *avcodec_get_name(enum AVCodecID id);
               ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:317:28: error: cannot initialize a parameter of type
         'enum AVCodecID' with an rvalue of type 'AVFrame **'
           avcodec_free_frame(&picture);
                              ^~~~~~~~
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavcodec/avcodec.h:6289:45: note: passing argument to parameter 'id' here
    const char *avcodec_get_name(enum AVCodecID id);
                                               ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:632:23: error: use of undeclared identifier
         'avcodec_alloc_frame'
               picture = avcodec_alloc_frame();
                         ^
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:635:41: error: use of undeclared identifier
         'PIX_FMT_BGR24'; did you mean 'AV_PIX_FMT_BGR24'?
                       avpicture_get_size( PIX_FMT_BGR24,
                                           ^~~~~~~~~~~~~
                                           AV_PIX_FMT_BGR24
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:65:5: note: 'AV_PIX_FMT_BGR24' declared here
       AV_PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
       ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:638:29: error: use of undeclared identifier
         'PIX_FMT_BGR24'; did you mean 'AV_PIX_FMT_BGR24'?
                               PIX_FMT_BGR24, enc->width, enc->height );
                               ^~~~~~~~~~~~~
                               AV_PIX_FMT_BGR24
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:65:5: note: 'AV_PIX_FMT_BGR24' declared here
       AV_PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
       ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:738:67: error: use of undeclared identifier
         'PIX_FMT_RGB24'; did you mean 'AV_PIX_FMT_RGB24'?
       avpicture_fill((AVPicture*)&rgb_picture, rgb_picture.data[0], PIX_FMT_RGB24,
                                                                     ^~~~~~~~~~~~~
                                                                     AV_PIX_FMT_RGB24
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:64:5: note: 'AV_PIX_FMT_RGB24' declared here
       AV_PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
       ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:756:17: error: use of undeclared identifier
         'PIX_FMT_BGR24'; did you mean 'AV_PIX_FMT_BGR24'?
                   PIX_FMT_BGR24,
                   ^~~~~~~~~~~~~
                   AV_PIX_FMT_BGR24
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:65:5: note: 'AV_PIX_FMT_BGR24' declared here
       AV_PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
       ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1110:15: error: use of undeclared identifier
         'avcodec_alloc_frame'
       picture = avcodec_alloc_frame();
                 ^
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1113:33: error: unknown type name 'PixelFormat'; did you
         mean 'AVPixelFormat'?
       size = avpicture_get_size( (PixelFormat) pix_fmt, width, height);
                                   ^~~~~~~~~~~
                                   AVPixelFormat
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:60:6: note: 'AVPixelFormat' declared here
    enum AVPixelFormat {
        ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1122:25: error: unknown type name 'PixelFormat'; did you
         mean 'AVPixelFormat'?
                          (PixelFormat) pix_fmt, width, height);
                           ^~~~~~~~~~~
                           AVPixelFormat
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:60:6: note: 'AVPixelFormat' declared here
    enum AVPixelFormat {
        ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1230:19: error: unknown type name 'PixelFormat'; did you
         mean 'AVPixelFormat'?
       c->pix_fmt = (PixelFormat) pixel_format;
                     ^~~~~~~~~~~
                     AVPixelFormat
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:60:6: note: 'AVPixelFormat' declared here
    enum AVPixelFormat {
        ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1405:26: error: use of undeclared identifier
         'PIX_FMT_BGR24'; did you mean 'AV_PIX_FMT_BGR24'?
       if (input_pix_fmt == PIX_FMT_BGR24) {
                            ^~~~~~~~~~~~~
                            AV_PIX_FMT_BGR24
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:65:5: note: 'AV_PIX_FMT_BGR24' declared here
       AV_PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
       ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1410:31: error: use of undeclared identifier
         'PIX_FMT_GRAY8'; did you mean 'AV_PIX_FMT_GRAY8'?
       else if (input_pix_fmt == PIX_FMT_GRAY8) {
                                 ^~~~~~~~~~~~~
                                 AV_PIX_FMT_GRAY8
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:70:5: note: 'AV_PIX_FMT_GRAY8' declared here
       AV_PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
       ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1423:25: error: unknown type name 'PixelFormat'; did you
         mean 'AVPixelFormat'?
                          (PixelFormat)input_pix_fmt, width, height);
                           ^~~~~~~~~~~
                           AVPixelFormat
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:60:6: note: 'AVPixelFormat' declared here
    enum AVPixelFormat {
        ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1429:47: error: unknown type name 'PixelFormat'; did you
         mean 'AVPixelFormat'?
                                                (PixelFormat)input_pix_fmt,
                                                 ^~~~~~~~~~~
                                                 AVPixelFormat
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:60:6: note: 'AVPixelFormat' declared here
    enum AVPixelFormat {
        ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1447:25: error: unknown type name 'PixelFormat'; did you
         mean 'AVPixelFormat'?
                          (PixelFormat)input_pix_fmt, width, height);
                           ^~~~~~~~~~~
                           AVPixelFormat
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:60:6: note: 'AVPixelFormat' declared here
    enum AVPixelFormat {
        ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1604:25: error: use of undeclared identifier
         'PIX_FMT_BGR24'; did you mean 'AV_PIX_FMT_BGR24'?
           input_pix_fmt = PIX_FMT_BGR24;
                           ^~~~~~~~~~~~~
                           AV_PIX_FMT_BGR24
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:65:5: note: 'AV_PIX_FMT_BGR24' declared here
       AV_PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
       ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1607:25: error: use of undeclared identifier
         'PIX_FMT_GRAY8'; did you mean 'AV_PIX_FMT_GRAY8'?
           input_pix_fmt = PIX_FMT_GRAY8;
                           ^~~~~~~~~~~~~
                           AV_PIX_FMT_GRAY8
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:70:5: note: 'AV_PIX_FMT_GRAY8' declared here
       AV_PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
       ^
    In file included from /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:
    /Users/myuser/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1683:25: error: use of undeclared identifier
         'PIX_FMT_YUV422P'; did you mean 'AV_PIX_FMT_YUV422P'?
           codec_pix_fmt = PIX_FMT_YUV422P;
                           ^~~~~~~~~~~~~~~
                           AV_PIX_FMT_YUV422P
    /usr/local/Cellar/ffmpeg/3.3.4/include/libavutil/pixfmt.h:66:5: note: 'AV_PIX_FMT_YUV422P' declared here
       AV_PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
       ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    /Users/myuser/opencv/modules/videoio/src/cap_qtkit.mm:46:9: fatal error: 'QTKit/QTKit.h' file not found
    #import <qtkit></qtkit>QTKit.h>
           ^
    1 error generated.
    make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_qtkit.mm.o] Error 1
    make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
    make: *** [all] Error 2

    This question on openCV’s website seems to adress the same issue but there is no solution posted : http://answers.opencv.org/question/90091/error-use-of-undeclared-identifier-avcodec_free_frame-did-you-mean-avcodec_get_name/

  • bash script to install / update ffmpeg static builds

    1er mars 2017, par Joakim

    Hi I’m trying to make my first "real" bash script to do some real work than can be executed both manually and through cron jobs.

    The script should download and install the ffmpeg-static-build from https://johnvansickle.com/ffmpeg

    Here is what I’ve got so far :

    #!/bin/bash
    # Still to come, see if the script runs with root privileges else exit
    #Download FFMPEG static daily build and it's md5
    cd ~
    wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz | tar -xf
    #wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz.md5
    curl -L https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz.md5 | tar -xf | tee -a https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz | cut -d\  -f1 | md5sum > md5sum.txt


    #Chech the md5 is currect
    #md5sum -c MD5SUMS
    file1="md5sum.txt"
    file2="ffmpeg-git-64bit-static.tar.xz.md5"

    if ! cmp --silent "$file1" "$file2"; then
       echo "md5sum doesn't match...\n exit" >&amp;2
       exit 1
    fi


    #tar -xf ffmpeg-*.tar.xz
    cp ffmpeg-*-static/ff* /usr/bin/
    cp ffmpeg-*-static/ff* /usr/local/bin/
    cp ffmpeg-*-static/qt-faststart /usr/bin/
    cp ffmpeg-*-static/qt-faststart /usr/local/bin/
    # Consider change second location to use ln -s
    # Remove downloads and do some clean up

    rm -fr ffmpeg-*

    #EOF

    As you can see in the script i would like to add the md5sum check but it fails (got the md5sum check part from Compare md5 sums in bash script)

    If i remove the md5sum part the script is working, but right now the script fails at the | tar -xf | part with this code

    2017-02-28 00:10:24 (617 KB/s) - ‘ffmpeg-git-64bit-static.tar.xz’ saved [17564756/17564756]

    tar: option requires an argument -- 'f'
    Try 'tar --help' or 'tar --usage' for more information.
    tee: 'https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz': No such file or directory
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
    100    65  100    65    0     0     87      0 --:--:-- --:--:-- --:--:--    87
    (23) Failed writing body
    md5sum doesn't match...
    exit

    As this is my first, I would appreciate any "I’m 4 years old" advices and why

    update

    Have made some changes to the script based on the suggestions in this thread, but my problem is I have no output what so ever at this state :( So I think it’s time to ask for the next clue

    #!/bin/bash

    # version 0.3z

    ## Download FFMPEG static daily build and it's md5
    ##
    ## To make this script working you might need to change the below values
    ## based on whether you are using a 32bit or 64 bit OS
    ## to obtain the right links you have to have a look @ https://johnvansickle.com/ffmpeg/
    ## and then change those below
    ##
    ## If you are running on a shared server or dowsn't have root priviliges you might need to uncomment
    ## point 5.


    # a "~" means running users home folder :) and should be different from destination dir
    download_dir=~

    # as this can change if the ffmpeg is to be stored on ex. shared server
    dest_dir=/usr/bin/

    # The version it equal the filename from above link
    version=ffmpeg-git-64bit-static.tar.xz

    ## Do not change anything below here!!
    source_url=https://johnvansickle.com/ffmpeg/builds/${version}
    md5_url=https://johnvansickle.com/ffmpeg/builds/${version}.md5

    # Still to come, see if the script runs with write privileges else exit

    # 1. Can we enter download directory else exit
    cd ${download_dir} ||

           printf "%s\n" "You can't enter this folder.\nPlease chage download_dir in this script..." >&amp;2
           exit 1

    # 2. Check the md5 is correct or have changed from last check
    ## instead of downloading ffmpeg-git-64bit-static.tar.xz every time,
    ## regardless if it is new or not, I recommend only downloading it
    ## if the md5 does not match. Would save John some bandwidth at least
    ## thx for the idea to @LordNeckbeard



    ## So somehow i'll guess some sed or grep only first part is nessesary :(
    ## This is getting more advance than expected for a first time script :/

    if ! diff &lt;(md5sum ${version}) &lt;(curl -s ${md5_url})

       then
           printf "%s\n" "md5sum doesn't match...\n
                           Downloading new version" >&amp;2
           rm -f ${version} >&amp;2
           curl ${source_url} -o ${download_dir}/${version} >&amp;2
           #exit 2

       elif
           diff &lt;(md5sum ${version}) &lt;(curl -s ${md5_url})
           printf "%s\n" "Nothing new to download" >&amp;2
         exit 3
    fi

    # 3. untar
    tar -xf ffmpeg-git-*-static.tar.xz

    # 4. Move builds to destination directories

    mv ${download_dir}/ffmpeg-*-static/ff* ${dest_dir}/
    mv ${download_dir}/ffmpeg-*-static/qt-faststart ${dest_dir}/

    # 5. Make soft links to static builds
    ln -sfn ${dest_dir}/qt-faststart /usr/local/bin/qt-faststart
    ln -sfn ${dest_dir}/ffmpeg /usr/local/bin/ffmpeg
    ln -sfn ${dest_dir}/ffmpeg-10bit /usr/local/bin/ffmpeg-10bit
    ln -sfn ${dest_dir}/ffprobe /usr/local/bin/ffprobe
    ln -sfn ${dest_dir}/ffserver /usr/local/bin/ffserver

    # Remove unzipped folder to do some clean up

    rm -fr ffmpeg-git-*-static/

    #EOF

    note : do to some more in depth answering of why not compile from source :
    1. This precompiled is usable on all Linux variations, despite distro and version
    2. It usable on shared hosting servers with ssh access

    UPDATE 2

       #!/bin/bash

    # version 0.4z

    ## Download FFMPEG static daily build and it's md5
    ##
    ## To make this script working you might need to change the below values
    ## based on whether you are using a 32bit or 64 bit OS
    ## to obtain the right links you have to have a look @ https://johnvansickle.com/ffmpeg/
    ## and then change those below
    ##
    ## Finished and working script should be distributed under GPLv3: free as in freedom
    ##
    ## If you are running on a shared server or dowsn't have root priviliges you might need to uncomment
    ## point 5.


    # a "~" means running users home folder :) and should be different from destination dir
    download_dir=~

    # as this can change if the ffmpeg is to be stored on ex. shared server
    dest_dir=/usr/bin/

    # The version it equal the filename from above link
    version=ffmpeg-git-64bit-static.tar.xz

    ## Do not change anything below here!!
    source_url=https://johnvansickle.com/ffmpeg/builds/${version}
    md5="curl -s https://johnvansickle.com/ffmpeg/builds/${version}.md5"

    # Still to come, see if the script runs with write privileges else exit

    # 1. Can we enter download directory else exit
    cd ${download_dir} ||
           printf "%s\n" "You can't enter this folder.\nPlease chage download_dir in this script..." >&amp;2
           exit 1

    # 2. Check the md5 is correct or have changed from last check
    ## instead of downloading ffmpeg-git-64bit-static.tar.xz every time,
    ## regardless if it is new or not, I recommend only downloading it
    ## if the md5 does not match. Would save John some bandwidth at least
    ## thx for the idea to @LordNeckbeard

    ## This is getting more advance than expected for a first time script :/

    if diff &lt;(md5sum ${version}) &lt;(${md5})

       then
           printf "%s\n" "No new version availeble" >&amp;2
           exit 1

    elif ! diff &lt;(md5sum ${version}) &lt;(${md5})
       then
           rm -f ${version}
           curl ${source_url} > ${version}
           exit 0

           #only proceed if downloaded version match it's md5
           if ! diff &lt;(md5sum ${version}) &lt;(${md5})
               then
               rm -f ${version}
               printf "%s\n" "Downloaded version is damaged, try later\ndamaged version have been deleted" >&amp;2
               exit 1
           fi

               # 3. untar
               tar -xf ffmpeg-git-*-static.tar.xz

               # 4. Move builds to destination directories
               mv ${download_dir}/ffmpeg-*-static/ff* ${dest_dir}/
               mv ${download_dir}/ffmpeg-*-static/qt-faststart ${dest_dir}/

               # 5. Make soft links to static builds
               ln -sfn ${dest_dir}/qt-faststart /usr/local/bin/qt-faststart
               ln -sfn ${dest_dir}/ffmpeg /usr/local/bin/ffmpeg
               ln -sfn ${dest_dir}/ffmpeg-10bit /usr/local/bin/ffmpeg-10bit
               ln -sfn ${dest_dir}/ffprobe /usr/local/bin/ffprobe
               ln -sfn ${dest_dir}/ffserver /usr/local/bin/ffserver

               # Remove unzipped folder to do some clean up
               rm -fr ffmpeg-git-*-static/
               printf "%s\n" "Going to install new version" >&amp;2
               exit 1
    fi
    #EOF

    But still having some issues :(

    1. Running this script returns : a blanc shell, but I’ve expected one of the printf statements
    2. When I’m trying to narrow down the problem and going back to basic and trying to run the script with only the "if" part it fails with 44 : Syntax error : "(" unexpected
    3. running the very same "if" part typed directly into the shell/terminal itself it’s all happy !!
      if diff &lt;(md5sum ffmpeg-git-64bit-static.tar.xz) &lt;(curl -s "https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz.md5"); then printf "%s\n" "No new version availeble" >&amp;2; elif ! diff &lt;(md5sum ffmpeg-git-64bit-static.tar.xz) &lt;(curl -s "https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz.md5"); then rm -f ffmpeg-git-64bit-static.tar.xz; curl https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz > ffmpeg-git-64bit-static.tar.xz; printf "%s\n" "Going to install new version" >&amp;2; fi

    4. I’m confused

  • How to build FFMPEG lib with android ndk

    27 janvier 2017, par S. Le Galloudec

    I introduce my problem : I’m a student working on a project asked by a company to my school.
    My part is to develop an android application (i have to use c++) who can make an authentication, ask to an api wich camera the client can watch, then display in real time the stream of the IP camera (using RTSP protocol)

    To be honnest i’m pretty lost. I’ve found the library FFMPEG, wich looks like useful to my project. If i got it right, the library can display a stream from a camera. So i built the library for my project, and then i tried to include it in my program.

    I did it the same way i did to include the library curl that i already use.

    But when i try to run my program, i got this message :

    FAILURE : Build failed with an exception.

    • What went wrong :
      Execution failed for task ’:app:externalNativeBuildDebug’.
      Build command failed.
      Error while executing ’/local/Android/Sdk/cmake/3.6.3155560/bin/cmake’ with arguments —build /local/Bureau/Projet2/videosurveillance/Application_Android/App_Android/app/.externalNativeBuild/cmake/debug/x86 —target lecteur
      [1/1] Linking CXX shared library ../obj/x86/liblecteur.so
      FAILED : : && /local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -target i686-none-linux-android -gcc-toolchain /local/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64 —sysroot=/local/Android/Sdk/ndk-bundle/platforms/android-9/arch-x86 -fPIC -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,—noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -std=gnu++11 -O0 -fno-limit-debug-info -Wl,—build-id -Wl,—warn-shared-textrel -Wl,—fatal-warnings -Wl,—no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,liblecteur.so -o ../obj/x86/liblecteur.so CMakeFiles/lecteur.dir/src/main/cpp/lecteur.cpp.o ../../../../../distribution/ffmpeg/x86/lib/libswscale.a -lz /local/Android/Sdk/ndk-bundle/platforms/android-9/arch-x86/usr/lib/liblog.so -lm "/local/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libgnustl_static.a" && :
      /local/Bureau/Projet2/videosurveillance/Application_Android/App_Android/app/src/main/cpp/lecteur.cpp:19 : error : undefined reference to ’avcodec_configuration’
      clang++ : error : linker command failed with exit code 1 (use -v to see invocation)
      ninja : build stopped : subcommand failed.

      Try :
      Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output.

    And i know that the problem comes from my cmakelist, or from my tree. But i don’t see the mistake, so if you could help me. Here is my cmakelist :

    cmake_minimum_required(VERSION 3.4.1)

    set(distribution_DIR ${CMAKE_SOURCE_DIR}/../distribution)


    add_library(lib-curl STATIC IMPORTED)

    add_library(ffmpeg SHARED IMPORTED)

    set_target_properties(lib-curl PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/curl/lib/${ANDROID_ABI}/libcurl.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavcodec.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavdevice.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavfilter.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavformat.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavutil.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libpostproc.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libswresample.a)

    set_target_properties(ffmpeg PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libswscale.a)




    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")


    add_library( # Sets the name of the library.
            downloader
            SHARED
            src/main/cpp/downloader.cpp
             #src/main/cpp/downloader.h
             )


    add_library( # Sets the name of the library.
            getrequest
            SHARED
            src/main/cpp/getrequest.cpp
             #src/main/cpp/getrequest.h
             )

    add_library( # Sets the name of the library.
            lecteur
            SHARED
            src/main/cpp/lecteur.cpp
             #src/main/cpp/lecteur.h
             )

    target_include_directories(downloader PRIVATE
                          ${distribution_DIR}/curl/include)

    target_include_directories(getrequest PRIVATE
                          ${distribution_DIR}/curl/include)

    target_include_directories(lecteur PRIVATE
                          ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/include)


    find_library( # Sets the name of the path variable.
             log-lib

             log )

    target_link_libraries( # Specifies the target library.
                      downloader
                      lib-curl
                      z
                      ${log-lib}
                      )

    target_link_libraries( # Specifies the target library.
                      getrequest
                      lib-curl
                      z
                      ${log-lib}
                      )

    target_link_libraries( # Specifies the target library.
                      lecteur
                      ffmpeg
                      z
                      ${log-lib}
                      )

    If you want to understand how i made my cmake, and what looks like my program you can check here : https://github.com/samylegalloudec/android-ndk-ffmepg

    Hope i was clear

    Best regards

    Edit n°1 :

    I think i’ve made a mistake in my cmakelist.txt so i fixed it (i guess) this way :

    cmake_minimum_required(VERSION 3.4.1)

    set(distribution_DIR ${CMAKE_SOURCE_DIR}/../distribution)


    add_library(lib-curl STATIC IMPORTED)



    set_target_properties(lib-curl PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/curl/lib/${ANDROID_ABI}/libcurl.a)

    add_library(ffmpeg-codec STATIC IMPORTED)
    set_target_properties(ffmpeg-codec PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavcodec.a)

    add_library(ffmpeg-device STATIC IMPORTED)
    set_target_properties(ffmpeg-device PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavdevice.a)

    add_library(ffmpeg-filter STATIC IMPORTED)
    set_target_properties(ffmpeg-filter PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavfilter.a)

    add_library(ffmpeg-format STATIC IMPORTED)
    set_target_properties(ffmpeg-format PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavformat.a)

    add_library(ffmpeg-util STATIC IMPORTED)
    set_target_properties(ffmpeg-util PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libavutil.a)

    add_library(ffmpeg-postproc STATIC IMPORTED)
    set_target_properties(ffmpeg-postproc PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libpostproc.a)

    add_library(ffmpeg-sample STATIC IMPORTED)
    set_target_properties(ffmpeg-sample PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libswresample.a)

    add_library(ffmpeg-scale STATIC IMPORTED)
    set_target_properties(ffmpeg-scale PROPERTIES IMPORTED_LOCATION ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/lib/libswscale.a)




    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")


    add_library( # Sets the name of the library.
            downloader
            SHARED
            src/main/cpp/downloader.cpp
             #src/main/cpp/downloader.h
             )


    add_library( # Sets the name of the library.
            getrequest
            SHARED
            src/main/cpp/getrequest.cpp
             #src/main/cpp/getrequest.h
             )

    add_library( # Sets the name of the library.
            lecteur
            SHARED
            src/main/cpp/lecteur.cpp
             #src/main/cpp/lecteur.h
             )

    target_include_directories(downloader PRIVATE
                          ${distribution_DIR}/curl/include)

    target_include_directories(getrequest PRIVATE
                          ${distribution_DIR}/curl/include)

    target_include_directories(lecteur PRIVATE
                          ${distribution_DIR}/ffmpeg/${ANDROID_ABI}/include)


    find_library( # Sets the name of the path variable.
             log-lib

             log )

    target_link_libraries( # Specifies the target library.
                      downloader
                      lib-curl
                      z
                      ${log-lib}
                      )

    target_link_libraries( # Specifies the target library.
                      getrequest
                      lib-curl
                      z
                      ${log-lib}
                      )

    target_link_libraries( # Specifies the target library.
                      lecteur
                      ffmpeg-codec
                      ffmpeg-device
                      ffmpeg-filter
                      ffmpeg-format
                      ffmpeg-util
                      ffmpeg-postproc
                      ffmpeg-sample
                      ffmpeg-scale
                      z
                      ${log-lib}
                      )

    Now i have another message :

    FAILURE : Build failed with an exception.

    • What went wrong :
      Execution failed for task ’:app:externalNativeBuildDebug’.
      Build command failed.
      Error while executing ’/local/Android/Sdk/cmake/3.6.3155560/bin/cmake’ with arguments —build /local/Bureau/Projet2/videosurveillance/Application_Android/App_Android/app/.externalNativeBuild/cmake/debug/x86 —target lecteur
      [1/1] Linking CXX shared library ../obj/x86/liblecteur.so
      FAILED : : && /local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -target i686-none-linux-android -gcc-toolchain /local/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64 —sysroot=/local/Android/Sdk/ndk-bundle/platforms/android-9/arch-x86 -fPIC -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,—noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -std=gnu++11 -O0 -fno-limit-debug-info -Wl,—build-id -Wl,—warn-shared-textrel -Wl,—fatal-warnings -Wl,—no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,liblecteur.so -o ../obj/x86/liblecteur.so CMakeFiles/lecteur.dir/src/main/cpp/lecteur.cpp.o ../../../../../distribution/ffmpeg/x86/lib/libavcodec.a ../../../../../distribution/ffmpeg/x86/lib/libavdevice.a ../../../../../distribution/ffmpeg/x86/lib/libavfilter.a ../../../../../distribution/ffmpeg/x86/lib/libavformat.a ../../../../../distribution/ffmpeg/x86/lib/libavutil.a ../../../../../distribution/ffmpeg/x86/lib/libpostproc.a ../../../../../distribution/ffmpeg/x86/lib/libswresample.a ../../../../../distribution/ffmpeg/x86/lib/libswscale.a -lz /local/Android/Sdk/ndk-bundle/platforms/android-9/arch-x86/usr/lib/liblog.so -lm "/local/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libgnustl_static.a" && :
      /local/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld : warning : shared library text segment is not shareable
      /local/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld : error : treating warnings as errors
      clang++ : error : linker command failed with exit code 1 (use -v to see invocation)
      ninja : build stopped : subcommand failed.

    • Try :
      Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output.