Lately I've been working to make a spinoff from my YoutubeDS project from a couple of years ago, to make it into a useable video player. After a lot of bugfixes and improvements I've managed to get pretty nice results. Mainly on DSi it works very well. It plays mpeg4 video and aac audio in a mp4 container. Note that the code is pretty shitty as it is a modified version of youtube ds. This project might be incorporated in some general purpose media player for ds(i) at some point, but concrete plans have not been made yet. The code can be build with the latest version of devkitpro.
How to convert
Use a recent version of ffmpeg. The player plays 176x144 stretched to widescreen with a little filtering and 256x144. Instead of the normal YUV color space, YCoCg is used because it is faster to convert to rgb. Ignore any warnings you get about it. On a pc the colors will look wrong, but it's fine in the player.
Recommend settings for DS:
Recommend settings for DSi:
In both cases replace %1 with your input video and %2 with your output video. Higher bitrates and such may work, depending on the video. Supported framerates are 23.976 fps and 29.97 fps, although on ds 23.976 will likely give the best results. Other framerates are not properly supported, as currently the rate is not completely correctly read from the mp4 container. It also seems that the bitstream changes a bit with some rates, which make the decoding fail. If your input video doesn't have the right rate, add fps=24000/1001, before colorspace in the commands above. Note that with long videos audio issues may appear after playing for a while. This is related to the precision of the audio timers on arm7. I still have to adjust the video rate so that it matches the amount of increase/decrease in audio rate to fix that (something smaller than 1%, won't be noticable).
Pressing B while playing a video will return to the file browser.
Github: https://github.com/Gericom/YoutubeDS/tree/mpeg4player
Special thanks to @Pk11 for helping with testing and adding the file browser.
How to convert
Use a recent version of ffmpeg. The player plays 176x144 stretched to widescreen with a little filtering and 256x144. Instead of the normal YUV color space, YCoCg is used because it is faster to convert to rgb. Ignore any warnings you get about it. On a pc the colors will look wrong, but it's fine in the player.
Recommend settings for DS:
Code:
ffmpeg -i %1 -f mp4 -s 176x144 -vf "colorspace=space=ycgco:primaries=bt709:trc=bt709:range=pc:iprimaries=bt709:iall=bt709" -dst_range 1 -color_range 2 -vcodec mpeg4 -profile:v 0 -level 8 -b:v 350000 -acodec aac -ar 22050 -b:a 64000 -ac 1 -slices 1 -g 50 %2
Code:
ffmpeg -i %1 -f mp4 -s 256x144 -vf "colorspace=space=ycgco:primaries=bt709:trc=bt709:range=pc:iprimaries=bt709:iall=bt709" -dst_range 1 -color_range 2 -vcodec mpeg4 -profile:v 0 -level 8 -b:v 500000 -acodec aac -ar 32000 -b:a 128000 -ac 1 -slices 1 -g 50 %2
In both cases replace %1 with your input video and %2 with your output video. Higher bitrates and such may work, depending on the video. Supported framerates are 23.976 fps and 29.97 fps, although on ds 23.976 will likely give the best results. Other framerates are not properly supported, as currently the rate is not completely correctly read from the mp4 container. It also seems that the bitstream changes a bit with some rates, which make the decoding fail. If your input video doesn't have the right rate, add fps=24000/1001, before colorspace in the commands above. Note that with long videos audio issues may appear after playing for a while. This is related to the precision of the audio timers on arm7. I still have to adjust the video rate so that it matches the amount of increase/decrease in audio rate to fix that (something smaller than 1%, won't be noticable).
Pressing B while playing a video will return to the file browser.
Github: https://github.com/Gericom/YoutubeDS/tree/mpeg4player
Special thanks to @Pk11 for helping with testing and adding the file browser.