#132036 - simonjhall - Fri Jun 22, 2007 5:05 pm
Hi guys - I'm sure this has been asked a million times before, but what's the state of MPEG 1/2 video playback on the DS?
I know Moonshell can play back videos, but I seem to remember that they need to be converted first.
Y'see I've got a basic MPEG-2 player going on my machine and since it was pretty easy, if there wasn't an existing player for the DS...well, why not?
_________________
Big thanks to everyone who donated for Quake2
#132037 - chuckstudios - Fri Jun 22, 2007 5:18 pm
MoonShell and Max Media Player firmware are the only functioning programs which can play back MPEG1 video.
#132041 - sonny_jim - Fri Jun 22, 2007 6:11 pm
Doesn't the Max Media firmware just use a modified version of Moonshell?
#132044 - chuckstudios - Fri Jun 22, 2007 6:15 pm
Well, it plays them in a correct MPEG format, not two raw streams muxed with a weird header on top.
#132055 - oofrab - Fri Jun 22, 2007 8:22 pm
Seconded on the weird DPG format. In addition, extensions to the format seem to be shoehorned in the existing format.
A normal mpeg player would be nice. Which library did you have in mind for the decoding or do you intend to write you own? Also, is mpeg the best we can do on the DS?
#132056 - Masterofdarkness - Fri Jun 22, 2007 8:33 pm
Hey simon!
MightyMax did try to make dsmpeg but never fully succeeded.
http://mightymax.org/dsmpeg.html
dsmpeg plugin
Hi,
i have decided to give up uppon the mpeg player. Reason behind that step is the
time that i am missing to maintain this project too. Okok the extreme dirtyness
of the code did its part too :p
Anyways, the code can be found here.
Please note that it is a very dirty approach to play MPEG. Glued together from
different sources. (Don't hurt me)
I'd like to see someone who takes some of the ideas / continues the player.
#132058 - Lynx - Fri Jun 22, 2007 8:47 pm
Player worked fine without audio, if I remember correct.
_________________
NDS Homebrew Roms & Reviews
#132117 - simonjhall - Sat Jun 23, 2007 4:23 pm
I've been getting libmpeg2 to work as I'm too lazy to roll my own. It plays fine, but the framerate is a bit shit, and I don't really know what to do about it...normally I'd spit out some fancy vector code, but since neither processor has anything juicy to work with...yeah...
Yeah.
_________________
Big thanks to everyone who donated for Quake2
#132119 - kusma - Sat Jun 23, 2007 4:48 pm
how shit?
#132123 - simonjhall - Sat Jun 23, 2007 5:42 pm
I'm getting about 5fps playing a 1.5Mbps 352x288 video-only clip.
I've just run it through my profiler and it seems that there are several hard-hitters (but not what I'd expect).
- idct 'add' takes the most time by far
- next up is YUV -> 16bpp RGB (I think it's a table lookup)
- then there's something which goes through all the macroblocks and unpacks them (I think)
- and well lower than what I expected was the motion compensation!
Obviously the performance is lower when I'm profiling it.
Dig it,
Code: |
address calls ms ms/call ms/frame lowest stack highest stack function name
0x200dca4 5895027 32128.37 0.01 85.68 14432 14432 mpeg2_idct_add_c
0x2025030 6750 13647.33 2.02 36.39 14624 14624 rgb_c_16_420
0x2013ad0 931780 10723.79 0.01 28.6 14728 14728 mpeg2_slice
0x2018594 1003805 7170.48 0.01 19.12 14664 14664 motion_fr_frame_420
0x200eccc 1315290 6500.83 0.01 17.34 14480 14480 mpeg2_idct_copy_c
0x200fdf4 53621 4760.37 0.09 12.69 14616 14616 MC_put_xy_16_c
0x2013200 422739 4274.94 0.01 11.4 14664 14664 get_non_intra_block
0x2011348 203824 3808.14 0.02 10.16 14624 14648 MC_put_o_8_c
0x200f85c 23024 2526.4 0.11 6.74 14616 14616 MC_avg_xy_16_c
0x20106bc 30804 2270.48 0.07 6.06 14624 14624 MC_put_y_16_c
0x2011028 103108 2197.07 0.02 5.86 14624 14624 MC_avg_o_8_c
0x20114f0 29305 1920.36 0.07 5.12 14624 14648 MC_put_o_16_c
0x2010e38 21875 1640.71 0.08 4.38 14624 14624 MC_put_x_16_c
|
It's gonna be a bit of a pain to make faster as the entire thing is written in macros (think templates but in C).
edit: MC_* are the motion compensation functions
_________________
Big thanks to everyone who donated for Quake2
#132125 - tepples - Sat Jun 23, 2007 6:14 pm
Assembly language IDCT and YUV->RGB functions might help, as well as juggling what goes into ITCM.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#132255 - tondopie - Mon Jun 25, 2007 3:02 am
simonjhall wrote: |
I'm getting about 5fps playing a 1.5Mbps 352x288 video-only clip |
5 FPS?!! Thats better than my 633Mhz Gateway can do! You're getting there.
_________________
Development Blog: http://teendev.org
Homebrew Podcast: http://homebrewcast.net
Web Design: http://xtendesign.net
#132259 - DragonMinded - Mon Jun 25, 2007 3:54 am
What profiler do you use simon?
_________________
Enter the mind of the dragon.
http://dragonminded.blogspot.com
Seriously guys, how hard is it to simply TRY something yourself?
#132271 - simonjhall - Mon Jun 25, 2007 10:54 am
DragonMinded wrote: |
What profiler do you use simon? |
It's something I wrote for Quake - it allows you to instrument your ELF and once you're done running your code it dumps loads of stats to disk. You then parse the stats with a silly little perl tool and it pops out with this big ol' spreadsheet!
It's here: http://forum.gbadev.org/viewtopic.php?t=11985
I'm sure I uploaded the files for people to use...
Quote: |
5 FPS?!! Thats better than my 633Mhz Gateway can do! You're getting there. |
That can't be right! This is only MPEG-2 (not MPEG-4 or its variants, eg H.264) and the frame size is smaller than DVD. And your computer can play DVDs, right? :-)
If not, time for an upgrade! (make a donate link in your sig!)
_________________
Big thanks to everyone who donated for Quake2
#132322 - HyperHacker - Mon Jun 25, 2007 10:21 pm
He might be using a lousy player. I was annoyed when I found Windows Media (eww, I know) wouldn't play some videos I came across at a decent speed, and figured my computer was probably just too slow, but then I found VLC which played them just fine. :)
_________________
I'm a PSP hacker now, but I still <3 DS.
#132338 - tondopie - Tue Jun 26, 2007 1:28 am
that was my old comp. I use a 933MHz one now. Its fast!
#132548 - pas - Wed Jun 27, 2007 7:30 pm
That shall be fast ? Sorry but I have a 2,4 Ghz one and I find it to be too slow for me ;)
_________________
Starcraft DS ?
#139078 - calcprogrammer1 - Sat Sep 01, 2007 5:33 pm
I can play full motion MPEG2 at 640x480 reasonably well (action scenes lag) on my Celeron 500MHz using VLC in either Win2000 or Linux (Ubuntu)...but on my 850MHz laptop, they run great, and same with my 2. 13GHz AthlonXP desktop.
Sadly enough, there's no good MPEG-2 program for PDAs though, cause 640x480 MPEG-2 would probably be possible (and really good if it worked) on my 624MHz PocketPC with VGA screen.
MPEG-2 for DS would be great, though I'd be happy with a DS player for any "real" format...I'd like to use some real movie making software (like Pinnacle Studio or Sony Screenblast) to convert videos...and if you mean D3V by "Max Media Player Firmware" (Games n' Music uses D3V, and it uses the MMP converter), since when is D3V a real format, it played on my Ubuntu PC but not on any Windows machine (maybe it's a renamed file, Linux ignores extensions and judges files on their content).
_________________
DS Firmware 1, Datel Games n' Music card / Chism's FW hacked GBA MP v2 CF
There's no place like 127.0.0.1.
#139083 - pas - Sat Sep 01, 2007 6:42 pm
Yeah, like I said, a file that is natively supported by the DS and the PC would be great (MPEG with a resoulution of 192x256 would reach fully, even thought MPEG 2 would be better ^^ )
#139085 - tepples - Sat Sep 01, 2007 6:46 pm
calcprogrammer1 wrote: |
since when is D3V a real format, it played on my Ubuntu PC but not on any Windows machine (maybe it's a renamed file, Linux ignores extensions and judges files on their content). |
You could try to use file(1) to detect magic numbers identifying the container, such as the "RIFF" at the beginning of every media file using a WAV or AVI container.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#139129 - chuckstudios - Sun Sep 02, 2007 3:36 pm
calcprogrammer1 wrote: |
since when is D3V a real format, it played on my Ubuntu PC but not on any Windows machine (maybe it's a renamed file, Linux ignores extensions and judges files on their content). |
I don't believe I have the text file I made that listed the settings, but it's a proper MPEG with the same kind of video/audio specs as MoonShell.