
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (68)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
Sélection de projets utilisant MediaSPIP
29 avril 2011, parLes exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
Ferme MediaSPIP @ Infini
L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)
Sur d’autres sites (5716)
-
HTML5 Video Chrome - ffmpeg - mp4 working in all but Chrome
16 octobre 2014, par IIIOXIIII have successfully encoded a file to .mp4 using ffmpeg which will play in all tested devices (Safari on PC, IE on PC, Android Browser, Andriod Video Player, and Safari iPad), except for Chrome.
As a work-around, I had planned to simply list the .ogg source prior to the .mp4 source so that chrome would play the .ogg source without even seeing the .mp4 source, however, I ran into the issue mentioned here.
Basically, I am after the proper ffmpeg command which will encode an .mp4 video to standards which will play in Chrome - of course without losing playback functionality on any of the other previously mentioned platforms.
I have tried several combinations, such as :
ffmpeg -i [filename].wmv -vprofile baseline -level 30 -vf scale=640:-1 -movflags faststart [filename].mp4
etc. but have not yet found the winning one.
EDIT : I tried :
ffmpeg_new -i [filename].wmv -strict experimental –acodec libvo_aacenc -ac 2 -ab 160k -vcodec libx264 -vf scale=640:-1 -pix_fmt yuv420p -preset slow -profile:v baseline -level 30 -maxrate 10000000 -bufsize 10000000 -b 1200k -f mp4 -threads 0 [filename].mp4
And here is the ffmpeg output :
ffmpeg version N-54207-ge59fb3f Copyright (c) 2000-2013 the FFmpeg developers built on Jun 25 2013 21:55:00 with gcc 4.7.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
enable-libxvid --enable-zlib
libavutil 52. 37.101 / 52. 37.101
libavcodec 55. 17.100 / 55. 17.100
libavformat 55. 10.100 / 55. 10.100
libavdevice 55. 2.100 / 55. 2.100
libavfilter 3. 77.101 / 3. 77.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
[asf @ 000000000254f9e0] Stream #0: not enough frames to estimate rate; consider
increasing probesize
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, asf, from 'C:\vidtests\Wildlife.wmv':
Metadata:
SfOriginalFPS : 299700
WMFSDKVersion : 11.0.6001.7000
WMFSDKNeeded : 0.0.0.0000
comment : Footage: Small World Productions, Inc; Tourism New Zealand
| Producer: Gary F. Spradling | Music: Steve Ball
title : Wildlife in HD
copyright : © 2008 Microsoft Corporation
IsVBR : 0
DeviceConformanceTemplate: AP@L3
Duration: 00:00:30.09, start: 0.000000, bitrate: 6977 kb/s
Stream #0:0(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp
, 192 kb/s
Stream #0:1(eng): Video: vc1 (Advanced) (WVC1 / 0x31435657), yuv420p, 1280x7
20, 5942 kb/s, 29.97 tbr, 1k tbn, 1k tbc
Please use -b:a or -b:v, -b is ambiguous
[libx264 @ 000000000264faa0] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 000000000264faa0] profile Constrained Baseline, level 3.0
[libx264 @ 000000000264faa0] 264 - core 133 r2334 a3ac64b - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=0 r
ef=5 deblock=1:0:0 analyse=0x1:0x111 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed
_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pski
p=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 deci
mate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyi
nt=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=abr mbtree=1
bitrate=1200 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=10000
vbv_bufsize=10000 nal_hrd=none ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'C:\vidtests\Wildlife_SE1.mp4':
Metadata:
SfOriginalFPS : 299700
WMFSDKVersion : 11.0.6001.7000
WMFSDKNeeded : 0.0.0.0000
comment : Footage: Small World Productions, Inc; Tourism New Zealand
| Producer: Gary F. Spradling | Music: Steve Ball
title : Wildlife in HD
copyright : © 2008 Microsoft Corporation
IsVBR : 0
DeviceConformanceTemplate: AP@L3
encoder : Lavf55.10.100
Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 6
40x360, q=-1--1, 1200 kb/s, 30k tbn, 29.97 tbc
Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100
Hz, stereo, s16, 160 kb/s
Stream mapping:
Stream #0:1 -> #0:0 (vc1 -> libx264)
Stream #0:0 -> #0:1 (wmav2 -> libvo_aacenc)
Press [q] to stop, [?] for help
frame= 59 fps= 55 q=32.0 size= 0kB time=00:00:00.16 bitrate= 2.3kbits/
frame= 66 fps= 42 q=31.0 size= 0kB time=00:00:00.40 bitrate= 1.0kbits/
frame= 75 fps= 35 q=31.0 size= 0kB time=00:00:00.70 bitrate= 0.5kbits/
frame= 84 fps= 31 q=31.0 size= 0kB time=00:00:01.00 bitrate= 0.4kbits/
frame= 93 fps= 29 q=31.0 size= 0kB time=00:00:01.30 bitrate= 0.3kbits/
frame= 102 fps= 27 q=31.0 size= 0kB time=00:00:01.60 bitrate= 0.2kbits/
frame= 111 fps= 26 q=31.0 size= 38kB time=00:00:01.90 bitrate= 165.1kbits/
Queue input is backward in time
[mp4 @ 000000000264f2c0] Non-monotonous DTS in output stream 0:1; previous: 7616
, current: 7063; changing to 7617. This may result in incorrect timestamps in th
e output file.
frame= 120 fps= 25 q=31.0 size= 107kB time=00:00:02.20 bitrate= 397.7kbits/
frame= 128 fps= 24 q=31.0 size= 161kB time=00:00:02.46 bitrate= 534.1kbits/
frame= 137 fps= 23 q=31.0 size= 194kB time=00:00:02.76 bitrate= 572.6kbits/
frame= 145 fps= 23 q=31.0 size= 219kB time=00:00:03.03 bitrate= 592.1kbits/
frame= 153 fps= 22 q=31.0 size= 273kB time=00:00:03.30 bitrate= 677.8kbits/
frame= 162 fps= 22 q=31.0 size= 317kB time=00:00:03.60 bitrate= 720.8kbits/
frame= 170 fps= 21 q=31.0 size= 366kB time=00:00:03.87 bitrate= 775.2kbits/
frame= 177 fps= 21 q=31.0 size= 451kB time=00:00:04.10 bitrate= 900.2kbits/
frame= 193 fps= 21 q=31.0 size= 602kB time=00:00:04.63 bitrate=1062.7kbits/
frame= 208 fps= 22 q=30.0 size= 755kB time=00:00:05.13 bitrate=1204.2kbits/
frame= 219 fps= 22 q=30.0 size= 769kB time=00:00:05.50 bitrate=1143.6kbits/
frame= 228 fps= 21 q=30.0 size= 790kB time=00:00:05.80 bitrate=1114.5kbits/
frame= 234 fps= 21 q=31.0 size= 806kB time=00:00:06.00 bitrate=1098.7kbits/
frame= 243 fps= 21 q=31.0 size= 806kB time=00:00:06.30 bitrate=1046.4kbits/
frame= 251 fps= 21 q=31.0 size= 831kB time=00:00:06.57 bitrate=1035.6kbits/
frame= 260 fps= 20 q=31.0 size= 860kB time=00:00:06.87 bitrate=1024.6kbits/
frame= 273 fps= 21 q=31.0 size= 934kB time=00:00:07.30 bitrate=1046.7kbits/
frame= 288 fps= 21 q=30.0 size= 1019kB time=00:00:07.80 bitrate=1068.7kbits/
frame= 302 fps= 21 q=30.0 size= 1066kB time=00:00:08.27 bitrate=1055.8kbits/
frame= 314 fps= 21 q=29.0 size= 1146kB time=00:00:08.67 bitrate=1082.1kbits/
frame= 328 fps= 21 q=28.0 size= 1189kB time=00:00:09.14 bitrate=1065.6kbits/
frame= 341 fps= 21 q=28.0 size= 1247kB time=00:00:09.57 bitrate=1066.7kbits/
frame= 352 fps= 22 q=27.0 size= 1274kB time=00:00:09.94 bitrate=1049.3kbits/
frame= 365 fps= 22 q=27.0 size= 1298kB time=00:00:10.37 bitrate=1024.7kbits/
frame= 376 fps= 22 q=27.0 size= 1349kB time=00:00:10.74 bitrate=1028.7kbits/
frame= 388 fps= 22 q=26.0 size= 1378kB time=00:00:11.14 bitrate=1012.9kbits/
frame= 401 fps= 22 q=26.0 size= 1415kB time=00:00:11.57 bitrate=1001.4kbits/
frame= 412 fps= 22 q=26.0 size= 1454kB time=00:00:11.94 bitrate= 996.9kbits/
frame= 421 fps= 22 q=27.0 size= 1489kB time=00:00:12.24 bitrate= 996.2kbits/
frame= 431 fps= 21 q=27.0 size= 1509kB time=00:00:12.57 bitrate= 982.7kbits/
frame= 441 fps= 21 q=28.0 size= 1555kB time=00:00:12.91 bitrate= 986.6kbits/
frame= 450 fps= 21 q=28.0 size= 1599kB time=00:00:13.21 bitrate= 991.7kbits/
frame= 460 fps= 21 q=28.0 size= 1621kB time=00:00:13.54 bitrate= 980.4kbits/
frame= 470 fps= 21 q=28.0 size= 1660kB time=00:00:13.88 bitrate= 979.9kbits/
frame= 480 fps= 21 q=28.0 size= 1734kB time=00:00:14.21 bitrate= 999.2kbits/
frame= 489 fps= 21 q=29.0 size= 1834kB time=00:00:14.51 bitrate=1035.3kbits/
frame= 499 fps= 21 q=29.0 size= 1890kB time=00:00:14.84 bitrate=1042.8kbits/
frame= 508 fps= 21 q=29.0 size= 1962kB time=00:00:15.14 bitrate=1060.8kbits/
frame= 519 fps= 21 q=29.0 size= 2061kB time=00:00:15.51 bitrate=1087.9kbits/
frame= 531 fps= 21 q=29.0 size= 2189kB time=00:00:15.91 bitrate=1126.6kbits/
frame= 540 fps= 21 q=29.0 size= 2329kB time=00:00:16.21 bitrate=1176.4kbits/
frame= 551 fps= 21 q=29.0 size= 2439kB time=00:00:16.58 bitrate=1204.8kbits/
frame= 562 fps= 21 q=29.0 size= 2569kB time=00:00:16.95 bitrate=1241.8kbits/
frame= 575 fps= 21 q=29.0 size= 2688kB time=00:00:17.38 bitrate=1266.9kbits/
frame= 581 fps= 21 q=29.0 size= 2749kB time=00:00:17.58 bitrate=1280.6kbits/
frame= 589 fps= 21 q=29.0 size= 2785kB time=00:00:17.85 bitrate=1278.1kbits/
frame= 595 fps= 21 q=30.0 size= 2808kB time=00:00:18.05 bitrate=1274.5kbits/
frame= 602 fps= 20 q=30.0 size= 2903kB time=00:00:18.28 bitrate=1300.7kbits/
frame= 610 fps= 20 q=31.0 size= 3008kB time=00:00:18.55 bitrate=1328.2kbits/
frame= 616 fps= 20 q=31.0 size= 3128kB time=00:00:18.75 bitrate=1366.6kbits/
frame= 625 fps= 20 q=31.0 size= 3238kB time=00:00:19.05 bitrate=1392.5kbits/
frame= 633 fps= 20 q=31.0 size= 3320kB time=00:00:19.31 bitrate=1407.9kbits/
frame= 642 fps= 20 q=31.0 size= 3397kB time=00:00:19.61 bitrate=1418.4kbits/
frame= 652 fps= 20 q=31.0 size= 3437kB time=00:00:19.95 bitrate=1411.1kbits/
frame= 661 fps= 20 q=31.0 size= 3511kB time=00:00:20.25 bitrate=1420.3kbits/
frame= 669 fps= 20 q=31.0 size= 3578kB time=00:00:20.52 bitrate=1428.2kbits/
frame= 679 fps= 20 q=31.0 size= 3606kB time=00:00:20.85 bitrate=1416.6kbits/
frame= 691 fps= 20 q=32.0 size= 3670kB time=00:00:21.25 bitrate=1414.5kbits/
frame= 701 fps= 20 q=32.0 size= 3798kB time=00:00:21.58 bitrate=1441.2kbits/
frame= 713 fps= 20 q=32.0 size= 3901kB time=00:00:21.98 bitrate=1453.3kbits/
frame= 723 fps= 20 q=32.0 size= 3969kB time=00:00:22.32 bitrate=1456.6kbits/
frame= 735 fps= 20 q=32.0 size= 4027kB time=00:00:22.72 bitrate=1451.7kbits/
frame= 744 fps= 20 q=32.0 size= 4102kB time=00:00:23.02 bitrate=1459.6kbits/
frame= 755 fps= 20 q=32.0 size= 4135kB time=00:00:23.39 bitrate=1448.3kbits/
frame= 764 fps= 20 q=32.0 size= 4172kB time=00:00:23.69 bitrate=1442.7kbits/
frame= 776 fps= 20 q=32.0 size= 4216kB time=00:00:24.09 bitrate=1433.5kbits/
frame= 787 fps= 20 q=32.0 size= 4254kB time=00:00:24.45 bitrate=1424.8kbits/
frame= 802 fps= 20 q=32.0 size= 4337kB time=00:00:24.95 bitrate=1423.6kbits/
frame= 815 fps= 20 q=32.0 size= 4369kB time=00:00:25.39 bitrate=1409.6kbits/
frame= 828 fps= 20 q=32.0 size= 4450kB time=00:00:25.82 bitrate=1411.5kbits/
frame= 840 fps= 20 q=32.0 size= 4467kB time=00:00:26.22 bitrate=1395.3kbits/
frame= 852 fps= 20 q=32.0 size= 4550kB time=00:00:26.62 bitrate=1399.8kbits/
frame= 865 fps= 20 q=32.0 size= 4594kB time=00:00:27.06 bitrate=1390.7kbits/
frame= 877 fps= 20 q=32.0 size= 4629kB time=00:00:27.46 bitrate=1380.9kbits/
frame= 889 fps= 20 q=32.0 size= 4689kB time=00:00:27.86 bitrate=1378.6kbits/
frame= 900 fps= 20 q=32.0 size= 4740kB time=00:00:28.22 bitrate=1375.6kbits/
frame= 901 fps= 19 q=-1.0 Lsize= 5203kB time=00:00:30.10 bitrate=1416.0kbits
/s
video:4586kB audio:590kB subtitle:0 global headers:0kB muxing overhead 0.532558%
[libx264 @ 000000000264faa0] frame I:8 Avg QP:22.98 size: 31700
[libx264 @ 000000000264faa0] frame P:893 Avg QP:27.55 size: 4974
[libx264 @ 000000000264faa0] mb I I16..4: 34.6% 0.0% 65.4%
[libx264 @ 000000000264faa0] mb P I16..4: 0.8% 0.0% 1.5% P16..4: 41.4% 18.8
% 8.5% 0.0% 0.0% skip:29.0%
[libx264 @ 000000000264faa0] final ratefactor: 24.50
[libx264 @ 000000000264faa0] coded y,uvDC,uvAC intra: 64.3% 76.0% 36.7% inter: 2
3.5% 19.6% 0.7%
[libx264 @ 000000000264faa0] i16 v,h,dc,p: 34% 33% 11% 22%
[libx264 @ 000000000264faa0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 16% 12% 9% 12%
11% 12% 7% 8%
[libx264 @ 000000000264faa0] i8c dc,h,v,p: 55% 23% 14% 7%
[libx264 @ 000000000264faa0] ref P L0: 72.3% 12.0% 8.1% 3.7% 3.9%
[libx264 @ 000000000264faa0] kb/s:1249.53But still no luck. The .mp4 will play in every compatible device/browser combination I have tried except for chrome.. Any advice ?
TIA.
-
error : undefined reference to 'av_free_packet(AVPacket*)' when use NDK to compile ffmpeg
23 juin 2015, par wolfzI compiled my cpps to use ffmpeg liberary with ANDROID NDK by my android MK as follow :
LOCAL_PATH := $(call my-dir)
DEFINES += -DTARGET_POSIX \
-DTARGET_LINUX \
-D_LINUX \
-DTARGET_ANDROID \
-D__STDC_CONSTANT_MACROS
include $(CLEAR_VARS)
LOCAL_MODULE := libavcodec
LOCAL_SRC_FILES := lib/lib/libavcodec.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libavfilter
LOCAL_SRC_FILES := lib/lib/libavfilter.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libavformat
LOCAL_SRC_FILES := lib/lib/libavformat.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libavutil
LOCAL_SRC_FILES := lib/lib/libavutil.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libpostproc
LOCAL_SRC_FILES := lib/lib/libpostproc.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libswresample
LOCAL_SRC_FILES := lib/lib/libswresample.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libswscale
LOCAL_SRC_FILES := lib/lib/libswscale.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE:= player
base := $(LOCAL_PATH)
LOCAL_SRC_FILES += cores/PlayDemux.cpp \
cores/PlayDemuxFFmpeg.cpp \
cores/PlayFactoryDemuxer.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH) \
$(LOCAL_PATH)/lib \
$(LOCAL_PATH)/lib/include \
$(LOCAL_PATH)/cores/player \
LOCAL_CPPFLAGS += -Wall -fexceptions $(DEFINES)
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE:= testmain
LOCAL_SRC_FILES := \
testmain.cpp \
LOCAL_C_INCLUDES += $(LOCAL_PATH) \
$(LOCAL_PATH)/lib
LOCAL_CPPFLAGS += -Wall -fexceptions $(DEFINES)
LOCAL_SHARED_LIBRARIES := libavcodec \
libavformat \
libavfilter \
libavutil \
libpostproc \
libswscale \
libswresample
LOCAL_STATIC_LIBRARIES := player
include $(BUILD_EXECUTABLE)but when i do "ndk-build v=1", After compiling, I got :
Install : libavcodec.so => libs/armeabi-v7a/libavcodec.so
install -p /cygdrive/d/player/obj/local/armeabi-v7a/libavcodec.so /cygdrive/d/player/libs/armeabi-v7a/libavcodec.so
/cygdrive/d/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-strip --strip-unneeded D:/player/libs/armeabi-v7a/libavcodec.so
Install : libavfilter.so => libs/armeabi-v7a/libavfilter.so
install -p /cygdrive/d/player/obj/local/armeabi-v7a/libavfilter.so /cygdrive/d/player/libs/armeabi-v7a/libavfilter.so
/cygdrive/d/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-strip --strip-unneeded D:/player/libs/armeabi-v7a/libavfilter.so
Install : libavformat.so => libs/armeabi-v7a/libavformat.so
install -p /cygdrive/d/player/obj/local/armeabi-v7a/libavformat.so /cygdrive/d/player/libs/armeabi-v7a/libavformat.so
/cygdrive/d/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-strip --strip-unneeded D:/player/libs/armeabi-v7a/libavformat.so
Install : libavutil.so => libs/armeabi-v7a/libavutil.so
install -p /cygdrive/d/player/obj/local/armeabi-v7a/libavutil.so /cygdrive/d/player/libs/armeabi-v7a/libavutil.so
/cygdrive/d/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-strip --strip-unneeded D:/player/libs/armeabi-v7a/libavutil.so
Install : libpostproc.so => libs/armeabi-v7a/libpostproc.so
install -p /cygdrive/d/player/obj/local/armeabi-v7a/libpostproc.so /cygdrive/d/player/libs/armeabi-v7a/libpostproc.so
/cygdrive/d/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-strip --strip-unneeded D:/player/libs/armeabi-v7a/libpostproc.so
Install : libswresample.so => libs/armeabi-v7a/libswresample.so
install -p /cygdrive/d/player/obj/local/armeabi-v7a/libswresample.so /cygdrive/d/player/libs/armeabi-v7a/libswresample.so
/cygdrive/d/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-strip --strip-unneeded D:/player/libs/armeabi-v7a/libswresample.so
Install : libswscale.so => libs/armeabi-v7a/libswscale.so
install -p /cygdrive/d/player/obj/local/armeabi-v7a/libswscale.so /cygdrive/d/player/libs/armeabi-v7a/libswscale.so
/cygdrive/d/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-strip --strip-unneeded D:/player/libs/armeabi-v7a/libswscale.so
Executable : testmain
/cygdrive/d/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-g++ -Wl,--gc-sections -Wl,-z,nocopyreloc --sysroot=D:/android/android-ndk-r8e/platforms/android-14/arch-arm D:/player/obj/local/armeabi-v7a/objs/testmain/testmain.o D:/player/obj/local/armeabi-v7a/libplayer.a D:/android/android-ndk-r8e/sources/cxx-stl/stlport/libs/armeabi-v7a/libstlport_static.a -lgcc D:/player/obj/local/armeabi-v7a/libavcodec.so D:/player/obj/local/armeabi-v7a/libavformat.so D:/player/obj/local/armeabi-v7a/libavfilter.so D:/player/obj/local/armeabi-v7a/libavutil.so D:/player/obj/local/armeabi-v7a/libpostproc.so D:/player/obj/local/armeabi-v7a/libswscale.so D:/player/obj/local/armeabi-v7a/libswresample.so -no-canonical-prefixes -march=armv7-a -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -lc -lm -o D:/player/obj/local/armeabi-v7a/testmain
D:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: D:/player/obj/local/armeabi-v7a/libplayer.a(PlayDemuxFFmpeg.o): in function PlayDemuxFFmpeg::Flush():D:/player/jni/lib/DllAvCodec.h:144: error: undefined reference to 'av_free_packet(AVPacket*)'I´m using windows 7 + cygwin + NDKR8,but the lib "libavcodec.so ,libavfilter.so,libavformat.so,libavutil.so,libpostproc.so,libswresample.so,libswscale.so " of ffmpeg was compiled with standalone mothed of NDK using "ubuntu + NDK8".
and i include the extern "c" code in the head file.so, how to correct the error ?
my DLLavcodec.h is :
#pragma once
#include "DllAvUtil.h"
extern "C" {
#include <libavcodec></libavcodec>avcodec.h>
}
class DllAvCodec : public DllAvCodecInterface
{
public:
static CCriticalSection m_critSection;
virtual ~DllAvCodec() {}
virtual void avcodec_register_all()
{
::avcodec_register_all();
}
virtual void avcodec_flush_buffers(AVCodecContext *avctx) { ::avcodec_flush_buffers(avctx); }
virtual int avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options)
{
return ::avcodec_open2(avctx, codec, options);
}
virtual int avcodec_open2_dont_call(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options) { *(volatile int *)0x0 = 0; return 0; }
virtual int avcodec_close_dont_call(AVCodecContext *avctx) { *(volatile int *)0x0 = 0; return 0; }
virtual AVCodec *avcodec_find_decoder(enum CodecID id) { return ::avcodec_find_decoder(id); }
virtual AVCodec *avcodec_find_encoder(enum CodecID id) { return ::avcodec_find_encoder(id); }
virtual int avcodec_close(AVCodecContext *avctx)
{
return ::avcodec_close(avctx);
}
virtual AVFrame *avcodec_alloc_frame() { return ::avcodec_alloc_frame(); }
virtual int avpicture_fill(AVPicture *picture, uint8_t *ptr, PixelFormat pix_fmt, int width, int height) { return ::avpicture_fill(picture, ptr, pix_fmt, width, height); }
virtual int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt) { return ::avcodec_decode_video2(avctx, picture, got_picture_ptr, avpkt); }
virtual int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { return ::avcodec_decode_audio4(avctx, frame, got_frame_ptr, avpkt); }
virtual int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt) { return ::avcodec_decode_subtitle2(avctx, sub, got_sub_ptr, avpkt); }
virtual int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples) { return ::avcodec_encode_audio(avctx, buf, buf_size, samples); }
virtual int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) { return ::avcodec_encode_audio2(avctx, avpkt, frame, got_packet_ptr); }
virtual int avpicture_get_size(PixelFormat pix_fmt, int width, int height) { return ::avpicture_get_size(pix_fmt, width, height); }
virtual AVCodecContext *avcodec_alloc_context3(AVCodec *codec) { return ::avcodec_alloc_context3(codec); }
virtual void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) { ::avcodec_string(buf, buf_size, enc, encode); }
virtual void avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec) { ::avcodec_get_context_defaults3(s, codec); }
virtual AVCodecParserContext *av_parser_init(int codec_id) { return ::av_parser_init(codec_id); }
virtual int av_parser_parse2(AVCodecParserContext *s,AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size,
int64_t pts, int64_t dts, int64_t pos)
{
return ::av_parser_parse2(s, avctx, poutbuf, poutbuf_size, buf, buf_size, pts, dts, pos);
}
virtual void av_parser_close(AVCodecParserContext *s) { ::av_parser_close(s); }
virtual AVBitStreamFilterContext *av_bitstream_filter_init(const char *name) { return ::av_bitstream_filter_init(name); }
virtual int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
AVCodecContext *avctx, const char *args,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size, int keyframe) { return ::av_bitstream_filter_filter(bsfc, avctx, args, poutbuf, poutbuf_size, buf, buf_size, keyframe); }
virtual void av_bitstream_filter_close(AVBitStreamFilterContext *bsfc) { ::av_bitstream_filter_close(bsfc); }
virtual void avpicture_free(AVPicture *picture) { ::avpicture_free(picture); }
virtual void av_free_packet(AVPacket *pkt) { ::av_free_packet(pkt); }
virtual int avpicture_alloc(AVPicture *picture, PixelFormat pix_fmt, int width, int height) { return ::avpicture_alloc(picture, pix_fmt, width, height); }
virtual int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic) { return ::avcodec_default_get_buffer(s, pic); }
virtual void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic) { ::avcodec_default_release_buffer(s, pic); }
virtual enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat *fmt) { return ::avcodec_default_get_format(s, fmt); }
virtual AVCodec *av_codec_next(AVCodec *c) { return ::av_codec_next(c); }
virtual int av_dup_packet(AVPacket *pkt) { return ::av_dup_packet(pkt); }
virtual void av_init_packet(AVPacket *pkt) { return ::av_init_packet(pkt); }
virtual int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, enum AVSampleFormat sample_fmt, const uint8_t *buf, int buf_size, int align) { return ::avcodec_fill_audio_frame(frame, nb_channels, sample_fmt, buf, buf_size, align); }
virtual void avcodec_free_frame(AVFrame **frame) { return ::avcodec_free_frame(frame); };
}; -
Setting up OpenCV 2.4.6.1 on Ubuntu 12.04.02
12 août 2013, par DamilolaI had previously used OpenCV 2.4.5 with some certain configs and packages on Ubuntu 12.04.1 but had issues upgrading to OpenCV 2.4.6.1 on Ubuntu 12.04.2
I would like to share some ideas (a compilation of noteworthy information gathered from several sources including SO, ubuntu.org, asklinux.org and many other ; and of course by trying several procedures)
Below is what eventually got me through.
NOTE : ensure you uninstall any previous installation of OpenCV, FFMpeg and other dependencies previously installed.
STEP 1 (install ffmpeg and dependencies)
# goto http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/
# download the latest stable opencv such as 2.4.6.1 (http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.5/opencv-2.4.5.1.tar.gz/download) to current directory (such as home or ~/Document)
# cd /opt
# tar -xvf /OpenCV-2.4.6.1.tar.gz
# cd OpenCV-2.4.6.1
# create a foler under current dir (following previous step, this should be ), called prepare
# cd prepare
# Copy the following script to gedit and save as install.sh to current dir, this should be /prepare
# Check corresponding url used in the script for latest versions of the package and replace as required
# Open terminal and navigate to location used above
# sudo chmod +x install.sh
# ./installecho "Removing any pre-installed ffmpeg, x264, and other dependencies (not all the previously installed dependecies)"
sudo apt-get remove ffmpeg x264 libx264-dev libvpx-dev librtmp0 librtmp-dev libopencv-dev
sudo apt-get update
arch=$(uname -m)
if [ "$arch" == "i686" -o "$arch" == "i386" -o "$arch" == "i486" -o "$arch" == "i586" ]; then
flag=0
else
flag=1
fi
echo "Installing Dependenices"
sudo apt-get install autoconf automake make g++ curl cmake bzip2 python unzip \
build-essential checkinstall git git-core libass-dev libgpac-dev \
libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libx11-dev \
libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev
echo "downloading yasm (assembler used by x264 and FFmpeg)"
# use git or tarball (not both)
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
echo "installing yasm"
./configure
make
sudo make install
cd ..
echo 'READ NOTE BELOW which was extracted from http://wiki.serviio.org/doku.php?id=build_ffmpeg_linux'
echo 'New version of x264 contains by default support of OpenCL. If not installed or without sense (example Ubuntu 12.04LTS on VMWare) add to configure additional option --disable-opencl. Without this option ffmpeg could not be configured (ERROR: libx264 not found).'
echo "downloading x264 (H.264 video encoder)"
# use git or tarball (not both)
# git clone http://repo.or.cz/r/x264.git or
git clone git://git.videolan.org/x264.git
cd x264
# wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20130801-2245-stable.tar.bz2
# tar -xvjf x264-snapshot-20130801-2245-stable.tar.bz2
# cd x264-snapshot-20130801-2245-stable/
echo "Installing x264"
if [ $flag -eq 0 ]; then
./configure --enable-static --disable-opencl
else
./configure --enable-shared --enable-pic --disable-opencl
fi
make
sudo make install
cd ..
echo "downloading fdk-aac (AAC audio encoder)"
# use git or tarball (not both)
git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
cd fdk-aac
echo "installing fdk-aac"
autoreconf -fiv
./configure --disable-shared
make
sudo make install
cd ..
echo "installing libmp3lame-dev (MP3 audio encoder.)"
sudo apt-get install libmp3lame-dev
echo "downloading libopus (Opus audio decoder and encoder.)
wget http://downloads.xiph.org/releases/opus/opus-1.0.3.tar.gz
tar xzvf opus-1.0.3.tar.gz
cd opus-1.0.3
echo "installing libopus"
./configure --disable-shared
make
sudo make install
cd ..
echo "downloading libvpx VP8/VP9 video encoder and decoder)
# use git or tarball (not both)
git clone --depth 1 http://git.chromium.org/webm/libvpx.git
cd libvpx
# wget http://webm.googlecode.com/files/libvpx-v1.1.0.tar.bz2 (this seems not to be update, but can still be used if the fedoraproject link below is not available))
# wget http://pkgs.fedoraproject.org/repo/pkgs/libvpx/libvpx-v1.2.0.tar.bz2/400d7c940c5f9d394893d42ae5f463e6/libvpx-v1.2.0.tar.bz2
# tar xvjf libvpx-v1.2.0.tar.bz2
# cd libvpx-v1.2.0
echo "installing libvpx"
./configure --disable-examples
make
sudo make install
cd ..
sudo ldconfig
echo "downloading ffmpeg"
# git clone http://repo.or.cz/r/ffmpeg.git
git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg/
# wget http://ffmpeg.org/releases/ffmpeg-2.0.tar.bz2
# tar -xvjf ffmpeg-2.0.tar.bz2
# cd ffmpeg-2.0/
echo "installing ffmpeg"
if [ $flag -eq 0 ]; then
./configure --enable-gpl --enable-libass --enable-libfdk-aac --enable-libopus --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-libvpx
else
./configure --enable-gpl --enable-libass --enable-libfdk-aac --enable-libopus --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-libvpx --enable-shared
fi
make
sudo make install
hash -r
cd .. # move up one level to prepare folder
cd .. # move up one level to opencv folder
echo "Checking to see if you're using your new ffmpeg"
ffmpeg 2>&1 | head -n1
sudo ldconfigSTEP 2 (Install OpenCV and necessary packages)
echo "Installing Dependenices"
sudo apt-get install libopencv-dev
sudo apt-get install libtiff4-dev libjpeg-dev libjasper-dev
echo "installing Video I/O libraries, support for Firewire video cameras and video streaming libraries"
sudo apt-get install libav-tools libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev v4l-utils v4l-conf
echo "installing the Python development environment and the Python Numerical library"
sudo apt-get install python-dev python-numpy
echo "installing the parallel code processing library (the Intel tbb library)"
sudo apt-get install libtbb-dev
echo "installing the Qt dev library"
sudo apt-get install libqt4-dev libgtk2.0-dev
echo "installing other dependencies (if need be it would upgrade current version of the packages)"
sudo apt-get install patch subversion ruby librtmp0 librtmp-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libvpx-dev libxvidcore-dev
echo installing optional packages"
sudo apt-get install libdc1394-utils libdc1394-22-dev libdc1394-22 libjpeg-dev libpng-dev libtiff-dev libjasper-devSTEP 3 (run ldconfig)
# Open a new terminal window
# Open /etc/ld.so.conf and check,
# if the paths "/usr/lib" and "/usr/local/lib" including the quote exist in the file. If not, add them manually or by
sudo echo "/usr/local/lib" >> /etc/ld.so.conf
sudo echo "/usr/lib" >> /etc/ld.so.conf
# execute the following
sudo ldconfigSTEP 4
# still ensure you haven't close the new terminal window open in STEP 3
# execute the following
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=OFF -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
make
sudo make install
# add the following to user environment variable ~/.bashrc
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig
# execute the following
sudo ldconfig
# start to use and enjoy opencv, it should have been install into these locations
# /usr/local/include/, /usr/local/share/, /usr/local/lib/STEP 5 (install v4l : Note : installing v4l-utils after opencv installation works for Ubuntu 12.04.2 & OpenCV 2.4.6.1)
# still ensure you haven't close the new terminal window open in STEP 3
# goto http://www.linuxtv.org/downloads/v4l-utils
# download the latest v4l such as v4l-utils-0.9.5.tar.bz2
# copy the downloaded file to the current terminal dir (following previous step, this should be /prepare)
# execute the following
tar -xvjf v4l-utils-0.9.5.tar.bz2
cd v4l-utils-0.9.5/
./configure
make
sudo make install
cd ..
cd .. # (to go to )
sudo ldconfigWorth Noting
# To check the path where opencv & other lib files are stored, do:
pkg-config --cflags opencv
(output will come as)
-I/usr/include/opencv
pkg-config --libs opencv
(output will come as)
-lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ --ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann
# The above paths are needed to compile your opencv programs, as given in the next illustration.
# write a simple C program to test, by saving below program in a file named DisplayImage.c
#include
#include <opencv2></opencv2>highgui/highgui.hpp>
int main(int argc, char *argv[]) {
IplImage* img=0; /* pointer to an image */
printf("Hello\n");
if(argv[1] != 0)
img = cvLoadImage(argv[1], 0); // 1 for color
else
printf("Enter filename\n");
if(img != 0) {
cvNamedWindow("Display", CV_WINDOW_AUTOSIZE); // create a window
cvShowImage("Display", img); // show image in window
cvWaitKey(0); // wait until user hits a key
cvDestroyWindow("Display");
}
else
printf("File not found\n");
return 0;
}
# write a simple C++ program to test, by saving below program in a file named DisplayImage.cpp
#include
#include <opencv2></opencv2>opencv.hpp>
#include <opencv2></opencv2>highgui/highgui.hpp>
using namespace cv;
int main( int argc, char** argv )
{
Mat image;
image = imread( argv[1], 1 );
if( argc != 2 || !image.data )
{
printf( "No image data \n" );
return -1;
}
namedWindow( "Display Image", CV_WINDOW_AUTOSIZE );
imshow( "Display Image", image );
waitKey(0);
return 0;
}
# To compile & run :
g++ `pkg-config --cflags --libs opencv` && ./a.out img
or
g++ -I/usr/include/opencv -I/usr/local/include -lopencv_core -lopencv_highgui -lopencv_ml -lopencv_imgproc -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann -lopencv_nonfree && ./a.out img
where “img” is the name of any image with extension within the same folder .
You should be able to see “Hello” and the image in a different window.
If this runs, Congrats! now you can run any C/C++ program with opencv lib.
# Now lets simplify the above big command by making a shortcut for it:
go to your local home directory(cd /home/) and open the .bashrc file using gedit(the file will be hidden). Append the following to the file:
alias gcv="g++ -I/usr/include/opencv -I/usr/local/include -lopencv_core -lopencv_highgui -lopencv_ml -lopencv_imgproc -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann -lopencv_nonfree"
and save. Close the terminal and open it again.(as this process requires relogin of the terminal)
# Now, go to directory containing a sample program & do
gcv && ./a.out
or
gcv
./a.out input_img.jpgAs you can see the commands now become similar to $cc filename.c, $./a.out which are used normally for compiling and executing C/C++ programs.
Some ways to check whether all lib files are installed-
apt-cache search opencv
returns :
libcv-dev - Translation package for libcv-dev
libcv2.3 - computer vision library - libcv* translation package
libcvaux-dev - Translation package for libcvaux-dev
libcvaux2.3 - computer vision library - libcvaux translation package
libhighgui-dev - Translation package for libhighgui-dev
libhighgui2.3 - computer vision library - libhighgui translation package
libopencv-calib3d-dev - development files for libopencv-calib3d
libopencv-calib3d2.3 - computer vision Camera Calibration library
libopencv-contrib-dev - development files for libopencv-contrib
libopencv-contrib2.3 - computer vision contrib library
libopencv-core-dev - development files for libopencv-core
libopencv-core2.3 - computer vision core library
libopencv-dev - development files for opencv
libopencv-features2d-dev - development files for libopencv-features2d
libopencv-features2d2.3 - computer vision Feature Detection and Descriptor Extraction library
libopencv-flann-dev - development files for libopencv-flann
libopencv-flann2.3 - computer vision Clustering and Search in Multi-Dimensional spaces library
libopencv-gpu-dev - development files for libopencv-gpu
libopencv-gpu2.3 - computer vision GPU Processing library
libopencv-highgui-dev - development files for libopencv-highgui
libopencv-highgui2.3 - computer vision High-level GUI and Media I/O library
libopencv-imgproc-dev - development files for libopencv-imgproc
libopencv-imgproc2.3 - computer vision Image Processing library
libopencv-legacy-dev - development files for libopencv-legacy
libopencv-legacy2.3 - computer vision legacy library
libopencv-ml-dev - development files for libopencv-ml
libopencv-ml2.3 - computer vision Machine Learning library
libopencv-objdetect-dev - development files for libopencv-objdetect
libopencv-objdetect2.3 - computer vision Object Detection library
libopencv-video-dev - development files for libopencv-video
libopencv-video2.3 - computer vision Video analysis library
opencv-doc - OpenCV documentation and examples
python-opencv - Python bindings for the computer vision library