Monday, August 29, 2011

FFMpeg extract images

To get a decent quality of extracted images, use the -sameq flag as such:
ffmpeg -i falename.avi -r 20 -ss 00:00:21 -t 8 -sameq image_doler/image%03d.png

Labels:

Tuesday, August 16, 2011

OpenGL MacOS 64bit

Had problems mostly due to being unfamiliar with Mac development.

Good example (which compiles if given x86_64 architecture) trough XCode is here. Also, useful information is here and general reading here.

Thursday, August 11, 2011

OpenCV 2.3.0 on OSX (10.6.8 64bit)

The notes from here are generally correct. My additions are:
  • use Fink to get additional libraries if needed
  • OpenEXR library is cool, but it's not necessary. I had to disable it because of some typedef redeclaration which conflicted with QT.framework (QT = quicktime)
  • QTKit comes with XCode and should not be downloaded separately
  • JPEG2000 support is called libjasper. Also had to disable it because Fink was compiling 386 version instead of 64bit one
  • don't use Carbon, it's outdated when Cocoa is around. It's needed for highgui
  • when running configuration initially run ccmake to setup the prefix to "/sw". Didn't find the cli parameter for it.
  • also did this at some point
sudo fink install pkgconfig libjpeg libtiff libpng3 atk1 gtk+2-dev glib2-dev
No idea if it was actually needed, but it was in some net post.
  • Final make command is:
cmake -G "Unix Makefiles" -D BUILD_TESTS=OFF -D WITH_CARBON=OFF -D WITH_OPENEXR=OFF -D WITH_JASPER=OFF .
make -j4
sudo make install

Unlike linux version, this OpenCV is linked by doing -lopencv_core -lopencv_*. Don't know if that came with the new version, but it's going to mess with my server builds.

Labels:

Monday, January 08, 2007

Instant http server

It only needs one line in Linux bash

python -c 'import SimpleHTTPServer; SimpleHTTPServer.test()'

Tested working for python2.4

Saturday, December 16, 2006

EntityManager.remove() not working

One of the possible reasons for this is that you (like me) assigned a Local interface instance to a remote interface. No error, no exceptions - just your application not working... Very nice for loosing your nerves...

Thursday, December 14, 2006

Hibernate confusion

or "How stuff doesn't work the way the API says it should"

Two irregularities so far:
1) EntityManager.persist() should Make an entity instance managed and persistent, but all it does is throw an exception about non-persistent object passed (or something alike)

2) EntityManager.remove() should throw IllegalArgumentException - if not an entity or if a detached entity but all it does in JBoss is issue
INFO [DefaultDeleteEventListener] handling transient entity in delete processing


The first is probably me not understanding something, but the second is just strange...

Reference API site

Wednesday, December 13, 2006

Value '0000-00-00' can not be represented as java.sql.Timestamp

This is a MySQL specific error.

As said on lo-fi, this is a problem that happens when there's a row in the table with all zero date.

Answer:
zeroDateTimeBehavior=convertToNull tag at the end of the connection string, e.g.

jdbc:mysql://myhost/mydatabase?zeroDateTimeBehavior=convertToNull