Monday, September 26, 2011

FFMPEG provide a good utility for you to make your mp4 file optimized for web. In general, it makes the moov atom before mdat atom so that it will be easier to find moov stom and send to remote client.

You can build qt-faststart via cygwin using Linux build step. However, it can only be run within cygwin environment as it will bind qt-faststart with cygwin libraries

Alternatively, build qt-faststart.exe from VS2010

1. Create a VS2010 project
2. Place qt-faststart.c into your source folder
3. You need to find and include 2 external header files inttypes.h and stdin.h
4. Configure your VS2010 project to use the above header files for compilation (Project Properties -> C/C++ -> General -> Additional Include Directories)
5. Open qt-faststart.c and replace __MINGW32__ with the following

Tuesday, September 13, 2011

Sometime, it is rather frustrating to work with C++. I always wish that they could feedback more useful error when there is a crash of a system.

This post is related to System.DllNotFoundException: Unable to load DLL 'xxxx.dll'. Well, this is a C# DLLImport error, but, it is kind of related to C++. DLL not found error does not really means that xxxx.dll is not found. It may means that the dll that xxxx.dll depends on is not found

Do the following check point if you encounter this error

1. Check if the xxxx.dll exist at the directory of your application or your library search path
2. If xxxx.dll exist go to ----- to download Dependency Walker. Dependency Walker is a nice program to tell you which dependency is missing/linked/needed
3. Drop xxxx.dll to Dependency Walker. Dependency Walker will load the DLL and search for missing dll
4. If you have a missing DLL dependency. It will prompt you as an error.
5. Try to locate the missing library and place it on your application or library search path.

Monday, September 12, 2011

Actually, until now, I don't know what is error -22 means when av_interleaved_write_frame return me this error code. But, I am sure it is related to PTS value in your AVPacket that is going to pass into av_interleaved_write_frame.

Monday, September 5, 2011

1. Download and install Python 2.7
2. Download and install NumPy and SciPy. Installing them is as simple as double clicking the downloaded installer. It will install the extension to your Python site-package folder
3. Download OpenCV 2.3.1 for Window Pre-build version
4. Double click on the OpenCV installer. It will extract OpenCV to your selected folder. For me, I extract it to C:\opencv and I will use that path for the rest of this blog
5. OpenCV 2.3.1 folder structure is different from OpenCV 2.2. The pre-build library and Python package are located at C:\opencv\build.
5. Add C:\opencv\build\x86\vc10\bin to PATH system environment variable for OpenCV.
6. Open Python IDLE
7. Add the following. Note: Having \\ for path is important. If not, Python interpretor may think some of the path as character encoding. For example, \b is consider as character encoding in Python

For Linux, most Linux distribution comes with python-imaging package. You can perform yum install python-imaging to install it. However, the default package may be out-dated. For example, CentOS 5.5 only have python-imaging 1.1.5 package while the latest package from the web site is 1.1.7