Sunday, December 28, 2008

Creative Zen, libmtp, gnomad2

Today I've encountered a number of bugs (and unexpected features)... mostly whilst trying to get fast forward, rewind and duration to work on video files transferred to the Creative Zen. After spending a number of hours trying to re-encode the video files with different tools, switches and the like - some heavy googling revealed that the problem might lie with the method I was using to transfer the files onto the device!

A quick test, using Windows to transfer the files instead of Linux + libmtp showed that the transfer method was the problem. MTP is Microsoft's Media Transfer Protocol, and unfortunately (for me) it allows meta-data to be sent 'out of band', ie. not relying on the data embedded in the media files being transferred. The duration of a video clip is one such piece of metadata, and the Zen apparently relies on this metadata when seeking in a video file.

libmtp comes with an (example) tool 'mtp-sendfile' which I'd been using, as well as a 'mtp-sendtr' which perhaps is more appropriate, as it allows meta-data to be specified. Unfortunately it doesn't handle .avi files in the release I have at least.

In the process, of investigating the above, I managed to 'corrupt' data in the Zen, such that it thought all the videos on it were gone. A reboot of the device resolved this.

I then found a blog post http://tiagoboldt.net/blog/creative-zen-linux/ indicating that gnomad2 handles the meta-data correctly. It uses libnjb to communicate with the device (I'm not sure if this is a layer above mtp or beside). Unfortunately it behaved badly on my machine, crashing with a seg-fault, and leaving the Zen hanging.

libnjb is beautifully documented via doxygen, so perhaps I'll read up more on it, and even do some coding to get a working solution :)

No comments: