Homebrew Homebrew app [Release] Video player for 3DS

Zeninari

Well-Known Member
Newcomer
Joined
Apr 24, 2021
Messages
45
Trophies
0
Age
20
XP
126
Country
United States
Just Wanted To Thank You Core_2_Extreme For What You Have Done. The Tagged Mp3 Playback May Have Been A Lucky Coincidence, And Because Of That You Helped Fix It As Well (even though you technically didn't have to)

But Yes I Do Thank You For Fixing The Bugs That Came With Playing Tagged Mp3 Even Though It's Supposed To Be A Mp4 Player ^^' (keep in mind you are technically the first person to build a player that can read the mp3's album art)

Also, One Quick Question If You Will, i can't figure out what the heck is wrong with the album art, i have tried understanding but it just eludes me. learned that it cant read png's (that's fine) basically i can't figure out how to change the pixel format for an image. is it even possible? trust me i have been trying to figure out a way to fix it to no avail so i'm guessing it's not possible. ;-;

on second thought don't worry about the question. i'll just stop trying i don't want to break my 3ds further by trying to figure this out. it's not worth it.

Well, Either Way, This Is The Best Mp4 Player For 3ds And Luckily The Best Tagged Mp3 Album Art Reader XD
(good luck with the hidden code :-D )
 
Last edited by Zeninari,
  • Like
Reactions: Core_2_Extreme

Core_2_Extreme

Well-Known Member
OP
Member
Joined
Feb 11, 2019
Messages
153
Trophies
0
Age
22
XP
1,163
Country
Japan
Just Wanted To Thank You Core_2_Extreme For What You Have Done. The Tagged Mp3 Playback May Have Been A Lucky Coincidence, And Because Of That You Helped Fix It As Well (even though you technically didn't have to)

But Yes I Do Thank You For Fixing The Bugs That Came With Playing Tagged Mp3 Even Though It's Supposed To Be A Mp4 Player ^^' (keep in mind you are technically the first person to build a player that can read the mp3's album art)

Also, One Quick Question If You Will, i can't figure out what the heck is wrong with the album art, i have tried understanding but it just eludes me. learned that it cant read png's (that's fine) basically i can't figure out how to change the pixel format for an image. is it even possible? trust me i have been trying to figure out a way to fix it to no avail so i'm guessing it's not possible. ;-;

on second thought don't worry about the question. i'll just stop trying i don't want to break my 3ds further by trying to figure this out. it's not worth it.

Well, Either Way, This Is The Best Mp4 Player For 3ds And Luckily The Best Tagged Mp3 Album Art Reader XD
(good luck with the hidden code :-D )
You can convert pixel format to yuvj420p (supported by video player for 3ds) by this command :
ffmpeg -i {input} -acodec copy -vcodec mjpeg -pix_fmt yuvj420p {output}
 
  • Like
Reactions: Zeninari

Core_2_Extreme

Well-Known Member
OP
Member
Joined
Feb 11, 2019
Messages
153
Trophies
0
Age
22
XP
1,163
Country
Japan
It seems that 3D video of H.264 / 240p won't be playing normally, the player hangs in few seconds.

I use New 3DS and patched Luma3DS CFW.
There is no guarantee, but if you turn off hardware decoder, it may work.
(Press Y button -> select second tab -> tap on the "Use hardware decoder")
 

Core_2_Extreme

Well-Known Member
OP
Member
Joined
Feb 11, 2019
Messages
153
Trophies
0
Age
22
XP
1,163
Country
Japan
Did you ever figure out whether it's possible to make MVD_Services decode B-frames properly, or whether Nintendo chose not to support B-frames on purpose?
There is a good news, I confirmed that MVD_Services DOES output every frames even a video contains B-frames, BUT in a strange way.

Usually I call these 2 functions for hardware decoding :
C:
mvdstdProcessVideoFrame();
mvdstdRenderVideoFrame();
Because of function name, I thought that I need to use mvdstdProcessVideoFrame() to process video then call mvdstdRenderVideoFrame() to get a video frame but it wasn't.

Actually, If videos do NOT contain b-frames, it always :
(let's say I'm playing a video that shows "0" then "1" then "2" then "3" then "4"... on the screen)
mvdstdProcessVideoFrame() will process video and write output to the buffer. (frame that shows "0")
mvdstdRenderVideoFrame() does nothing (at least won't write anything to the output buffer)
call it again, then mvdstdRenderVideoFrame() does nothing (at least won't write anything to the output buffer)
(so only 1 output)

and if videos DO contain b-frames,
(let's say I'm playing a video that shows "0" then "1" then "2" then "3" then "4"... on the screen)
case 1 (same as without b-frames videos)
mvdstdProcessVideoFrame() will process video and write output to the buffer. (frame that shows "0")
mvdstdRenderVideoFrame() does nothing (at least won't write anything to the output buffer)
call it again, then mvdstdRenderVideoFrame() does nothing (at least won't write anything to the output buffer)
(so only 1 output)

case 2
mvdstdProcessVideoFrame() will process video (only processing, no outputs).
mvdstdRenderVideoFrame() will write output to the buffer (frame that shows "0")
call it again, then mvdstdRenderVideoFrame() does nothing (at least won't write anything to the output buffer)
(so only 1 output)

case 3
mvdstdProcessVideoFrame() will process video (only processing, no outputs).
mvdstdRenderVideoFrame() does nothing (at least won't write anything to the output buffer)
call it again, then mvdstdRenderVideoFrame() does nothing (at least won't write anything to the output buffer)
(so no outputs at all)

case 4
mvdstdProcessVideoFrame() will process video (only processing, no outputs).
mvdstdRenderVideoFrame() will write output to the buffer (frame that shows "0")
call it again, then mvdstdRenderVideoFrame() will write output to the buffer (frame that shows "1")
(so more than 1 outputs)

case 5
mvdstdProcessVideoFrame() will process video and write output to the buffer. (frame that shows "0")
mvdstdRenderVideoFrame() will write output to the buffer (frame that shows "1")
call it again, then mvdstdRenderVideoFrame() will write output to the buffer (frame that shows "2")
(so more than 1 outputs)

About case 4 and case 5, it seems completely random that how many frames are written.
Maybe related to max B-frames in encoding settings?
But in the same video, sometimes it writes 3 frames but sometimes 2 frames.
(so maybe 2 frames, 3 frames or even 5 frames, no prediction is available)

Finally, the big problem is, no matter it wrote a frame to the buffer or not, mvdstdProcessVideoFrame() WILL return
MVD_STATUS_FRAMEREADY(0x17003) and no matter it wrote a frame to the buffer or not, mvdstdRenderVideoFrame() WILL return MVD_STATUS_OK(0x17000) or MVD_STATUS_BUSY(0x17002).

Edit :
So if I play a video that shows "0" then "1" then "2" then "3" then "4"... on the screen, which contains B-frames :
and let's say "case 2 -> case 3 -> case 4" happen, (let's say case 4 writes 2 frames)
then you'll see "0" -> "0" -> "2" on the screen.
 
Last edited by Core_2_Extreme,
  • Like
Reactions: AleronIves

AleronIves

Well-Known Member
Member
Joined
Nov 17, 2016
Messages
460
Trophies
0
Age
36
Location
California
XP
2,242
Country
United States
How strange! It seems like this might be related to the number of consecutive B-frames... or maybe the B-pyramid? Blu-ray has restrictions on how B-frames are used. You're supposed to use only 2 consecutive B-frames, and the B-pyramid must be a strict hierarchy.

Code:
-b, --bframes <integer>     Number of B-frames between I and P [3]
 --b-adapt <integer>     Adaptive B-frame decision method [1]
                                  Higher values may lower threading efficiency.
                                  - 0: Disabled
                                  - 1: Fast
                                  - 2: Optimal (slow with high --bframes)
      --b-pyramid <string>    Keep some B-frames as references [normal]
                                  - none: Disabled
                                  - strict: Strictly hierarchical pyramid
                                  - normal: Non-strict (not Blu-ray compatible)
--bluray-compat         Enable compatibility hacks for Blu-ray support
Maybe setting the B-pyramid to none would help? This should prevent B-frames from being used as references. It's not efficient to actually encode videos with this option, but it might help you debug what is wrong with MVD_Services if you disable B-frames as references, and then the buggy behaviour changes.

The default x264 settings are not Blu-ray compatible, because most H.264 decoders do not have these restrictions. It seems like MVD_Services is not happy with "normal" H.264 videos, though.
 
  • Like
Reactions: Core_2_Extreme

Core_2_Extreme

Well-Known Member
OP
Member
Joined
Feb 11, 2019
Messages
153
Trophies
0
Age
22
XP
1,163
Country
Japan
How strange! It seems like this might be related to the number of consecutive B-frames... or maybe the B-pyramid? Blu-ray has restrictions on how B-frames are used. You're supposed to use only 2 consecutive B-frames, and the B-pyramid must be a strict hierarchy.

Code:
-b, --bframes <integer>     Number of B-frames between I and P [3]
 --b-adapt <integer>     Adaptive B-frame decision method [1]
                                  Higher values may lower threading efficiency.
                                  - 0: Disabled
                                  - 1: Fast
                                  - 2: Optimal (slow with high --bframes)
      --b-pyramid <string>    Keep some B-frames as references [normal]
                                  - none: Disabled
                                  - strict: Strictly hierarchical pyramid
                                  - normal: Non-strict (not Blu-ray compatible)
--bluray-compat         Enable compatibility hacks for Blu-ray support
Maybe setting the B-pyramid to none would help? This should prevent B-frames from being used as references. It's not efficient to actually encode videos with this option, but it might help you debug what is wrong with MVD_Services if you disable B-frames as references, and then the buggy behaviour changes.

The default x264 settings are not Blu-ray compatible, because most H.264 decoders do not have these restrictions. It seems like MVD_Services is not happy with "normal" H.264 videos, though.

Thank you for your information, I'll continue investigating it.
I think I finally managed to handle videos that contain B-frames, but there may be videos that may not be played smoothly so can you test if it works on your videos?

3dsx
cia
 
  • Like
Reactions: AleronIves

AleronIves

Well-Known Member
Member
Joined
Nov 17, 2016
Messages
460
Trophies
0
Age
36
Location
California
XP
2,242
Country
United States
I normally use the CIA version, but I thought I would try the 3DSX version for testing. I created a Video_player directory inside /3ds/ and ran the 3DSX file with the Homebrew Launcher, but when I try to play my test video with B-frames (848x480@24 H.264), I see:

Code:
Error ffmpeg returned NOT success
Error avcodec_find_decoder() failed
Place Vid/Decode thread
Error code 0xFFFFFFFA

The test videos I encoded specifically for the 3DS play fine (800x240@24 H.264, no B-frames for MVD_Services; 400x240@24 XviD for O3DS software decoding), so either the 480p file is too big for this version of the video player, or it's a problem with your new B-frame code. I think it's the B-frame code, because this video plays on old versions of the video player. The video is just choppy with hardware decoding enabled, because of the B-frames.
 
  • Like
Reactions: Core_2_Extreme

Core_2_Extreme

Well-Known Member
OP
Member
Joined
Feb 11, 2019
Messages
153
Trophies
0
Age
22
XP
1,163
Country
Japan
I normally use the CIA version, but I thought I would try the 3DSX version for testing. I created a Video_player directory inside /3ds/ and ran the 3DSX file with the Homebrew Launcher, but when I try to play my test video with B-frames (848x480@24 H.264), I see:

Code:
Error ffmpeg returned NOT success
Error avcodec_find_decoder() failed
Place Vid/Decode thread
Error code 0xFFFFFFFA

The test videos I encoded specifically for the 3DS play fine (800x240@24 H.264, no B-frames for MVD_Services; 400x240@24 XviD for O3DS software decoding), so either the 480p file is too big for this version of the video player, or it's a problem with your new B-frame code. I think it's the B-frame code, because this video plays on old versions of the video player. The video is just choppy with hardware decoding enabled, because of the B-frames.
Some people report avcodec_find_decoder() failed error but I still can't reproduce it.
I usually use .3dsx file for debugging because I don't have to install it via FBI so it's faster than .cia, but I have never seen that error.
So can you tell me the exact command line or send the files here?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    cearp @ cearp: Welcome hazbeans