Recherche avancée

Médias (91)

Autres articles (43)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • 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" (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

Sur d’autres sites (4947)

  • ffmpeg HLS creation and segmentation results in "cannot decode" on iPad

    5 mai 2014, par jt_dylan

    I have the following code that plays on Mac Safari :

       
         
         
         

       <video controls="controls" width="480" height="270">
       
       <source src="http://d1ckv7o9k6o3x9.cloudfront.net/d54cfa01-eff2-4e86-946e-dc8b2ee4a7e8/media/  hls/MVI_5927.m3u8">
       </source></video>

    The url can be cut/pasted into the browser and works also but neither this code nor the url works in Windows Safari or iPad. Specifically on iPad I receive a cannot decode error. On Mac I have Quicktime installed so I tried that on Windows with no luck. The link that can be play on Mac is below.

    http://d1ckv7o9k6o3x9.cloudfront.net/d54cfa01-eff2-4e86-946e-dc8b2ee4a7e8/media/hls/MVI_5927.m3u8

    Browser Versions of software :
    Mac Safari : Version 7.0.3 (9537.75.14) (works)
    Windows Safari : Version 5.1.7 (7534.7.2) (doesn’t work - blank screen)
    iPad Safari : ios Version 7.1.1 (doesn’t work - cannot decode)

    Here is how I’m creating my mp4 (lgpl)
    I’m creating an mp4 with this command :
    ffmpeg -i input.mov c:v mpeg4 q:v 1 test.mp4

    I’m creating the hls using ffmpeg lpgl with this command :

    ffmpegcmd -re -y -i test.mp4 -map 0 -f segment -segment_list test.m3u8 -segment_list_flags +live -segment_time 1 -segment_list_type m3u8 test%05d.ts 2>&amp;1

    Now this works in Mac Safari with Quicktime installed but results in "cannot decode" if I try the url from ipad Safari.

    I then tried with libx264 to create the mp4 as h.264 with aac and then copy to mpeg2 container as follows :

    ffmpeg -i test.mov  -c:v libx264 -c:a libfdk_aac -preset slower -b:a 240k test.slower.mp4
    ffmpeg -i test.slower.mp4 -vcodec copy -f mpegts -bsf h264_mp4toannexb test.slower.ts
    ffmpeg -re -y -i test.slower.ts -map 0 -f segment -segment_list test.slower.m3u8 -segment_list_flags +live -segment_time 1 -segment_list_type m3u8 test.slower.%05d.ts

    This still produces the same results. Any idea what is wrong here ?

    Any help is much appreciated.

    Regards,
    jt_dylan

    Output from libx264 commands below :

    ffmpeg -i test.mov  -c:v libx264 -c:a libfdk_aac -preset slower -b:a 240k test.slower.mp4

    ffmpeg version git-2014-05-04-aeeb3d4 Copyright (c) 2000-2014 the FFmpeg developers
     built on May  4 2014 17:01:19 with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2)
     configuration: --prefix=/home/ec2-user/ffmpeg_build --extra-cflags=-I/home/ec2-user/ffmpeg_build/include --extra-ldflags=-L/home/ec2-user/ffmpeg_build/lib --bindir=/home/ec2-user/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
     libavutil      52. 81.100 / 52. 81.100
     libavcodec     55. 60.103 / 55. 60.103
     libavformat    55. 37.102 / 55. 37.102
     libavdevice    55. 13.101 / 55. 13.101
     libavfilter     4.  5.100 /  4.  5.100
     libswscale      2.  6.100 /  2.  6.100
     libswresample   0. 18.100 /  0. 18.100
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tst/MVI_1716.MOV':
     Metadata:
       major_brand     : qt  
       minor_version   : 537331968
       compatible_brands: qt  CAEP
       creation_time   : 2012-07-21 05:17:44
     Duration: 00:00:20.06, start: 0.000000, bitrate: 34471 kb/s
       Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p(pc, smpte170m), 1920x1080, 33663 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 48k tbc (default)
       Metadata:
         creation_time   : 2012-07-21 05:17:44
       Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16, 768 kb/s (default)
       Metadata:
         creation_time   : 2012-07-21 05:17:44
    No pixel format specified, yuvj420p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x39ae9e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
    [libx264 @ 0x39ae9e0] profile High, level 5.0
    [libx264 @ 0x39ae9e0] 264 - core 142 r2 ac76440 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=8 deblock=1:0:0 analyse=0x3:0x133 me=umh subme=9 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'tstconv/MVI_1716.slower.mp4':
     Metadata:
       major_brand     : qt  
       minor_version   : 537331968
       compatible_brands: qt  CAEP
       encoder         : Lavf55.37.102
       Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p, 1920x1080, q=-1--1, 24k tbn, 23.98 tbc (default)
       Metadata:
         creation_time   : 2012-07-21 05:17:44
       Stream #0:1(eng): Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 48000 Hz, mono, s16, 240 kb/s (default)
       Metadata:
         creation_time   : 2012-07-21 05:17:44
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 -> libx264)
     Stream #0:1 -> #0:1 (pcm_s16le -> libfdk_aac)
    Press [q] to stop, [?] for help
    frame=  481 fps=1.5 q=-1.0 Lsize=   18428kB time=00:00:20.07 bitrate=7519.9kbits/s    
    video:17827kB audio:589kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.060811%
    [libx264 @ 0x39ae9e0] frame I:3     Avg QP:23.31  size:113718
    [libx264 @ 0x39ae9e0] frame P:135   Avg QP:25.06  size: 56912
    [libx264 @ 0x39ae9e0] frame B:343   Avg QP:27.13  size: 29825
    [libx264 @ 0x39ae9e0] consecutive B-frames:  1.2%  4.2% 20.6% 74.0%
    [libx264 @ 0x39ae9e0] mb I  I16..4: 20.0% 53.3% 26.6%
    [libx264 @ 0x39ae9e0] mb P  I16..4:  9.7% 22.8%  5.4%  P16..4: 41.0%  8.6%  5.4%  0.1%  0.0%    skip: 7.0%
    [libx264 @ 0x39ae9e0] mb B  I16..4:  3.3%  7.2%  2.0%  B16..8: 40.7%  9.8%  1.7%  direct: 6.3%  skip:29.0%  L0:49.6% L1:44.7% BI: 5.7%
    [libx264 @ 0x39ae9e0] 8x8 transform intra:58.9% inter:70.2%
    [libx264 @ 0x39ae9e0] direct mvs  spatial:99.4% temporal:0.6%
    [libx264 @ 0x39ae9e0] coded y,uvDC,uvAC intra: 58.6% 46.9% 7.3% inter: 23.9% 20.2% 0.2%
    [libx264 @ 0x39ae9e0] i16 v,h,dc,p: 10% 64% 14% 12%
    [libx264 @ 0x39ae9e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  7% 50% 10%  3%  4%  3%  8%  4% 12%
    [libx264 @ 0x39ae9e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu:  4% 64%  5%  2%  3%  2%  6%  2% 10%
    [libx264 @ 0x39ae9e0] i8c dc,h,v,p: 35% 53%  9%  3%
    [libx264 @ 0x39ae9e0] Weighted P-Frames: Y:11.1% UV:4.4%
    [libx264 @ 0x39ae9e0] ref P L0: 47.8% 12.2% 15.8%  6.8%  5.7%  4.2%  4.3%  2.6%  0.6%  0.0%
    [libx264 @ 0x39ae9e0] ref B L0: 76.8% 10.5%  5.1%  2.9%  2.2%  1.5%  0.9%
    [libx264 @ 0x39ae9e0] ref B L1: 94.6%  5.4%
    [libx264 @ 0x39ae9e0] kb/s:7279.24

    ffmpeg -i test.slower.mp4 -vcodec copy -f mpegts -bsf h264_mp4toannexb test.slower.ts

    ffmpeg version git-2014-05-04-aeeb3d4 Copyright (c) 2000-2014 the FFmpeg developers
     built on May  4 2014 17:01:19 with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2)
     configuration: --prefix=/home/ec2-user/ffmpeg_build --extra-cflags=-I/home/ec2-user/ffmpeg_build/include --extra-ldflags=-L/home/ec2-user/ffmpeg_build/lib --bindir=/home/ec2-user/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
     libavutil      52. 81.100 / 52. 81.100
     libavcodec     55. 60.103 / 55. 60.103
     libavformat    55. 37.102 / 55. 37.102
     libavdevice    55. 13.101 / 55. 13.101
     libavfilter     4.  5.100 /  4.  5.100
     libswscale      2.  6.100 /  2.  6.100
     libswresample   0. 18.100 /  0. 18.100
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tstconv/MVI_1716.slower.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf55.37.102
     Duration: 00:00:20.11, start: 0.042667, bitrate: 7508 kb/s
       Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 1920x1080, 7279 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 240 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    [swscaler @ 0x367c0c0] deprecated pixel format used, make sure you did set range correctly
    Output #0, segment, to 'MVI_1716.slower.%05d.ts':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf55.37.102
       Stream #0:0(eng): Video: mpeg2video, yuv420p, 1920x1080, q=2-31, 200 kb/s, 90k tbn, 23.98 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(eng): Audio: mp2, 48000 Hz, mono, s16, 384 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 -> mpeg2video)
     Stream #0:1 -> #0:1 (aac -> mp2)
    Press [q] to stop, [?] for help
    frame=  482 fps= 24 q=31.0 Lsize=N/A time=00:00:20.12 bitrate=N/A dup=1 drop=0    
    video:8293kB audio:944kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 195032183209984.000000%
    ffmpeg version git-2014-05-04-aeeb3d4 Copyright (c) 2000-2014 the FFmpeg developers
     built on May  4 2014 17:01:19 with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2)
     configuration: --prefix=/home/ec2-user/ffmpeg_build --extra-cflags=-I/home/ec2-user/ffmpeg_build/include --extra-ldflags=-L/home/ec2-user/ffmpeg_build/lib --bindir=/home/ec2-user/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
     libavutil      52. 81.100 / 52. 81.100
     libavcodec     55. 60.103 / 55. 60.103
     libavformat    55. 37.102 / 55. 37.102
     libavdevice    55. 13.101 / 55. 13.101
     libavfilter     4.  5.100 /  4.  5.100
     libswscale      2.  6.100 /  2.  6.100
     libswresample   0. 18.100 /  0. 18.100
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tstconv/MVI_1716.slower.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf55.37.102
     Duration: 00:00:20.11, start: 0.042667, bitrate: 7508 kb/s
       Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 1920x1080, 7279 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 240 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    File 'tstconv/MVI_1716.slower.ts' already exists. Overwrite ? [y/N] y
    Output #0, mpegts, to 'tstconv/MVI_1716.slower.ts':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf55.37.102
       Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuvj420p, 1920x1080, q=2-31, 7279 kb/s, 23.98 fps, 90k tbn, 23.98 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(eng): Audio: mp2, 48000 Hz, mono, s16, 384 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (aac -> mp2)
    Press [q] to stop, [?] for help
    frame=  481 fps=0.0 q=-1.0 Lsize=   20334kB time=00:00:20.12 bitrate=8276.6kbits/s    
    video:17827kB audio:944kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.325850%

    ffmpeg -re -y -i test.slower.ts -map 0 -f segment -segment_list test.slower.m3u8 -segment_list_flags +live -segment_time 1 -segment_list_type m3u8 test.slower.%05d.ts

    ffmpeg version git-2014-05-04-aeeb3d4 Copyright (c) 2000-2014 the FFmpeg developers
     built on May  4 2014 17:01:19 with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2)
     configuration: --prefix=/home/ec2-user/ffmpeg_build --extra-cflags=-I/home/ec2-user/ffmpeg_build/include --extra-ldflags=-L/home/ec2-user/ffmpeg_build/lib --bindir=/home/ec2-user/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
     libavutil      52. 81.100 / 52. 81.100
     libavcodec     55. 60.103 / 55. 60.103
     libavformat    55. 37.102 / 55. 37.102
     libavdevice    55. 13.101 / 55. 13.101
     libavfilter     4.  5.100 /  4.  5.100
     libswscale      2.  6.100 /  2.  6.100
     libswresample   0. 18.100 /  0. 18.100
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, mpegts, from 'tstconv/MVI_1716.slower.ts':
     Duration: 00:00:20.11, start: 1.430733, bitrate: 8282 kb/s
     Program 1
       Metadata:
         service_name    : Service01
         service_provider: FFmpeg
       Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuvj420p(pc), 1920x1080, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
       Stream #0:1[0x101](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, mono, s16p, 373 kb/s
    [swscaler @ 0x1fe9ae0] deprecated pixel format used, make sure you did set range correctly
       Output #0, segment, to 'MVI_1716.slower.%05d.ts':
         Metadata:
           encoder         : Lavf55.37.102
           Stream #0:0: Video: mpeg2video, yuv420p, 1920x1080, q=2-31, 200 kb/s, 90k tbn, 23.98 tbc
           Stream #0:1(eng): Audio: mp2, 48000 Hz, mono, s16, 384 kb/s
       Stream mapping:
         Stream #0:0 -> #0:0 (h264 -> mpeg2video)
         Stream #0:1 -> #0:1 (mp2 -> mp2)
  • OpenCV VideoWriter using ffmpeg with "Could not open codec 'libx264'" Error

    28 septembre 2016, par user2262504

    I am new to OpenCV, and I want write Mat images into video using VideoWriter on Ubuntu 12.04. But when constructing VideoWriter, errors came out.

    It seems that OpenCV invoke ffmpeg API using default parameters and ffmpeg invoke x264 using its default parameters. Then these setting is broken for libx264. Thus the "Could not open codec ’libx264’" error.

    Anyone has ideas to solve this problem ?

    More specifically :

    1. anyone knows where and how OpenCV invoke ffmpeg API ?
    2. how to change ffmpeg default settings using code, hopefull, can be easily embeded into OpenCV ?
    3. will changes of default in ffmpeg be carried to libx264 ?

    Errors :

    1. Uising CV_FOURCC('H', '2', '6', '4')
    [libx264 @ 0x255de40] broken ffmpeg default settings detected
    [libx264 @ 0x255de40] use an encoding preset (e.g. -vpre medium)
    [libx264 @ 0x255de40] preset usage: -vpre <speed> -vpre <profile>
    [libx264 @ 0x255de40] speed presets are listed in x264 --help
    [libx264 @ 0x255de40] profile is optional; x264 defaults to high
    Could not open codec 'libx264': Unspecified error

    2. Using FOURCC = -1 to invoke user customized codec
    OpenCV Error: Unsupported format or combination of formats (Gstreamer Opencv
    backend doesn't support this codec acutally.) in CvVideoWriter_GStreamer::open,
    file /home/XXX/Downloads/opencv-2.4.8/modules/highgui/src/cap_gstreamer.cpp,
    line 505 terminate called after throwing an instance of 'cv::Exception'
    what():  /home/XXX/Downloads/opencv-2.4.8/modules/highgui/src/cap_gstreamer.cpp:
    505: error: (-210) Gstreamer Opencv backend doesn't support this codec acutally.
    in function CvVideoWriter_GStreamer::open
    </profile></speed>

    Codes :

    int main(int argc, char *argv[])
    {
       VideoWriter outputVideo;
       bool fourcc_on = true; //switch on / off different error
       if (fourcc_on)
           outputVideo.open("outVideo.avi", CV_FOURCC('H', '2', '6', '4'), 25, Size(100, 100), true);
       else
           outputVideo.open("outVideo.avi", -1, 25, Size(100, 100), true);

       if (!outputVideo.isOpened())
       {
           cout  &lt;&lt; "Could not open the output video for write" &lt;&lt; endl;
           return -1;
       }
       return 0;
    }

    OpenCV Configuration :

    -- Detected version of GNU GCC: 46 (406)
    -- Found OpenEXR: /usr/lib/libIlmImf.so
    -- Looking for linux/videodev.h
    -- Looking for linux/videodev.h - not found
    -- Looking for linux/videodev2.h
    -- Looking for linux/videodev2.h - found
    -- Looking for sys/videoio.h
    -- Looking for sys/videoio.h - not found
    -- Looking for libavformat/avformat.h
    -- Looking for libavformat/avformat.h - found
    -- Looking for ffmpeg/avformat.h
    -- Looking for ffmpeg/avformat.h - not found
    -- Could NOT find JNI (missing:  JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
    --
    -- General configuration for OpenCV 2.4.8 =====================================
    --   Version control:               unknown
    --
    --   Platform:
    --     Host:                        Linux 3.8.0-38-generic x86_64
    --     CMake:                       2.8.7
    --     CMake generator:             Unix Makefiles
    --     CMake build tool:            /usr/bin/make
    --     Configuration:               RELEASE
    --
    --   C/C++:
    --     Built as dynamic libs?:      YES
    --     C++ Compiler:                /usr/bin/c++  (ver 4.6)
    --     C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG  -DNDEBUG
    --     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG
    --     C Compiler:                  /usr/bin/gcc
    --     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG  -DNDEBUG
    --     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG
    --     Linker flags (Release):      
    --     Linker flags (Debug):        
    --     Precompiled headers:         YES
    --
    --   OpenCV modules:
    --     To be built:                 core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib python stitching superres ts videostab
    --     Disabled:                    world
    --     Disabled by dependency:      -
    --     Unavailable:                 androidcamera dynamicuda java
    --
    --   GUI:
    --     QT:                          NO
    --     GTK+ 2.x:                    YES (ver 2.24.10)
    --     GThread :                    YES (ver 2.32.4)
    --     GtkGlExt:                    NO
    --     OpenGL support:              NO
    --
    --   Media I/O:
    --     ZLib:                        /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.3.4)
    --     JPEG:                        /usr/lib/x86_64-linux-gnu/libjpeg.so (ver )
    --     PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.46)
    --     TIFF:                        /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 3.9.5)
    --     JPEG 2000:                   /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1)
    --     OpenEXR:                     /usr/lib/libImath.so /usr/lib/libIlmImf.so /usr/lib/libIex.so /usr/lib/libHalf.so /usr/lib/libIlmThread.so (ver 1.6.1)
    --
    --   Video I/O:
    --     DC1394 1.x:                  NO
    --     DC1394 2.x:                  YES (ver 2.2.0)
    --     FFMPEG:                      YES
    --       codec:                     YES (ver 55.58.105)
    --       format:                    YES (ver 55.37.101)
    --       util:                      YES (ver 52.78.100)
    --       swscale:                   YES (ver 2.6.100)
    --       gentoo-style:              YES
    --     GStreamer:                  
    --       base:                      YES (ver 0.10.36)
    --       app:                       YES (ver 0.10.36)
    --       video:                     YES (ver 0.10.36)
    --     OpenNI:                      NO
    --     OpenNI PrimeSensor Modules:  NO
    --     PvAPI:                       NO
    --     GigEVisionSDK:               NO
    --     UniCap:                      NO
    --     UniCap ucil:                 NO
    --     V4L/V4L2:                    Using libv4l (ver 1.0.1)
    --     XIMEA:                       NO
    --     Xine:                        NO
    --
    --   Other third-party libraries:
    --     Use IPP:                     NO
    --     Use Eigen:                   NO
    --     Use TBB:                     NO
    --     Use OpenMP:                  NO
    --     Use GCD                      NO
    --     Use Concurrency              NO
    --     Use C=:                      NO
    --     Use Cuda:                    NO
    --     Use OpenCL:                  YES
    --
    --   OpenCL:
    --     Version:                     dynamic
    --     Include path:                /home/shixudongleo/Downloads/opencv-2.4.8/3rdparty/include/opencl/1.2
    --     Use AMD FFT:                 NO
    --     Use AMD BLAS:                NO
    --
    --   Python:
    --     Interpreter:                 /usr/bin/python (ver 2.7.3)
    --     Libraries:                   /usr/lib/libpython2.7.so
    --     numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.6.1)
    --     packages path:               lib/python2.7/dist-packages
    --
    --   Java:
    --     ant:                         NO
    --     JNI:                         NO
    --     Java tests:                  NO
    --
    --   Documentation:
    --     Build Documentation:         NO
    --     Sphinx:                      NO
    --     PdfLaTeX compiler:           /usr/bin/pdflatex
    --
    --   Tests and samples:
    --     Tests:                       YES
    --     Performance tests:           YES
    --     C/C++ Examples:              NO
    --
    --   Install path:                  /usr/local
    --
    --   cvconfig.h is in:              /home/shixudongleo/Downloads/opencv-2.4.8/build
    -- -----------------------------------------------------------------
    --
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/XXX/Downloads/opencv-2.4.8/build

    FFMPEG

    ffmpeg is enable to support OpenCV and libx264 is enabled when compiling ffmpeg.
    By using ffmpeg command line, libx264 is running normally.

    $ ffmpeg -i test.avi -vcodec libx264 test.mp4
    ffmpeg -i test.avi -vcodec libx264 test.mp4 > ~/Downloads/ffmpeg_log.txt
    ffmpeg version 2.2.git Copyright (c) 2000-2014 the FFmpeg developers
     built on Apr 24 2014 16:39:51 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
     configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-shared --enable-pic
     libavutil      52. 78.100 / 52. 78.100
     libavcodec     55. 58.105 / 55. 58.105
     libavformat    55. 37.101 / 55. 37.101
     libavdevice    55. 13.100 / 55. 13.100
     libavfilter     4.  4.100 /  4.  4.100
     libswscale      2.  6.100 /  2.  6.100
     libswresample   0. 18.100 /  0. 18.100
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, avi, from 'test.avi':
     Duration: 00:00:03.73, start: 0.000000, bitrate: 1757 kb/s
       Stream #0:0: Video: msvideo1 (CRAM / 0x4D415243), rgb555le, 320x240, 1781 kb/s, 15 tbr, 15 tbn, 15 tbc
       Metadata:
         title           : julius.avi Video #1
    File 'test.mp4' already exists. Overwrite ? [y/N] y
    No pixel format specified, yuv444p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x25d08e0] using cpu capabilities: none!
    [libx264 @ 0x25d08e0] profile High 4:4:4 Predictive, level 1.2, 4:4:4 8-bit
    [libx264 @ 0x25d08e0] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=12 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=15 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'test.mp4':
     Metadata:
       encoder         : Lavf55.37.101
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p, 320x240, q=-1--1, 15360 tbn, 15 tbc
       Metadata:
         title           : julius.avi Video #1
    Stream mapping:
     Stream #0:0 -> #0:0 (msvideo1 -> libx264)
    Press [q] to stop, [?] for help
    frame=   56 fps=0.0 q=-1.0 Lsize=     321kB time=00:00:03.60 bitrate= 731.0kbits/s    
    video:320kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.409949%
    [libx264 @ 0x25d08e0] frame I:3     Avg QP:15.36  size:  7975
    [libx264 @ 0x25d08e0] frame P:38    Avg QP:26.05  size:  6230
    [libx264 @ 0x25d08e0] frame B:15    Avg QP:28.25  size:  4418
    [libx264 @ 0x25d08e0] consecutive B-frames: 46.4% 53.6%  0.0%  0.0%
    [libx264 @ 0x25d08e0] mb I  I16..4:  1.4% 72.8% 25.8%
    [libx264 @ 0x25d08e0] mb P  I16..4:  1.6%  5.7% 15.1%  P16..4:  7.6%  6.3%  7.4%  0.0%  0.0%    skip:56.3%
    [libx264 @ 0x25d08e0] mb B  I16..4:  0.2%  1.0%  2.0%  B16..8: 13.3%  7.8%  8.7%  direct: 8.3%  skip:58.8%  L0:34.9% L1:36.6% BI:28.5%
    [libx264 @ 0x25d08e0] 8x8 transform intra:37.7% inter:2.3%
    [libx264 @ 0x25d08e0] coded y,u,v intra: 52.1% 42.1% 30.1% inter: 19.6% 9.2% 5.2%
    [libx264 @ 0x25d08e0] i16 v,h,dc,p: 56% 17% 24%  2%
    [libx264 @ 0x25d08e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 16% 68%  1%  1%  1%  1%  1%  1%
    [libx264 @ 0x25d08e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 18% 28%  5%  6%  5%  7%  5%  6%
    [libx264 @ 0x25d08e0] Weighted P-Frames: Y:31.6% UV:21.1%
    [libx264 @ 0x25d08e0] ref P L0: 70.5%  9.0% 12.1%  6.5%  2.0%
    [libx264 @ 0x25d08e0] ref B L0: 91.3%  8.7%
    [libx264 @ 0x25d08e0] kb/s:700.56
  • libx264 encoder error in ffmpeg android build

    26 décembre 2013, par kerim yucel

    Right now, I have a ffmeg build script which recognizes libx264 and compiles succesfully. I have also compiled x264 and obtained libx264.a library. Both ffmpeg and libx264 are built from source. I can build ffmpeg without libx264 succesfully as well. Below you may find my script which tries to build ffmpeg with libx264.

    #!/bin/bash
    NDK=~/Android_NDK_r7b
    PLATFORM=$NDK/platforms/android-8/arch-arm/
    PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
    alitan=~/x264/ndk7_build
    function build_one
    {
    ./configure --target-os=linux \
    --prefix=$PREFIX \
    --enable-cross-compile \
    --extra-libs="-lgcc " \
    --arch=arm \
    --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
    --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
    --nm=$PREBUILT/bin/arm-linux-androideabi-nm \
    --sysroot=$PLATFORM \
    --extra-cflags=" -I$alitan/include" \
    --disable-shared \
    --enable-static \
    --extra-ldflags=" -L$alitan/lib " \
    --enable-version3 \
    --enable-gpl \
    --disable-doc \
    --disable-everything \
    --enable-libx264 \
    --enable-encoder=libx264 \
    $ADDITIONAL_CONFIGURE_FLAG

    make clean
    make -j4 install
    $PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o
    $PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -soname libffmpeg.so -shared -nostdlib -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a
    }

    #arm v7vfpv3
    CPU=armv7-a
    OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=$CPU "
    PREFIX=./DONE/$CPU
    ADDITIONAL_CONFIGURE_FLAG=
    build_one

    Above script doesn't give me libx264.a in ffmpeg output builds.Several other scenarios are as follows.
    If I enable x264 encoder, I get undefined reference errors to some variables in x264.c (in libavcodec).
    If I enable shared in ffmpeg configure, I get an error which says it can't cd to my prefix directory (no permission issues by the way).

    I am using latest releases of ffmpeg and x264 (cloned the git today) and ndk 7. Ubuntu runs on VM, installed on Windows 7. For further details about my adventure of ffmpeg/x264 porting to Android, you may refer here.

    What should I do to use libx264 with ffmpeg ? I kept on trying this script with different configurations, removed all ffmpeg x264 folders and reinstalled them, but to no avail.

    Thanks a lot in advance.

    EDIT
    Below is my x264 build script. It builds fine, gives me the static library and the headers.

    export ARM_ROOT=/home/mehmet/Android_NDK_r7b
    export ARM_INC=$ARM_ROOT/platforms/android-8/arch-arm/usr/include/
    export ARM_LIB=$ARM_ROOT/platforms/android-8/arch-arm/usr/lib/
    export ARM_TOOL=$ARM_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
    export ARM_LIBO=$ARM_TOOL/lib/gcc/arm-linux-androideabi/4.4.3
    export PATH=$ARM_TOOL/bin:$PATH
    export PATH=$ARM_TOOL/arm-linux-androideabi/bin:$PATH
    export ARM_PRE=arm-linux-androideabi
    #tries to build for 4.4.3 toolchain

    ./configure --prefix=./ndk7_build \
    --disable-gpac \
    --extra-cflags=" -I$ARM_INC -fPIC -DANDROID -fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -DANDROID -Wa,--noexecstack -MMD -MP " \
    --extra-ldflags=" -nostdlib -Bdynamic -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,nocopyreloc -Wl,-soname,/system/lib/libz.so -Wl,-rpath-link=$ARM_LIB,-dynamic-linker=/system/bin/linker -L$ARM_LIB -nostdlib $ARM_LIB/crtbegin_dynamic.o $ARM_LIB/crtend_android.o -lc -lm -ldl -lgcc " \
    --cross-prefix=${ARM_PRE}- \
    --disable-asm \
    --enable-static \
    --host=arm-linux \

    This is what happens on terminal when i enable libx264 encoder.

    STRIP   ffmpeg
    INSTALL install-progs-yes
    INSTALL ffmpeg
    INSTALL ffprobe
    libavcodec/libavcodec.a(libx264.o): In function `X264_frame&#39;:
    /home/mehmet/ffmpeg/libavcodec/libx264.c:158: undefined reference to `x264_picture_init&#39;
    /home/mehmet/ffmpeg/libavcodec/libx264.c:178: undefined reference to `x264_encoder_reconfig&#39;
    /home/mehmet/ffmpeg/libavcodec/libx264.c:189: undefined reference to `x264_encoder_encode&#39;
    /home/mehmet/ffmpeg/libavcodec/libx264.c:195: undefined reference to `x264_encoder_delayed_frames&#39;
    libavcodec/libavcodec.a(libx264.o): In function `encode_nals&#39;:
    /home/mehmet/ffmpeg/libavcodec/libx264.c:100: undefined reference to `x264_bit_depth&#39;
    libavcodec/libavcodec.a(libx264.o): In function `X264_close&#39;:
    /home/mehmet/ffmpeg/libavcodec/libx264.c:230: undefined reference to `x264_encoder_close&#39;
    libavcodec/libavcodec.a(libx264.o): In function `X264_init&#39;:
    /home/mehmet/ffmpeg/libavcodec/libx264.c:283: undefined reference to `x264_param_default&#39;
    /home/mehmet/ffmpeg/libavcodec/libx264.c:291: undefined reference to `x264_param_default_preset&#39;
    /home/mehmet/ffmpeg/libavcodec/libx264.c:313: undefined reference to `x264_param_parse&#39;
    /home/mehmet/ffmpeg/libavcodec/libx264.c:448: undefined reference to `x264_param_apply_fastfirstpass&#39;
    /home/mehmet/ffmpeg/libavcodec/libx264.c:451: undefined reference to `x264_param_apply_profile&#39;
    /home/mehmet/ffmpeg/libavcodec/libx264.c:494: undefined reference to `x264_encoder_open_125&#39;
    /home/mehmet/ffmpeg/libavcodec/libx264.c:505: undefined reference to `x264_encoder_headers&#39;