Recherche avancée

Médias (91)

Autres articles (70)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (16749)

  • Bad video quality and only 3 fps

    25 juillet 2019, par ApplowPi

    There are a few things wrong with the quality of the output file when I run this command.

    arecord -d 0 -r 48000 -c 2 -f S16_LE -t wav -D sysdefault:CARD=tc358743 | avconv -t 0 -i pipe:0 -f v4l2 -i /dev/video0 -c:v libx264 -r 30 -acodec aac -ar 48000 -vcodec flv -strict experimental -y -f flv test.flv

    The audio seems okay at the moment but, if I’m reading it correctly (at the very bottom of the output below), the fps is about 3 and the quality is at 31, which I understand is the worse. This is the output during the process.

    I’m looking to get 30 fps (ideally 60 if possible).

    I’m pretty new to this, any help would be great. Thanks in advance.

    ffmpeg version 3.2.10-1~deb9u1+rpt2 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
     configuration: --prefix=/usr --extra-version='1~deb9u1+rpt2' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
     libavutil      55. 34.101 / 55. 34.101
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.101 / 57. 56.101
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libavresample   3.  1.  0 /  3.  1.  0
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    Guessed Channel Layout for Input Stream #0.0 : stereo
    Input #0, wav, from 'pipe:0':
     Duration: N/A, bitrate: 1536 kb/s
       Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
    [video4linux2,v4l2 @ 0x172e110] ioctl(VIDIOC_G_PARM): Inappropriate ioctl for device
    [video4linux2,v4l2 @ 0x172e110] Time per frame unknown
    Input #1, video4linux2,v4l2, from '/dev/video0':
     Duration: N/A, start: 927.631204, bitrate: N/A
       Stream #1:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 1280x720, 120 tbr, 1000k tbn, 1000k tbc
    Output #0, flv, to 'test.flv':
     Metadata:
       encoder         : Lavf57.56.101
       Stream #0:0: Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p, 1280x720, q=2-31, 200 kb/s, 120 fps, 1k tbn, 120 tbc
       Metadata:
         encoder         : Lavc57.64.101 flv
       Side data:
         cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
       Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 48000 Hz, stereo, fltp, 128 kb/s
       Metadata:
         encoder         : Lavc57.64.101 aac
    Stream mapping:
     Stream #1:0 -> #0:0 (rawvideo (native) -> flv1 (flv))
     Stream #0:0 -> #0:1 (pcm_s16le (native) -> aac (native))
    [wav @ 0x1728730] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    [video4linux2,v4l2 @ 0x172e110] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    overrun!!! (at least 9513.101 ms long)44kB time=00:00:00.97 bitrate=2890.9kbits/s speed=0.0987x
    overrun!!! (at least 25.077 ms long) 363kB time=00:00:01.84 bitrate=1614.1kbits/s speed=0.162x
    overrun!!! (at least 254.192 ms long)421kB time=00:00:02.97 bitrate=1159.1kbits/s speed=0.226x
    overrun!!! (at least 93.349 ms long) 441kB time=00:00:03.86 bitrate= 935.3kbits/s speed=0.263x
    overrun!!! (at least 198.942 ms long)461kB time=00:00:04.97 bitrate= 758.6kbits/s speed=0.303x
    overrun!!! (at least 155.909 ms long)526kB time=00:00:06.14 bitrate= 701.0kbits/s speed=0.337x
    frame=   54 fps=2.8 q=31.0 Lsize=     534kB time=00:00:06.67 bitrate= 655.6kbits/s speed=0.352x

    Running different commands to see what happens. This command :

    avconv -t 0 -i /dev/video0 -c:v libx264 -preset ultrafast -y newtest.h264

    Slowly builds up to 40 fps but the result is still poor. Feels like it’s 5 fps not 40. The CPU percentage when running this is 65-70%. Output is :

    ffmpeg version 3.2.10-1~deb9u1+rpt2 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
     configuration: --prefix=/usr --extra-version='1~deb9u1+rpt2' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
     libavutil      55. 34.101 / 55. 34.101
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.101 / 57. 56.101
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libavresample   3.  1.  0 /  3.  1.  0
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    [video4linux2,v4l2 @ 0x16d4600] ioctl(VIDIOC_G_PARM): Inappropriate ioctl for device
    [video4linux2,v4l2 @ 0x16d4600] Time per frame unknown
    Input #0, video4linux2,v4l2, from '/dev/video0':
     Duration: N/A, start: 5015.769341, bitrate: N/A
       Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 1280x720, 59.94 tbr, 1000k tbn, 1000k tbc
    No pixel format specified, yuv422p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x16d77e0] using cpu capabilities: ARMv6 NEON
    [libx264 @ 0x16d77e0] profile High 4:2:2, level 3.2, 4:2:2 8-bit
    Output #0, h264, to 'newtest.h264':
     Metadata:
       encoder         : Lavf57.56.101
       Stream #0:0: Video: h264 (libx264), yuv422p, 1280x720, q=-1--1, 59.94 fps, 59.94 tbn, 59.94 tbc
       Metadata:
         encoder         : Lavc57.64.101 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    frame= 1813 fps= 37 q=-1.0 Lsize=    3218kB time=00:00:30.24 bitrate= 871.5kbits/s dup=1700 drop=0 speed=0.617x
    video:3218kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
    [libx264 @ 0x16d77e0] frame I:8     Avg QP:14.00  size:170114
    [libx264 @ 0x16d77e0] frame P:1805  Avg QP:15.46  size:  1071
    [libx264 @ 0x16d77e0] mb I  I16..4: 100.0%  0.0%  0.0%
    [libx264 @ 0x16d77e0] mb P  I16..4:  0.4%  0.0%  0.0%  P16..4:  2.0%  0.0%  0.0%  0.0%  0.0%    skip:97.6%
    [libx264 @ 0x16d77e0] coded y,uvDC,uvAC intra: 43.4% 28.3% 19.2% inter: 1.1% 0.8% 0.2%
    [libx264 @ 0x16d77e0] i16 v,h,dc,p: 61% 26%  8%  5%
    [libx264 @ 0x16d77e0] i8c dc,h,v,p: 68% 12% 17%  4%
    [libx264 @ 0x16d77e0] kb/s:871.45

    Running this command :

    avconv -t 0 -i /dev/video0 -r 60 -c:v libx264 -preset ultrafast -y newtest.flv

    (just specifying a different output file format, results in a CPU usage of about 30% and produces this output :

    avconv -t 0 -i /dev/video0 -r 60 -c:v libx264 -preset ultrafast -y newtest.flv
    ffmpeg version 3.2.10-1~deb9u1+rpt2 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
     configuration: --prefix=/usr --extra-version='1~deb9u1+rpt2' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
     libavutil      55. 34.101 / 55. 34.101
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.101 / 57. 56.101
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libavresample   3.  1.  0 /  3.  1.  0
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    [video4linux2,v4l2 @ 0x527620] ioctl(VIDIOC_G_PARM): Inappropriate ioctl for device
    [video4linux2,v4l2 @ 0x527620] Time per frame unknown
    Input #0, video4linux2,v4l2, from '/dev/video0':
     Duration: N/A, start: 6071.912862, bitrate: N/A
       Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 1280x720, 120 tbr, 1000k tbn, 1000k tbc
    No pixel format specified, yuv422p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x52a870] using cpu capabilities: ARMv6 NEON
    [libx264 @ 0x52a870] profile High 4:2:2, level 3.2, 4:2:2 8-bit
    [libx264 @ 0x52a870] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
    Output #0, flv, to 'newtest.flv':
     Metadata:
       encoder         : Lavf57.56.101
       Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv422p, 1280x720, q=-1--1, 60 fps, 1k tbn, 60 tbc
       Metadata:
         encoder         : Lavc57.64.101 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    frame=  158 fps=4.1 q=-1.0 Lsize=     878kB time=00:00:30.70 bitrate= 234.2kbits/s speed=0.803x
    video:874kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.385400%
    [libx264 @ 0x52a870] frame I:1     Avg QP:20.00  size: 68854
    [libx264 @ 0x52a870] frame P:157   Avg QP: 8.93  size:  5261
    [libx264 @ 0x52a870] mb I  I16..4: 100.0%  0.0%  0.0%
    [libx264 @ 0x52a870] mb P  I16..4:  1.4%  0.0%  0.0%  P16..4:  7.7%  0.0%  0.0%  0.0%  0.0%    skip:90.9%
    [libx264 @ 0x52a870] coded y,uvDC,uvAC intra: 28.1% 13.8% 13.4% inter: 3.4% 2.7% 2.3%
    [libx264 @ 0x52a870] i16 v,h,dc,p: 76% 22%  1%  1%
    [libx264 @ 0x52a870] i8c dc,h,v,p: 88%  4%  7%  0%
    [libx264 @ 0x52a870] kb/s:231.42
  • Building ffmpeg for Android with clang

    30 juillet 2019, par Guerlando OCs

    I’m trying to build ffmpeg for Android using Clang and Android NDK 20 in Ubuntu 18.04.

    I’m trying :

    ./configure
    --prefix=android/
    --disable-asm
    --enable-cross-compile
    --disable-static
    --disable-programs
    --disable-doc
    --enable-shared
    --enable-protocol=file
    --enable-pic
    --enable-small
    --disable-pthreads
    --ar=/home/sources/android-ndk-r20/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar
    --strip=/home/sources/android-ndk-r20/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip
    --ld=/home/sources/android-ndk-r20/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld
    --cc=/home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
    --cxx=/home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
    --as=/home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
    --target-os=android
    --extra-cflags=-target aarch64-none-linux-android
    -mfpu=neon
    -mfloat-abi=soft
    -I/home/sources/android-ndk-r20/sysroot/usr/include/aarch64-linux-android
    -O3
    -fPIC
    --extra-ldflags=-L/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x
    -L/platforms/android-/arch-arm64/usr/lib
    --sysroot=/home/sources/android-ndk-r20/sysroot

    But I’m getting some compile errors like this :

    /home/sources/android-ndk-r20/sysroot/usr/include/stdlib.h:61:7: error: expected identifier or '('
    char* getenv(const char* __name);
         ^
    ./config.h:17:19: note: expanded from macro 'getenv'
    #define getenv(x) NULL
                     ^
    /home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stddef.h:105:18: note: expanded from macro 'NULL'
    #  define NULL ((void*)0)
                    ^
    In file included from libavdevice/alldevices.c:23:
    In file included from ./libavformat/internal.h:27:
    In file included from ./libavformat/avformat.h:319:
    In file included from ./libavcodec/avcodec.h:31:
    In file included from ./libavutil/samplefmt.h:24:
    In file included from ./libavutil/avutil.h:296:
    In file included from ./libavutil/common.h:39:
    /home/sources/android-ndk-r20/sysroot/usr/include/stdlib.h:61:7: error: expected ')'
    ./config.h:17:19: note: expanded from macro 'getenv'
    #define getenv(x) NULL
                     ^
    /home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stddef.h:105:18: note: expanded from macro 'NULL'
    #  define NULL ((void*)0)
                    ^
    /home/sources/android-ndk-r20/sysroot/usr/include/stdlib.h:61:7: note: to match this '('
    ./config.h:17:19: note: expanded from macro 'getenv'
    #define getenv(x) NULL
                     ^
    /home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stddef.h:105:17: note: expanded from macro 'NULL'
    #  define NULL ((void*)0)
                   ^
    In file included from libavdevice/alldevices.c:23:
    In file included from ./libavformat/internal.h:27:
    In file included from ./libavformat/avformat.h:319:
    In file included from ./libavcodec/avcodec.h:31:
    In file included from ./libavutil/samplefmt.h:24:
    In file included from ./libavutil/avutil.h:296:
    In file included from ./libavutil/common.h:39:
    /home/sources/android-ndk-r20/sysroot/usr/include/stdlib.h:61:7: error: expected ')'
    char* getenv(const char* __name);
         ^
    ./config.h:17:19: note: expanded from macro 'getenv'
    #define getenv(x) NULL
                     ^
    /home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stddef.h:105:24: note: expanded from macro 'NULL'
    #  define NULL ((void*)0)
                          ^
    /home/sources/android-ndk-r20/sysroot/usr/include/stdlib.h:61:7: note: to match this '('
    ./config.h:17:19: note: expanded from macro 'getenv'
    #define getenv(x) NULL
                     ^
    /home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stddef.h:105:16: note: expanded from macro 'NULL'
    #  define NULL ((void*)0)
                  ^
    In file included from libavdevice/fbdev_dec.c:37:
    In file included from ./libavutil/internal.h:42:
    In file included from ./libavutil/timer.h:41:
    /home/sources/android-ndk-r20/sysroot/usr/include/stdlib.h:61:7: error: expected identifier or '('
    char* getenv(const char* __name);
         ^
    ./config.h:17:19: note: expanded from macro 'getenv'
    #define getenv(x) NULL
                     ^
    /home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stddef.h:105:18: note: expanded from macro 'NULL'
    #  define NULL ((void*)0)
                    ^
    In file included from libavdevice/fbdev_dec.c:37:
    In file included from ./libavutil/internal.h:42:
    In file included from ./libavutil/timer.h:41:
    /home/sources/android-ndk-r20/sysroot/usr/include/stdlib.h:61:7: error: expected ')'
    ./config.h:17:19: note: expanded from macro 'getenv'
    #define getenv(x) NULL
                     ^
    /home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/8.0.7/include/stddef.h:105:18: note: expanded from macro 'NULL'
    #  define NULL ((void*)0)
                    ^
    /home/sources/android-ndk-r20/sysroot/usr/include/stdlib.h:61:7: note: to match this '('
    ./config.h:17:19: note: expanded from macro 'getenv'
    #define getenv(x) NULL

    I also tried, from here :

    ./configure
    --prefix=/home/deps/build/ffmpeg/arm64
    --cross-prefix=/home/sources/android-ndk-r20/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android-
    --sysroot=/home/sources/android-ndk-r20/sysroot
    --disable-static
    --disable-doc
    --disable-ffmpeg
    --disable-ffplay
    --disable-ffprobe
    --disable-symver
    --enable-shared
    --enable-protocol=concat
    --enable-protocol=file
    --enable-muxer=mp4
    --enable-demuxer=mpegts
    --target-os=android
    --enable-decoder=h264
    --enable-cross-compile
    --arch=aarch64
    --toolchain=clang-usan
    --extra-cflags=-fPIE
    -fPIC
    -ffast-math
    -funroll-loops
    -mfloat-abi=softfp
    -mfpu=vfpv3-d16
    --extra-ldflags=-pie
    --ar=/home/sources/android-ndk-r20/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar
    --strip=/home/sources/android-ndk-r20/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip
    --ld=/home/sources/android-ndk-r20/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld
    --cc=/home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
    --cxx=/home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
    --as=/home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/clang

    But I get this error :

    /home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/clang is unable to create an executable file.
    C compiler test failed.

    In the log file I get :

    /home/sources/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --sysroot=/home/sources/android-ndk-r20/sysroot -fsanitize=undefined -fPIE -fPIC -ffast-math -funroll-loops -mfloat-abi=softfp -mfpu=vfpv3-d16 -c -o /tmp/ffconf.knsd57OI/test.o /tmp/ffconf.knsd57OI/test.c
    clang: warning: argument unused during compilation: '-mfloat-abi=softfp' [-Wunused-command-line-argument]
    clang: warning: argument unused during compilation: '-mfpu=vfpv3-d16' [-Wunused-command-line-argument]
    /home/sources/android-ndk-r20/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld -pie -fsanitize=undefined --sysroot=/home/sources/android-ndk-r20/sysroot -o /tmp/ffconf.knsd57OI/test /tmp/ffconf.knsd57OI/test.o
    /home/sources/android-ndk-r20/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld: -f may not be used without -shared
    C compiler test failed.

    It looks like, by the line -fsanitize=undefined that an undefined is being passed, I don’t know why.

    Anyone knows what’s happening or an alternative way to build ?

  • When linking from a static ffmpeg library, lots of undefined references

    29 août 2019, par Lucas Zanella

    Here’s how I’m compiling ffmpeg :

    ./configure \
           --prefix=${BUILD_DIR}/desktop/x86_64 \
           --extra-cflags="-I$HOME/ffmpeg_build/include" \
           --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
           --enable-shared \
           --arch=x86_64 \
           --enable-vaapi \
           --disable-vaapi \
           --enable-opencl \
           --disable-debug \
           --enable-nvenc \
           --enable-cuda \
           --enable-cuvid \
           --enable-libvpx \
           --enable-libdrm \
           --enable-gpl \
           --enable-runtime-cpudetect \
           --enable-libfdk-aac \
           --enable-libx264 \
           --enable-openssl \
           --enable-pic \
           --extra-libs="-lpthread -lm -lz -ldl" \
           --enable-nonfree

         PATH="$HOME/bin:$PATH"
         make clean
         make -j$(nproc)
         make -j$(nproc) install
         make -j$(nproc) distclean

    Here’s the part of my cmake that links the libraries :

    add_library(AVFORMAT_LIB STATIC IMPORTED)
    set_target_properties(AVFORMAT_LIB PROPERTIES IMPORTED_LOCATION ${FFMPEG_LIB_DIR}/libavformat.a)
    add_library(AVUTIL_LIB STATIC IMPORTED)
    set_target_properties(AVUTIL_LIB PROPERTIES IMPORTED_LOCATION ${FFMPEG_LIB_DIR}/libavutil.a)
    add_library(AVCODEC_LIB STATIC IMPORTED)
    set_target_properties(AVCODEC_LIB PROPERTIES IMPORTED_LOCATION ${FFMPEG_LIB_DIR}/libavcodec.a)
    add_library(SWS_SCALE_LIB STATIC IMPORTED)
    set_target_properties(SWS_SCALE_LIB PROPERTIES IMPORTED_LOCATION ${FFMPEG_LIB_DIR}/libswscale.a)
    add_library(SWRESAMPLE_LIB STATIC IMPORTED)
    set_target_properties(SWRESAMPLE_LIB PROPERTIES IMPORTED_LOCATION ${FFMPEG_LIB_DIR}/libswresample.a)

    add_executable(orwell ${ORWELL_SOURCES})

    target_link_libraries(orwell PRIVATE
       AVFORMAT_LIB AVCODEC_LIB SWS_SCALE_LIB AVUTIL_LIB SWRESAMPLE_LIB
       ${ZLIB_LIBRARY} ${LIBDL_LIBRARY} ${X11_LIBRARY} ${LIB_VDPAU} ${LIB_VA} ${LIB_VA_DRM} ${LIB_VA_X11} ${LIBDRM_LIBRARY}
       myRtspClient pthread ${GTKMM_LIBRARIES} ${GLEW_LIBRARY} ${GLU_LIBRARY} ${GL_LIBRARY} epoxy)

    Since the libraries are static, I shouldn’t need to relink libs like libx264, libvpxdec, libfdk-aacenc, but I’m getting them as undefined references in the linking process :

    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libfdk-aacdec.o): In function `fdk_aac_decode_frame':
    libfdk-aacdec.c:(.text+0x4f): undefined reference to `aacDecoder_Fill'
    libfdk-aacdec.c:(.text+0x6d): undefined reference to `aacDecoder_DecodeFrame'
    libfdk-aacdec.c:(.text+0x8d): undefined reference to `aacDecoder_GetStreamInfo'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libfdk-aacdec.o): In function `fdk_aac_decode_close':
    libfdk-aacdec.c:(.text.unlikely+0xf): undefined reference to `aacDecoder_Close'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libfdk-aacdec.o): In function `fdk_aac_decode_init':
    libfdk-aacdec.c:(.text.unlikely+0x45): undefined reference to `aacDecoder_Open'
    libfdk-aacdec.c:(.text.unlikely+0x82): undefined reference to `aacDecoder_ConfigRaw'
    libfdk-aacdec.c:(.text.unlikely+0xb7): undefined reference to `aacDecoder_SetParam'
    libfdk-aacdec.c:(.text.unlikely+0x129): undefined reference to `aacDecoder_SetParam'
    libfdk-aacdec.c:(.text.unlikely+0x187): undefined reference to `aacDecoder_AncDataInit'
    libfdk-aacdec.c:(.text.unlikely+0x1ac): undefined reference to `aacDecoder_SetParam'
    libfdk-aacdec.c:(.text.unlikely+0x1d1): undefined reference to `aacDecoder_SetParam'
    libfdk-aacdec.c:(.text.unlikely+0x1f2): undefined reference to `aacDecoder_SetParam'
    libfdk-aacdec.c:(.text.unlikely+0x213): undefined reference to `aacDecoder_SetParam'
    libfdk-aacdec.c:(.text.unlikely+0x22f): undefined reference to `aacDecoder_SetParam'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libfdk-aacdec.o):libfdk-aacdec.c:(.text.unlikely+0x250): more undefined references to `aacDecoder_SetParam' follow
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libfdk-aacenc.o): In function `aac_encode_close':
    libfdk-aacenc.c:(.text+0xf9): undefined reference to `aacEncClose'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libfdk-aacenc.o): In function `aac_encode_frame':
    libfdk-aacenc.c:(.text+0x2c1): undefined reference to `aacEncEncode'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libfdk-aacenc.o): In function `aac_encode_init':
    libfdk-aacenc.c:(.text.unlikely+0x3c): undefined reference to `aacEncOpen'
    libfdk-aacenc.c:(.text.unlikely+0x7c): undefined reference to `aacEncoder_SetParam'
    libfdk-aacenc.c:(.text.unlikely+0xb8): undefined reference to `aacEncoder_SetParam'
    libfdk-aacenc.c:(.text.unlikely+0xfa): undefined reference to `aacEncoder_SetParam'
    libfdk-aacenc.c:(.text.unlikely+0x180): undefined reference to `aacEncoder_SetParam'
    libfdk-aacenc.c:(.text.unlikely+0x25d): undefined reference to `aacEncoder_SetParam'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libfdk-aacenc.o):libfdk-aacenc.c:(.text.unlikely+0x28d): more undefined references to `aacEncoder_SetParam' follow
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libfdk-aacenc.o): In function `aac_encode_init':
    libfdk-aacenc.c:(.text.unlikely+0x567): undefined reference to `aacEncEncode'
    libfdk-aacenc.c:(.text.unlikely+0x5a1): undefined reference to `aacEncInfo'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libvpxdec.o): In function `vpx_decode':
    libvpxdec.c:(.text+0x58): undefined reference to `vpx_codec_decode'
    libvpxdec.c:(.text+0xa2): undefined reference to `vpx_codec_get_frame'
    libvpxdec.c:(.text+0x10c): undefined reference to `vpx_codec_error'
    libvpxdec.c:(.text+0x117): undefined reference to `vpx_codec_error_detail'
    libvpxdec.c:(.text+0x19e): undefined reference to `vpx_codec_decode'
    libvpxdec.c:(.text+0x1ae): undefined reference to `vpx_codec_error'
    libvpxdec.c:(.text+0x1ca): undefined reference to `vpx_codec_get_frame'
    libvpxdec.c:(.text+0x560): undefined reference to `vpx_codec_vp9_dx_algo'
    libvpxdec.c:(.text+0x58f): undefined reference to `vpx_codec_vp8_dx_algo'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libvpxdec.o): In function `vpx_free':
    libvpxdec.c:(.text.unlikely+0x9): undefined reference to `vpx_codec_destroy'
    libvpxdec.c:(.text.unlikely+0x18): undefined reference to `vpx_codec_destroy'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libvpxdec.o): In function `vpx_init':
    libvpxdec.c:(.text.unlikely+0x87): undefined reference to `vpx_codec_version_str'
    libvpxdec.c:(.text.unlikely+0xa5): undefined reference to `vpx_codec_build_config'
    libvpxdec.c:(.text.unlikely+0xdf): undefined reference to `vpx_codec_dec_init_ver'
    libvpxdec.c:(.text.unlikely+0xed): undefined reference to `vpx_codec_error'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libvpxdec.o): In function `vp8_init':
    libvpxdec.c:(.text.unlikely+0x134): undefined reference to `vpx_codec_vp8_dx_algo'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libvpxdec.o): In function `vp9_init':
    libvpxdec.c:(.text.unlikely+0x142): undefined reference to `vpx_codec_vp9_dx_algo'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libvpxenc.o): In function `vpx_encode':
    libvpxenc.c:(.text+0xda): undefined reference to `vpx_codec_encode'
    libvpxenc.c:(.text+0x2b3): undefined reference to `vpx_codec_encode'
    libvpxenc.c:(.text+0x33a): undefined reference to `vpx_codec_get_cx_data'
    libvpxenc.c:(.text+0x3cd): undefined reference to `vpx_codec_get_cx_data'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libvpxenc.o): In function `log_encoder_error':
    libvpxenc.c:(.text.unlikely+0x351): undefined reference to `vpx_codec_error'
    libvpxenc.c:(.text.unlikely+0x35c): undefined reference to `vpx_codec_error_detail'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libvpxenc.o): In function `codecctl_int':
    libvpxenc.c:(.text.unlikely+0x43a): undefined reference to `vpx_codec_control_'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libvpxenc.o): In function `vpx_init':
    libvpxenc.c:(.text.unlikely+0x4fb): undefined reference to `vpx_codec_get_caps'
    libvpxenc.c:(.text.unlikely+0x503): undefined reference to `vpx_codec_version_str'
    libvpxenc.c:(.text.unlikely+0x521): undefined reference to `vpx_codec_build_config'
    libvpxenc.c:(.text.unlikely+0x563): undefined reference to `vpx_codec_enc_config_default'
    libvpxenc.c:(.text.unlikely+0x573): undefined reference to `vpx_codec_err_to_string'
    libvpxenc.c:(.text.unlikely+0xc2c): undefined reference to `vpx_codec_enc_init_ver'
    libvpxenc.c:(.text.unlikely+0xc86): undefined reference to `vpx_codec_enc_init_ver'
    libvpxenc.c:(.text.unlikely+0xffb): undefined reference to `vpx_img_wrap'
    libvpxenc.c:(.text.unlikely+0x1040): undefined reference to `vpx_img_wrap'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libvpxenc.o): In function `vp8_init':
    libvpxenc.c:(.text.unlikely+0x10be): undefined reference to `vpx_codec_vp8_cx'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libvpxenc.o): In function `vp9_init':
    libvpxenc.c:(.text.unlikely+0x10d3): undefined reference to `vpx_codec_vp9_cx'
    ../../../deps/ffmpeg/build/desktop/x86_64/lib/libavcodec.a(libvpxenc.o): In function `vpx_free':
    ...

    Why this happens ?