Using Expression Encoder 3 to create WMV, Flash, and Ogg Theora screencasts
My Dell laptop died.
I fried the motherboard trying to reduce the fan noise … long story. The computer was a couple years old and was pretty low-powered, so I don't feel too bad.
I got a new laptop. It's a Lenovo T510 – pretty much the only laptop I could find under $1k that had a matte screen. I just can't look at those glossy screens.
Anyway, I've been playing around with having a more powerful computer so I dowloaded Microsoft's Expression Encoder 3 (formerly Windows Media Encoder). Besides the encoder, it also has a screen capture function. The free version limits you to 10 minute captures, but I'm guessing you could merge several screencasts in the Encoder component to make a longer video.
Anyway, on the downside of course is that the free version limits you to WMV (Windows Media) format. Now, there's nothing wrong with that, but it isn't the best format for widespread deployment via the Internet. But you can easily upload the video to YouTube or the much classier Vimeo. That way you can get the file converted to something that can be viewed in-line with Flash and hosted for free. And those sites offer easy ways to share and embed the videos into your blog, website, or Facebook page, etc.
Now another option if
- you have the bandwidth to host the video yourself
- and you like open standards
is to convert your WMV file to Ogg Theora via ffmpeg2theora. All I had to do was dowload the Windows version of ffmpeg2theora (version 0.26) and then place it in the same folder as my WMV file.
Let's say the file is called "foo.wmv" and that it's in my root C drive.
The WMV can be converted to Ogg Theora via the following command line code:
C:\> ffmpeg2theora-0.26 foo.wmv
I should mention that I seemed to only have any luck with this if I first set Expression Encoder to export to VC-1 Simple/WMA for the respective video/audio output formats.
Anyway, the new file called "foo.ogv" gets made and you can open and play it straight from Firefox which has native HTML 5 <video> tag support for Ogg Theora video files.
By the way, here's an interesting bit on the impending battle between Ogg Theora and the H.264 video codec.
AudioRegent Installation (Xubuntu)
I just got a Vimeo account.
AudioRegent Installation (Xubuntu) from nitin arora on Vimeo.
A quick tutorial on installing and running AudioRegent 1.1 in Xubuntu 9.04.
AudioRegent’s documentation is available at:
http://blog.humaneguitarist.org/projects/audioregent/
The documentation includes a download link to the program files.
LS-598 #4: MXMLiszt on Windows Server 2003
Yesterday I wrote about trying out a Windows VPS using KickAssVPS.com to run MXMLiszt, my web demo for my music encoding research project.
Well, so far so good. Sort of …
I use Windows XP Home Edition (SP3, 32-bit) on my laptop, so my software and everything that it utilizes runs well on XP since I naturally made sure everything works.
But to my surprise things didn’t go that great when I uploaded everything to my VPS which uses Windows Server 2003. Here’s what was problematic:
- Musecore version 0.9.5 is what I call to make PDFs and PNG preview files from the MusicXML files. On the VPS, the titles of the pieces weren’t showing up when these image files were getting made, so I went on to version 0.9.6 which is still in beta. It’s working OK. The PDFs are getting made when one transposes a piece, but they look better with the XP version of MXMLiszt on my laptop which uses version 0.9.5 of MuseScore. But, there’s something funny going on with the administrative PHP script that makes PNG preview files for the site. These are small image of the 1st page of each piece so the user can get a feel for the piece, its key and initial texture, etc. Not all the previews are getting made. Weird.
- I also use MuseScore to "normalize" each MusicXML file by opening/saving them in MuseScore so that every file gets "spit out" by the same application before I use an XSL transformation to auto-generate MODS metadata from the MusicXML files. Works great on XP and with MuseScore 0.9.5 but on the VPS with the beta version of MuseScore, the title of each piece is showing up in the MODS as the primary and sub-title – so it’s redundant. If you don’t know what I’m talking about, don’t worry. Bottom line is things are wonky.
- The software that makes the transpositions, MusicXML Library version 2.0, wasn’t working on the VPS. So I went down to version 1.09. Moreover, my PHP script that calls the MusicXML Library to transpose the music per user request looks for the "xmltranspose.exe" executable in version 2. The older version of the software calls that file "transpose.exe". So rather than change my script, I just renamed "transpose.exe" to "xmltranspose.exe" on the VPS.
So in other words, MXMLiszt really isn’t too compatible with Windows Server 2003. It’s working well enough as a live demo now, but I wouldn’t try and run it "for real" on the VPS since the PNG preview and MODS generation are problematic. So the production version is the XP version as on my laptop.
Oh well. The user doesn’t miss out, it’s just the Administrator who has to do the work on a local machine and upload everything to the VPS for the sake of having a live demo.
Such is life.
p.s. it’ll be a few more weeks before I can post the link to the demo. It needs more documentation before I can share it with anyone other than my professor. Feel free to email me off-list if you would like me to send the link as long as you agree not to post the link until the documentation is done.
This blog post is part of a semester-long investigation into digital encoding of symbolic music representation (SMR), its context in libraries, web-based delivery, preservation and metadata, and search and retrieval technologies..
LS-598 #3: Web Demo Update
Before I provide a quick update on the status of the web demo for my MusicXML digital library delivery mock-up, it goes without saying that I haven’t been bloggin per my original intent. That is to say, the initial idea of writing my paper with a modular approach fed by blog posts, has essentially been scrapped. The idea of it all seemed a bit too piece-meal to me. Instead, I’ll write the paper and post it in its entirety when it’s been written.
As for the web demo, it’s more or less completed from a programming p.o.v at this point, but there are a few things I want to mention:
- The software has a name in MXMLiszt, i.e. "MusicXML List". It’s pronounced "maximalist" and happily references my favorite composer in the process.
- It should run "out of the box" (after you install all dependencies) on Windows servers running XAMPP or at least an Apache installation on a Windows server with the same folder configuration as XAMPP.
- It will utilize open-source software only, with the ironic exception of the OS.
- MXMLiszt will be released with a BSD license approximately 6-8 weeks from now after the documentation is complete and my paper is finished.
Eventually, I’ll port MXMLiszt to Linux (in all likelihood for Ubuntu specifically), but that will entail some work I’m not willing to be distracted by just yet. With Linux, I’ll have more homework to do before I can distribute it and ask people to expect it to work.
Other problems are finding a server to support MXMLiszt. Given all the software requirements and that I *do not* want to have to rearrange – for either a Windows or Linux server – all the paths to the various executable I utilize and - for Linux hosting – the fact that I can’t control what Linux distro a web hosting company offers, I have only two options:
- Use my own laptop as a server. The downside of this is that I can’t leave it on 24/7. I’ll only be able to offer it from roughly 9-5 EST Mon-Fri since I’ll need my computer to rest and/or be available for personal use while I’m home.
- Run MXMLiszt from a Virtual Private Server (VPS) – i.e. instead of a typical web hosting plan, I’ll rent out a virtual machine running Windows from a hosting provider. This gives me total control of the VM and I don’t have to make compromises and/or rearrange folders and paths to executables, etc.
I’ve decided to go with the 2nd option for now using KickAssVPS. I’ll report back how that works out, but I want to close with the economic dilemma all this presents.
It’s roughly $35 a month to have a Windows VPS with KickAssVPS. And that’s on the low end of VPS pricing. That’s not that expensive but when one factors in that for that rate I could finance a brand-new really high end laptop, I have to ask myself "Why not just use my current low-end Dell laptop as a server and use the $35 bucks a month to get a really nice laptop?".
Good question. For now I’ll try the VPS, but I have a feeling that my narcissistic need to control everything will lead me back to running a server from home. And I think in the end I just won’t be able to justify the cost of renting (VPS) vs. renting to own (financing a new laptop).
If you’re asking "Why get an expensive laptop? Why not get a really cheap one or better yet a used headless server?"
Well, my friend, it doesn’t get much cheaper than my Dell Vostro. If I buy a low-end laptop, it’ll end up being comparable in price and specs to my Dell. It doesn’t make much sense to essentially have two of the same thing. As for headless servers, that would be better from the p.o.v. of running a server 24/7 but I’d need a monitor at some point and I don’t want to get into buying more peripherals …
… unless someone can tell me how to remotely control a headless server from a laptop without *ever* needing a monitor for the headless.
This blog post is part of a semester-long investigation into digital encoding of symbolic music representation (SMR), its context in libraries, web-based delivery, preservation and metadata, and search and retrieval technologies.
LS-598 #2: XQuery problems and solutions
Just a quick morning post today …
The last 10 days or so I’ve been struggling with some major problems that arose in trying to implement effective XQuer-ies on my web demo.
- Dublin Core doesn’t allow me to differentiate creator "types", so I was limited to searching across the DC:creator element for all creators, be they Composer, Lyricist, or Arranger. MusicXML does differentiate these types, so essentially Dublin Core was making me "dumb down" some information. I want people to be able to search creator specifically by their role: Composer, Lyricist, or Arranger.
- I needed a way to iterate an XQuery over all the MusicXML documents and I needed it to be relatively fast. A demo is a demo, but impatience is impatience and I just can’t accept slow query processing.
- The XQuery processor I was using didn’t support some XQuery functions that would allow a searcher to type in "Bach" and retrieve documents for which the creator was "J.S Bach", "Johann Sebastian Bach", "Bach, J.S", "P.D.Q Bach", etc. This really was limiting the search/query coolness factor and I wasn’t at all happy about it.
Here are my solutions (details to follow in a few days or so):
- Ditch Dublin Core and switch to MODS, which does allow me to specify the role of a creator. Last week, I made a MusicXML to MODS XSL transformation for descriptive metadata and it’s working well.
- Steal an idea from Using XQuery on MusicXML Databases for Musicological Analysis so that rather than iterate one query (say for the number of notes in a piece) across multiple MusicXML docs, I just concatenated all the MusicXML documents. The original files are left alone, but a "super" MusicXML file gets created so that one can just query that one file, hence no need for lengthy iteration. I’m not sure how those fellows did it, but I just automated it via PHP using the following format:
- Switch XQuery processors! I’ll go into the ones that didn’t support the function I needed another time, but I will say that BaseX did the trick. Below is the query that searches for creators with "Bach" somewhere in MusicXML’s <creator> element. For the deliverable demo, I won’t be querying these big MusicXML documents for simple descriptive metadata like Creator, that’s what the MODS is for. But this is just an example. The "ftcontains" syntax is what allows for retrieval of values where "Bach" is somewhere within the element, but isn’t necessarily equivalent to the entire element value.
<hyperMXML>
<hypoMXML file="foo1.xml">
1st MusicXML document
</hypoMXML>
<hypoMXML file="foo2.xml">
2nd MusicXML document
</hypoMXML>
</hyperMXML>
for $i in doc("../temp/concat/concatMXML.xml")/hyperMXML/hypoMXML/score-partwise
where $i/identification/creator ftcontains "Bach"
return ($i/work/work-title)
This blog post is part of a semester-long investigation into digital encoding of symbolic music representation (SMR), its context in libraries, web-based delivery, preservation and metadata, and search and retrieval technologies.
LS-598 #1: intro
This is my final semester at the School of Library and Information Studies at the University of Alabama.
For my final credits, I’ll be researching the digital encoding of symbolic music representation (SMR), i.e. "sheet music", its background, and the benefits it offers over simply thinking of SMR as an image – all within the context of libraries, including avenues of web-based delivery, preservation and metadata, and search and retrieval technologies. My research will be directed by Dr. Steven MacCall.
In addition to a paper addressing these issues, I’m required to deliver what is essentially a "demo" of a MusicXML web-based delivery system that could serve to demonstrate to librarians the possibilities that arise with the usage of XML-encoded musical information.
I’ll be blogging along this semester as part of a modular approach to constructing the paper. Currently, I’m plugging away at the demo which utilizes open-source server-side music applications.
The first idea behind the demo is that one could "drop" MusicXML documents on their server and – via automation – PDF, audio, and preliminary Dublin Core metadata are generated. So far, I’ve got all that covered but I need to polish the output and I really need to comment-up my PHP code as I’m even forgetting at times what I’ve done and why. I’ll be sharing the code as well as the XSL transformations that are used to generate the Dublin Core metadata from the MusicXML documents.
As time allows, I’ll try and add some cool features. For example, this week I implemented libmusicxml so that the user can generate a PDF of a musical score in a different key than the original. I’m guessing this is the same way that the Wikifonia site offers this transposition option. I’ll have to ask them to make sure.
The second idea behind the demo is to implement a search/retrieval mechanism using XQuery. This will prove the biggest challenge as I don’t know XQuery well, but I have some excellent sources on querying MusicXML documents from which I can learn. Implementing XQuery on the site has – for the most part – already been dealt with in terms of scripting. In other words, the hard, hard work is done in terms of the demo, but I’m not quite there yet …
ps: Unfortunately, the server-side software required to run the demo can’t be added to a free server like the one I use for this blog. But while I can’t host the demo, I will at the end of the semester offer it as a download-able package so that one can run it on their personal computer as server.
This blog post is part of a semester-long investigation into digital encoding of symbolic music representation (SMR), its context in libraries, web-based delivery, preservation and metadata, and search and retrieval technologies.
segmenting audio with AudioRegent, SoX and XML
For some reason I feel obligated to point out that I haven’t blogged in a while for a few reasons:
- Christmas break from school/work at the University of Alabama
- the desire not to blog for the sake of blogging
- and …
I’ve been working on something huge – at least for me. It’s a piece of software called AudioRegent that harnesses XML to create derivative "clips" of regions within WAV audio files. A region is simply a user-defined segment within an audio file, like a track on a Compact Disc.
Besides writing the program in Python, which I pretty much finished in December, I had to also develop the XML format which I call SimpleADL (Simple Audio Decision List) that AudioRegent looks at and then makes derivative audio clips by leveraging SoX, the Sound Exchange command line audio editor. AudioRegent and SimpleADL can also be used to sync audio to text, like transcripts.
Actually, the programming and devising SimpleADL were the easy part. The hard stuff was the documentation and deciding on a license for the software.
I tried to find a balance in documenting the software: being thorough without writing a novel. I’m not sure I succeeded, but I can always improve it with time.
I used the W3C’s Amaya editor to write the documentation in XHTML. Sure, you can use OpenOffice to export a document to XHTML, but man is it bloated and messy. Amaya writes really clean XHTML.
As for the license, I chose the BSD license. As I understand it, this allows one to use the source code at will in future open or closed-source applications as long as you maintain the credits for AudioRegent. I was tempted to use the Mozilla Public License (MPL) which, again from what I can tell, is similar to the BSD license except that any source derived from AudioRegent would have to stay open-source though any peripheral code can be closed-source. I absolutely decided against the GNU General Public License which is viral and imposes its philosophy perpetually on all subsequent code, even peripheral code. Some have even argued that it works against its own objectives and is less "open" than the MPL.
Now I realize that, practically speaking, a skilled programmer could write better code from scratch in 30 minutes as opposed to the some 30 hours I needed, but I wanted to go about this quasi-professionally. And I learned more about licensing, which was cool.
Anyway, rather than try and explain the software itself and how to get it, I’d be better off pointing you to the documentation if you have any interest …
South Park Launcher: Python and VB editions
It seems that about a year ago, the creators of South Park started freely offering their episodes online at southparkstudios.com.
The move was made, in part, to offer a legal way for fans without television access or even televisions (that’s me!) to watch the show. As the creators stated, they got:
This was great for me because I admittedly was downloading those shows as well. One of the other great things about it is the Random Episode link which, you guessed it, launches a random episode of the show.
The only thing that makes it less than perfect is that I can’t set it to repeatedly play more random episodes.
Until now.
I decided to sit down and write the most important code I may ever write: a program that leverages the Random Episode feature to launch successive random episodes of the great social commentary, courtesy of Matt and Trey.
Here’s the core of the code, from a Python perspective:
import sys, webbrowser, time
url = ‘http://www.southparkstudios.com/episodes/random.php’
i=1
while i <= 5:
webbrowser.open(url)
time.sleep(1440) # 1440 seconds = 24 minutes, the average length of an episode plus ads.
i=i+1
sys.exit()
Basically this is a loop that keeps launching a episode every 24 minutes while the variable "i" is less than or equal to 5. After every episode, "i" grows by one so when "i" equals 6, the program shuts down. BTW: after the program starts, the user does have to manually initiate playback of the first episode, but the last 4 episodes play automatically.
Now, this works fine and I even embellished the code so that the user can select from 2 to 10 episodes to launch. But I was still thinking, "This would be great to share with my friends, but they aren’t going to run software from the command line!"
So I wrote a version using Microsoft’s Visual Studio Express, a free version of their software that allows one to create GUI applications with a mixture of visual tools and the Visual Basic language. It’s a really great tool that I hope to use more in the future although I do worry about the extra time required just to make software have a graphical interface.
Anyway, here’s a ZIP file that contains both the installer for the Windows version of South Park Launcher as well as the Python version for Windows and other platforms. Make sure to read the ReadMe.txt file first!
You assume all responsibility for use.
UPDATE, 03/14/2010: Looks like the South Park site now requires one to click the "play" button to start each and every episode, so South Park Launcher isn’t very useful anymore.
Oh well. It was fun while it lasted.
MusicSQL: initial thoughts
One of the nice things about an emerging standard, namely MusicXML, having a command center (Recordare LLC) is having a central place to learn about what’s new.
On Friday, I was looking at Recordare’s page of MusicXML related software for software that worked from the command line and noticed something new and really interesting: MusicSQL.
According the the Goodle Code page that hosts this project, MusicSQL is:
a system for conducting complex searches of symbolic music databases. The database can import and export MusicXML files. In the current version searches are constructed using a command line interface or through simple Python scripting tools.
Basically, at least as I understand it, MusicSQL is a Python program that sits on top of a MySQL database – now I really hope Oracle doesn’t kill MySQL if it buys Sun.
I was so excited to get MusicSQL working that I didn’t notate all the little problems I had along the way. The documentation for MusicSQL is very good and is written for Windows, Mac, and Linux (Ubuntu) users. But I’m inconceivably impatient, so I just mowed through the installation with little care for remembering what I was doing.
I do remember that I had to install Python 2.5, whereas I already have Python 2.6 installed – now I have both. I put/installed all the dependencies in my Python 2.5 directory just to compartmentalized everything – the exception being MySQL, which I installed wherever the default is.
So far, I only ran the first query in the documentation that uses "scientific" musical notation in the form Nx, where "N" is the alphabetical note name, say C, and "x" is an integer that denotes what octave the note is a member of. In other words, a C-Major scale would be "Cx Dx Ex Fx Gx Ax Bx Cx+1", something like "C5 D5 … B5 C6", etc. You can place an integer before the note name to denote its duration.
Running the query from the command line, I was really happy with the speed and the output of MusicSQL for the test query.
One problem I did have, though, is I kept getting errors for another great feature of MusicSQL. Basically, after you run your query, you can see a PDF of the results (i.e. the music excerpt pertaining to the query results). The PDF is made by Lilypond, a text-based notation software that produces – in my opinion – the absolute best looking engraving out there, that’s why I use it (and yes, it’s free).
Now Lilypond doesn’t natively read MusicXML, it uses its own encoding. So MusicSQL takes advantage of a Python script that comes with the Lilypond install called "xml2ly" that converts MusicXML to Lilypond format. I left a message on the project forum for MusicSQL, so I’m hoping I can figure out what I need to do to get the Lilypond outout of the query results to work. At any rate, I do wonder how effective it can be since the conversion from MusicXML to Lilypond can sometimes get ugly.
I wonder if an alternative solution is to use the command line options for the MuseScore notation software to generate a PDF of the query results. Musescore can also convert MusicXML to other graphics formats (PNG) and even audio (WAV, FLAC, OGG), so theoretically it could be leveraged to make audio files for the corresponding query results.
At any rate, I’m really looking forward to the future developments of MusicSQL.
And as for using MuseScore’s command line in conjunction with MusicXML and how it can add value to a web collection of MusicXML docs – there will be more to that later …
running XQuery online
A while ago, I posted about my first experience with XQuery and how I’d used the .NET version of the Saxon processor on my local Windows machine.
Obviously, I want to extend that experience to running XQueries online. So far, I know this can easily be done with a native XML database server like eXist. That is to say, when I installed eXist on my local machine and made it go live: bam! – instant XML server with built-in XQuery functionality, accessible from anywhere.
Another way is to use one of the more popular web-scripting languages to execute XQuery syntax. I nearly killed myself this weekend trying to install the Zorba PHP binding for XQuery (i.e. run XQuery natively from within a PHP script). I just couldn’t get all the dependencies successfully installed on my virtual install of Ubuntu Netbook Remix (BTW: I use Sun’s VirtualBox for virtualization). Perhaps I’ll be able to make it work another time.
Now, even though it makes all the sense in the world to stick with a native XML server like eXist if I want to make a large collection of searchable XML documents online (and I do), I’m feeling non-sensical. What I decided to try was to run my computer as a more traditional server using the X-Apache-MySql-PHP model, specifically WampServer.
From there, I placed my sample document, "books.xml" and my "test.xquery" file from last time:
<ul>
{
for $x in doc("books.xml")/bookstore/book/title
order by $x
return <li>{data($x)}</li>
}
</ul>
in WAMP’s "www" directory – i.e. the directory which is accessible from the browser, the place where one would put all their .html files, etc. for the world to see.
Of course, I was still missing the actual XQuery processor at this point. What I tried is to put the relevant executables for Saxon in the "www" directory as well.
… Now, I’m sure this is totally unsafe or something, but I was just testing and I only make my computer "go live" as a server for short periods of time.
Anyway, from there I used PHP to call the Saxon processor and to display the results in the browser. It actually worked!
Here’s the code:
<?php
echo "Hi. I’m going to use XQuery to list the books alphabetically.";
exec("query.exe test.xquery !indent=yes", $results);
foreach ($results as $value)
{
echo "$value";
}
?>
You can see that the PHP "exec" command called the Saxon executable named "query.exe" and executes the "test.xquery" file.
It saves the results in a variable called "results" and then prints each value of the results in the browser.
…
For now, I’m OK with this, but I need to eventually do the same thing with the Java version of Saxon, I suppose, if I’m ever going to run this on a Linux server. It shouldn’t present any new hurdles, but I need to try it to make sure, of course.
If anyone out there has any thoughts or recommendations on a more elegant method to achieve these results – and what the security risks of the approach I’ve outlined presents (since I didn’t use a CGI-bin), please speak up. I’m all ears.
UPDATE, 11/15/2009: No problems with using the Java version of Saxon. I did place it in a "bin" directory on my local server so that the Java file wouldn’t reside in the directory that users have direct access to.