Giter Club home page Giter Club logo

video_player_for_3ds's Introduction

Video player for 3DS

GitHub all releases GitHub commits since latest release (by SemVer) GitHub commit activity

Index

Screenshots

With multiple audio tracks support

With subtitles

With night mode

And many more...

Features

Hardware accelerated decoding(*0)✅
Hardware accelerated color conversion✅
Multiple video codec support ✅
Multiple audio codec support ✅
Multiple Subtitle support ✅
Seek ✅
3D video(*1)✅
Zoom in/out video ✅
Move video ✅
File explorer ✅ Fullscreen mode ✅

⚠️ *0 New 3DS and New 2DS only
⚠️ *1 New 3DS and 3DS only, software decoder only, in order to see 3D video as 3D
you need to enable 3D mode in settings(settings->LCD->Screen mode->3D)

Prepare videos

If you are advanced user, see Recommended resolution and Benchmark for performance then use commandline in the Prepare videos (advanced users).

If not, you can use these tools :

Prepare videos (advanced users)

  • Download ffmpeg
    • For NEW3DS and NEW2DS type :
    • ffmpeg -i {input_file_name} -acodec aac -vcodec libx264 -s 800x240 -preset medium -crf 25 {output_file_name}
    • For OLD3DS and OLD2DS type :
    • ffmpeg -i {input_file_name} -acodec aac -vcodec mpeg4 -s 400x240 -crf 25 {output_file_name}
  • Copy generated video files to your 3DS (anywhere on your SD card)

Replace {input_file_name} with your input file name and {output_file_name} with your output file name.
e.g. : ffmpeg -i original_video.mp4 -acodec aac -vcodec libx264 -s 800x240 -preset medium -crf 25 converted_video.mp4

for 3D video, referer this : How to convert your 3d video for 3DS (by T0biasCZe)

Controls

  • In normal mode
    • A : Play/Pause
    • B : Stop
    • Y : Open settings menu
    • X : Select a file
    • R : Zoom in
    • L : Zoom out
    • CPAD : Move a video and/or subtitle
    • DPAD ←→ : Seek
    • DPAD ↑↓ : Change screen brightness
    • START : Back to main menu
    • SELECT : Enter fullscreen mode
    • Touch on the bar : Seek
  • In fullscreen mode
    • A : Play/Pause
    • DPAD ←→ : Seek
    • DPAD ↑↓ : Change screen brightness
    • SELECT : Exit fullscreen mode

Supported languages

  • English
  • Japanese/日本語
  • Hungarian/Magyar (translated by vargaviktor)
  • Simplified Chinese/简体中文 (translated by LITTOMA)
  • Italian/Italiano (translated by dixy52-beep)
  • Spanish/Español (translated by Cookiee)
  • Romanian/Română (translated by Tescu48)
  • Polish/Polski (translated by JustScratchCoder)
  • Ryukyuan/琉球諸語 (translated by kuragehimekurara1)

Supported codecs

Supported video codecs

  • AV1
  • H.261
  • H.262
  • H.263
  • H.263+
  • H.264 (AVC, MPEG4 part10)
  • H.265 (HEVC)
  • Motion jpeg
  • MPEG1video
  • MPEG2video
  • MPEG4 (MPEG4 part2)

Supported audio codecs

  • aac (Advanced audio coding)
  • ac3
  • mp1 (MPEG audio layer 1)
  • mp2 (MPEG audio layer 2)
  • mp3 (MPEG audio layer 3)
  • ogg (Vorbis)
  • opus
  • pcm audio

Supported subtitle codecs

  • movtext
  • subrip
  • subviewer (No style support)

Supported containers (extensions)

  • aac
  • ac3
  • avi
  • mkv
  • mp1
  • mp2
  • mp3
  • mp4
  • mov
  • ogg
  • wav

Links

Discord channel
GBAtemp thread

Build

You need :

If you want to build .cia, then you also need :

  • bannertool and makerom (Copy them in your path e.g. in {devkitPro_install_dir}\tools\bin).

If you already have devkitpro, type {devkitPro_install_dir}\devkitARM\bin\arm-none-eabi-gcc -v.
You should see something like :

.....
.....
.....
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.0 (devkitARM release 62)

Make sure you have release 62.
(later version may work but sometimes later version has incompatibility)
If you have older devkitpro, update it or compilation will fail.

  • Clone this repository
    • On windows run build.bat
    • On other system, type make (make -j for faster build)

