NDs-mPeG

NDs-mPeG

nDs-mPeG, usually abbreviated DPG, is a special format of MPEG-1 video specifically for playback using the homebrew Moonshell program for the Nintendo DS. The video is encoded on a computer and then transferred, along with Moonshell, to the DS for playback.

Encoding

With GUI Programs

DPG files are usually created using the dpgtools program for Windows, but a newer program, BatchDPG [cite web | url=http://ls5.citizendeleted.com/ | title=BatchDPG homepage ] , is a viable alternative. Super is also able to encode DPG1 files Additionally, Fengtao software has added support for the DPG1 format to its [http://www.dvdfab.com/dvd-fab-platinum.htm DVDFab Platinum] product.

GUI encoding programs for platforms other than Windows do not exist (but see below for command-line encoding programs), but the file format is simple enough to allow DPG files to be manually encoded and placed into the proper container format. Also, a program called EZBuilder by erspicu_brox can convert to DPG with FFmpeg.

Without GUI Programs

There is a Python script which uses MEncoder and can be used on platforms where both Python and MPlayer are available.Version 0.43 of this script uses mpeg_stat which you can find here: http://bmrc.berkeley.edu/ftp/pub/multimedia/mpeg/stat/

The script can be found [http://theli.is-a-geek.org/blog/static/dpgconv here] .As mpeg_stat homepage is now dead, you can get it at any FreeBSD mirror, like [ftp://ftp.riken.go.jp/pub/FreeBSD/distfiles/mpeg_stat-2.2b-src.tar.gz here] .

Complete List of Encoders

For Mac:

* [http://www.homepage.mac.com/atkinson.d/DPG%20Converter.zip DPG Converter release 1] .
* [http://www.somefreesoftware.com/?p=3 DPG Converter release 2] .

Both releases require [http://prdownloads.sourceforge.net/mplayerosx/ffmpegXbinaries20060307.zip MEncoder] to be placed in the same folder.

In order to create a working DPG, one must encode it as a 15 fps 256*192 avi with MPEG-2 (Hi Quality) or OGG (Low Quality) 128 kps sound. A program such as [http://www.squared5.com/ MPEG Streamclip] or [http://ffmpeg.mplayerhq.hu/ ffmpeg] can be used to do this.

While older DPG files were limited to 15 fps, the newer version (DPG2) supports up to 24 fps.

*The Python script.

For Windows:

* [http://home.att.ne.jp/blue/moonlight/moonshell171p1_with_dpgtools131.zip DPGTools ] Dead link|date=September 2008 - requires DirectX 8.0 or higher
* [http://ls5.citizendeleted.com/index.php?download=BatchDPG_v1.0.exe BatchDPG] Dead link|date=August 2008 -requires [http://avisynth.org/ avisynth] and .NET environment
* [http://www.softpedia.com/progDownload/SUPER-Download-23696.html SUPER] -includes ffmpeg among others. A good guide can be found [http://www.r4ds-forums.com/viewtopic.php?t=38 here] .
* [http://abraxas.no-ip.org/ezbuilder_en/download.php?target=ezbuilder_en_fullpackage_20070720.7z EZBuilder] -requires [http://avisynth.org/ avisynth] and [http://free-codecs.com/download/K_Lite_Mega_Codec_Pack.htm codecs] . A good guide can be found [http://ehsia.com/nintendo-ds/howto/dpg-video-converting-with-ezbuilder here] .
*The Python script.
* [http://www.dvdfab.com/dvd-fab-platinum.htm DVDFab Platinum] - a commercial application

For Linux:

*The Python script.

File Format

General Outline

The DPG file specification is simple. All DPG files contain a 36 byte header, followed by audio, and then a standard mpeg-1 video stream. The audio format can differ; older DPG files used a special WAV format audio, but newer versions of moonshell have phased that out in favor of MP2 audio.

The format specified below is the "DPG0" format. Moonshell supports additional versions of the DPG format [cite web | url=http://forum.gbadev.org/viewtopic.php?t=7897&start=48 | title=DPG file format specification ] , including DPG1, DPG2 and DPG3, though documentation of the revised formats is not included in this article at this time. DPG2 includes additional index information that allows fast relocation in the video/audio stream, thus allowing improved user navigation during playback.

File Structure

A DPG0 file begins with a 36 byte header (Note: all of the numbers below are hexadecimal.):

* 44 50 47 30 (this stands for DPG0 in ASCII)
* Four bytes for the number of frames in the video
* Two bytes for the frames per second that the video runs
* 00 00
* Four bytes for the audio sample rate
* 00 00 00 00 (this was the number of audio channels, now deprecated in favor of MP2 audio)
* 24 00 00 00 (this is the start of the audio file, i.e. right after the header)
* Four bytes for the length, in bytes, of the audio
* Four bytes for the above length + 36 bytes (i.e. the start of the video file)
* Four bytes for the length, in bytes, of the video(A C program and source is included in the BatchDPG source code to simplify the header generation)

After a header has been made, concatenate everything together:
*Linux & Mac (OS X Terminal): cat header.head audio.mp2 video.raw.mpg > ndsmpeg.dpg
*Windows: copy /b header.head + audio.mp2 + video.raw.mpg ndsmpeg.dpg

Audio Encoding

The audio is encoded in standard MP2 format. For example, using ffmpeg to encode in.avi into out.mp2 at a 22050 sample rate and a bitrate of 64 kb/s: ffmpeg -i in.avi -vn -ab 64k -ar 22050 out.mp2

Video Encoding

MoonShell can be very particular about the types of MPEG video it will decode correctly. Videos made with ffmpeg do not work very well; MEncoder seems to be a better option. The FPS and bitrate rely on personal preference, but the DS does not have much processing power - lower bitrates and framerates seem to work better. Finally, since the DS screen is so small, rescaling to 256 by 192 is the most space-efficient.

Here is an example command using MEncoder (this should be on one line):

mencoder in.avi -o out.mpg -nosound -ovc lavc -lavcopts vcodec=mpeg1video:vrc_buf_size=327:vrc_maxrate=512:vbitrate=256:vstrict=-1 -ofps 18 -vf scale=256:192

This produces an AVI with a working MPEG video stream, but it should be extracted into a raw format with ffmpeg, however, this is not required:

ffmpeg -i out.mpg -an -vcodec copy -f mpeg1video out.raw.mpg

Or, in more recent versions of mencoder you can just add the following option:

-of rawvideo

This makes MEncoder output raw video with no need to extract it later with ffmpeg.

External links

* [http://forum.gbadev.org/viewtopic.php?t=7897 Convert Moonshell Video under Linux (GBADev forums)]
* [http://moonbooks.net/ The Moon Books Project] Website dedicated to making classic literature and films available on the Nintendo DS
* [http://www.themanfromdelmonte.co.uk/nintendo-ds-videos/ Guide on how to install Moonshell and Convert your first Video]

References


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • NDs-mPeG — DPG es un formato contenedor de vídeo y audio diseñado específicamente para Nintendo DS. Su nombre proviene de la contracción de NDS MPEG. Contenido 1 Finalidad del formato 2 Presentación 3 Códecs de audio y vídeo …   Wikipedia Español

  • DPG — may refer to The Diplomatic Protection Group is a branch of the London Metropolitan Police. The Deutsche Physikalische Gesellschaft German Physical Society. A name for Tha Dogg Pound a gangsta rap group (Dogg Pound Gangstaz). The D.P.G. Recordz… …   Wikipedia

  • DPG — (initiales de nDs mPeG[1]) est un format vidéo pour Nintendo DS. L encodage en DPG se fait par des logiciels comme DPGencoder, BatchDPG ou bien encore le logiciel de conversion universel SUPER Seul les homebrews Moonshell et GB Alpha (présents… …   Wikipédia en Français

  • OTAU TV — Отрасль: Спутниковое телерадиовещание Текущий владелец: АО Казтелерадио Страна происхождения …   Википедия

  • Digital video recorder — Foxtel iQ, a combined digital video recorder and satellite receiver. V+, a combined digital vid …   Wikipedia

  • Common Interface — Various components of Conditional Access Common Interfa …   Wikipedia

  • List of file formats — This is an incomplete list, which may never be able to satisfy particular standards for completeness. You can help by expanding it with reliably sourced entries. See also: List of file formats (alphabetical) This is a list of file formats… …   Wikipedia

  • Pirate decryption — most often refers to the reception of compromised pay TV or pay radio signals without authorization from the original broadcaster. The term pirate in this case is used in the sense of copyright infringement and has little or nothing to do with… …   Wikipedia

  • HD Radio — HD Radio, which originally stood for Hybrid Digital , is the trademark for iBiquity s in band on channel (IBOC) digital radio technology used by AM and FM radio stations to transmit audio and data via a digital signal in conjunction with their… …   Wikipedia

  • Common Interface — Verschiedene mögliche Realisierungen Common Interface Modul vor …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”