
Recherche avancée
Autres articles (77)
-
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 (...) -
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...)
Sur d’autres sites (6714)
-
CJEU rules US cloud servers don’t comply with GDPR and what this means for web analytics
17 juillet 2020, par Jake Thornton -
Cant link against ffmpeg static build
24 mars 2017, par David BarishevI have build ffmpeg libraries statically for x86 android using a custom configuration.Now i wanted to add them in my android project.
Im using ffmpeg 3.2.git, android studio 2.3.
I created a folder named distribution which had my binaries, and the minimum headers i needed for it to not tell me about missing header (Except for the avutil- i just included them all), located the root of my project.
Here is a file tree :distribution
├── libavcodec
│ ├── lib
│ │ └── x86
│ │ └── libavcodec.a
│ ├── avcodec.h
│ └── version.h
├── libavfilter
│ ├── lib
│ │ └── x86
│ │ └── libavfilter.a
│ ├── avfiltergraph.h
│ └── avfilter.h
├── libavformat
│ ├── lib
│ │ └── x86
│ │ └── libavformat.a
│ ├── avformat.h
│ ├── avio.h
│ └── version.h
├── libavutil
│ ├── lib
│ │ └── x86
│ │ └── libavutil.a
│ ├── attributes.h
│ ├── avconfig.h
│ ├── avutil.h
│ ├── buffer.h
│ ├── buffer_internal.h
│ ├── camellia.h
│ ├── cast5.h
│ ├── channel_layout.h
│ ├── colorspace.h
│ ├── color_utils.h
│ ├── common.h
│ ├── cpu.h
│ ├── cpu_internal.h
│ ├── crc.h
│ ├── des.h
│ ├── dict.h
│ ├── display.h
│ ├── downmix_info.h
│ ├── dynarray.h
│ ├── error.h
│ ├── eval.h
│ ├── ffmath.h
│ ├── ffversion.h
│ ├── fifo.h
│ ├── file.h
│ ├── fixed_dsp.h
│ ├── float_dsp.h
│ ├── frame.h
│ ├── hash.h
│ ├── hmac.h
│ ├── hwcontext_cuda.h
│ ├── hwcontext_cuda_internal.h
│ ├── hwcontext_dxva2.h
│ ├── hwcontext.h
│ ├── hwcontext_internal.h
│ ├── hwcontext_qsv.h
│ ├── hwcontext_vaapi.h
│ ├── hwcontext_vdpau.h
│ ├── imgutils.h
│ ├── integer.h
│ ├── internal.h
│ ├── intfloat.h
│ ├── intmath.h
│ ├── intreadwrite.h
│ ├── lfg.h
│ ├── libm.h
│ ├── lls.h
│ ├── log.h
│ ├── lzo.h
│ ├── macros.h
│ ├── mastering_display_metadata.h
│ ├── mathematics.h
│ ├── md5.h
│ ├── mem.h
│ ├── mem_internal.h
│ ├── motion_vector.h
│ ├── murmur3.h
│ ├── opencl.h
│ ├── opencl_internal.h
│ ├── opt.h
│ ├── parseutils.h
│ ├── pca.h
│ ├── pixdesc.h
│ ├── pixelutils.h
│ ├── pixfmt.h
│ ├── qsort.h
│ ├── random_seed.h
│ ├── rational.h
│ ├── rc4.h
│ ├── replaygain.h
│ ├── reverse.h
│ ├── ripemd.h
│ ├── samplefmt.h
│ ├── sha512.h
│ ├── sha.h
│ ├── softfloat.h
│ ├── softfloat_ieee754.h
│ ├── softfloat_tables.h
│ ├── spherical.h
│ ├── stereo3d.h
│ ├── tablegen.h
│ ├── tea.h
│ ├── thread.h
│ ├── threadmessage.h
│ ├── timecode.h
│ ├── time.h
│ ├── time_internal.h
│ ├── timer.h
│ ├── timestamp.h
│ ├── tree.h
│ ├── twofish.h
│ └── version.h
└── libswresample
├── lib
│ └── x86
│ └── libswresample.a
├── swresample.h
└── swresample_internal.hI edited my cmake to include the libraries :
add_library(
native-lib
SHARED
src/main/cpp/native-lib.cpp )
set(distribution_DIR ${CMAKE_SOURCE_DIR}/../distribution)
add_library(lib_avcodec STATIC IMPORTED)
set_target_properties(lib_avcodec PROPERTIES IMPORTED_LOCATION
${distribution_DIR}/libavcodec/lib/${ANDROID_ABI}/libavcodec.a)
add_library(lib_avfilter STATIC IMPORTED)
set_target_properties(lib_avfilter PROPERTIES IMPORTED_LOCATION
${distribution_DIR}/libavfilter/lib/${ANDROID_ABI}/libavfilter.a)
add_library(lib_avformat STATIC IMPORTED)
set_target_properties(lib_avformat PROPERTIES IMPORTED_LOCATION
${distribution_DIR}/libavformat/lib/${ANDROID_ABI}/libavformat.a)
add_library(lib_avutil STATIC IMPORTED)
set_target_properties(lib_avutil PROPERTIES IMPORTED_LOCATION
${distribution_DIR}/libavutil/lib/${ANDROID_ABI}/libavutil.a)
add_library(lib_swresample STATIC IMPORTED)
set_target_properties(lib_swresample PROPERTIES IMPORTED_LOCATION
${distribution_DIR}/libswresample/lib/${ANDROID_ABI}/libswresample.a)
include_directories(
${distribution_DIR}
)
target_link_libraries(
native-lib
lib_avcodec
lib_avfilter
lib_avformat
lib_avutil
lib_swresample
)I also restricted the build to only x86, in my app build.gradle :
ndk {
// Specifies the ABI configurations of your native
// libraries Gradle should build and package with your APK.
abiFilters 'x86'
}The project gradle sync worked successfully.
I wrote the following code in my cpp file :#include
extern "C"{
#include "libavformat/avformat.h"
}
JNIEXPORT void JNICALL
Java_com_example_david_testffmpegcpp_MainActivity_stringFromJNI(
JNIEnv *env,
jobject /* this */) {
av_register_all ();
avformat_network_init ();
}Just to check if the library works, but i cant seem to link against the libraries correctly. It complains about undefined symbols.
What did i do wrong ?Error :
[2/2] Linking CXX shared library
..\..\..\..\build\intermediates\cmake\debug\obj\x86\libnative-lib.so
FAILED: cmd.exe /C "cd . && D:\AndroidSDK\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=i686-none-linux-android --gcc-toolchain=D:/AndroidSDK/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64 --sysroot=D:/AndroidSDK/ndk-bundle/platforms/android-16/arch-x86 -fPIC -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -Wa,--noexecstack -Wformat -Werror=format-security -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -Wa,--noexecstack -Wformat -Werror=format-security -O0 -fno-limit-debug-info -O0 -fno-limit-debug-info -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libnative-lib.so -o ..\..\..\..\build\intermediates\cmake\debug\obj\x86\libnative-lib.so CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o -llog ../../../../../distribution/libavcodec/lib/x86/libavcodec.a ../../../../../distribution/libavfilter/lib/x86/libavfilter.a ../../../../../distribution/libavformat/lib/x86/libavformat.a ../../../../../distribution/libavutil/lib/x86/libavutil.a ../../../../../distribution/libswresample/lib/x86/libswresample.a -lm "D:/AndroidSDK/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/libgnustl_static.a" && cd ."
src/libavformat/allformats.c:51: error: undefined reference to 'avcodec_register_all'
src/libavformat/id3v2.c:1009: error: undefined reference to 'uncompress'
src/libavformat/id3v2.c:1153: error: undefined reference to 'av_init_packet'
src/libavformat/matroskadec.c:1393: error: undefined reference to 'inflateInit_'
src/libavformat/matroskadec.c:1408: error: undefined reference to 'inflate'
src/libavformat/matroskadec.c:1401: error: undefined reference to 'inflateEnd'
src/libavformat/matroskadec.c:1411: error: undefined reference to 'inflateEnd'
src/libavformat/matroskadec.c:3113: error: undefined reference to 'av_new_packet'
src/libavformat/matroskadec.c:3134: error: undefined reference to 'av_packet_new_side_data'
src/libavformat/matroskadec.c:2855: error: undefined reference to 'av_new_packet'
src/libavformat/matroskadec.c:3147: error: undefined reference to 'av_packet_new_side_data'
src/libavformat/matroskadec.c:3022: error: undefined reference to 'av_new_packet'
src/libavformat/matroskadec.c:3031: error: undefined reference to 'av_packet_new_side_data'
src/libavformat/matroskadec.c:3042: error: undefined reference to 'av_packet_new_side_data'
src/libavformat/matroskadec.c:3151: error: undefined reference to 'av_packet_unref'
src/libavformat/matroskadec.c:2680: error: undefined reference to 'av_packet_unref'
src/libavformat/matroskadec.c:963: error: undefined reference to 'av_fast_padded_malloc'
src/libavformat/matroskadec.c:2163: error: undefined reference to 'av_get_codec_tag_string'
src/libavformat/matroskadec.c:2680: error: undefined reference to 'av_packet_unref'
src/libavformat/matroskadec.c:2579: error: undefined reference to 'av_init_packet'
src/libavformat/matroskadec.c:2580: error: undefined reference to 'av_new_packet'
src/libavformat/matroskadec.c:1715: error: undefined reference to 'avpriv_mpeg4audio_sample_rates'
src/libavformat/matroskadec.c:1715: error: undefined reference to 'avpriv_mpeg4audio_sample_rates'
src/libavformat/matroskadec.c:1715: error: undefined reference to 'avpriv_mpeg4audio_sample_rates'
src/libavformat/matroskadec.c:1866: error: undefined reference to 'avcodec_chroma_pos_to_enum'
src/libavformat/matroskadec.c:2680: error: undefined reference to 'av_packet_unref'
src/libavformat/matroskaenc.c:2482: error: undefined reference to 'avcodec_get_type'
src/libavformat/matroskaenc.c:646: error: undefined reference to 'avpriv_split_xiph_headers'
src/libavformat/matroskaenc.c:1066: error: undefined reference to 'av_get_bits_per_sample'
src/libavformat/matroskaenc.c:723: error: undefined reference to 'avpriv_mpeg4audio_get_config'
src/libavformat/matroskaenc.c:875: error: undefined reference to 'avcodec_enum_to_chroma_pos'
src/libavformat/matroskaenc.c:813: error: undefined reference to 'avcodec_get_name'
src/libavformat/matroskaenc.c:806: error: undefined reference to 'avcodec_get_name'
src/libavformat/matroskaenc.c:824: error: undefined reference to 'avcodec_get_name'
..... -
OpenCV and Cloud Cameras
8 mai 2014, par AlexanderSo as a bit of context ; this program was built originally to work with USB cameras - but a few things changed. I’m trying to convert it to work with networked cameras, but my presence here should make it quite apparent what my level of success has been. I still consider myself somewhat new at programming, and definately new at visual processing/OpenCV - so please forgive a few blunders if I make them. I’m going to try to provide as much detail as possible, so apologies for the length below.
I’m using :
- OpenCV 2.4.6.0
- Microsoft Visual Studio Express 2012
- C++
- D-Link Cloud Camera 7100
I am trying to access the DLink camera’s video feed through OpenCV.
I can access the camera through it’s IP address with a browser without any issues. Unfourtunately ; my program is less cooperative. I’ve put it on two computers (excluding the computer it gets compiled on, which for unrelated/unchangable reasons cannot be placed on the same network the network camera is on) which both fail to grant my program access to the camera. One computer gives the OpenCV-generated error :
warning : Error opening file (../../modules/highgui/src/cap_ffmpeg_impl.hpp:529)
This error occurs with just about everything I try that doesn’t somehow generate more problems. The other computer (same code) generates no such error - it just doesn’t get the camera’s output either.
For reference - the code in OpenCV’s cap_ffmpeg_impl.hpp around line 529 is as follows :
522 bool CvCapture_FFMPEG::open( const char* _filename )
523 {
524 unsigned i;
525 bool valid = false;
526
527 close();
528
529 #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0)
530 int err = avformat_open_input(&ic, _filename, NULL, NULL);
531 #else
532 int err = av_open_input_file(&ic, _filename, NULL, 0, NULL);
533 #endif
...
616 }...for which I have no idea what I’m looking at.
My entire program is rather large, so I’m editing it down as much as possible to help keep this readable - if I miss something you think is important please leave a comment telling me as much so I can throw it in...
First up - this is one of the first things in main() so I don’t have to recompile every time I want to try a different value :
3380 cout << "Please Enter Video Location: ";
3381 cin >> videoFeedAddress;
3382 cout << "videoFeedAddress: " << videoFeedAddress << endl;Just a simple string value.
Next up - the actual place we’re having the problem ! Probably...Note that in the below code - if networkCam is false and a USB camera is connected there is no problem. The error here is caused by line 153.
121 void displayCameraView()
122 {
123 if(camviewOn) // displayCameraView is triggered by a button the user can press as often as they want. Doesn't mean we want to let them break everything.
124 {return;}
125 else
126 {
127 CvCapture* cv_cap;
128 VideoCapture cv_cap_IP;
129 Mat color_img_IP;
130 camviewOn = true;
131 int capture;
132 IplImage* color_img;
133 if(!networkCam)
134 {
135 cv_cap = cvCaptureFromCAM(0);
136 Sleep(100);
137 if(!cv_cap)
138 {
139 setExitError(1002);
140 if(textOutput){cout << "Video Error: Video input will not work.\n";}
141 MessageBox(hwnd, "Error opening camera.", "Error", MB_ICONEXCLAMATION);
142 cvReleaseCapture( &cv_cap );
143 cvDestroyWindow("Camera View");
144 return;
145 }
146 color_img = cvQueryFrame(cv_cap);
147 clickPointStorage.create(((Mat)color_img).rows, ((Mat)color_img).cols, CV_8UC3);
148 }
149 else
150 {
151 ///*\
152
153 cv_cap_IP.open(videoFeedAddress);
154 Sleep(100);
155 if(!cv_cap_IP.isOpened())
156 {
157 setExitError(1002);
158 if(textOutput){cout << "Video Error: Video input will not work.\n";}
159 MessageBox(hwnd, "Error opening camera.", "Error", MB_ICONEXCLAMATION);
160 cvDestroyWindow("Camera View");
161 return;
162 }
163 clickPointStorage.create(color_img_IP.rows, color_img_IP.cols, CV_8UC3);
164
165 //\*/
166 }
167 clickPointStorage.setTo(Scalar(0, 0, 0));
168 cvNamedWindow("Camera View", 0); // create window
169 cvSetMouseCallback("Camera View", CallBackFunc, NULL);
170 IplImage* IplClickPointStorage = new IplImage(clickPointStorage);
171 IplImage* Ipl_IP_Img;
172
173 if(!networkCam)
174 {
175 for(;;)
176 {
177 IplClickPointStorage = new IplImage(clickPointStorage);
178 cvAdd(cvQueryFrame(cv_cap), IplClickPointStorage, color_img); // get frame
181 cvShowImage("Camera View", color_img); // show frame
182 capture = cvWaitKey(10); // wait 10 ms or for key stroke
183 if(capture == 27 || capture == 13 || capture == 32){break;} // if ESC, Return, or space; close window.
184 }
185 /* clean up */
186 cvReleaseCapture( &cv_cap );
187 delete cv_cap;
188 delete IplClickPointStorage;
189 }
190 else
191 {
192 ///*\
193
194 for(;;)
195 {
196 cv_cap_IP.read(color_img_IP);
197 IplClickPointStorage = new IplImage(clickPointStorage);
198 Ipl_IP_Img = new IplImage(color_img_IP);
199 cvAdd(Ipl_IP_Img, IplClickPointStorage, color_img);
200 cvShowImage("Camera View", color_img); // show frame
201 capture = cvWaitKey(10); // wait 10 ms or for key stroke
202 if(capture == 27 || capture == 13 || capture == 32){break;} // if ESC, Return, or space; close window.
203 }
204 cv_cap_IP.release();
205 delete Ipl_IP_Img;
206 delete IplClickPointStorage;
207
208 //\*/
209 }
210 cvDestroyWindow("Camera View");
211 camviewOn = false;
212 }
213 return;
214 }As I said, on one computer I get the above error - both of them give me my own error from here :
155 if(!cv_cap_IP.isOpened())
156 {
157 setExitError(1002);
158 if(textOutput){cout << "Video Error: Video input will not work.\n";}
159 MessageBox(hwnd, "Error opening camera.", "Error", MB_ICONEXCLAMATION);
160 cvDestroyWindow("Camera View");
161 return;
162 }...which of course tells me cv_cap_IP is not open. One of my primary concerns is with the videoFeedAddress variable. No value I enter seems to get a different result.
I searched the Googles - and come across a number of different "possible" answers - but none of them seem to work for me. If you attempt to google it yourself you may come across some of these :
- This is one of the first configurations my code was in. No dice.
- This one is talking about files - not cameras. It also mentions codecs - but I wouldn’t be able to watch it in a web browser if that were the problem, right ? (Correct me if I’m wrong here...)
- This one has the wrong error code/points to the wrong line of code !
- This one mentions compiling OpenCV with ffmpeg support - but I believe 2.4.6.0 already comes with that all set and ready ! Otherwise it’s not that different from what I’ve already tried.
- Now THIS one appears to be very similar to what I have, but the only proposed solution doesn’t really help as I had already located a list of connections. I do not believe this is a duplicate, because as per THIS meta discussion I had a lot more information and so didn’t feel comfortable taking over someone else’s question - especially if I end up needing to add even more information later.
Back to the videoFeedAddress variable : I found THIS site that lists a number of possible addresses to connect to it. since there exists no 7100 anywhere in the list - and the install is the same for the DCS-7010L I used the addresses found next to the DCS-7010L listings. Most of them can be reached through the browser, confirming that they reach the camera - but they don’t seem to affect the outcome when I change them.
As per many of the above links, I’ve tried many of them both with any without username:password, port number (554), and variations on ?.mjpg (the format) at the end.
Any ideas ?