This program contains a Perl function I wrote to extract data about a given video.
It also shows how to parse information from program output and organize it usefully.
This has been used a few times in production systems.
If you use this, please drop a comment! It would be fun to know.