Giter Site home page Giter Site logo

Wrong order of dialogues about libjass HOT 4 CLOSED

Dador avatar Dador commented on September 24, 2024
Wrong order of dialogues

from libjass.

Comments (4)

Arnavion avatar Arnavion commented on September 24, 2024

Yes, currently the renderer always appends new subs to the layer div, so new subs always appear in document order (i.e., below) existing subs.

Is it okay to just reverse this for the layer1-3 divs - use insert instead of append? Or is there something else to consider?

from libjass.

Dador avatar Dador commented on September 24, 2024

First dialogues ordered by "start time" (the earliest dialogue would be at the bottom).
If there are dialogues with the same "start time", then order by position in script (the dialogue that closest to beguining whould be at the bottom). Script to test that.

I don't think that thing with time important for common dialogues. But maybe it can be important for typesetting (for example when one dialogue "moves" another).
Time already half-considered in libjass (just by fact that we append dialogue on start time). Why half? If click "pause" and then "play" again (i.e. dialogues re-rendered?) subtitles re-ordered without considering time.

In other words, "just reverse" would help in most cases. What to do with time - it is your choise :)

from libjass.

Arnavion avatar Arnavion commented on September 24, 2024

Sorting by start time is technically not right. Eg: dialogue1 is from 2s to 7s and dialogue2 is from 1s to 5s. If seeking to 3s, then d1 should show before d2 (assuming \an2, d1 should be below d2). However if you play the video with vsfilter from 0s to 3s you will see it put d2 below d1, which is because of three reasons:

  • Since at 1s vsfilter already rendered d2, it will not move it at 2s when it has to render d1. Instead it will render d1 above it.
  • For the same reason, at 6s even though d2 is gone, d1 will remain floating in the air.
  • vsfilter caches a dialogue once it's rendered. So say you seek to 10s and then back to 6s, d1 will be rendered fresh but it will still be floating in mid-air.

An interesting outcome of the third point above is that you can make it give different results. If you close and reopen the video and seek directly to 6s, now vsfilter will render d1 at the bottom. Then if you seek back to 3s, now it will render d2 above d1. Then if you seek to 0s and play normally, at 1s it will render d2 in the air, since that's where it's cached it now.

I do understand that sorting by start time emulates the order vsfilter would've chosen if playing normally.

At any rate, not moving dialogues when the current set of visible subs changes is another thing libjass can't do, since it relies on the browser to position the sub divs.


Pausing and playing should not reorder the dialogues. They should still render in the same order as before pause. I'll investigate.

from libjass.

Arnavion avatar Arnavion commented on September 24, 2024

Oh right, it reorders on pause and play for a similar reason to vsfilter's caching - libjass doesn't re-render subs that are already displayed. So in normal playback the 4-* are already displayed, so the 5-* are appended below the 4-*. However on pause/play, all subs at the current time are re-rendered in script order, so 5-* are put first and 4-* appended below them.

from libjass.

Related Issues (20)

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.