Pada wrote:How do I check whether ZM is using this libjpeg-turbo library?
Also, if ZM is feeding from mpeg cameras via RTSP and then streaming as mpeg again, then this library will not even be used?
"sudo lsof /opt/libjpeg-turbo" will show you which programs are accessing files in that path. It stands for LiSt Open Files. You can specify a particular path to check, a particular pid (with -p), or all open files (with no args). So alternatively, you could do "sudo lsof |grep libjpeg.so.62.0.0" to get an idea of which programs are accessing any libjpeg.so.62.0.0 (whether or not it's in /opt/libjpeg-turbo). Or you could get the pids of your zoneminder processes and do "lsod -p PID".
In my case I ran the second command after installing libjpeg-turbo_1.0.1_amd64.deb from
http://sourceforge.net/projects/libjpeg-turbo/files/ and modifying the init script. I can see zoneminder is not calling the libjpeg-turbo version of libjpeg.so.62.0.0. It's calling libjpeg from /usr/lib (default ubuntu version) instead of /opt/libjpeg-turbo (new enhanced version)
# lsof |grep libjpeg.so.62.0.0
...
zmc 5710 www-data mem REG 8,17 146032 3950487 /usr/lib/libjpeg.so.62.0.0
zmc 5715 www-data mem REG 8,17 146032 3950487 /usr/lib/libjpeg.so.62.0.0
zmc 5720 www-data mem REG 8,17 146032 3950487 /usr/lib/libjpeg.so.62.0.0
zma 5734 www-data mem REG 8,17 146032 3950487 /usr/lib/libjpeg.so.62.0.0
zma 5736 www-data mem REG 8,17 146032 3950487 /usr/lib/libjpeg.so.62.0.0
zma 5737 www-data mem REG 8,17 146032 3950487 /usr/lib/libjpeg.so.62.0.0
...
I'm running Ubuntu 10.10, so I did the following:
Code: Select all
# sudo gedit /etc/ld.so.conf.d/libjpeg-turbo.conf
This will be a new file, so just add in a line that says
Then run
# ldconfig
Finally restart zoneminder
# /etc/init.d/zoneminder restart
# lsof |grep libjpeg.so.62.0.0
...
zmc 6426 www-data mem REG 8,17 298151 3980 /opt/libjpeg-turbo/lib/libjpeg.so.62.0.0
zmc 6431 www-data mem REG 8,17 298151 3980 /opt/libjpeg-turbo/lib/libjpeg.so.62.0.0
zmc 6436 www-data mem REG 8,17 298151 3980 /opt/libjpeg-turbo/lib/libjpeg.so.62.0.0
zma 6451 www-data mem REG 8,17 298151 3980 /opt/libjpeg-turbo/lib/libjpeg.so.62.0.0
zma 6452 www-data mem REG 8,17 298151 3980 /opt/libjpeg-turbo/lib/libjpeg.so.62.0.0
zma 6453 www-data mem REG 8,17 298151 3980 /opt/libjpeg-turbo/lib/libjpeg.so.62.0.0
...
Notice how the path for this library is /opt/libjpeg-turbo? ^ verified to be using the new libjpeg-turbo.
Note: you won't need a modified init script after this...nor will you need to set LD_LIBRARY_PATH in your profile. If you only export it in your profile, it only works for programs running as that user. Likewise, if you only export it in the zoneminder init script, only zoneminder will use it. The way I described above will tell
all programs to use /opt/libjpeg-turbo. This method
should survive ubuntu updates.