-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|39|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Blogs Home -> Blogs


 
spinal
Created : 05 January 2008
 

NDS movie format...



I have started working (initially on a movie converter) on the emc movie format for use with palib on the nds. I want to get my head around the format, and what better way to do that, than to code a converter for it and create a .emc for myself.

Currently I know that the format is mainly a small header, a bunch if jpg images and a huge raw audio sample.

So far, I have managed to extract the jpg images from the video and have a blitz program display them at the correct frame rate. Now I just have to figure out the audio.

 

Comments


Saturday, 05 January 2008, 14:47
Jayenkai
*Applauds Spinal for the great work already*

Something I'd never attempt, myself! Well done.
Saturday, 05 January 2008, 15:40
spinal
I have based it on the already working file format, but, like i said, I need to know how it works to try to make it better. I'm really only re-discovering Eponasoft's work.
Saturday, 05 January 2008, 16:11
spinal
Having got playback working on the DS, I now face the tricky stage of adding sound. I have managed to rip the audio from a clip directly to a format playable by palib's raw sound playing function, just need to remove the file header to prevent a half second of noise at the start.

The way I understand Eponasoft's video format, the audio is split into a number of samples sith the length of 1 video frame (at 14fps, that should be samplerate/14 I think) and merged into the format in the following way -

short int (frame size in bytes) + jpg frame + audio sample [then repeat for each frame]

At this point I am having a little trouble. The sample rate of the audio file is 11025 and the frame rate of the end video will be 14fps. I also need to calculate the umber of frames, I'm having a little trouble with this also as the only thing I really have to work with is the size of the audio track.

the total number of samples in the file should be something like audio_file_size - 44 (the .wav header is 44 bytes long)
once I have that value, I assume I divide it by the sample rate (11025) to give me the number of seconds? then by 14 to find the number of frames I will have at 14fps over however many seconds I work out?
Monday, 07 January 2008, 05:05
spinal
I have managed to get this thing fairly compatible with Eponasoft's format, the header is different, but thats about the only difference at the moment. I'm having trouble with the sound playback, I can hear the sound in the background, but I'm getting loud noise over the top in intervals, I think its a buffer problem.

Once this is working, I want to add some sort of key framing using a lookup table, probably recording either 100 frame locations (percentage of the video file) or 256 (width of DS screen, for progress bar) so when the user wants to skip the movie, they player does not have to search through the whole file (witch could end up being quite large).