Search this site:

2010-05-18

Creating Time Lapse with ffmpeg




Here is how I made this time lapse video from image:

  1. Rename the images in sequence as frameXXX.jpg (where XXX is 000, 001, 002, etc). Many photo viewing software like XnVew (free solution, recommended!) and ACDSee can do this easily
  2. Run the ffmpeg with the following parameter:
    ffmpeg -r 12 -i frame%03d.jpg -sameq -s hd720 -vcodec libx264 -vpre hq -crf 25 OUTPUT.MP4
  3. Done!

You may want to change the -r parameter to your favorite frame rate. If you want 1080p, simply replace the -s hd720 parameter as -s hd1080, or -s 1920x1080 if you want.

One more important point to note is that the order of parameters matters. Any parameters before the -i will become options for input stream. Like if you type something like ffmpeg -r 12 -i blah blah blah, you will make the specified rate meaningless as it will be applied to input stream which are still imagesthis is how the rate parameter should be specified. Make sure that you don't mix them up when you customize the parameter. Another common problem I've seen is the format for -i parameter. It is actually the same as that of the printf() function in C++. For example, frame%03d.jpg will make ffmpeg looks for images with names frame000.jpg, frame001.jpg, frame002.jpg... while frame%05d.jpg means frame00000.jpg, frame00001.jpg, frame00002.jpg...

Yet I think the quality is not very perfect. Maybe need further fine tunning the parameters. Anyone has hints please?

A uncompressed version can be done like this:
  1. Resize your image to your desired output resolution (e.g. 1920x1080, 1280x720, etc)
  2. Rename the images in sequence as frameXXX.jpg (where XXX is 000, 001, 002, etc). Many photo viewing software like XnVew (free solution, recommended!) and ACDSee can do this easily
  3. Run the ffmpeg with the following parameter:
    ffmpeg -r 12 -i frame%03d.jpg -vcodec copy OUTPUT.AVI
  4. Done again!

Enjoy~

2010-05-01

Documentation Tool for .NET


This is a really nice one... released by MS:
Sandcastle - http://sandcastle.codeplex.com/

Capable to output HTML (with ASP.NET files so that you can deploy to IIS with more feature), HTML Help 1.x (.chm), and HTML Help 2.x (.HxS).

And you would probably like this nice GUI of the tool:
Sandcastle Help File Builder (SHFB) - http://shfb.codeplex.com/

There is also a Visual Studio integration:
DocProject for Sandcastle - http://docproject.codeplex.com/
It's powerful but I like the SHFB more for simplicity :)

Some notes to add:

  • Remember to read the instructions for SHFB before installing and you will find prerequisites like the Microsoft HTML Help for outputting .chm files.
  • Simply specifying the solution files in SHFB will do the job - don't really need to add all source files!
  • You may need to reconfigure your C# projects so that it also generates XML document files when building, or else the method/field descriptions will not be available in the output.
  • If you encounter errors when generating the output, try to change the Working directory in SHFB settings to something really simple - alphanumeric onlys, without spaces, etc (something like C:\Temp\working might be a good one)... It seems that the hhc.exe from Microsoft HTML Help packages does not handle special characters well...

That's it. Enjoy!

Disclaimer

ALL CONTENTS AND INFORMATION IN THIS WEB SITE ARE PROVIDED "AS IT" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. THE ACCURACY AND AVAILABILITY OF THE CONTENTS, INFORMATION AND THE WEB SITE ITSELF ARE NOT GUARANTEED. THE AUTHOR TAKES NO RESPONSIBILITIES ON ANY COSTS OR DAMAGES (DIRECT OR INDIRECT) ARISING OUT OF OR IN CONNECTION WITH THE ACCESS, USAGE OR INABILITY OF USAGE OF THIS WEB SITE.