Container: add Matroska (MKV) demuxer for existing supported codecs - #21
Conversation
Adds MKV container demuxing support for formats already supported by SMS (MPEG-4 Part 2 / Xvid, MPEG-1/2, AAC, MP3, AC3, DTS, Vorbis, FLAC, PCM, and UTF-8 subtitles). - Implements EBML parsing, track mapping, and lacing (Xiph, Fixed, EBML). - Supports keyframe seeking via Cues and multi-audio/subtitle OSD switching. - Gracefully ignores unsupported codecs (e.g. H.264/HEVC) without failing. - Registers .mkv in file/container tables and updates Makefile.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@Nathan-Nascimento-Mendes please do real hardware testing and report back. |
|
Good evening,
Sorry for the delay. I did an initial test before submitting the pull
request, but I needed a little more time to test it more thoroughly.
From what I understand, the code is able to read the contents of an MKV
file and, when it finds something it can handle, it lists the file. I
noticed that all the MKV files I found online use modern codecs, and when I
tried to play them with the program, only the audio would play.
I also tried creating a test MKV file using Xvid for the video and MP3 for
the audio, but the program froze when I attempted to play it.
Even if that had worked, however, it would still require more effort than
simply converting the video to AVI or MPEG-2, so I don't think this
contribution would be particularly useful in the end.
If you would still like to test it and try to understand what I may have
done wrong, I'll leave the pull request open for a few more hours so you
can take a look at the code. After that, I plan to close it.
Thank you for your time, and sorry that I wasn't able to contribute
something more useful to this work.
Em qui., 20 de ago. de 2026 às 02:49, NathanNeurotic (Ripto) <
***@***.***> escreveu:
… *NathanNeurotic* left a comment (NathanNeurotic/Simple-Media-System#21)
<#21 (comment)>
@Nathan-Nascimento-Mendes <https://github.com/Nathan-Nascimento-Mendes>
please do real hardware testing and report back.
As an avid AI user myself, I need some human testing verification.
Please report back, artifacts are here:
https://github.com/NathanNeurotic/Simple-Media-System/actions/runs/32332469723
https://github.com/NathanNeurotic/Simple-Media-System/actions/runs/32332469722
—
Reply to this email directly, view it on GitHub
<#21?email_source=notifications&email_token=A6OKRN7OUAM6BCSY3YRGWZL5K2GPHA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMZVGE4TANZQG4Z2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5351907073>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A6OKRN6V5TI5GLRSYRYZZFD5K2GPHAVCNFSNUABGKJSXA33TNF2G64TZHMYTENZZGE4DMNRXHE5US43TOVSTWNJRHE4TOMJYHA2TNILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/A6OKRN3CJIFHX3LMRWHX35D5K2GPHA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMZVGE4TANZQG4Z2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/A6OKRN3XPTRWGDAVGKTO7O35K2GPHA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMZVGE4TANZQG4Z2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
No problem at all! I appologize I figured the draft was a request hahaha |
Important
Author note: This PR was developed with AI assistance (DeepMind Antigravity) by a developer who does not normally work with C, embedded systems, or PS2 assembly. A thorough review, feedback, and verification from maintainers would be greatly appreciated!
Pull Request
Summary
Adds a native Matroska / MKV (
.mkv) container demuxer to Simple Media System (SMS)..mkvmedia files containing video, audio, and subtitle streams that SMS already natively supports.Type of Change
Related Issues
Related to #18
Scope
Technical Details
V_MPEG4/ISO/ASP,V_MPEG1,V_MPEG2,V_MS/VFW/FOURCC(via BITMAPINFOHEADER).A_AAC(extractingAudioSpecificConfigfromCodecPrivate),A_MPEG/L3,A_MPEG/L2,A_AC3,A_DTS,A_VORBIS,A_FLAC,A_PCM/INT/LIT,A_PCM/INT/BIG,A_MS/ACM.S_TEXT/UTF8,S_TEXT/ASCII.SimpleBlockandBlockGroupkeyframe detection, and unlaces No-lacing, Xiph, Fixed-size, and EBML laced frames.Cuesindex for binary-search seek to the nearest keyframe cluster.SMS_MAX_STREAMS = 8) with language tags for dynamic OSD switching.SMS_ContainerMKV.oand setEE_CFLAGSto-G4096to safely accommodate the GP-relative small data section.Testing
How it was tested:
tools/test_mkv_demuxer.py) covering VINT encoding/decoding, multi-track MKV demuxing, lacing unpacking, Cues seek, and corrupted file rejection.SMS.elfandSMS-packed.elf) using the officialps2dev/ps2dev:v1.0toolchain container.Breaking Changes
No breaking changes.
Security Considerations
Checklist
Additional Notes
Future work can expand on this foundation to support remote HTTP streaming (Part B of the SMS roadmap).