I'm trying to get videoIO to run on Mac OS 10.5.7 (Intel) using GCC 4.0.1 and Matlab 7.6.
I removed all old versions of ffmpeg and installed the last version from SVN as described in the installation instructions. Then, I had to make some minor code edits in order to get everything to compile: e.g., globally replaced sighandler_t into sig_t and added some missing casts from int to PointFormat. Then I added the following in arch2gccarch.pl:
I think I should use m32 here right, and not m64? The only problem I could not get fixed is a problem with the script ffmpeg-config-internal.pl not finding my ffmpeg libraries:
./ffmpeg-config-internal.pl --libs
Could not find ffmpeg's avformat library
I thought I could circumvent this problem by manually editing the Makefile to get the right settings:
Everything then actually compiles and links, but videoIO crashes while running the tests, presumably because it cannot resolve the links to the ffmpeg libraries:
??? Error using ==> feval
Unexpected Standard exception from MEX file.
What() is:basic_string::_S_construct NULL not valid
Error in ==> videoReader.videoReader at 151
vr.handle = feval(vr.plugin, 'open',vr.handle, ...
I tried to resolve this problem by static linking in ffmpeg by changing the Makefile to:
ld: absolute addressing (perhaps -mdynamic-no-pic) used in _put_signed_pixels_clamped_mmx from /usr/local/lib/libavcodec.a(dsputil_mmx.o) not allowed in slidable image. Use '-read_only_relocs suppress' to enable text relocs
collect2: ld returned 1 exit status
mex: link of ' "videoReader_ffmpegDirect.mexmaci"' failed.
I guess the best way to go is to try and get the ./ffmpeg-config-internal.pl to actually recognize my ffmpeg installation. Any thoughts on how to get this done? Or any other thoughts on how to proceed?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm glad to see a Mac user daring enough to try to get this to work. I've never used a Mac for more than a few minutes, so I'll have to make some guesses. For the -m32 versus -m64, you'll need to know whether you have 32-bit or 64-bit Matlab (and you'll want to have the corresponding bitness for ffmpeg if you want to keep life easy). Try running the videoIoSysInfo script and look at the "arch" variable. Note that the current build system tries to be smart enough to even let you use 32-bit ffmpeg with 64-bit Matlab, under limited circumstances.
It looks like .dylib is Mac's equivalent to .so, based on what you have listed above. In that case, edit ffmpeg-config-internal.pl and look for ("so","a") in findUsrLib. Add a "dylib" option to the beginning of the list (so it's preferred over static libs).
If you're going to modify FFMPEG_LINK directly, use -L for directories and -l for actual libraries. For example, to use the dylibs, use "-L/usr/local/lib -lavcodec -lavformat -lswscale".
The reason it's crashing with the dylibs is because the C++ standard library isn't getting linked (based on the error message you included...basic_string is a core part of C++'s standard lib). On some platforms, it's linked by default, but apparently it's not linked for you by default for some reason. ffmpeg-config-internal.pl actually does try hard to hunt down all the required dependencies. On linux, this is handled via the 'findUsrLib($option,0, "", "z","dl","m");' line and the "`nm ..." calls. We may need to expand the set of libraries being searched. We'll discuss that option once we get ffmpeg-config-internal.pl to recognize the ffmpeg libs.
As for the static linking problem, you should be able to statically link, but you've just bumped into an annoying problem with static libs on 64-bit machines. The whole binary being built must make a decision on whether to be "relocatable" or not. Being relocatable adds a lot of flexibility, but it reserves one CPU register for the relocation address (thus possible reducing performance). We need to be relocatable for some technical reasons. If you want to statically link, you'll need to rebuild ffmpeg's static libs with relocation turned on. With gcc on linux, this is done by adding -fPIC to CXX_FLAGS and C_FLAGS.
My preference would be to get ffmpeg-config-internal.pl to work, as you suggest. That way others can benefit too.
Well, actually my absolute preference would be to redo the build system to use autotools, but that's a long-term and low-priority job...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, I edited the ffmpeg-config-internal.pl to hunt for dylibs, and it works now. It was checking whether the architecture was correct in findUsrLib, and the check was only implemented for Linux. Also, it assumed folders like /usr/lib32 and /usr/lib64, which are simply called /usr/lib on OS X. Here's the results of running ffmpeg-config-internal.pl:
That looks all fine to me!
Then, I edited to Makefile to not explicitly specify the architecture to ffmpeg-config-internal.pl, as the maci architecture is not implemented there (so it calls ffmpeg-config-internal.pl as I do in the example above).
But now, when I clean and rebuild, the linker quits without proper error message:
It looks like we're making some good progress. After we're all done, it would be nice to have a final copy of your modified ffmpeg-config-internal.pl.
I did some poking around on the web for the collect2 error message. The consensus for such error messages is that one of 3 things is happening: (1) there's a hardware bug (unlikely, IMHO), (2) there's a bug in the version of ld you're using (seems extremely likely), or (3) the files supplied to ld are bad and a bug in ld's error checking is causing the segfault (seems to be the most likely). Is there a way you can upgrade your binutils package? It seems that 2.18 is much more stable than 2.16.
A few other things to do: (1) run videoIoSysInfo and send me the videoIoSysInfo.txt file that it creates. Often this helps me find tricky problems. (2) Take the failed call to mex and run it directly in your shell, but add a "-v" option. Post the results. This will give us some extra details about what exactly is being done.
I was about to suggest that you try buildVideoIO inside Matlab, but it looks like you already have done so. Sometimes this makes things better, sometimes it makes them worse. Matlab ships with its own version of gcc, etc. I wouldn't be surprised if it has its own copy of ld. It would still be interesting to investigate some of the issues I mentioned above so we can come up with a robust solution. I'll answer the buildVideoIO post next.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It looks like Matlab's version of gcc and/or binutils (ld) is working better than Apple's, but the std c++ library is not being linked.
Quick thing to try... run each of these:
standardTestBattery('ffmpegPopen2')
standardTestBattery('ffmpegDirect')
Do both result in the problem you're seeing?
The current problem is most likely due to one of two things. (1) the standard c++ library may not be linked for some odd reason or (2) it is linked, but LD_LIBRARY_PATH may not be working correctly. Problem #2 is the more likely. Matlab tends to do some crazy stuff with the LD_LIBRARY_PATH.
Try adding /usr/local/lib to LD_LIBRARY_PATH before launching Matlab. If you use bash, this can be done via:
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
Try running the tests again.
If that fails, we'll try a quick hack: add "-lstdc++" to the linker options, at the end (order is important). At least on Linux, that's the
If that fails, then it's time to try to hunt down the actual library where basic_string is defined. At least on Linux, this can be done by hunting through likely directories using the "nm" and "objdump" commands. I can go into more detail if we have to resort to this method.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It turns out my LD_LIBRARY_PATH was empty indeed. I simply set it in Matlab: setenv('LD_LIBRARY_PATH', '/usr/local/lib');
Both standardTestBatteries now terminate with a different error. The standardTestBattery('ffmpegDirect') is actually running for quite some time, claiming it runs doFullRead and doMultiFullReadTest on all movies, but when it gets to doMultiFullReadTestOnAllLoadables it exits. The standardTestBattery('ffmpegOpen2') exit pretty much right away, also at doMultiFullReadTestOnAllLoadables. Here's the error message I get:
doMultiFullReadTestOnAllLoadables...
"intersection147.25fps.xvid.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"intersection256.25fps.xvid.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"intersection300.10fps.ffdshowXvid.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"intersection300.10fps.wmv3.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"intersection300.10fps.xvid.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"intersection300.25fps.xvid.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"intersection300.orig.revel.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.3ivx.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.divx611.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.uncompressed.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.uncompressed.rgba.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.wmv3.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.x264.10fps.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.x264.29_97fps.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.x264.30fps.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.x264.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
...doMultiFullReadTestOnAllLoadables
??? Error using ==> videoReader_ffmpegPopen2
EOF found while trying to read the communication tag. The server process probably died. String so far:
"" Function: int VideoIO::readMessageHeader(FILE*)
File : pipecomm.h
Line : 306
Error in ==> videoReader.videoReader at 151
vr.handle = feval(vr.plugin, 'open',vr.handle, ...
os:
ProductName: Mac OS X
ProductVersion: 10.5.7
BuildVersion: 9J61
version_date:
??? Undefined function or variable "field".
Error in ==> videoIoSysInfo>printStruct at 139
if isempty(field)
Error in ==> videoIoSysInfo at 113
printStruct(info, 1);
So it seems like one of the two plugins is pretty much working; at least it reads in frames. What's the difference with the ffmpegPopen2-plugin? Any speed differences / different features / etc.? Is the EOF error somehow fixable?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Did you run videoIoSysInfo after the setenv call, or before it?
Don't worry about the "is not fully compatible" messages right now. It's important information to know as a user, but it's presented poorly in the current version. I'm slowly working on presenting it better. The basic point is that the underlying codecs are not required to be correct...they can do things like guess the right file location when you ask it to seek to a specific frame. They can also decode the exact same same frame differently depending on things like past seeks and its guess as to how much of a hurry you are in.
Did you get any error message from the ffmpegDirect plugin? It would be very helpful. If it's crashing and killing Matlab, you might be able to run Matlab without a GUI so you can still see the messages. On linux, you can launch Matlab via "matlab --nodesktop"
I'll have to try to figure out why videoIoSysInfo is dying. Do you know what version of Matlab you have?
The two plugins have exactly the same backend, but they are built differently and have a different communication protocol with Matlab. ffmpegDirect is built the way one would normally build a MEX function. Matlab calls a specially-named C++ function called "mexFunction", which eventually calls the ffmpeg libraries. Everything is bound up together in a shared library, the MEX function (i.e. the *.mex* files on a Mac are really *.dylib files with renamed extensions). ffmpegDirect is technically the most efficient way to run videoIO.
I created the ffmpegPopen2 plugins a while ago because I kept running into a few issues. First, from time to time, ffmpeg has been buggy and could crash an application, especially when one uses the subversion version instead of the official releases. The other problem is that ffmpeg and libraries it relies on are built with the system's gcc, but Matlab was built with its own version of gcc. Sometimes this causes nasty conflicts when you try to load a shared library built with one version of gcc into an application built with a different version of gcc that's incompatible (gcc makes breaking changes every few years). In both cases, a solution is to have a very thin shared library act as the MEX function and then build a separate full-fledged executable to do the real work. The MEX function launches the backend application and communicates with it through a pair of pipes. Pipes are basically fake file handles...the MEX function writes to a fake file handle and the backend reads commands from that handle whenever they show up. popen2 is the system call to start an executable and grab the pair of pipes (one for reading, one for writing). If a bug in the backend (either my fault or ffmpeg's) causes a crash, then the server app dies, but Matlab keeps on ticking. Also, the two versions of gcc basically only need to be compatible enough to successfully call popen2 and handle read and write operations properly. The downsides of the popen2 architecture are that it's slightly slower (but not enough to notice) and when the backend crashes, it's hard to get error messages out of it...the backend sends them, but sometimes it dies and shuts down the pipes before the MEX function has a chance to read them.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
...readTests
concatReadTests...
??? Error using ==> videoReader_ffmpegPopen2
EOF found while trying to read the communication tag. The server process probably died. String so far:
"" Function: int VideoIO::readMessageHeader(FILE*)
File : pipecomm.h
Line : 306
Error in ==> videoReader.videoReader at 151
vr.handle = feval(vr.plugin, 'open',vr.handle, ...
Error in ==> videoReader_concat at 163
clips{i} = videoReader(clips{i}, defaultPlugin, defaultArgs{:});
Error in ==> videoReader.videoReader at 158
vr.handle = feval(vr.plugin, 'open',vr.handle, ...
Error in ==> concatReadTests at 31
vrConcat = videoReader({...
Error in ==> standardTestBattery at 17
concatReadTests; % without a plugin specified
Apparently the ffmpegDirect test-battery does use ffmpegPopen2 at some point?!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2009-10-29
Hello lvdmaaten,
It seems that you have worked out how to get VideoIO running on a MAC OSx. Would it be possible to get your changed files in order to install VideoIO?
You also refer to "FFMPEG SVN as described in the installation instructions" Which installation instructions do you refer to?
Do you really need SVN version or is ffmpegx also good?
I used videoIO on a PC and that was very usefull. But I switched to MAC and hope to get it running there as well!
Thank
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's a long time ago since I did this, so I don't really remember the details. Anyway… there's a copy of my full videoIO folder with MACI binaries on http://ict.ewi.tudelft.nl/~lvandermaaten/videoIO.zip (46 MB).
I guess you need a working installation of ffmpegx in order for it to work, and you need to make sure that Matlab can find it. I installed ffmpegx in /usr/local/lib and I do this in order to use videoIO:
<pre>
addpath('videoIO');
setenv('LD_LIBRARY_PATH', '/usr/local/lib');
vr = videoReader(base_folder, 'ffmpegDirect');
info = get(vr);
no_frames = info.numFrames;
for i=1:no_frames
next(vr);
imshow(getframe(vr));
drawnow;
end
</pre>
Hope that helps!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank for the code.
It works to some extend, but not quite.
It might be that I have Snow Leopard installed?
So I try a again:
Trying to colpile VideoIO I run into several problems. 1 I dealed with in the makelfile.
But still I run into trouble. See the error message below. Does this ring a bell?
Undefined symbols:
"_fdopen$UNIX2003",…
Thank in advance,
Jeroen
I altered the makefile a bit:
For some reason I had to explicitly include a libriray. I suppose there is a better way to do this.
…
##############################################################################
###### ECHO PROTOCOL TESTER ##################################################
##############################################################################
JEB := -L/Developer/usr/lib/gcc/i686-apple-darwin10/4.2.1
JEB2 := -lstdc++ -lc
I also ran into similar problems when compiling VideoIO for IntelMac.
Finally, I managed to get it all compiled.
I collected any changes I made in a diff file (see next post).
testAll.m run into some errors, which is probably due to the modifications I made in some cpp files.
(pretty dump changes, just to get it compiled.)
Anyway, reading videos into matlab works fine. Approximately 7 times faster than with the
internal Matlab VideoReader class.
great work! thanks!
#-----------------------------------------------------
MATLAB:
MATLAB Version 7.11.0.584 (R2010b)
#-----------------------------------------------------
System:
Darwin Kernel Version 10.6.0
root:xnu-1504.9.26~3/RELEASE_I386 i386
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
GNU Make 3.81
#-----------------------------------------------------
the output of testAll.m
#-----------------------------------------------------
I'm trying to get videoIO to run on Mac OS 10.5.7 (Intel) using GCC 4.0.1 and Matlab 7.6.
I removed all old versions of ffmpeg and installed the last version from SVN as described in the installation instructions. Then, I had to make some minor code edits in order to get everything to compile: e.g., globally replaced sighandler_t into sig_t and added some missing casts from int to PointFormat. Then I added the following in arch2gccarch.pl:
} elsif ($arch eq "-maci") { # Mac Intel
print "-m32";
I think I should use m32 here right, and not m64? The only problem I could not get fixed is a problem with the script ffmpeg-config-internal.pl not finding my ffmpeg libraries:
./ffmpeg-config-internal.pl --libs
Could not find ffmpeg's avformat library
I thought I could circumvent this problem by manually editing the Makefile to get the right settings:
FFMPEG_LINK := -L /usr/local/lib/libavcodec.dylib -L /usr/local/lib/libavformat.dylib -L /usr/local/lib/libswscale.dylib -L /usr/local/lib/libavutil.dylib
Everything then actually compiles and links, but videoIO crashes while running the tests, presumably because it cannot resolve the links to the ffmpeg libraries:
??? Error using ==> feval
Unexpected Standard exception from MEX file.
What() is:basic_string::_S_construct NULL not valid
Error in ==> videoReader.videoReader at 151
vr.handle = feval(vr.plugin, 'open',vr.handle, ...
I tried to resolve this problem by static linking in ffmpeg by changing the Makefile to:
FFMPEG_LINK := -L /usr/local/lib/libavcodec.a -L /usr/local/lib/libavformat.a -L /usr/local/lib/libswscale.a -L /usr/local/lib/libavutil.a
But then I get a strange error while linking:
ld: absolute addressing (perhaps -mdynamic-no-pic) used in _put_signed_pixels_clamped_mmx from /usr/local/lib/libavcodec.a(dsputil_mmx.o) not allowed in slidable image. Use '-read_only_relocs suppress' to enable text relocs
collect2: ld returned 1 exit status
mex: link of ' "videoReader_ffmpegDirect.mexmaci"' failed.
I guess the best way to go is to try and get the ./ffmpeg-config-internal.pl to actually recognize my ffmpeg installation. Any thoughts on how to get this done? Or any other thoughts on how to proceed?
I'm glad to see a Mac user daring enough to try to get this to work. I've never used a Mac for more than a few minutes, so I'll have to make some guesses. For the -m32 versus -m64, you'll need to know whether you have 32-bit or 64-bit Matlab (and you'll want to have the corresponding bitness for ffmpeg if you want to keep life easy). Try running the videoIoSysInfo script and look at the "arch" variable. Note that the current build system tries to be smart enough to even let you use 32-bit ffmpeg with 64-bit Matlab, under limited circumstances.
It looks like .dylib is Mac's equivalent to .so, based on what you have listed above. In that case, edit ffmpeg-config-internal.pl and look for ("so","a") in findUsrLib. Add a "dylib" option to the beginning of the list (so it's preferred over static libs).
If you're going to modify FFMPEG_LINK directly, use -L for directories and -l for actual libraries. For example, to use the dylibs, use "-L/usr/local/lib -lavcodec -lavformat -lswscale".
The reason it's crashing with the dylibs is because the C++ standard library isn't getting linked (based on the error message you included...basic_string is a core part of C++'s standard lib). On some platforms, it's linked by default, but apparently it's not linked for you by default for some reason. ffmpeg-config-internal.pl actually does try hard to hunt down all the required dependencies. On linux, this is handled via the 'findUsrLib($option,0, "", "z","dl","m");' line and the "`nm ..." calls. We may need to expand the set of libraries being searched. We'll discuss that option once we get ffmpeg-config-internal.pl to recognize the ffmpeg libs.
As for the static linking problem, you should be able to statically link, but you've just bumped into an annoying problem with static libs on 64-bit machines. The whole binary being built must make a decision on whether to be "relocatable" or not. Being relocatable adds a lot of flexibility, but it reserves one CPU register for the relocation address (thus possible reducing performance). We need to be relocatable for some technical reasons. If you want to statically link, you'll need to rebuild ffmpeg's static libs with relocation turned on. With gcc on linux, this is done by adding -fPIC to CXX_FLAGS and C_FLAGS.
My preference would be to get ffmpeg-config-internal.pl to work, as you suggest. That way others can benefit too.
Well, actually my absolute preference would be to redo the build system to use autotools, but that's a long-term and low-priority job...
Ok, I edited the ffmpeg-config-internal.pl to hunt for dylibs, and it works now. It was checking whether the architecture was correct in findUsrLib, and the check was only implemented for Linux. Also, it assumed folders like /usr/lib32 and /usr/lib64, which are simply called /usr/lib on OS X. Here's the results of running ffmpeg-config-internal.pl:
Macintosh-10:videoIO laurens$ ./ffmpeg-config-internal.pl --libs
-L/usr/local/lib -L/usr/lib -lavformat -lavcodec -lavutil -lswscale -lz -ldl -lm
Macintosh-10:videoIO laurens$ ./ffmpeg-config-internal.pl --staticlibs
/usr/local/lib/libavformat.a /usr/local/lib/libavcodec.a /usr/local/lib/libavutil.a /usr/local/lib/libswscale.a /usr/local/lib/libz.a
Macintosh-10:videoIO laurens$ ./ffmpeg-config-internal.pl --arch
-maci
Macintosh-10:videoIO laurens$ ./ffmpeg-config-internal.pl --cflags
-I/usr/local/include -I/usr/include -m32
Macintosh-10:videoIO laurens$ ./ffmpeg-config-internal.pl --rpath
/usr/local/lib:/usr/lib
That looks all fine to me!
Then, I edited to Makefile to not explicitly specify the architecture to ffmpeg-config-internal.pl, as the maci architecture is not implemented there (so it calls ffmpeg-config-internal.pl as I do in the example above).
But now, when I clean and rebuild, the linker quits without proper error message:
Macintosh-10:videoIO laurens$ make
/Applications/Matlab/bin/mex -c CC=g++ CXX=g++ LD=g++ ARCH=maci CXXFLAGS\#'-O2 -g -I. -fPIC -D__STDC_CONSTANT_MACROS -m32 -o echo.mexmaci.o' echo.cpp
/Applications/Matlab/bin/mex -c CC=g++ CXX=g++ LD=g++ ARCH=maci CXXFLAGS\#'-O2 -g -I. -fPIC -D__STDC_CONSTANT_MACROS -m32 -o mexClientDirect.mexmaci.o' mexClientDirect.cpp
/Applications/Matlab/bin/mex -c CC=g++ CXX=g++ LD=g++ ARCH=maci CXXFLAGS\#'-O2 -g -I. -fPIC -D__STDC_CONSTANT_MACROS -m32 -o debug.mexmaci.o' debug.cpp
/Applications/Matlab/bin/mex -cxx CC=g++ CXX=g++ LD=g++ ARCH=maci CXXFLAGS\#'-O2 -g -fPIC -m32 -Wl,-rpath=/usr/local/lib:/usr/lib' echo.mexmaci.o mexClientDirect.mexmaci.o debug.mexmaci.o -output echoDirect.mexmaci
collect2: ld terminated with signal 11 [Segmentation fault]
mex: link of ' "echoDirect.mexmaci"' failed.
I manually tried to compile with -m64 and -arch i386 instead of -m32 inside CXXFLAGS, but that did not help much. Any thoughts on what's next?
It looks like we're making some good progress. After we're all done, it would be nice to have a final copy of your modified ffmpeg-config-internal.pl.
I did some poking around on the web for the collect2 error message. The consensus for such error messages is that one of 3 things is happening: (1) there's a hardware bug (unlikely, IMHO), (2) there's a bug in the version of ld you're using (seems extremely likely), or (3) the files supplied to ld are bad and a bug in ld's error checking is causing the segfault (seems to be the most likely). Is there a way you can upgrade your binutils package? It seems that 2.18 is much more stable than 2.16.
A few other things to do: (1) run videoIoSysInfo and send me the videoIoSysInfo.txt file that it creates. Often this helps me find tricky problems. (2) Take the failed call to mex and run it directly in your shell, but add a "-v" option. Post the results. This will give us some extra details about what exactly is being done.
I was about to suggest that you try buildVideoIO inside Matlab, but it looks like you already have done so. Sometimes this makes things better, sometimes it makes them worse. Matlab ships with its own version of gcc, etc. I wouldn't be surprised if it has its own copy of ld. It would still be interesting to investigate some of the issues I mentioned above so we can come up with a robust solution. I'll answer the buildVideoIO post next.
Curiously, using buildVideoIO in Matlab instead of make in the Terminal resolved that problem! Everything now compiled successfully.
However, when running testAll I get the same error as before:
??? Error using ==> feval
Unexpected Standard exception from MEX file.
What() is:basic_string::_S_construct NULL not valid
Error in ==> videoReader.videoReader at 151
vr.handle = feval(vr.plugin, 'open',vr.handle, ...
Any thoughts on how to get the standard library to be linked in?
Answer to the buildVideoIO post...
It looks like Matlab's version of gcc and/or binutils (ld) is working better than Apple's, but the std c++ library is not being linked.
Quick thing to try... run each of these:
standardTestBattery('ffmpegPopen2')
standardTestBattery('ffmpegDirect')
Do both result in the problem you're seeing?
The current problem is most likely due to one of two things. (1) the standard c++ library may not be linked for some odd reason or (2) it is linked, but LD_LIBRARY_PATH may not be working correctly. Problem #2 is the more likely. Matlab tends to do some crazy stuff with the LD_LIBRARY_PATH.
Try adding /usr/local/lib to LD_LIBRARY_PATH before launching Matlab. If you use bash, this can be done via:
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
Try running the tests again.
If that fails, we'll try a quick hack: add "-lstdc++" to the linker options, at the end (order is important). At least on Linux, that's the
If that fails, then it's time to try to hunt down the actual library where basic_string is defined. At least on Linux, this can be done by hunting through likely directories using the "nm" and "objdump" commands. I can go into more detail if we have to resort to this method.
It turns out my LD_LIBRARY_PATH was empty indeed. I simply set it in Matlab: setenv('LD_LIBRARY_PATH', '/usr/local/lib');
Both standardTestBatteries now terminate with a different error. The standardTestBattery('ffmpegDirect') is actually running for quite some time, claiming it runs doFullRead and doMultiFullReadTest on all movies, but when it gets to doMultiFullReadTestOnAllLoadables it exits. The standardTestBattery('ffmpegOpen2') exit pretty much right away, also at doMultiFullReadTestOnAllLoadables. Here's the error message I get:
doMultiFullReadTestOnAllLoadables...
"intersection147.25fps.xvid.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"intersection256.25fps.xvid.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"intersection300.10fps.ffdshowXvid.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"intersection300.10fps.wmv3.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"intersection300.10fps.xvid.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"intersection300.25fps.xvid.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"intersection300.orig.revel.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.3ivx.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.divx611.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.uncompressed.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.uncompressed.rgba.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.wmv3.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.x264.10fps.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.x264.29_97fps.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.x264.30fps.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
"numbers.x264.avi" (or more likely its codec) is not fully compatible with videoReader... not tested (Error using ==> videoReader_ffmpegPopen2\nEOF found while trying to read the communication tag. The server process probably died. String so far: "" Function: int VideoIO::readMessageHeader(FILE*)\n File : pipecomm.h\n Line : 306)
...doMultiFullReadTestOnAllLoadables
??? Error using ==> videoReader_ffmpegPopen2
EOF found while trying to read the communication tag. The server process probably died. String so far:
"" Function: int VideoIO::readMessageHeader(FILE*)
File : pipecomm.h
Line : 306
Error in ==> videoReader.videoReader at 151
vr.handle = feval(vr.plugin, 'open',vr.handle, ...
And here's the results from running videoSysInfo:
allLibDirs:
/usr/local/lib
/usr/lib
/lib/i686-apple-darwin9/4.0.1/
/lib/
/usr/lib/i686-apple-darwin9/4.0.1/
/usr/lib/
/usr/lib/gcc/i686-apple-darwin9/4.0.1/
/usr/lib/gcc/i686-apple-darwin9/4.0.1/
/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/i686-apple-darwin9/4.0.1/
/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/
/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../i686-apple-darwin9/4.0.1/
/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../
arch:
maci
computer:
MACI
cxxflags:
endian:
L
ffmpegCflags:
-I/usr/local/include -I/usr/include -m32
ffmpegLibs:
-L/usr/local/lib -L/usr/lib -lavformat -lavcodec -lavutil -lswscale -lz -ldl -lm
gccLibDirs:
/lib/i686-apple-darwin9/4.0.1/
/lib/
/usr/lib/i686-apple-darwin9/4.0.1/
/usr/lib/
/usr/lib/gcc/i686-apple-darwin9/4.0.1/
/usr/lib/gcc/i686-apple-darwin9/4.0.1/
/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/i686-apple-darwin9/4.0.1/
/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/
/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../i686-apple-darwin9/4.0.1/
/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../
java:
Java 1.5.0_19 with Apple Inc. Java HotSpot(TM) Client VM mixed mode, sharing
libsArch:
libavformat.a
libavcodec.a
libavutil.a
libswscale.a
libz.a
matlabDate:
23-Jan-2008
matlabRelease:
(R2008a)
matlabVersion:
7.6
maxsize:
2147483647
mexext:
mexmaci
os:
ProductName: Mac OS X
ProductVersion: 10.5.7
BuildVersion: 9J61
version_date:
??? Undefined function or variable "field".
Error in ==> videoIoSysInfo>printStruct at 139
if isempty(field)
Error in ==> videoIoSysInfo at 113
printStruct(info, 1);
So it seems like one of the two plugins is pretty much working; at least it reads in frames. What's the difference with the ffmpegPopen2-plugin? Any speed differences / different features / etc.? Is the EOF error somehow fixable?
Did you run videoIoSysInfo after the setenv call, or before it?
Don't worry about the "is not fully compatible" messages right now. It's important information to know as a user, but it's presented poorly in the current version. I'm slowly working on presenting it better. The basic point is that the underlying codecs are not required to be correct...they can do things like guess the right file location when you ask it to seek to a specific frame. They can also decode the exact same same frame differently depending on things like past seeks and its guess as to how much of a hurry you are in.
Did you get any error message from the ffmpegDirect plugin? It would be very helpful. If it's crashing and killing Matlab, you might be able to run Matlab without a GUI so you can still see the messages. On linux, you can launch Matlab via "matlab --nodesktop"
I'll have to try to figure out why videoIoSysInfo is dying. Do you know what version of Matlab you have?
The two plugins have exactly the same backend, but they are built differently and have a different communication protocol with Matlab. ffmpegDirect is built the way one would normally build a MEX function. Matlab calls a specially-named C++ function called "mexFunction", which eventually calls the ffmpeg libraries. Everything is bound up together in a shared library, the MEX function (i.e. the *.mex* files on a Mac are really *.dylib files with renamed extensions). ffmpegDirect is technically the most efficient way to run videoIO.
I created the ffmpegPopen2 plugins a while ago because I kept running into a few issues. First, from time to time, ffmpeg has been buggy and could crash an application, especially when one uses the subversion version instead of the official releases. The other problem is that ffmpeg and libraries it relies on are built with the system's gcc, but Matlab was built with its own version of gcc. Sometimes this causes nasty conflicts when you try to load a shared library built with one version of gcc into an application built with a different version of gcc that's incompatible (gcc makes breaking changes every few years). In both cases, a solution is to have a very thin shared library act as the MEX function and then build a separate full-fledged executable to do the real work. The MEX function launches the backend application and communicates with it through a pair of pipes. Pipes are basically fake file handles...the MEX function writes to a fake file handle and the backend reads commands from that handle whenever they show up. popen2 is the system call to start an executable and grab the pair of pipes (one for reading, one for writing). If a bug in the backend (either my fault or ffmpeg's) causes a crash, then the server app dies, but Matlab keeps on ticking. Also, the two versions of gcc basically only need to be compatible enough to successfully call popen2 and handle read and write operations properly. The downsides of the popen2 architecture are that it's slightly slower (but not enough to notice) and when the backend crashes, it's hard to get error messages out of it...the backend sends them, but sometimes it dies and shuts down the pipes before the MEX function has a chance to read them.
I see. Debugging the ffmpegPopen2 sounds horrible indeed; I remember using pipes once to communicate between C++ and JavaScript: big mess!
Well, I can at least use the direct implementation for now (I need speed anyway)...
I did the videoIoSysInfo after the setenv. I use Matlab 7.6 (R2008a). The ffmpegDirect run outputs the following:
>> standardTestBattery('ffmpegDirect')
standardTestBattery...
readTests...
>>> doPreciseSeekTests('numbers.uncompressed.avi',...)
>>> doFullRead('numbers.uncompressed.avi',...)
<<< doFullRead('numbers.uncompressed.avi',...)
<<< doPreciseSeekTests('numbers.uncompressed.avi',...)
doMultiFullReadTestOnAllLoadables...
>>> doMultiFullReadTest('intersection147.25fps.xvid.avi',...)
>>> doFullRead('intersection147.25fps.xvid.avi',...)
<<< doFullRead('intersection147.25fps.xvid.avi',...)
<<< doMultiFullReadTest('intersection147.25fps.xvid.avi',...)
>>> doMultiFullReadTest('intersection256.25fps.xvid.avi',...)
>>> doFullRead('intersection256.25fps.xvid.avi',...)
<<< doFullRead('intersection256.25fps.xvid.avi',...)
<<< doMultiFullReadTest('intersection256.25fps.xvid.avi',...)
>>> doMultiFullReadTest('intersection300.10fps.ffdshowXvid.avi',...)
>>> doFullRead('intersection300.10fps.ffdshowXvid.avi',...)
<<< doFullRead('intersection300.10fps.ffdshowXvid.avi',...)
<<< doMultiFullReadTest('intersection300.10fps.ffdshowXvid.avi',...)
>>> doMultiFullReadTest('intersection300.10fps.wmv3.avi',...)
>>> doFullRead('intersection300.10fps.wmv3.avi',...)
<<< doFullRead('intersection300.10fps.wmv3.avi',...)
<<< doMultiFullReadTest('intersection300.10fps.wmv3.avi',...)
>>> doMultiFullReadTest('intersection300.10fps.xvid.avi',...)
>>> doFullRead('intersection300.10fps.xvid.avi',...)
<<< doFullRead('intersection300.10fps.xvid.avi',...)
<<< doMultiFullReadTest('intersection300.10fps.xvid.avi',...)
>>> doMultiFullReadTest('intersection300.25fps.xvid.avi',...)
>>> doFullRead('intersection300.25fps.xvid.avi',...)
<<< doFullRead('intersection300.25fps.xvid.avi',...)
<<< doMultiFullReadTest('intersection300.25fps.xvid.avi',...)
>>> doMultiFullReadTest('intersection300.orig.revel.avi',...)
>>> doFullRead('intersection300.orig.revel.avi',...)
<<< doFullRead('intersection300.orig.revel.avi',...)
<<< doMultiFullReadTest('intersection300.orig.revel.avi',...)
>>> doMultiFullReadTest('numbers.3ivx.avi',...)
>>> doFullRead('numbers.3ivx.avi',...)
<<< doFullRead('numbers.3ivx.avi',...)
<<< doMultiFullReadTest('numbers.3ivx.avi',...)
>>> doMultiFullReadTest('numbers.divx611.avi',...)
>>> doFullRead('numbers.divx611.avi',...)
<<< doFullRead('numbers.divx611.avi',...)
<<< doMultiFullReadTest('numbers.divx611.avi',...)
>>> doMultiFullReadTest('numbers.uncompressed.avi',...)
>>> doFullRead('numbers.uncompressed.avi',...)
<<< doFullRead('numbers.uncompressed.avi',...)
<<< doMultiFullReadTest('numbers.uncompressed.avi',...)
>>> doMultiFullReadTest('numbers.uncompressed.rgba.avi',...)
>>> doFullRead('numbers.uncompressed.rgba.avi',...)
<<< doFullRead('numbers.uncompressed.rgba.avi',...)
<<< doMultiFullReadTest('numbers.uncompressed.rgba.avi',...)
>>> doMultiFullReadTest('numbers.wmv3.avi',...)
>>> doFullRead('numbers.wmv3.avi',...)
<<< doFullRead('numbers.wmv3.avi',...)
<<< doMultiFullReadTest('numbers.wmv3.avi',...)
>>> doMultiFullReadTest('numbers.x264.10fps.avi',...)
>>> doFullRead('numbers.x264.10fps.avi',...)
<<< doFullRead('numbers.x264.10fps.avi',...)
<<< doMultiFullReadTest('numbers.x264.10fps.avi',...)
>>> doMultiFullReadTest('numbers.x264.29_97fps.avi',...)
>>> doFullRead('numbers.x264.29_97fps.avi',...)
<<< doFullRead('numbers.x264.29_97fps.avi',...)
<<< doMultiFullReadTest('numbers.x264.29_97fps.avi',...)
>>> doMultiFullReadTest('numbers.x264.30fps.avi',...)
>>> doFullRead('numbers.x264.30fps.avi',...)
<<< doFullRead('numbers.x264.30fps.avi',...)
<<< doMultiFullReadTest('numbers.x264.30fps.avi',...)
>>> doMultiFullReadTest('numbers.x264.avi',...)
>>> doFullRead('numbers.x264.avi',...)
<<< doFullRead('numbers.x264.avi',...)
<<< doMultiFullReadTest('numbers.x264.avi',...)
...doMultiFullReadTestOnAllLoadables
Successfully caught backend error: Error using ==> videoReader_ffmpegDirect
Data type mismatch: expected mxDOUBLE_CLASS, but a string "abcdef" was found instead. Function: T VideoIO::mat2scalar(const VideoIO::MatArray*) [with T = double]
File : matarray.h
Line : 232
...readTests
concatReadTests...
??? Error using ==> videoReader_ffmpegPopen2
EOF found while trying to read the communication tag. The server process probably died. String so far:
"" Function: int VideoIO::readMessageHeader(FILE*)
File : pipecomm.h
Line : 306
Error in ==> videoReader.videoReader at 151
vr.handle = feval(vr.plugin, 'open',vr.handle, ...
Error in ==> videoReader_concat at 163
clips{i} = videoReader(clips{i}, defaultPlugin, defaultArgs{:});
Error in ==> videoReader.videoReader at 158
vr.handle = feval(vr.plugin, 'open',vr.handle, ...
Error in ==> concatReadTests at 31
vrConcat = videoReader({...
Error in ==> standardTestBattery at 17
concatReadTests; % without a plugin specified
Apparently the ffmpegDirect test-battery does use ffmpegPopen2 at some point?!
Hello lvdmaaten,
It seems that you have worked out how to get VideoIO running on a MAC OSx. Would it be possible to get your changed files in order to install VideoIO?
You also refer to "FFMPEG SVN as described in the installation instructions" Which installation instructions do you refer to?
Do you really need SVN version or is ffmpegx also good?
I used videoIO on a PC and that was very usefull. But I switched to MAC and hope to get it running there as well!
Thank
It's a long time ago since I did this, so I don't really remember the details. Anyway… there's a copy of my full videoIO folder with MACI binaries on http://ict.ewi.tudelft.nl/~lvandermaaten/videoIO.zip (46 MB).
I guess you need a working installation of ffmpegx in order for it to work, and you need to make sure that Matlab can find it. I installed ffmpegx in /usr/local/lib and I do this in order to use videoIO:
<pre>
addpath('videoIO');
setenv('LD_LIBRARY_PATH', '/usr/local/lib');
vr = videoReader(base_folder, 'ffmpegDirect');
info = get(vr);
no_frames = info.numFrames;
for i=1:no_frames
next(vr);
imshow(getframe(vr));
drawnow;
end
</pre>
Hope that helps!
Thank for the code.
It works to some extend, but not quite.
It might be that I have Snow Leopard installed?
So I try a again:
Trying to colpile VideoIO I run into several problems. 1 I dealed with in the makelfile.
But still I run into trouble. See the error message below. Does this ring a bell?
Undefined symbols:
"_fdopen$UNIX2003",…
Thank in advance,
Jeroen
I altered the makefile a bit:
For some reason I had to explicitly include a libriray. I suppose there is a better way to do this.
…
##############################################################################
###### ECHO PROTOCOL TESTER ##################################################
##############################################################################
JEB := -L/Developer/usr/lib/gcc/i686-apple-darwin10/4.2.1
JEB2 := -lstdc++ -lc
###-- popen2 version --------------------------------
echoPopen2.$(MEXT): mexClientPopen2.$(MEXT).o debug.$(MEXT).o popen2.$(MEXT).o
$(MEX) -cxx $(MEXOPTS) CXXFLAGS\#'$(LDOPTS_MATLAB)' $(JEB) $^ $(JEB2) -output $@
….
>> buildvideoIO
make MEXEXT=mexmaci
readlink: illegal option - f
usage: readlink
/bin/mex -c CC=g++ CXX=g++ LD=g++ ARCH=maci CXXFLAGS\#'-O2 -g -I. -fPIC -D__STDC_CONSTANT_MACROS -m32 -o echo.mexmaci.o' echo.cpp
/bin/mex -c CC=g++ CXX=g++ LD=g++ ARCH=maci CXXFLAGS\#'-O2 -g -I. -fPIC -D__STDC_CONSTANT_MACROS -m32 -o mexClientDirect.mexmaci.o' mexClientDirect.cpp
/bin/mex -c CC=g++ CXX=g++ LD=g++ ARCH=maci CXXFLAGS\#'-O2 -g -I. -fPIC -D__STDC_CONSTANT_MACROS -m32 -o debug.mexmaci.o' debug.cpp
/bin/mex -cxx CC=g++ CXX=g++ LD=g++ ARCH=maci CXXFLAGS\#'-O2 -g -fPIC -m32' -L/Developer/usr/lib/gcc/i686-apple-darwin10/4.2.1 echo.mexmaci.o mexClientDirect.mexmaci.o debug.mexmaci.o -lstdc++ -lc -output echoDirect.mexmaci
/bin/mex -c CC=g++ CXX=g++ LD=g++ ARCH=maci CXXFLAGS\#'-O2 -g -I. -fPIC -D__STDC_CONSTANT_MACROS -m32 -o mexClientPopen2.mexmaci.o' mexClientPopen2.cpp
/bin/mex -c CC=g++ CXX=g++ LD=g++ ARCH=maci CXXFLAGS\#'-O2 -g -I. -fPIC -D__STDC_CONSTANT_MACROS -m32 -o popen2.mexmaci.o' popen2.cpp
/bin/mex -cxx CC=g++ CXX=g++ LD=g++ ARCH=maci CXXFLAGS\#'-O2 -g -fPIC -m32' -L/Developer/usr/lib/gcc/i686-apple-darwin10/4.2.1 mexClientPopen2.mexmaci.o debug.mexmaci.o popen2.mexmaci.o -lstdc++ -lc -output echoPopen2.mexmaci
Undefined symbols:
"_fdopen$UNIX2003", referenced from:
initialize() in mexClientPopen2.mexmaci.o
initialize() in mexClientPopen2.mexmaci.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
mex: link of ' "echoPopen2.mexmaci"' failed.
make: *** Error 1
I also ran into similar problems when compiling VideoIO for IntelMac.
Finally, I managed to get it all compiled.
I collected any changes I made in a diff file (see next post).
testAll.m run into some errors, which is probably due to the modifications I made in some cpp files.
(pretty dump changes, just to get it compiled.)
Anyway, reading videos into matlab works fine. Approximately 7 times faster than with the
internal Matlab VideoReader class.
great work! thanks!
#-----------------------------------------------------
MATLAB:
MATLAB Version 7.11.0.584 (R2010b)
#-----------------------------------------------------
ffmpeg:
FFmpeg version 0.6.1, Copyright (C) 2000-2010 the FFmpeg developers
built on Mar 2 2011 14:16:16 with gcc 4.2.1 (Apple Inc. build 5664)
configuration: -enable-gpl -enable-pthreads -enable-shared -enable-swscale -enable-zlib -enable-ffplay -enable-ffserver -enable-avcodec -enable-avformat -enable-avfilter
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
#-----------------------------------------------------
VideoIO:
videoIO-r720-source.zip
#-----------------------------------------------------
System:
Darwin Kernel Version 10.6.0
root:xnu-1504.9.26~3/RELEASE_I386 i386
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
GNU Make 3.81
#-----------------------------------------------------
the output of testAll.m
#-----------------------------------------------------
>> testAll
testAll…
test_pvtVideoIO_mexName…
…test_pvtVideoIO_mexName
testLoadAndImread…
readIndvFrameTests…
>>> doPreciseSeekTests('frames/numbers.%04d.mat',…)
>>> doFullRead('frames/numbers.%04d.mat',…)
<<< doFullRead('frames/numbers.%04d.mat',…)
<<< doPreciseSeekTests('frames/numbers.%04d.mat',…)
>>> doPreciseSeekTests('frames/numbers.*.mat',…)
>>> doFullRead('frames/numbers.*.mat',…)
<<< doFullRead('frames/numbers.*.mat',…)
<<< doPreciseSeekTests('frames/numbers.*.mat',…)
…readIndvFrameTests
readIndvFrameTests…
>>> doPreciseSeekTests('frames/numbers.%04d.mat',…)
>>> doFullRead('frames/numbers.%04d.mat',…)
<<< doFullRead('frames/numbers.%04d.mat',…)
<<< doPreciseSeekTests('frames/numbers.%04d.mat',…)
>>> doPreciseSeekTests('frames/numbers.*.mat',…)
>>> doFullRead('frames/numbers.*.mat',…)
<<< doFullRead('frames/numbers.*.mat',…)
<<< doPreciseSeekTests('frames/numbers.*.mat',…)
…readIndvFrameTests
readIndvFrameTests…
>>> doPreciseSeekTests('frames/numbers.%04d.png',…)
>>> doFullRead('frames/numbers.%04d.png',…)
<<< doFullRead('frames/numbers.%04d.png',…)
<<< doPreciseSeekTests('frames/numbers.%04d.png',…)
>>> doPreciseSeekTests('frames/numbers.*.png',…)
>>> doFullRead('frames/numbers.*.png',…)
<<< doFullRead('frames/numbers.*.png',…)
<<< doPreciseSeekTests('frames/numbers.*.png',…)
…readIndvFrameTests
…testLoadAndImread
testMatrix…
…testMatrix
testFfmpeg…
Warning: Don't know wheter this works under MAC -> DisabledUse the make build environment!
> In buildVideoIO at 49
In testFfmpeg at 20
In testAll at 35
standardTestBattery…
readTests…
>>> doPreciseSeekTests('numbers.uncompressed.avi',…)
>>> doFullRead('numbers.uncompressed.avi',…)
<<< doFullRead('numbers.uncompressed.avi',…)
<<< doPreciseSeekTests('numbers.uncompressed.avi',…)
doMultiFullReadTestOnAllLoadables…
>>> doMultiFullReadTest('addFrameDemo_fancyFig.avi',…)
>>> doFullRead('addFrameDemo_fancyFig.avi',…)
<<< doFullRead('addFrameDemo_fancyFig.avi',…)
<<< doMultiFullReadTest('addFrameDemo_fancyFig.avi',…)
>>> doMultiFullReadTest('addFrameDemo_figure.avi',…)
>>> doFullRead('addFrameDemo_figure.avi',…)
<<< doFullRead('addFrameDemo_figure.avi',…)
<<< doMultiFullReadTest('addFrameDemo_figure.avi',…)
>>> doMultiFullReadTest('addFrameDemo_getframe.avi',…)
>>> doFullRead('addFrameDemo_getframe.avi',…)
<<< doFullRead('addFrameDemo_getframe.avi',…)
<<< doMultiFullReadTest('addFrameDemo_getframe.avi',…)
>>> doMultiFullReadTest('addFrameDemo_gray.avi',…)
>>> doFullRead('addFrameDemo_gray.avi',…)
<<< doFullRead('addFrameDemo_gray.avi',…)
<<< doMultiFullReadTest('addFrameDemo_gray.avi',…)
>>> doMultiFullReadTest('addFrameDemo_multiframe.avi',…)
>>> doFullRead('addFrameDemo_multiframe.avi',…)
<<< doFullRead('addFrameDemo_multiframe.avi',…)
<<< doMultiFullReadTest('addFrameDemo_multiframe.avi',…)
>>> doMultiFullReadTest('addFrameDemo_resize.avi',…)
>>> doFullRead('addFrameDemo_resize.avi',…)
<<< doFullRead('addFrameDemo_resize.avi',…)
<<< doMultiFullReadTest('addFrameDemo_resize.avi',…)
>>> doMultiFullReadTest('addFrameDemo_rgb.avi',…)
>>> doFullRead('addFrameDemo_rgb.avi',…)
<<< doFullRead('addFrameDemo_rgb.avi',…)
<<< doMultiFullReadTest('addFrameDemo_rgb.avi',…)
>>> doMultiFullReadTest('intersection147.25fps.xvid.avi',…)
>>> doFullRead('intersection147.25fps.xvid.avi',…)
<<< doFullRead('intersection147.25fps.xvid.avi',…)
<<< doMultiFullReadTest('intersection147.25fps.xvid.avi',…)
>>> doMultiFullReadTest('intersection256.25fps.xvid.avi',…)
>>> doFullRead('intersection256.25fps.xvid.avi',…)
<<< doFullRead('intersection256.25fps.xvid.avi',…)
<<< doMultiFullReadTest('intersection256.25fps.xvid.avi',…)
>>> doMultiFullReadTest('intersection300.10fps.ffdshowXvid.avi',…)
>>> doFullRead('intersection300.10fps.ffdshowXvid.avi',…)
<<< doFullRead('intersection300.10fps.ffdshowXvid.avi',…)
<<< doMultiFullReadTest('intersection300.10fps.ffdshowXvid.avi',…)
>>> doMultiFullReadTest('intersection300.10fps.wmv3.avi',…)
>>> doFullRead('intersection300.10fps.wmv3.avi',…)
<<< doFullRead('intersection300.10fps.wmv3.avi',…)
<<< doMultiFullReadTest('intersection300.10fps.wmv3.avi',…)
>>> doMultiFullReadTest('intersection300.10fps.xvid.avi',…)
>>> doFullRead('intersection300.10fps.xvid.avi',…)
<<< doFullRead('intersection300.10fps.xvid.avi',…)
<<< doMultiFullReadTest('intersection300.10fps.xvid.avi',…)
>>> doMultiFullReadTest('intersection300.25fps.xvid.avi',…)
>>> doFullRead('intersection300.25fps.xvid.avi',…)
<<< doFullRead('intersection300.25fps.xvid.avi',…)
<<< doMultiFullReadTest('intersection300.25fps.xvid.avi',…)
>>> doMultiFullReadTest('intersection300.orig.revel.avi',…)
>>> doFullRead('intersection300.orig.revel.avi',…)
<<< doFullRead('intersection300.orig.revel.avi',…)
<<< doMultiFullReadTest('intersection300.orig.revel.avi',…)
>>> doMultiFullReadTest('numbers.3ivx.avi',…)
>>> doFullRead('numbers.3ivx.avi',…)
<<< doFullRead('numbers.3ivx.avi',…)
<<< doMultiFullReadTest('numbers.3ivx.avi',…)
>>> doMultiFullReadTest('numbers.divx611.avi',…)
>>> doFullRead('numbers.divx611.avi',…)
<<< doFullRead('numbers.divx611.avi',…)
<<< doMultiFullReadTest('numbers.divx611.avi',…)
>>> doMultiFullReadTest('numbers.uncompressed.avi',…)
>>> doFullRead('numbers.uncompressed.avi',…)
<<< doFullRead('numbers.uncompressed.avi',…)
<<< doMultiFullReadTest('numbers.uncompressed.avi',…)
>>> doMultiFullReadTest('numbers.uncompressed.rgba.avi',…)
>>> doFullRead('numbers.uncompressed.rgba.avi',…)
<<< doFullRead('numbers.uncompressed.rgba.avi',…)
<<< doMultiFullReadTest('numbers.uncompressed.rgba.avi',…)
>>> doMultiFullReadTest('numbers.wmv3.avi',…)
>>> doFullRead('numbers.wmv3.avi',…)
<<< doFullRead('numbers.wmv3.avi',…)
<<< doMultiFullReadTest('numbers.wmv3.avi',…)
>>> doMultiFullReadTest('numbers.x264.10fps.avi',…)
>>> doFullRead('numbers.x264.10fps.avi',…)
<<< doFullRead('numbers.x264.10fps.avi',…)
<<< doMultiFullReadTest('numbers.x264.10fps.avi',…)
>>> doMultiFullReadTest('numbers.x264.29_97fps.avi',…)
>>> doFullRead('numbers.x264.29_97fps.avi',…)
<<< doFullRead('numbers.x264.29_97fps.avi',…)
<<< doMultiFullReadTest('numbers.x264.29_97fps.avi',…)
>>> doMultiFullReadTest('numbers.x264.30fps.avi',…)
>>> doFullRead('numbers.x264.30fps.avi',…)
<<< doFullRead('numbers.x264.30fps.avi',…)
<<< doMultiFullReadTest('numbers.x264.30fps.avi',…)
>>> doMultiFullReadTest('numbers.x264.avi',…)
>>> doFullRead('numbers.x264.avi',…)
<<< doFullRead('numbers.x264.avi',…)
<<< doMultiFullReadTest('numbers.x264.avi',…)
…doMultiFullReadTestOnAllLoadables
Successfully caught backend error: Error using ==> videoReader_ffmpegPopen2
Data type mismatch: expected mxDOUBLE_CLASS, but a string "abcdef" was found instead. Function: T VideoIO::mat2scalar(const VideoIO::MatArray*)
File : matarray.h
Line : 232
…readTests
concatReadTests…
>>> doFullRead('intersection147.25fps.xvid.avi',…)
<<< doFullRead('intersection147.25fps.xvid.avi',…)
>>> doFullRead('intersection300.orig.revel.avi',…)
<<< doFullRead('intersection300.orig.revel.avi',…)
>>> doFullRead('numbers.uncompressed.avi',…)
<<< doFullRead('numbers.uncompressed.avi',…)
>>> doFullRead('frames/numbers.*.mat',…)
<<< doFullRead('frames/numbers.*.mat',…)
…concatReadTests
concatReadTests…
>>> doFullRead('intersection147.25fps.xvid.avi',…)
<<< doFullRead('intersection147.25fps.xvid.avi',…)
>>> doFullRead('intersection300.orig.revel.avi',…)
<<< doFullRead('intersection300.orig.revel.avi',…)
>>> doFullRead('numbers.uncompressed.avi',…)
<<< doFullRead('numbers.uncompressed.avi',…)
>>> doFullRead('frames/numbers.*.mat',…)
<<< doFullRead('frames/numbers.*.mat',…)
…concatReadTests
writeTests…
…writeTests
testBitRate…
codec encoding time bitRate supported sizes
------- --------- ----------- ---
asv1 1s unable to encode 0 0
asv2 1s unable to encode 0 0
bmp 1s unable to encode 0 0
dnxhd 1s unable to encode 0 0
dvvideo 1s unable to encode 0 0
ffv1 1s bitRate ignored 2699640 2699640
ffvhuff 1s bitRate ignored 3333324 3333324
flashsv 1s unable to encode 0 0
flv 1s unable to encode 0 0
gif 1s unable to encode 0 0
h261 1s bitRate supported 422806 771856
h263 1s bitRate supported 505270 665320
h263p 1s bitRate supported 505324 665392
huffyuv 1s bitRate ignored 3808524 3808524
jpegls 1s unable to encode 0 0
ljpeg 1s unable to encode 0 0
mjpeg 1s bitRate supported 813640 966126
mpeg1video 1s bitRate supported 488306 815110
mpeg2video 1s bitRate supported 414946 761260
mpeg4 1s bitRate supported 627022 611114
msmpeg4 1s unable to encode 0 0
msmpeg4v1 1s bitRate supported 6358 6352
msmpeg4v2 1s bitRate supported 520488 654634
pam 1s bitRate ignored 7611080 7611080
pbm 1s bitRate ignored 323380 323380
pcx 1s unable to encode 0 0
pgm 1s unable to encode 0 0
pgmyuv 1s bitRate ignored 3808280 3808280
png 2s bitRate ignored 3665964 3665964
ppm 1s bitRate ignored 7609880 7609880
qtrle 2s bitRate ignored 7606658 7606658
rawvideo 1s unable to encode 0 0
roqvideo 1s unable to encode 0 0
rv10 1s bitRate supported 505226 665272
rv20 1s bitRate supported 627562 807794
sgi 1s unable to encode 0 0
snow 1s unable to encode 0 0
svq1 1s unable to encode 0 0
targa 1s unable to encode 0 0
tiff 1s unable to encode 0 0
v210 1s unable to encode 0 0
wmv1 1s bitRate supported 547806 649572
wmv2 1s bitRate supported 562726 694608
zlib 1s unable to encode 0 0
zmbv 1s unable to encode 0 0
…testBitRate
testGopSize…
codec encoding time gopSize supported sizes
------- --------- ----------- ---
asv1 1s unable to encode 0 0 0
asv2 1s unable to encode 0 0 0
bmp 1s unable to encode 0 0 0
dnxhd 1s unable to encode 0 0 0
dvvideo 1s unable to encode 0 0 0
ffv1 1s gopSize supported 2717122 2700456 2698550
ffvhuff 1s gopSize ignored 3333476 3333476 3333476
flashsv 1s unable to encode 0 0 0
flv 1s unable to encode 0 0 0
gif 1s unable to encode 0 0 0
h261 1s gopSize supported 1341972 726842 645968
h263 1s gopSize supported 1385314 763964 654520
h263p 1s gopSize supported 1385384 764010 654534
huffyuv 1s gopSize ignored 3808676 3808676 3808676
jpegls 1s unable to encode 0 0 0
ljpeg 1s unable to encode 0 0 0
mjpeg 1s gopSize ignored 998902 998902 998902
mpeg1video 1s gopSize supported 983516 672770 624942
mpeg2video 1s gopSize supported 985426 831032 784854
mpeg4 1s gopSize supported 1172490 1037614 968898
msmpeg4 1s unable to encode 0 0 0
msmpeg4v1 1s gopSize supported 6380 6354 6340
msmpeg4v2 1s gopSize supported 1159900 1038788 932864
pam 1s gopSize ignored 7611080 7611080 7611080
pbm 1s gopSize ignored 323380 323380 323380
pcx 1s unable to encode 0 0 0
pgm 1s unable to encode 0 0 0
pgmyuv 1s gopSize ignored 3808280 3808280 3808280
png 3s gopSize ignored 3665922 3665922 3665922
ppm 1s gopSize ignored 7609880 7609880 7609880
qtrle 2s gopSize supported 7611526 7606726 7606228
rawvideo 1s unable to encode 0 0 0
roqvideo 1s unable to encode 0 0 0
rv10 1s gopSize supported 1385268 763916 654474
rv20 1s gopSize supported 1172928 855004 752346
sgi 1s unable to encode 0 0 0
snow 1s unable to encode 0 0 0
svq1 1s unable to encode 0 0 0
targa 1s unable to encode 0 0 0
tiff 1s unable to encode 0 0 0
v210 1s unable to encode 0 0 0
wmv1 1s gopSize supported 1157938 1062540 958808
wmv2 1s gopSize supported 1188704 999190 717924
zlib 1s unable to encode 0 0 0
zmbv 1s unable to encode 0 0 0
…testGopSize
testQuality…
codec encoding time quality supported sizes
------- --------- ----------- ---
asv1 1s unable to encode 0 0
asv2 1s unable to encode 0 0
bmp 1s unable to encode 0 0
dnxhd 1s unable to encode 0 0
dvvideo 1s unable to encode 0 0
ffv1 1s unable to encode 0 0
ffvhuff 1s unable to encode 0 0
flashsv 1s unable to encode 0 0
flv 1s unable to encode 0 0
gif 1s unable to encode 0 0
h261 1s unable to encode 0 0
h263 1s unable to encode 0 0
h263p 1s unable to encode 0 0
huffyuv 1s unable to encode 0 0
jpegls 1s unable to encode 0 0
ljpeg 1s unable to encode 0 0
mjpeg 1s unable to encode 0 0
mpeg1video 1s unable to encode 0 0
mpeg2video 1s unable to encode 0 0
mpeg4 1s unable to encode 0 0
msmpeg4 1s unable to encode 0 0
msmpeg4v1 1s unable to encode 0 0
msmpeg4v2 1s unable to encode 0 0
pam 1s unable to encode 0 0
pbm 1s unable to encode 0 0
pcx 1s unable to encode 0 0
pgm 1s unable to encode 0 0
pgmyuv 1s unable to encode 0 0
png 1s unable to encode 0 0
ppm 1s unable to encode 0 0
qtrle 1s unable to encode 0 0
rawvideo 1s unable to encode 0 0
roqvideo 1s unable to encode 0 0
rv10 1s unable to encode 0 0
rv20 1s unable to encode 0 0
sgi 1s unable to encode 0 0
snow 1s unable to encode 0 0
svq1 1s unable to encode 0 0
targa 1s unable to encode 0 0
tiff 1s unable to encode 0 0
v210 1s unable to encode 0 0
wmv1 1s unable to encode 0 0
wmv2 1s unable to encode 0 0
zlib 1s unable to encode 0 0
zmbv 1s unable to encode 0 0
…testQuality
longWriteTest…
Testing writing then reading 32 frames…
…encoding time: 5.734242s, decoding time: 6.026640s
Testing writing then reading 64 frames…
…encoding time: 10.880501s, decoding time: 12.851402s
Testing writing then reading 128 frames…
…encoding time: 22.178238s, decoding time: 26.544548s
Testing writing then reading 256 frames…
…encoding time: 44.072165s, decoding time: 54.006433s
Testing writing then reading 512 frames…
…encoding time: 87.616495s, decoding time: 109.956204s
Testing writing then reading 1024 frames…
…encoding time: 177.661247s, decoding time: 222.951917s
…longWriteTest
…standardTestBattery
standardTestBattery…
readTests…
>>> doPreciseSeekTests('numbers.uncompressed.avi',…)
>>> doFullRead('numbers.uncompressed.avi',…)
<<< doFullRead('numbers.uncompressed.avi',…)
<<< doPreciseSeekTests('numbers.uncompressed.avi',…)
doMultiFullReadTestOnAllLoadables…
>>> doMultiFullReadTest('addFrameDemo_fancyFig.avi',…)
>>> doFullRead('addFrameDemo_fancyFig.avi',…)
<<< doFullRead('addFrameDemo_fancyFig.avi',…)
<<< doMultiFullReadTest('addFrameDemo_fancyFig.avi',…)
>>> doMultiFullReadTest('addFrameDemo_figure.avi',…)
>>> doFullRead('addFrameDemo_figure.avi',…)
<<< doFullRead('addFrameDemo_figure.avi',…)
<<< doMultiFullReadTest('addFrameDemo_figure.avi',…)
>>> doMultiFullReadTest('addFrameDemo_getframe.avi',…)
>>> doFullRead('addFrameDemo_getframe.avi',…)
<<< doFullRead('addFrameDemo_getframe.avi',…)
<<< doMultiFullReadTest('addFrameDemo_getframe.avi',…)
>>> doMultiFullReadTest('addFrameDemo_gray.avi',…)
>>> doFullRead('addFrameDemo_gray.avi',…)
<<< doFullRead('addFrameDemo_gray.avi',…)
<<< doMultiFullReadTest('addFrameDemo_gray.avi',…)
>>> doMultiFullReadTest('addFrameDemo_multiframe.avi',…)
>>> doFullRead('addFrameDemo_multiframe.avi',…)
<<< doFullRead('addFrameDemo_multiframe.avi',…)
<<< doMultiFullReadTest('addFrameDemo_multiframe.avi',…)
>>> doMultiFullReadTest('addFrameDemo_resize.avi',…)
>>> doFullRead('addFrameDemo_resize.avi',…)
<<< doFullRead('addFrameDemo_resize.avi',…)
<<< doMultiFullReadTest('addFrameDemo_resize.avi',…)
>>> doMultiFullReadTest('addFrameDemo_rgb.avi',…)
>>> doFullRead('addFrameDemo_rgb.avi',…)
<<< doFullRead('addFrameDemo_rgb.avi',…)
<<< doMultiFullReadTest('addFrameDemo_rgb.avi',…)
>>> doMultiFullReadTest('intersection147.25fps.xvid.avi',…)
>>> doFullRead('intersection147.25fps.xvid.avi',…)
<<< doFullRead('intersection147.25fps.xvid.avi',…)
<<< doMultiFullReadTest('intersection147.25fps.xvid.avi',…)
>>> doMultiFullReadTest('intersection256.25fps.xvid.avi',…)
>>> doFullRead('intersection256.25fps.xvid.avi',…)
<<< doFullRead('intersection256.25fps.xvid.avi',…)
<<< doMultiFullReadTest('intersection256.25fps.xvid.avi',…)
>>> doMultiFullReadTest('intersection300.10fps.ffdshowXvid.avi',…)
>>> doFullRead('intersection300.10fps.ffdshowXvid.avi',…)
<<< doFullRead('intersection300.10fps.ffdshowXvid.avi',…)
<<< doMultiFullReadTest('intersection300.10fps.ffdshowXvid.avi',…)
>>> doMultiFullReadTest('intersection300.10fps.wmv3.avi',…)
>>> doFullRead('intersection300.10fps.wmv3.avi',…)
<<< doFullRead('intersection300.10fps.wmv3.avi',…)
<<< doMultiFullReadTest('intersection300.10fps.wmv3.avi',…)
>>> doMultiFullReadTest('intersection300.10fps.xvid.avi',…)
>>> doFullRead('intersection300.10fps.xvid.avi',…)
<<< doFullRead('intersection300.10fps.xvid.avi',…)
<<< doMultiFullReadTest('intersection300.10fps.xvid.avi',…)
>>> doMultiFullReadTest('intersection300.25fps.xvid.avi',…)
>>> doFullRead('intersection300.25fps.xvid.avi',…)
<<< doFullRead('intersection300.25fps.xvid.avi',…)
<<< doMultiFullReadTest('intersection300.25fps.xvid.avi',…)
>>> doMultiFullReadTest('intersection300.orig.revel.avi',…)
>>> doFullRead('intersection300.orig.revel.avi',…)
<<< doFullRead('intersection300.orig.revel.avi',…)
<<< doMultiFullReadTest('intersection300.orig.revel.avi',…)
>>> doMultiFullReadTest('numbers.3ivx.avi',…)
>>> doFullRead('numbers.3ivx.avi',…)
<<< doFullRead('numbers.3ivx.avi',…)
<<< doMultiFullReadTest('numbers.3ivx.avi',…)
>>> doMultiFullReadTest('numbers.divx611.avi',…)
>>> doFullRead('numbers.divx611.avi',…)
<<< doFullRead('numbers.divx611.avi',…)
<<< doMultiFullReadTest('numbers.divx611.avi',…)
>>> doMultiFullReadTest('numbers.uncompressed.avi',…)
>>> doFullRead('numbers.uncompressed.avi',…)
<<< doFullRead('numbers.uncompressed.avi',…)
<<< doMultiFullReadTest('numbers.uncompressed.avi',…)
>>> doMultiFullReadTest('numbers.uncompressed.rgba.avi',…)
>>> doFullRead('numbers.uncompressed.rgba.avi',…)
<<< doFullRead('numbers.uncompressed.rgba.avi',…)
<<< doMultiFullReadTest('numbers.uncompressed.rgba.avi',…)
>>> doMultiFullReadTest('numbers.wmv3.avi',…)
>>> doFullRead('numbers.wmv3.avi',…)
<<< doFullRead('numbers.wmv3.avi',…)
<<< doMultiFullReadTest('numbers.wmv3.avi',…)
>>> doMultiFullReadTest('numbers.x264.10fps.avi',…)
>>> doFullRead('numbers.x264.10fps.avi',…)
<<< doFullRead('numbers.x264.10fps.avi',…)
<<< doMultiFullReadTest('numbers.x264.10fps.avi',…)
>>> doMultiFullReadTest('numbers.x264.29_97fps.avi',…)
>>> doFullRead('numbers.x264.29_97fps.avi',…)
<<< doFullRead('numbers.x264.29_97fps.avi',…)
<<< doMultiFullReadTest('numbers.x264.29_97fps.avi',…)
>>> doMultiFullReadTest('numbers.x264.30fps.avi',…)
>>> doFullRead('numbers.x264.30fps.avi',…)
<<< doFullRead('numbers.x264.30fps.avi',…)
<<< doMultiFullReadTest('numbers.x264.30fps.avi',…)
>>> doMultiFullReadTest('numbers.x264.avi',…)
>>> doFullRead('numbers.x264.avi',…)
<<< doFullRead('numbers.x264.avi',…)
<<< doMultiFullReadTest('numbers.x264.avi',…)
…doMultiFullReadTestOnAllLoadables
Successfully caught backend error: Error using ==> videoReader_ffmpegDirect
Data type mismatch: expected mxDOUBLE_CLASS, but a string "abcdef" was found instead. Function: T VideoIO::mat2scalar(const VideoIO::MatArray*)
File : matarray.h
Line : 232
…readTests
concatReadTests…
>>> doFullRead('intersection147.25fps.xvid.avi',…)
<<< doFullRead('intersection147.25fps.xvid.avi',…)
>>> doFullRead('intersection300.orig.revel.avi',…)
<<< doFullRead('intersection300.orig.revel.avi',…)
>>> doFullRead('numbers.uncompressed.avi',…)
<<< doFullRead('numbers.uncompressed.avi',…)
>>> doFullRead('frames/numbers.*.mat',…)
<<< doFullRead('frames/numbers.*.mat',…)
…concatReadTests
concatReadTests…
>>> doFullRead('intersection147.25fps.xvid.avi',…)
<<< doFullRead('intersection147.25fps.xvid.avi',…)
>>> doFullRead('intersection300.orig.revel.avi',…)
<<< doFullRead('intersection300.orig.revel.avi',…)
>>> doFullRead('numbers.uncompressed.avi',…)
<<< doFullRead('numbers.uncompressed.avi',…)
>>> doFullRead('frames/numbers.*.mat',…)
<<< doFullRead('frames/numbers.*.mat',…)
Warning: Frame 85 from the concatenated source looks different from frame 85 from "intersection147.25fps.xvid.avi"
(randomly selected frame #943). This is either because the decoder jumped to the wrong frame (imprecise seeking)
and/or it used a low-quality decode to make the random seek faster.
> In concatReadTests at 129
In standardTestBattery at 18
In testFfmpeg at 23
In testAll at 35
…concatReadTests
writeTests…
…writeTests
testBitRate…
codec encoding time bitRate supported sizes
------- --------- ----------- ---
asv1 1s unable to encode 0 0
asv2 1s unable to encode 0 0
bmp 1s unable to encode 0 0
dnxhd 1s unable to encode 0 0
dvvideo 1s unable to encode 0 0
ffv1 1s bitRate ignored 2700432 2700432
ffvhuff 1s bitRate ignored 3333976 3333976
flashsv 1s unable to encode 0 0
flv 1s unable to encode 0 0
gif 1s unable to encode 0 0
h261 1s bitRate supported 382026 686984
h263 1s bitRate supported 366174 702326
h263p 1s bitRate supported 366244 702380
huffyuv 1s bitRate ignored 3809176 3809176
jpegls 1s unable to encode 0 0
ljpeg 1s unable to encode 0 0
mjpeg 1s bitRate supported 814202 966500
mpeg1video 1s bitRate supported 439870 674486
mpeg2video 1s bitRate supported 435974 674498
mpeg4 1s bitRate supported 656076 1097616
msmpeg4 1s unable to encode 0 0
msmpeg4v1 1s bitRate supported 6344 6358
msmpeg4v2 1s bitRate supported 743772 874896
pam 1s bitRate ignored 7611080 7611080
pbm 1s bitRate ignored 323380 323380
pcx 1s unable to encode 0 0
pgm 1s unable to encode 0 0
pgmyuv 1s bitRate ignored 3808280 3808280
png 2s bitRate ignored 3665784 3665784
ppm 1s bitRate ignored 7609880 7609880
qtrle 2s bitRate ignored 7607002 7607002
rawvideo 1s unable to encode 0 0
roqvideo 1s unable to encode 0 0
rv10 1s bitRate supported 366128 702278
rv20 1s bitRate supported 663516 900488
sgi 1s unable to encode 0 0
snow 1s unable to encode 0 0
svq1 1s unable to encode 0 0
targa 1s unable to encode 0 0
tiff 1s unable to encode 0 0
v210 1s unable to encode 0 0
wmv1 1s bitRate supported 634424 945028
wmv2 1s bitRate supported 643778 1012974
zlib 1s unable to encode 0 0
zmbv 1s unable to encode 0 0
…testBitRate
testGopSize…
codec encoding time gopSize supported sizes
------- --------- ----------- ---
asv1 1s unable to encode 0 0 0
asv2 1s unable to encode 0 0 0
bmp 1s unable to encode 0 0 0
dnxhd 1s unable to encode 0 0 0
dvvideo 1s unable to encode 0 0 0
ffv1 1s gopSize supported 2715988 2699952 2698214
ffvhuff 1s gopSize ignored 3332080 3332080 3332080
flashsv 1s unable to encode 0 0 0
- --------- -----------
('numbers.uncompressed.avi',…)
('numbers.uncompressed.avi',…)
…testAll
klzzwxh:12428klzzwxh:12429
Here are the modifications (see previous post)
Common subdirectories: ./@videoReader and ../videoIO-r720-source_Orig/@videoReader
Common subdirectories: ./@videoWriter and ../videoIO-r720-source_Orig/@videoWriter
diff ./FfmpegCommon.cpp ../videoIO-r720-source_Orig/FfmpegCommon.cpp
117c117
< //av_vlog = ffLog;
--
> av_vlog = ffLog;
Only in .: FfmpegCommon.mexmaci64.o
Only in .: FfmpegIVideo.mexmaci64.o
diff ./FfmpegOVideo.cpp ../videoIO-r720-source_Orig/FfmpegOVideo.cpp
640c640
< static AVFrame *allocPicture(PixelFormat pixFmt, int width, int height)
--
> static AVFrame *allocPicture(int pixFmt, int width, int height)
Only in .: FfmpegOVideo.mexmaci64.o
diff ./arch2gccarch.pl ../videoIO-r720-source_Orig/arch2gccarch.pl
24,31d23
< } elsif ($arch eq "-mexmaci") { # 32-bit Mac
< print "-m32";
< } elsif ($arch eq "-mexmaci64") { # 64-bit Mac
< print "-m64";
< } elsif ($arch eq "-maci") { # 32-bit Mac
< print "-m32";
< } elsif ($arch eq "-maci64") { # 64-bit Mac
< print "-m64";
diff ./buildVideoIO.m ../videoIO-r720-source_Orig/buildVideoIO.m
49,52d48
< warning(['Don''t know wheter this works under MAC -> Disabled', …
< 'Use the make build environment!'])
< return
<
79c75
< cmd = ['sudo make ', sprintf('%s ',varargin{:},)];
--
> cmd = ['make ', sprintf('%s ',varargin{:},)];
diff ./buildVideoIoPackages.m ../videoIO-r720-source_Orig/buildVideoIoPackages.m
1c1
< function buildVideoIoPackages
--
> %buildVideoIoPackages
16,19d15
< warning(['Don''t know wheter this works under MAC -> Disabled', …
< 'Use the make build environment!'])
< return
<
Common subdirectories: ./contrib and ../videoIO-r720-source_Orig/contrib
diff ./debug.cpp ../videoIO-r720-source_Orig/debug.cpp
36c36
< /*#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
--
> #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
42d41
< */
44,45c43
< /*#endif
< */
--
> #endif
58c56
< pthread_t getThreadId()
--
> int getThreadId()
60c58
< /*#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
--
> #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
63,66c61,62
< */
< return pthread_self();
< /*#endif
< */
--
> return (int)pthread_self();
> #endif
diff ./debug.h ../videoIO-r720-source_Orig/debug.h
179c179
< extern pthread_t getThreadId();
--
> extern int getThreadId();
Only in .: debug.mexmaci64.o
Common subdirectories: ./doc and ../videoIO-r720-source_Orig/doc
Only in .: echo.mexmaci64.o
Only in .: echoDirect.mexmaci64
Only in .: echoPopen2.mexmaci64
Only in .: echoPopen2Server
diff ./ffmpeg-config-internal.pl ../videoIO-r720-source_Orig/ffmpeg-config-internal.pl
37,39c37
< elsif ($arg eq "-mexmaci") { $bits64 = 0; }
< elsif ($arg eq "-mexmaci64") { $bits64 = 1; }
< else { print "arg $arg\n"; usage(); }
--
> else { usage(); }
49,51c47
< #our $arch = ($bits64 ? "-glnxa64" : "-glnx86");
< #our $arch = ($bits64 ? "-mexmaci64" : "-mexmaci");
< our $arch = "-mexmaci64" ;
--
> our $arch = ($bits64 ? "-glnxa64" : "-glnx86");
54c50
< foreach my $bitness (''){ #(reverse('', ($bits64?'64':'32'))) {
--
> foreach my $bitness (reverse('', ($bits64?'64':'32'))) {
60d55
< #print "@linkPath\n\n";
62c57
< push @includePath, "/usr/include", "/usr/local/include","/Applications/MATLAB_R2010b.app/extern/include/" ;
--
> push @includePath, "/usr/include", "/usr/local/include";
180c175
< my $ext = "dylib";
--
> my $ext = "so";
184c179
< if ($l =~ /NEEDED\s+lib(+).$ext/) {
--
> if ($l =~ /NEEDED\s+lib(+).so/) {
239d233
< #print "lib $lib\n";
243c237
< foreach my $ext ("so","a","dylib") {
--
> foreach my $ext ("so","a") {
249,250d242
< #print "arch $arch\n";
< #print "myarch $myarch\n";
294c286
< return "-mexmaci64";
--
> return;
Only in .: ffmpeg.help.txt
diff ./makefile ../videoIO-r720-source_Orig/makefile
156c156
< #MATLAB_PATH := $(shell readlink -f `which matlab` | sed -e 's/\/bin\/matlab//')
--
> MATLAB_PATH := $(shell readlink -f `which matlab` | sed -e 's/\/bin\/matlab//')
162,163c162
< #MEXEXT := $(shell $(MATLAB_PATH)/bin/mexext)
< MEXEXT := /Applications/MATLAB_R2010b.app/bin/mexext
--
> MEXEXT := $(shell $(MATLAB_PATH)/bin/mexext)
179,180c178
< #MEX := $(MATLAB_PATH)/bin/mex
< MEX := /Applications/MATLAB_R2010b.app/bin/mex
--
> MEX := $(MATLAB_PATH)/bin/mex
183c181
< MATLAB_ARCH := maci64 #$(shell ./mexext2arch.pl $(MEXT))
--
> MATLAB_ARCH := $(shell ./mexext2arch.pl $(MEXT))
195c193
< FFMPEG_BACKEND_RPATH := -Wl #,-rpath=$(shell ./ffmpeg-config-internal.pl -rpath -$(FARCH))
--
> FFMPEG_BACKEND_RPATH := -Wl,-rpath=$(shell ./ffmpeg-config-internal.pl -rpath -$(FARCH))
206,208d203
< # Try to do it anyways
< BUILD_DIRECT := 'true'
< FFMPEG_DIRECT_RPATH := $(FFMPEG_BACKEND_RPATH)
415,419c410
< #JEB := -L/Developer/usr/lib/gcc/i686-apple-darwin10/4.2.1
< #JEB2 := -lstdc++ -lc
< ###-- popen2 version --------------------------------
< #echoPopen2.$(MEXT): mexClientPopen2.$(MEXT).o debug.$(MEXT).o popen2.$(MEXT).o
< # $(MEX) -cxx $(MEXOPTS) CXXFLAGS\#'$(LDOPTS_MATLAB)' $(JEB) $^ $(JEB2) -output $@
--
> ###-- popen2 version --------------------------------
423c414
< echoPopen2Server: echo.$(FARCH).o mexServerStdio.$(FARCH).o debug.$(FARCH).o /Applications/MATLAB_R2010b.app/bin/maci64/libmx.dylib
--
> echoPopen2Server: echo.$(FARCH).o mexServerStdio.$(FARCH).o debug.$(FARCH).o
448c439
< videoReader_ffmpegPopen2Server: mexServerStdio.$(FARCH).o videoReaderWrapper.$(FARCH).o FfmpegIVideo.$(FARCH).o FfmpegCommon.$(FARCH).o registry.$(FARCH).o debug.$(FARCH).o /Applications/MATLAB_R2010b.app/bin/maci64/libmx.dylib
--
> videoReader_ffmpegPopen2Server: mexServerStdio.$(FARCH).o videoReaderWrapper.$(FARCH).o FfmpegIVideo.$(FARCH).o FfmpegCommon.$(FARCH).o registry.$(FARCH).o debug.$(FARCH).o
456c447
< videoReader_ffmpegDirect.$(MEXT): videoReaderWrapper.$(MEXT).o FfmpegIVideo.$(MEXT).o FfmpegCommon.$(MEXT).o registry.$(MEXT).o debug.$(MEXT).o mexClientDirect.$(MEXT).o /Applications/MATLAB_R2010b.app/bin/maci64/libmx.dylib
--
> videoReader_ffmpegDirect.$(MEXT): videoReaderWrapper.$(MEXT).o FfmpegIVideo.$(MEXT).o FfmpegCommon.$(MEXT).o registry.$(MEXT).o debug.$(MEXT).o mexClientDirect.$(MEXT).o
469c460
< videoWriter_ffmpegPopen2Server: mexServerStdio.$(FARCH).o videoWriterWrapper.$(FARCH).o FfmpegOVideo.$(FARCH).o FfmpegCommon.$(FARCH).o registry.$(FARCH).o debug.$(FARCH).o /Applications/MATLAB_R2010b.app/bin/maci64/libmx.dylib
--
> videoWriter_ffmpegPopen2Server: mexServerStdio.$(FARCH).o videoWriterWrapper.$(FARCH).o FfmpegOVideo.$(FARCH).o FfmpegCommon.$(FARCH).o registry.$(FARCH).o debug.$(FARCH).o
477c468
< videoWriter_ffmpegDirect.$(MEXT): videoWriterWrapper.$(MEXT).o FfmpegOVideo.$(MEXT).o FfmpegCommon.$(MEXT).o registry.$(MEXT).o debug.$(MEXT).o mexClientDirect.$(MEXT).o /Applications/MATLAB_R2010b.app/bin/maci64/libmx.dylib
--
> videoWriter_ffmpegDirect.$(MEXT): videoWriterWrapper.$(MEXT).o FfmpegOVideo.$(MEXT).o FfmpegCommon.$(MEXT).o registry.$(MEXT).o debug.$(MEXT).o mexClientDirect.$(MEXT).o
575c566
< $(CC) -c $(CXXOPTS) -I/Applications/MATLAB_R2010b.app/extern/include/ $< -o $@
--
> $(CC) -c $(CXXOPTS) $< -o $@
Only in .: masdfasdf.m
diff ./matarray.h ../videoIO-r720-source_Orig/matarray.h
43c43
< //#ifdef MATLAB_MEX_FILE
--
> #ifdef MATLAB_MEX_FILE
46c46
< //#endif
--
> #endif
diff ./mexClientDirect.cpp ../videoIO-r720-source_Orig/mexClientDirect.cpp
40,43c40,43
< //#ifdef __linux__
< //# include <sys/types.h>
< //# include <sys/wait.h>
< //#else
--
> #ifdef __linux__
> # include <sys/types.h>
> # include <sys/wait.h>
> #else
45c45
< //#endif
--
> #endif
Only in .: mexClientDirect.mexmaci64.o
diff ./mexClientPopen2.cpp ../videoIO-r720-source_Orig/mexClientPopen2.cpp
40,42c40,41
< //#include <sys/types.h>
< //#include <sys/wait.h>
< typedef void (*sighandler_t)(int sig);
--
> #include <sys/types.h>
> #include <sys/wait.h>
Only in .: mexClientPopen2.mexmaci64.o
Only in .: mexServerStdio.mexmaci64.o
diff ./mexext2arch.pl ../videoIO-r720-source_Orig/mexext2arch.pl
23,24d22
< } elsif ($ARGV eq "mexmaci64") { # 64-bit Macintosh (Intel)
< print "maci64";
Only in .: popen2.mexmaci64.o
Common subdirectories: ./private and ../videoIO-r720-source_Orig/private
Only in .: protocoll.txt
diff ./pvtVideoIO_normalizeFilename.m ../videoIO-r720-source_Orig/pvtVideoIO_normalizeFilename.m
24c24
< = fileparts(raw);
--
> = fileparts(raw);
26c26
< canonical = fullfile(strrep(pathstr,'/','\'), );
--
> canonical = fullfile(strrep(pathstr,'/','\'), );
28c28
< canonical = fullfile(strrep(pathstr,'\','/'), );
--
> canonical = fullfile(strrep(pathstr,'\','/'), );
Only in .: q
Only in .: registry.mexmaci64.o
Common subdirectories: ./tests and ../videoIO-r720-source_Orig/tests
Only in ../videoIO-r720-source_Orig/: videoIO.Mac.diff.patch
diff ./videoIoSysInfo.m ../videoIO-r720-source_Orig/videoIoSysInfo.m
6c6
< % 'videoIoSysInfo.txt' in the current directory.
--
> % 'videoIoSysInfo.txt' in the current directory.
20c20
< %when using this library on GNU/Linux).
--
> %when using this library on GNU/Linux).
36c36
< info.arch = computer('arch');
--
> info.arch = computer('arch');
38c38
< info.arch = 'unknown';
--
> info.arch = 'unknown';
43,45c43,45
< info.os = system_dependent('getos');
< info.osver = system_dependent('getwinsys');
< info.osarch = getenv('PROCESSOR_ARCHITECTURE');
--
> info.os = system_dependent('getos');
> info.osver = system_dependent('getwinsys');
> info.osarch = getenv('PROCESSOR_ARCHITECTURE');
47,48c47,48
< = unix('sw_vers');
< if fail, info.os = 'Unknown Macintosh'; end
--
> = unix('sw_vers');
> if fail, info.os = 'Unknown Macintosh'; end
50c50
< info.os = system_dependent('getos');
--
> info.os = system_dependent('getos');
56,65c56,65
< info.include = getenv('INCLUDE');
< info.lib32 = getenv('LIB32');
< info.lib64 = getenv('LIB64');
< if strcmpi(info.mexext, 'mex') || …
< ~isempty(strfind(info.mexext, '32')) || …
< strcmpi(info.mexext, 'dll') % handle older versions
< info.allLibDirs = splitSemiColonPaths(info.lib32);
< else
< info.allLibDirs = splitSemiColonPaths(info.lib64);
< end
--
> info.include = getenv('INCLUDE');
> info.lib32 = getenv('LIB32');
> info.lib64 = getenv('LIB64');
> if strcmpi(info.mexext, 'mex') || …
> ~isempty(strfind(info.mexext, '32')) || …
> strcmpi(info.mexext, 'dll') % handle older versions
> info.allLibDirs = splitSemiColonPaths(info.lib32);
> else
> info.allLibDirs = splitSemiColonPaths(info.lib64);
> end
67,88c67,87
< % We may want to move this block into the makefile at some point
< info.cxxflags = getenv('CXXFLAGS');
< = system(sprintf(…
< 'cd %s; ./ffmpeg-config-internal.pl -cflags', videoIODir));
< = system(sprintf(…
< 'cd %s; ./ffmpeg-config-internal.pl -libs', videoIODir));
< = system(…
< 'gcc -print-search-dirs | grep libraries');
< if status == 0
< info.gccLibDirs = split(':',…
< info.gccLibDirs(length('libraries: =')+1:end))';
< end
<
< d1 = getLinkPathsFromGccArgs(info.cxxflags);
< d2 = getLinkPathsFromGccArgs(info.ffmpegLibs);
< d3 = info.gccLibDirs;
< info.allLibDirs = {d1{:},d2{:},d3{:}};
< mask = true(1,length(info.allLibDirs));
< for i=1:length(mask)
< if isempty(info.allLibDirs{i})
< mask(i)=0;
< end
--
> % We may want to move this block into the makefile at some point
> info.cxxflags = getenv('CXXFLAGS');
> = system(sprintf(…
> 'cd %s; ./ffmpeg-config-internal.pl -cflags', videoIODir));
> = system(sprintf(…
> 'cd %s; ./ffmpeg-config-internal.pl -libs', videoIODir));
> = system(…
> 'gcc -print-search-dirs | grep libraries');
> if status == 0
> info.gccLibDirs = split(':',…
> info.gccLibDirs(length('libraries: =')+1:end))';
> end
>
> d1 = getLinkPathsFromGccArgs(info.cxxflags);
> d2 = getLinkPathsFromGccArgs(info.ffmpegLibs);
> d3 = info.gccLibDirs;
> info.allLibDirs = {d1{:},d2{:},d3{:}};
> mask = true(1,length(info.allLibDirs));
> for i=1:length(mask)
> if isempty(info.allLibDirs{i})
> mask(i)=0;
90,92c89,92
< info.allLibDirs = { info.allLibDirs{mask} }';
<
< info.libsArch = getLibArchs(info.ffmpegLibs, info.allLibDirs);
--
> end
> info.allLibDirs = { info.allLibDirs{mask} }';
>
> info.libsArch = getLibArchs(info.ffmpegLibs, info.allLibDirs);
101,106c101,106
< parts = split('\/', videoIODir);
< v = ver(parts{end});
< fns = fieldnames(v);
< for i=1:length(fns)
< info.() = v.(fns{i});
< end
--
> parts = split('\/', videoIODir);
> v = ver(parts{end});
> fns = fieldnames(v);
> for i=1:length(fns)
> info.() = v.(fns{i});
> end
108c108
< info.version = 'could not retrieve';
--
> info.version = 'could not retrieve';
113,119c113,119
< printStruct(info, 1);
<
< fname = 'videoIoSysInfo.txt';
< F = fopen(fname, 'w');
< printStruct(info, F);
< fclose(F);
< fprintf('System information saved to %s.\n', fname);
--
> printStruct(info, 1);
>
> fname = 'videoIoSysInfo.txt';
> F = fopen(fname, 'w');
> printStruct(info, F);
> fclose(F);
> fprintf('System information saved to %s.\n', fname);
121,122c121,122
< out = info;
< end
--
> out = info;
> end
137,139c137,147
< fprintf(F, '%s:\n', fn{1});
< if isempty(info.(fn{1}))
< % do nothing
--
> fprintf(F, '%s:\n', fn{1});
> field = info.(fn{1});
> if isempty(field)
> % do nothing
> elseif ischar(field)
> fprintf(F, ' %s\n', field);
> elseif isnumeric(field)
> fprintf(F, ' %s\n', mat2str(field));
> elseif iscell(field)
> if isempty(field)
> % do nothing
141,167c149,152
< field = info.(fn{1});
< if ischar(field)
< fprintf(F, ' %s\n', field);
< elseif isnumeric(field)
< fprintf(F, ' %s\n', mat2str(field));
< elseif iscell(field)
< if isempty(field)
< % do nothing
< else
<
< padwidths = max(cellfun(@length, field), , 1);
< for r=1:size(field,1)
< for c=1:size(field,2)
< field{r,c} = pad(sprintf('%s',field{r,c}), padwidths(C)+1);
< end
< end
< field = cell2mat(field);
< field = […
< char(zeros(size(field,1),2))+' ', …
< field, …
< char(zeros(size(field,1),1))+sprintf('\n')]'; %#ok<AGROW>
< field = field(:)';
< field = field(1:end-1);
< fprintf(F, '%s\n', field);
< end
< else
< error('unsupported data type');
--
> padwidths = max(cellfun(@length, field), , 1);
> for r=1:size(field,1)
> for c=1:size(field,2)
> field{r,c} = pad(sprintf('%s',field{r,c}), padwidths(C)+1);
168a154,162
> end
> field = cell2mat(field);
> field = […
> char(zeros(size(field,1),2))+' ', …
> field, …
> char(zeros(size(field,1),1))+sprintf('\n')]'; %#ok<AGROW>
> field = field(:)';
> field = field(1:end-1);
> fprintf(F, '%s\n', field);
170c164,167
< fprintf(F, '\n');
--
> else
> error('unsupported data type');
> end
> fprintf(F, '\n');
189,199c186,195
< p = allpaths{i};
< myplugins = dir(fullfile(p,));
< for j=1:length(myplugins)
< plugin = myplugins(j).name;
< % skip obvious backup files
< if ~ismember(plugin(end), '#~') && ~strcmpi(plugin(end-3:end), '.bak')
< pathname = fullfile(p, plugin);
< arch = getBinaryArch(pathname);
< plugins{end+1,1} = pathname; %#ok<AGROW>
< plugins{end,2} = arch;
< end
--
> p = allpaths{i};
> myplugins = dir(fullfile(p,));
> for j=1:length(myplugins)
> plugin = myplugins(j).name;
> % skip obvious backup files
> if ~ismember(plugin(end), '#~') && ~strcmpi(plugin(end-3:end), '.bak')
> pathname = fullfile(p, plugin);
> arch = getBinaryArch(pathname);
> plugins{end+1,1} = pathname; %#ok<AGROW>
> plugins{end,2} = arch;
200a197
> end
211,214c208,211
< if strmatch('-L', args{i})
< newpaths = split(':', args{i}(3:end));
< paths = {paths{:} newpaths{:}};
< end
--
> if strmatch('-L', args{i})
> newpaths = split(':', args{i}(3:end));
> paths = {paths{:} newpaths{:}};
> end
227,230c224,227
< if strmatch('-l', args{i})
< newlibs = split(':', args{i}(3:end));
< libs = {libs{:} newlibs{:}};
< end
--
> if strmatch('-l', args{i})
> newlibs = split(':', args{i}(3:end));
> libs = {libs{:} newlibs{:}};
> end
236,251c233,245
< l = libs{i};
< for j=1:length(allLibDirs)
< d = allLibDirs{j};
< for ext = {'so', 'a'};
< libname = ;
< p = fullfile(d,libname);
< if exist(p,'file')
< arch = getBinaryArch(p);
< if ~isempty(arch)
< libsArch{row,1} = libname;%#ok<AGROW>
< libsArch{row,2} = arch;
< else
< libsArch{row,1} = libname; %#ok<AGROW>
< end
< row = row+1;
< end
--
> l = libs{i};
> for j=1:length(allLibDirs)
> d = allLibDirs{j};
> for ext = {'so', 'a'};
> libname = ;
> p = fullfile(d,libname);
> if exist(p,'file')
> arch = getBinaryArch(p);
> if ~isempty(arch)
> libsArch{row,1} = libname;%#ok<AGROW>
> libsArch{row,2} = arch;
> else
> libsArch{row,1} = libname; %#ok<AGROW>
252a247,248
> row = row+1;
> end
253a250
> end
269,274c266,268
< if strcmpi(path(end-1:end), '.m')
< if isMFileWithCode(path)
< arch = 'mfile';
< else
< arch = 'mdoc';
< end
--
> if strcmpi(path(end-1:end), '.m')
> if isMFileWithCode(path)
> arch = 'mfile';
276,280c270,276
< = system(sprintf(…
< 'objdump -x ''%s'' | grep "file format" | head -n 1', path));
< if status==0
< arch = objdump(strfind(objdump, 'file format ')+12:end-1);
< end
--
> arch = 'mdoc';
> end
> else
> = system(sprintf(…
> 'objdump -x ''%s'' | grep "file format" | head -n 1', path));
> if status==0
> arch = objdump(strfind(objdump, 'file format ')+12:end-1);
281a278
> end
Only in .: videoReaderWrapper.mexmaci64.o
Only in .: videoReader_ffmpegDirect.mexmaci64
Only in .: videoReader_ffmpegPopen2.mexmaci64
Only in .: videoReader_ffmpegPopen2Server
Only in .: videoWriterWrapper.mexmaci64.o
Only in .: videoWriter_ffmpegDirect.mexmaci64
Only in .: videoWriter_ffmpegPopen2.mexmaci64
Only in .: videoWriter_ffmpegPopen2Server