Amarok 2 Media Transcoder : Got to think Low Level

Was discussing QTScript calls planned for and already in Amarok 2 in the freenode channel tonight. Seems a good portion of the functionality I’d need for my media device script would need to be added into Amarok as it stands. Which means I’m back to C++ for the entire process, and to build what needs to be included into Amarok 2. Little bit more work than I was thinking when I first thought to try this.

Fact is I wasn’t entirely certain a lot of what I wanted to put into this script should even BE in a script. A lot of the calls need to be made to media devices at the device level, and for that a lot of calls need to be made to libgpod and libmtp. Which means that a lot of Amarok.Script calls would have to be written to link to libgpod and libmtp. Seems the easiest way to even think about this is to try to make things easier and low level for the program. WindowsUninstall is already working on a transcoder C++ program for audio files only. Since I want to do things in video as well I’m going to have to try on my own and hope I can extend things.

Time for more pseudo-code

Media Device transcoder/up-loader (c++ edition)
#include qt.core;
#include libgpod;
#include libmtp;
#include mencoder/lame/flac;
#include mp4box;

Obviously the first section here would be all the needed and required libs for the functions. This would all be held in lib.h header file, which may already exist. I don’t know yet.

Function developed to pull information from file for tags;

Function developed to add information for Video to tags

Tagging information is going to be difficult to handle, as video files have extra info that is really extraneous to music files. This information is still needed however as we want our finished video files to fall into proper spots on the media devices.

Function to ask for specific variable information. vbit, abit, wxh, fps if not known will attempt to guess fps

Function to call mp4box and set information for transcoding

Function to transcode audio stream (can be adapted for transcoding music files for transfer)

Function to transcode video stream (should be able to be set for media devices preferred format)

Function to mux video and audio into media device file

Most of the information needs to have set variables for defaults that are safe and sane. they should allow for someone to change them if they think they could use higher or lower bit rates. With that info then proceed to transcode and mux the files

Function to add all tagging information

Once our file has been transcoded and put back together we add all the meta data needed into it.

Function to allow for image upload to media device (should allow for image conversion to media device specific format)

A want, but not a priority at this time. A function to allow Amarok 2 to upload static images into media devices and setup as slide shows. Low priority but still a want.

Function to write all files to media device

Function to catch and display all error codes

Function to clean up all temp files

Once all he work is done the files are copied over to the device, the program cleans up the temp space, and any errors that need to be notified on are notified on. This is at least my current thought process on the whole thing.