-
Notifications
You must be signed in to change notification settings - Fork 1
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
Matroska : Auto-populate SeekHead when adding new children under Segment #5
Comments
I should have Seek elements working correctly by tomorrow. 👍 I have rewritten a lot of the library and added a Blazor EBML Editor demo. The library now uses (and includes) XML schema files: It can now add and CRC-32 values thanks to Crc32.NET |
Just figured it out. Apparently the value written to SeekPosition = SeekIDelement.Position - SeekHead.Size SeekIDelement.Position = SeekPosition + SeekHead.Size This helps. 👍 |
Awesome! Thanks a bunch for your efforts 🤝 I can't wait to try it 😀
A-ha! I've been focused on the definition of Segment Position and didn't realize SeekPosition followed another logic. Man, the Matroska format is one hell of a beast... |
Nice, you appear to have been on the right track and I was off last night with my conclusion. I was seeing a pattern but I mixed up the numbers (I mixed up SeekHead position and size.) Segment Position appears to be the answer. Here is a reference image using the Blazor EBML viewer I linked to. Red links SeekID and its target: 0x1549A966 (\Segment\Info) So the SeekID target's position is: 👍
lol I agree. |
First preview of the editor with automatic SeekHead updating is up. When using the Blazor Editor, if you open devtools with the current build, there is some debug output indicating when the library checks SeekHead and updates it. CRC auto updating is also implemented and logs to console. What app are you using to view .mka cover art? You can click an element's value cell to edit it. Binary types can be saved to a file and a file can be loaded into a binary element's value. I also added support for viewing images that are in binary elements. Just click on the binary element row and if the data is an image, it will try to show it in the right bottom preview pane. |
Okay, I just updated the Blazor editor. To demo:
You can then go into There are API settings to disable/enable auto-populate, crc auto update, etc. I will update the README with example code soon. |
First of all thanks a bunch for all the hard work 💪 I'm done merging your updates with mine, and am still in the process of rewriting what I've done client-side to adapt to v2 API changes. I'll get back to you soon regarding the two issues I posted. |
Right now, when adding brand new children under the
Segment
node (e.g. addingTags
orAttachments
to an untagged file), one needs to manually handle the creation of its index underSeekHead
.Problem is, when adding a new node from scratch, the client app has no idea what its position should be, as SpawnDev.EBML handles low-level I/O.
I can't find a proper way to get around it. My most recent attempt is as follows :
1- Add new
Segment
child node (e.g.Tags
)2- Add new
Seek
node underSeekHead
with itsSeekPosition
valued to TEMP_INT643- Save the file
4- Reopen it
5- Read the position of the node created at Step 1 using
BaseElement.Stream.Offset
6- Write that position on the
SeekPosition
node created at Step 2 instead of TEMP_INT64There are two issues with that method :
Wouldn't that case be a solid argument to apply this suggestion? 😁
The text was updated successfully, but these errors were encountered: