-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add a duration
field to Frame
#7
Comments
The duration is not a mandatory field in the EBML block (BlockDuration, 0x9B). Simple Blocks don't contain it at all. So documentation says this about how to extract the duration from the EBML document:
This would need to be implemented by taking the default duration of the track (already exposed), the "BlockDuration" of a block (not exposed) or the time difference between the current and next frame into account (already exposed). Not sure if this should be handled by the application or by the library though. PRs are welcome. |
I also need to get the BlockDuration for extract subtitles. I have take a look to how it can be implemented. It seems to me that this would be more appropriate to handle this in |
@gwen-lg I'm open to improvement to the duration extraction. What kind of API do you have in mind? |
Subtitle frame generaly need a duration. In this case, the Frame is placed in a Block grouped in a GroupBlock with a BlockDuration. This should fix issue hasenbanck#7 : [Add a duration field to Frame](hasenbanck#7)
Subtitle frame generaly need a duration. In this case, the Frame is placed in a Block grouped in a GroupBlock with a BlockDuration. Without break the laced frames management. This should fix issue hasenbanck#7 : [Add a duration field to Frame](hasenbanck#7)
Subtitle frame generaly need a duration. In this case, the Frame is placed in a Block grouped in a GroupBlock with a BlockDuration. Without break the laced frames management. This should fix issue hasenbanck#7 : [Add a duration field to Frame](hasenbanck#7)
Subtitle frame generally need a duration. In this case, the Frame is placed in a Block grouped in a GroupBlock with a BlockDuration. Without break the laced frames management. This should fix issue hasenbanck#7 : [Add a duration field to Frame](hasenbanck#7)
Subtitle frame generally need a duration. In this case, the Frame is placed in a Block grouped in a GroupBlock with a BlockDuration. Without break the laced frames management. This should fix issue hasenbanck#7 : [Add a duration field to Frame](hasenbanck#7)
@hasenbanck : finally I managed to add the feature while keeping the same API. You can review the proposal in the Darft PR : #16 |
Subtitle frame generally need a duration. In this case, the Frame is placed in a Block grouped in a GroupBlock with a BlockDuration. Without break the laced frames management. This should fix issue hasenbanck#7 : [Add a duration field to Frame](hasenbanck#7)
Subtitle frame generally need a duration. In this case, the Frame is placed in a Block grouped in a GroupBlock with a BlockDuration. Without break the laced frames management. This should fix issue hasenbanck#7 : [Add a duration field to Frame](hasenbanck#7)
Fixed by 57c94b1 |
The
Frame
struct only contains a timestamp without a duration. This is problematic if you'd want to e.g. demux ASS subtitles since the raw subtitles are mangled and muxed into the.mkv
without the timestamps.For example, this is a raw line from an external
.ass
sub:And if you'd mux that into an
.mkv
this is how it's going to look like:As you can see the timestamps are gone. The idea here is that you're supposed to recover them from the block timestamp + duration, as documented here.
For your reference, the
symphonia_format_mkv
crate does include the duration when demuxing.The text was updated successfully, but these errors were encountered: