Homebrew MPEG4 Player for DS and DSi

chachun

Member
Newcomer
Joined
Jan 31, 2021
Messages
22
Trophies
0
Age
25
XP
77
Country
Germany
this is the correct download site:
https://ffmpeg.org/download.html

dont use others, just the official ffmpeg one

also, can you show the command you use to convert


ffmpeg -i %1 -f mp4 -vf "fps=24000/1001, colorspace=space=ycgco:Primaries=bt709:trc=bt709:range=pc:iprimaries=bt709:iall=bt709, scale=256:144" -dst_range 1 -color_range 2 -vcodec mpeg4 -profile:v 0 -level 8 -q:v 2 -maxrate 500k -acodec aac -ar 32k -b:a 64000 -ac 1 -slices 1 -g 50 %2

(if you're using Windows 10, type it as ./ffmpeg. %1 and %2 are the input and output file names)

Also, I'm not sure which of the versions on the ffmpeg site I should get
 

mive

Well-Known Member
Member
Joined
Jul 19, 2018
Messages
252
Trophies
0
Age
41
XP
608
Country
Germany
  • Like
Reactions: banjo2

chachun

Member
Newcomer
Joined
Jan 31, 2021
Messages
22
Trophies
0
Age
25
XP
77
Country
Germany
t
use this one:
https://github.com/GyanD/codexffmpe...1-01-26/ffmpeg-4.3.1-2021-01-26-full_build.7z

if it still doesn't work you could try:
1. reduce video quality (raise q:v value, e.g. try 4)
2. reduce maxrate (try 450k or 400k)
3. not sure but maybe also worth to try, use constant bitrate instead of variable one (use b:v rate, e.g b:v 450k instead of maxrate and q:v)
thanks, ill try this out

--------------------- MERGED ---------------------------

use this one:
https://github.com/GyanD/codexffmpe...1-01-26/ffmpeg-4.3.1-2021-01-26-full_build.7z

if it still doesn't work you could try:
1. reduce video quality (raise q:v value, e.g. try 4)
2. reduce maxrate (try 450k or 400k)
3. not sure but maybe also worth to try, use constant bitrate instead of variable one (use b:v rate, e.g b:v 450k instead of maxrate and q:v)
This worked! thanks!
 

jeffyTheHomebrewer

Neato Burrito!
Member
Joined
Aug 24, 2018
Messages
1,649
Trophies
1
Location
his house!
Website
catboybeebop.neocities.org
XP
3,756
Country
United States
You need to code it to do so.
However, reading from NitroFS would still require SD or DLDI access.
But what if the rom were loaded through HaxxStation? Would SD/DLDI still be needed?
(also on a scale of -10 (very very easy) to 10 (extremely hard) how difficult would it be to code it that way?)
 

RocketRobz

Stylish TWiLight Hero
Developer
Joined
Oct 1, 2010
Messages
16,943
Trophies
3
Age
25
XP
21,838
Country
United States

Jevil_DS

Active Member
Newcomer
Joined
Oct 26, 2020
Messages
36
Trophies
0
Age
25
XP
111
Country
United States
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:
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
Recommend settings for DSi:
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.
When converting the video "BFDI 1a" to work on my DSi using the method shown, the audio was there, but the video was a blue screen, what did I do wrong?

EDIT: When going later into the video, I saw glitched visuals and noticed repeating chunks of audio.

EDIT2: I found a reply by RocketRobz on how another converting method that worked, thanks rob :)
 
Last edited by Jevil_DS,

AoShiroSan

New Member
Newbie
Joined
May 30, 2021
Messages
2
Trophies
0
Age
23
XP
37
Country
Czech Republic
Hi im just wanted to try it but im still getting errors.Can someone help me with this big problem?

(sorry im from Czech republic so english isnt my main language)
 

T3hFridg3

Member
Newcomer
Joined
Jun 5, 2021
Messages
23
Trophies
0
Age
24
XP
244
Country
Poland
Hi! Just for fun i made an app that is user friendly for converting the normal mp4 files to these that Gericom`s player can understand.
It is just an assistant that makes converting easier.
BUT STILL!!! you need an FFMPEG to make the converting segment to work!
If i have some grammar problems, that is i am polish.
 

Attachments

  • MPEG4 DS Assistant.7z
    70.5 KB · Views: 183

Firexploit

Well-Known Member
Newcomer
Joined
Nov 7, 2018
Messages
77
Trophies
0
Location
NintendoSDK
XP
1,128
Country
Germany
Hi! Just for fun i made an app that is user friendly for converting the normal mp4 files to these that Gericom`s player can understand.
It is just an assistant that makes converting easier.
BUT STILL!!! you need an FFMPEG to make the converting segment to work!
If i have some grammar problems, that is i am polish.
Sadly it doesnt work. I get an error message: "This program was made with an unlicensed compiler. Please buy PRO version to distribute your EXE"

--------------------- MERGED ---------------------------

asadaf.png
 
  • Like
Reactions: jeffyTheHomebrewer

T3hFridg3

Member
Newcomer
Joined
Jun 5, 2021
Messages
23
Trophies
0
Age
24
XP
244
Country
Poland
I made a new version now with another compiler
does it work?

--------------------- MERGED ---------------------------

I made a new version now with another compiler
does it work?
not that file :|

ok now it is correct
yea it is working now i tested this on my main pc
bcs i coded this on my old one
 

Attachments

  • MPEG4 DS Assistant.7z
    41.9 KB · Views: 333
Last edited by T3hFridg3,

T3hFridg3

Member
Newcomer
Joined
Jun 5, 2021
Messages
23
Trophies
0
Age
24
XP
244
Country
Poland
Update:
I made a github page so everyone can lookup through the code, and build the exe. Well maybe not build but it is still something.
/JustScratchCoder/MPEG-4-DS-Assistant/tree/main
just add at the beginning: h t t p s: / / g i t h u b . c o m
just get rid of spaces
 
  • Like
Reactions: jeffyTheHomebrewer

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://youtu.be/XNhoUyYbq8s?si=Z9vWWnlSaprgEzAT