Recommended resolution

On NEW 3(2)DS, it is recommended to use patched Luma3DS for better performance.

Videos that in this resolution will be played without any problems in most of the situations.

Recommended resolution mpeg1video mpeg2video H263+ H264 H265
OLD3DS Software decoding 400x240@30 400x240@30 400x240@24 256x144@24 256x144@10
NEW3DS Software decoding 800x240@30 800x240@30 800x240@30 800x240@30 800x240@20
NEW3DS Hardware decoding none none none 800x240@60 none

Videos that in this resolution may be played without problems if video is not moving a lot.

Maximum resolution mpeg1video mpeg2video H263+ H264 H265
OLD3DS Software decoding 800x240@24 800x240@24 800x240@20 400x240@15 256x144@20
NEW3DS Software decoding 800x480@30 800x480@30 800x480@30 800x480@24 800x240@30
NEW3DS Hardware decoding none none none 1280x720@20 none

Note : Video resolution that exceeds screen resolution (400x240 on OLD2DS, 800x240 on OLD3DS, NEW2DS and NEW3DS) has little visible effect.

Benchmark

⚠️ Decoding speed depends on encoder option, video type, video scene, etc...

Original video file : Big Buck Bunny
The test videos were generated with following commands :
mjpeg : ffmpeg -i {input_file} -acodec copy -vcodec mjpeg -s {width}x{height} -q:v 5 -t 03:00 {output_file}
mpeg1video : ffmpeg -i {input_file} -acodec copy -vcodec mpeg1video -s {width}x{height} -q:v 5 -t 03:00 {output_file}
mpeg2video : ffmpeg -i {input_file} -acodec copy -vcodec mpeg2video -s {width}x{height} -q:v 5 -t 03:00 {output_file}
mpeg4 : ffmpeg -i {input_file} -acodec copy -vcodec mpeg4 -s {width}x{height} -q:v 5 -t 03:00 {output_file}
h263p : ffmpeg -i {input_file} -acodec copy -vcodec h263p -s {width}x{height} -q:v 5 -t 03:00 {output_file}
h264 : ffmpeg -i {input_file} -acodec copy -vcodec libx264 -s {width}x{height} -crf 25 -t 03:00 {output_file}
h265 : ffmpeg -i {input_file} -acodec copy -vcodec libx265 -s {width}x{height} -crf 30 -t 03:00 {output_file}
av1 : ffmpeg -i {input_file} -acodec copy -vcodec libsvtav1 -s {width}x{height} -crf 40 -row-mt 1 -cpu-used 5 -t 03:00 {output_file}

NEW3DS : new3ds_decoding_speed

OLD3DS : old3ds_decoding_speed

Patch note

v1.5.3

Changes
Audio files more than 2ch (e.g. 2.1ch) has been supported.
Many pixel formats have been supported, however, YUV420P is recommended for performance reason.
Ryukyuan(琉球諸語) translation has been added (by kuragehimekurara1).
Auto mode for top screen mode has been added, when this is enabled (settings -> LCD -> screen mode -> auto) you can just use 3d slider to change between 3D <-> 800px mode.
Simplified Chinese(简体中文) translation has been updated.

Fixed bugs
Many problems with seek function including backward seeking has been fixed.
Problem that it won't enter sleep mode in some case has been fixed.
Problem that h263p video is not played correctly in some resolution has been fixed.

v1.5.2

Changes
Ignore unsupported codec so that you can play supported codec only.
(e.g. You can now play videos that contain unsupported subtitles/audio)

