Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error opening files for processing in Linux #20

Open
GuerreroNinja opened this issue Jan 26, 2025 · 10 comments
Open

Error opening files for processing in Linux #20

GuerreroNinja opened this issue Jan 26, 2025 · 10 comments
Labels
bug Something isn't working

Comments

@GuerreroNinja
Copy link

GuerreroNinja commented Jan 26, 2025

I get an error when I try to open MKV files for changing the default subtitles. This error seems a bit random, sometimes it shows when opening the files through the file selector (and I can't process them), sometimes it shows after I process the files (and it works as intended) and sometimes it just works without issues. Seems it is somewhat related to the content of the MKV file.

OS: Manjaro Linux Kernel 6.12.4-1
X11 KDE Plasma 6.2.4
Qt Version: 6.8.1

Framework: .NET 8.0.2
RuntimeIdentifier: linux-x64
OS: Manjaro Linux

No mkv file info.

NEbml.Core.EbmlDataFormatException: I/O error occurred.
at NEbml.Core.EbmlReader.ReadVarInt(Int32 maxLength)
at NEbml.Core.EbmlReader.ReadElement()
at NEbml.Core.EbmlReader.ReadNext()
at MatroskaLib.MatroskaReader._ReadSeekHead(EbmlReader reader, FileStream fileStream, List`1 seekList)
at MatroskaLib.MatroskaReader.ReadMkvFiles(String[] filePaths)
at MatroskaLib.MkvFilesContainer..ctor(String[] filePaths)
at MkvDefaultTrackChanger.MainForm.LoadFiles()
at MkvDefaultTrackChanger.MainForm.BtnBrowseFilesClick(Object sender, EventArgs e)

@GuerreroNinja
Copy link
Author

Ok, after checking further, seems MKVDefaultTrackChanger changes something in MKV and subsequent tries to open the same MKV result in that error. The first time may work, but subsequent tries does not.

@GuerreroNinja
Copy link
Author

GuerreroNinja commented Jan 26, 2025

UPDATE: Seems MKVDefaultTrackChanger breaks the MKV header, as MKVToolNix crashes when I edit & save the header. However, after the edit, the header is fixed and MKVDefaultTrackChanger open it without error. Then it breaks the MKV header again. It may be my system, a library perhaps.

@MikeMoolenaar
Copy link
Owner

MikeMoolenaar commented Jan 26, 2025

I'm also on Linux so it's probably a bug in my code haha. Could you share me the link to the mkv file or the file itself via Email if you feel comfortable doing so? My email is in my Github profile.

@GuerreroNinja
Copy link
Author

GuerreroNinja commented Jan 27, 2025

I tried today some other MKV and this time had no errors, so seems it is related to some MKV. The ones that failed are pretty big, so I may need to upload to some cloud service to share them with you. Please let me check some more, may I find one that is easily shareable.

@GuerreroNinja
Copy link
Author

Ok, found a smaller one that also fails. You can download it from this link:

https://www.dropbox.com/scl/fi/eo71zy436u36aw4omsjd7/mkv_fail_testing.mkv?rlkey=v3nc8kpq0qfa9hn3ib094s27i&st=kaq9ytoq&dl=0

@MikeMoolenaar
Copy link
Owner

Thanks, I've downloaded it and you can remove the link now. Just to be clear, you already ran it trough MkvDefaultTrackChanger right?
Hopefuly I can get a fix out this weekend.

@MikeMoolenaar MikeMoolenaar added the bug Something isn't working label Jan 27, 2025
@GuerreroNinja
Copy link
Author

GuerreroNinja commented Jan 27, 2025

This is the original file before I run MkvDefaultTrackChanger. If I try to open it, the program throws and error and does not open. Can you please test it on your side?

UPDATE: Definitely, there is something wrong with that MKV (or my system). If I edit its header with MkvToolNix, it crash when I hit save option (but anyways save succesfully).

@MikeMoolenaar
Copy link
Owner

Ah I see, it also errors for me. It seems like the MKV file is not completely valid. Programs like VLC and MPV can work around those errors, my program can't yet :). I'll look into it.

@GuerreroNinja
Copy link
Author

GuerreroNinja commented Jan 27, 2025

Just edited my comment. Yes, seems the MKV has something wrong. Editing the header with MkvToolNix seems to fix it somehow, but it crashes the program also. I have a bunch of those pesky MKV, so I think they are bad formatted or something. Your code seems OK then, it is a problem with the MKV files.

@GuerreroNinja
Copy link
Author

Ok, I tested some more MKV files (mostly anime episodes) and they tool worked flawlessly in most of them. Sometimes, after changing the MKV header, the program crash but it saves it right. So far, MkvDefaultTrackChanger is helping me a lot with my collection. Thank you for this great tool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants