VCS OOP Rewrite?

Note: VCS stands for Video Contact Sheet *NIX, visit http://p.outlyer.net/vcs/ for details.

Abstract
I'm considering an alternative language in which to rewrite VCS. It must support OOP well enough and be relatively common-place. Current candidates are Java, Python and PHP5. Comments/suggestions/preferences are welcome, either here or by mail (outlyer@gmail.com) (but leave alone language hatred/fandom!).

VCS is, no matter how you look at it, a script. It's a piece of software that basically interfaces with other
pieces of software simplifying a task that could be done manually (yet in a harder way) with them. So a scripting language was the right choice, bash is the one I know better, it is really
powerful and most computers already have it installed. The-right-choice… *but*. Writing a relatively long and complex piece
of code and keeping it as modular as possible in bash is a pain; anyone that may have looked at the code should agree it's hard to read, let alone maintain. So, almost from the start I've been considering alternatives to bash.

The problem is I want to maintain the feats that make a script desirable (after all, it will remain technically a script as I have no intention to interface directly with ImageMagick's or libavcodec's libs). These
features can be summarised as cross platform, no compilation and a single file approach: users should be able to download the script file and run it right away (after filling dependencies of course, just as currently).

My language candidates are PHP version 5, Python and Java.

Java, while the less script-ish of them can still be single-file (JAR) and would need no compilation (by final users). PHP since version 5 has a lot more power in regards of OOP and of course it has that massive
library web developers love and hate 🙂 Python is the least known by me, it's meaningful whitespace still feels weird but apparently it's a very good option for OOP software.

I'm currently rewriting vcs in PHP and I'm even more convinced to switch languages after having some more power on my hands. I fear though that switching away from a shell script might make some people overlook vcs.

Comments would be greatly appreaciated.

VCS update 2007-09-04: Back from pause

Sorry for the long break, I had some things to delve with in off-line life, plus
a web server change. I hope to restart development soon and look into the list of reported and known bugs.

Also, I should be expanding online documentation. Hopefully.

In the meantime I'm updating the list of known bugs with the ones I hadn't yet added.

VCS update 2007-05-12: 1.0.7a released

The new version is out. I've noticed some things that didn't work as expected (or as I assumed before, like command-line overrides –although as usual I guess few or no people uses them anyway :p– I'll have to look at them but have not much time anymore so I'm releasing as is.

What's new in 1.0.7a

  • Decimal point precission
    Finally you can set an exact frame to capture, define the exact boundaries of the capture or set an interval like 30 seconds and 250 milliseconds.

    The new timecode format accepts a point now, e.g. 2m.2 (2 minutes and 0.2 seconds) or 15.333 (15 seconds and 333 milliseconds).

    As a side effect, the timestamps now include centiseconds.

  • Soft Shadows
    A subtle yet nice improvement, the captures have now "real" shadows:
    Upper: Hard shadows, Lower: Soft shadows
    Upper half has hard shadows (version 1.0.6b and below), lower half has soft shadows (1.0.7a).
  • Funky modes.

    You can consider this feature in alpha stage, it has many rough edges still.

    Worth noting also is that funky modes are random, so the result might look great or be plain dull.

    In short the funky modes are like the normal vcs mode but less useful 😛. They are meant to provide some nicer output modes. Well in fact they're a toy of mine, but don't tell anyone.

    Probably the most interesting bit is the polaroid mode, based on a feature built in newer versions of ImageMagick (although I'm not actually using it), here's a sample:

    polaroid mode sample

    As you can see, it basically adds a frame around each capture, rotates and overlaps them semi-randomly.

    Although not useful for common video previews it might be nice for family videos and such 🙂

    The list of funky modes in the current version is:

    Description Sample
    rotate
    Rotates each capture randomly.
    rotate sample
    overlap
    Overlaps captures randomly.
    overlap sample
    photoframe
    Adds a frame to each capture.
    photoframe sample
    polaroid
    See above. A combination of rotate,
    photoframe and overlap.
    polaroid sample
    film
    This one is specially rough, currently. Adds a filmstrip effect
    to captures.
    film mode sample
    random

    This is basically a way to discover nice fonts/colours combinations. Randomizes
    font and colours selection. The output is rarely usable.

    (no sample)
  • Support for non-latin file names

    Honestly, I don't know how well this works or doesn't because I can't speak any such language. What this feature does is switching the font to an alternate one (by default Kochi Mincho) just to print the filename. In theory this should work for Hiragana and Katakana (plus latin scripts) and (partially?) for the Hangul and Cyrillic scripts (although the default font in my system already prints Cyrillic).
    Samples. These are vcs runs against a file named "Roman – 日本語 – 漢語 – Русский – 한글.avi"
    (if your browser can't display the name correctly, see this image):

    non-latin scripts sample

    The first row uses the default font (helvetica), only latin and cyrillic characters are drawn.
    The second row uses the alternate font (by default Kochi Mincho), only the korean text is ignored.

    If you can help with this I'd appreciate it 🙂

  • Workaround for ffmpeg arguments order.

    A known issue is that depending on the order of arguments passed to ffmpeg, with some input files the capture will stall or fail. If vcs seems to get stuck on the first capture for too long, try using -Wo. On some files in works, on others it doesn't. Some files simply make ffmpeg suffer a lot and eventually it does the capture but taking a lot more time.

    Matroska files (.mkv) seem to be specially tough, most of my samples won't work.
    Can't help more here right now.

  • End offset
    My personal impression is that most often it is desirable not to capture from the very end of the video. I'm not talking about spoilers, what I mean is that when vcs is run over a full film, often the last capture is simply a black (or blank) frame.
    Now by default a minute from the end is ignored, hence in those situations the last capture most often will be of the credits.

    This isn't practical for a lot of videos so you can change or disable the offset by using -E or --end_offset. By default it will be disabled when the video runs for less than the default offset. Use -E 0 to disable the offset, or override DEFAULT_END_OFFSET to change/disable the default.

    As I haven't written the overrides documentation yet, here's what you can do to disable the "end offset" feature forever:
    $ echo 'DEFAULT_END_OFFSET=0' >> ~/.vcs.conf

    If later you want to use the end offset use the -E option normally.

VCS update 2007-04-21: Docs coming, highlights, extended mode

I've started writing some documentation, will be updating it shortly.

See the documentation for details on the modes added in 1.0.5b (extended mode and highlights).

Here's a sample using both:

Highlight and Extended mode sample

The first row (pale golden background) are the highlights (-l)
while the smaller thumbnails are the extended mode (-e).

It's a variation of the sample at the home, the
command used was:
$ vcs -t 28m24 -n6 -e -l20m25 -l22 -a 16/9 -H 540 mariposaHD.S01E05.1080p.en.wmv

Scroll to Top