Fixed bugs
Hardware decoder won't play videos that contain B-frames smoothly has been fixed.
(It means you don't have to care about B-frames when encoding to H.264 videos)

v1.5.1

Changes
Screen update frequency in audio only files have been increased.
Performance has been improved by adding DMA.
Video playback is automatically paused when runs out of buffer.
(You can change threshold by changing 'Restart playback threshold' settings)
Seeking speed has been improved.
Disallow sleep when only headset is connected.
(allow sleep if headset is disconnected during playback)
App directory has been changed from "sdmc:/Video_player/" to "sdmc:/3ds/Video_player/".
(App will automatically move folder)
Simplified Chinese(简体中文) translation has been updated.
Enabled 'correct aspect ratio option' by default.

Fixed bugs
Crashes in hw decoder in some videos have been fixed.
Automatically enter full screen mode even file explorer is opened has been fixed.
App will freeze if you seek after EOF has been fixed.
Unable to pause/resume in tagged mp3 has been fixed.
Video position won't be saved in some cases have been fixed.
Glitch on video in full screen mode has been fixed.
Some directories can't be entered have been fixed.
Some videos won't be played at correct speed has been fixed.
Frame desync in some 3D videos have been fixed.

v1.5.0

Subtitles have been supported. (*0)
Disable video, audio and subtitle have been added.
Audio desync has been fixed.
AV1 videos have been supported.
The problem some video won't play smoothly in sw decoder has been fixed.
Screen brightness adjustment function has been added (DPAD "↑" and "↓").
*0 No style support, only plain text
Other minor changes.

v1.4.2

Unexpected touch in Nintendo's home menu has been fixed
Multi-threaded decoding stability has been fixed and it is enabled by default
Seeking stability has been fixed
Repeat, in order, random playback mode have been added
Other minor changes.

v1.4.1

The "FSUSER_OpenFile() failed" error has been fixed.
Adjusted font and button size in settings menu.
Multi-threaded decoding is disabled by default because it has stability problem.
Polish(Polski) translation has been added (by JustScratchCoder).
Other minor changes.

v1.4.0

Decoded image(raw) buffer has been added and it makes playback.
much much much much better (especially on OLD3DS) Spanish(español) translation has been added (by Cookiee).
Romanian(Română) translation has been added (by Tescu48).
Other minor changes.

v1.3.3

'aspect ratio 10:3 mode' has been changed to 'correct aspect ratio mode' (follow sar value(*0)).
Color conversion speed has been improved.
Simplified Chinese(简体中文) translation has been added (by LITTOMA).
Italian(italiano) translation has been added (by dixy52-beep).
*0 if video size is 800x240 and no sar value is set, it autmatically apply sar 1:2.
Other minor changes.

v1.3.2

Added aspect ratio 10:3 mode (for 800x240 videos).
Added disable resize and move video mode.
Added remember video pos mode (resume from that pos next time).
Other minor changes.

v1.3.1

Volume adjustment has been added (from 0% to 999%).
Direction pad seeking has been added (from 1 second to 99 seconds).
Hungarian(magyar) translation has been added (by vargaviktor).
Other minor changes.

v1.3.0

The video that has more than one audio tracks has been supported (Press Y key-> select audio track to select track).
Multi-threaded decoding has been supported (Press Y key-> use multi-threaded decoding to toggle).
Hardware decoder has been merged (Press Y key-> use hw decoder to toggle).
Full screen mode has been supported (Press select key to toggle).
Other minor changes.

v1.2.0

Hardware decoding won't work in .cia has been fixed.
Hardware decoding won't work in some resolution has been fixed.
Added hardware color conversion for software decoder.
Added 3D video support(software decoder only).
Other minor changes and optimization.

v1.1.1

Video will not be decoded correctly in hardware decoder has been fixed.

v1.1.0

Added hardware decoder (β).

v1.0.1

Added allow skip frames option.

v1.0.0

Initial release.

License

This software is licensed as GNU General Public License v3.0.

Third party libraries are licensed as :

Library License
Base64 No specific license name
citro2d zlib License
citro3d zlib License
curl No specific license name
dav1d BSD 2-Clause
ffmpeg GNU General Public License v2.0
libctru zlib License
mbedtls Apache License 2.0
mp3lame GNU Lesser General Public License v2.0
stb_image Public Domain
x264 GNU General Public License v2.0
zlib zlib License

Credits

  • Core 2 Extreme
  • dixy52-beep (icon, banner, in app texture, Italian translation)
  • windows-server-2003 (bug fix)
  • vargaviktor (Hungarian translation)
  • HIDE810 (bug fix)
  • LITTOMA (Simplified chinese translation)
  • Cookiee (Spanish translation)
  • Tescu48 (Romanian translation)
  • JustScratchCoder (Polish translation)
  • T0biasCZe (Nintendo Video Convertor)
  • kuragehimekurara1 (Ryukyuan translation)

Donation

If you find my app helpful, buy me a cup of coffee.

  • BTC : bc1qch33qdce5hwxte0pm8pn0a6qqnartg2ujklhhc
  • LTC : MKTD3U2vCMi7S7Jb1EQ2FiS4AdHC23PxJh

video_player_for_3ds's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

video_player_for_3ds's Issues

800px mode

Since this apparently supports videos around 800px horizontally, it would be great if this has 800px mode implemented, in order to achieve a high image quality.

Failure when decoding a video containing B-frame.

Current implementation repeats reading a single frame and trying to decode it alone, but decoding a B-frame requires some frames after it.
As a result, avcodec_receive_frame() returns AVERROR(EAGAIN) (refer to https://ffmpeg.org/doxygen/3.4/group__lavc__decoding.html#ga11e6542c4e66d3028668788a1a74217c).
The actual behavior of the app is a complete freeze. This might be another issue because I think it is better to show an error message and stop playing.
If you download a random youtube video with youtube-dl -f 160 [link], it probably contains B-frames, so you can test with it.

I will work on this issue and open a PR if that's not a problem for you.

Full Screen mode?

Hi, this is a great app!

Just a couple of suggestions:

  1. Would it be possible to toggle the top bar to have a full screen experience?
  2. Would it be possible to turn off or make black the bottom screen while the video is playing? Then touching it or pressing a button would bring it back?

Thanks and keep up the good work!

Cannot play long videos

The video player works fine with videos that aren't too long, but there's one that I downloaded which is 51 minuets, and it can't open it and it gives me an error in message which is provided in the attachment. is there any way to fix this?
2022_02_03_22_51_35.txt

Brightness Set to 100

When I open the app, The brightness (luminance) sets to 100. I don't know if this is a bug or a feature, but it is pretty annoying since I like my screen brightness at 16

Support VP9 video codec

VP9 is the predecessor of AV1. It is used for a lot of videos on the web, and is YouTube's main codec.

Hardware Decoder data copy spikes desyncs the video?

Hi,

I know the hardware decoder is in beta. It does seem it is able to provide better and accurate colors like better blacks and overall details. The problem is that the audio/video is not synched and every few seconds, the graph from the Y button reports a spike that causes the video to sync/desync/skip frame? Not really sure how to describe it. This issue does not happen on the software decoder.

Right now my solution is to encode videos to 240p and use the software decoder which plays it smoothly. However, the hardware decoder seem to do a better job at handling colors but with this tiny issue.

Not sure how easy it is to fix it, but wanted to let you know.

This is the command line I'm using to encode my videos using ffmpeg:

ffmpeg -c:v h264_cuvid -i {h264_input_video} -c:v h264_nvenc -preset slow -c:a libfdk_aac -b:v 1M -b:a 256K -ac 2 -vf scale=-1:240 {h264_output_video}

Frame desync in 3D videos

I found the file to the video, but when i click a on it it tells me

Error Out of linear memory
Description:

Place:
Vid\Decode Thread
Error code:
0xfffffffd

Cannot Scroll through file explorer.

When i installed the newest update, when wanting to play a video, i could not scroll through the files, there was only the (move to parent directory) (dir), by clicking this option, there was only Unknown directories.

Here`s a video of the error:
https://youtu.be/UnuujgYw8sE

EDIT:
when looking in the logs it says:
[Expl/Read dir thread] Util_file_read_dir()...[Error]Out of memory. 0xfffffffe

request for aditions to the screen record feature

The title really explains it but it would be nice if the screen record feature could record the screen after the application is closed and then whenever you go back into it you can end the recording and then send it to something like a laptop for editing and posting to something like YouTube. Would this be possible? I was thinking something like NTR CFW does...

Screen record

Is the ScreenRecording will be working soon ? Thx in Advance.

Screen capture doesn't work at all

The screen capture feature doesn't work at all. It crashes upon pressing either of the 3 options. I might be unaware that it doesn't do anything and is probably an experimental feature.

Brightness control using d-pad?

Hi, just wondering if there's a chance we could control the screen brightness by using some key like the d-pad up/down when in full screen mode. It would be wonderful instead of going to the settings to adjust it.

Thanks a lot for this homebrew!!

error when building

/bin/sh: -c: line 1: syntax error near unexpected token (' /bin/sh: -c: line 1: mkdir -p (1)/Video_player_for_3DS-main/build'
make: *** [Makefile:232: (1)/Video_player_for_3DS-main/build] Error 2
Press any key to rebuild.

keep stopping and going😐

the software keep saying processing while the video is playing. And while it´s playing it´s keep stopping an going and it is annoying. so can some one find the problem and try to fix it probably try to get a better update

Some directories cannot be entered

I'm leaving for a trip in a few hours so I copied over a bunch of stuff to watch using the Windows robocopy tool and for some reason the app won't enter the directory

It just says

Summary: FFMPEG returned NOT success

Description: av_format_open_input() failed. -2

Place: Vid/Decode thread

Error code: 0xfffffffa

Version is 1.5.0 and I'm using Windows 10 if that matters

Support unsplitted 3D videos

it would be handy to just allow people to play SBS video without having to do the splitting first. even if you can only have files under 4GB, it should be permitted

Does not work on Citra emulator

I tried the homebrew on Citra (3DS emulator) and it only got me a black screen.
I wonder if you can make a Citra-optimised version on your program or if Citra developers need to patch it up for your homebrew to function?

Video: Seeking issues if MKV container is used

ffmpeg -i {input} -c:v h264_nvenc -preset slow -c:a libfdk_aac -b:a 256K -af "volume=4" -bf 0 -g 48 -ac 2 {output.mkv}

The above command line will work. Seeking via the touch screen actually works and is way faster than when the container is .mp4.

The real issue here is that using the D-Pad doesn't work correctly. Going back actually goes forward and it seems to jump to a farther point as the video progresses. It only seems to work at the very first minutes of a video file.

The seeking issue doesn't happen on .mp4 files produced with the same command line but of course, changing the output container to .mp4.

Exception when playing video

Alright, so i took an H265 10bit anime episode and transcoded it so that it would be easier to play back by my O3DS XL.

ffmpeg -i episode.mkv -c:v scale=400:240, libx264 -preset placebo -t 20 output1.mp4
(scale to 400x240, use H264 preset placebo and only include the first 20 seconds)

But when i try to play it back, the application throws an exception and the console crashes.

(had to zip the dump because github doesnt like .dmp files)
crash_dump_00000023.zip

the video
output1.zip

Audio: No audio on surround tracks

ffmpeg -i {input} -c:v h264_nvenc -preset slow -c:a libfdk_aac -b:a 256K -af "volume=4" -bf 0 -g 48 -ac 2 {output}

At lease using ffmpeg, by default it will encode all audio channels unless the -ac 2 argument is passed to encode the audio as a stereo track. If I forget to use it, the resulting video file will play without audio.

Not sure if it's a bug or if the player expects it to be a stereo track, in which case, please ignore this. Just posting about this finding.

Player freezes after playing 3 seconds of H.264 or H.265 MP4 video

I used ffmpeg to convert video to a suitable format that I thought would run well on the 3ds but first I did not get any audio and second the entire player froze after 3 seconds of playback and would not respond. This issue could be reproduced by restarting the 3ds and selecting the same mp4 file again.

ffmpeg commands used (in this order):

ffmpeg -i "$HOME/Video/BigBuckBunny720p30.mp4" -profile:v baseline -preset fast -vf scale=120:72 -vcodec libx264 -vcodec libx264 -crf 24 -acodec aac -b:a 64K "/tmp/tmp-bbb.mp4"

ffmpeg -i "/tmp/tmp-bbb.mp4" -filter:v fps=15 "/mnt/3DS/Video_player/bbb.mp4"

can't read .mpg /.vob file

i get an error when i try to play an mpg file i took from a dvd, mpeg2 and ac3 audio codec should be supported, mpeg4/xvid files work fine
i'm using old 3ds

Screen recording

There is no way to screen record anything outside the video player for 3ds app

Bottom screen blackout

When you tap on the bottom screen to reactivate a menu or to jump seek via the UI slider the screen does not go away again and stays lit. It would be nice if it timed out or had a button that could make it go away so you don't have it interfering with the video.

Backlight turns off on 2DS

When playing a video in full screen, the bottom backlight turns off. This is fine on all models except for the 2DS which only has one backlight. Doing this on the 2ds just makes the screen completely black except under very bright light.
A simple fix is to detect 2ds hardware and not turn off the backlight in such cases

Screen Recording does not work

whenever I go to the screen recording tab and choose any of the 3 options(with the LCD setting set from 800px to none) it crashes my New 3DS XL entirely. Luma bluescreen with the error Data Abort(
20210801_210155 1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.