This library contains a win32 server app, a standalone client and
Matlab client to read
image frames from a video file. The
client could also be your own app, testNetAvi.cpp
will
help you with the communication protocol. Since DirectShow is "mostly"
avaiable on win32, this library provides a client-server implementation
to support different platforms. The server supports multiple clients
simulaneously and runs on win32/win64 systems. The client mex files use
socket based communication and should compile
anywhere, we provide 32 & 64 bit clients for linux and windows.
-- To start the server on win32/win64 system (the precompiled executable is in 'netAvi\netAviClientApp-VisualStudio\Release' and the corresponding visual studio solution is 'netAvi\netAvi-VisualStudio\netAvi.sln'),
netAviServer.exe <port_number>
Ensure to configure the windows firewall to allow
connections to this port. Zebedee
is a simple means to securely tunnel and compress the communications
stream.
Matlab client
-- testNetAvi.m is a simple example. The
library usage is as follows,
%
To disable display of debugging info
warning( 'off', 'netAvi:info' ); % Open connection to server for
given video file
[avi_hdl, avi_inf] = netAviOpen( <full path to video file on windows server
(e.g., 'C:\something\something.mov') : string> , ...
<server : string> ,
<server port_number : double> ); % avi_inf contains
useful properties of the video % Read a frame from video
pixmap = netAviReadMex( avi_hdl, < frame_number : double > ); img = reshape( pixmap, [
avi_inf.Height, avi_inf.Width, 3 ] );
...... % more read statements
% close connection to server netAviCloseMex( avi_hdl );
-- To compile client mex files use mex_cmd.m
For windows, add -DWIN32 or -DWIN64 to
COMPFLAGS in mexopts.bat
Standalone client
-- testNetAvi.cpp is a command line
client to get started with the communicaitons API, gives a rough
estimate for the client-server frame rate.
-- To compile, for windows uncomment and run appropriate pair of lines
in "testNetAvi-compile.bat", for linux run "testNetAvi-compile.sh".
These files are included in the package.
-- To run: testNetAvi.exe
<server name> <server port> <server video file path
(each '\' should be '\\')>
Troubleshooting
-- If your avi file fails to open: try installing the K-lite codec
pack on the server.
-- I've noticed that with some specific codecs, when a video file is
open, the server goes into a CPU intensive loop. Serving of frames
seems unaffected and the server goes back to its docile mode with
netAviCloseMex().
-- Other related non server-client projects: dxAvi
and mplayerMex.