[MPlayer-dev-eng] MEncoder: libass support (patch)

Nicolas George nicolas.george at normalesup.org
Thu Nov 1 14:30:59 CET 2007


Hi.

I would like to try and push this patch.

Le jour du Labour, an CCXV, Reimar Döffinger a écrit :
> If the code is very similar to the MPlayer one, please try putting it in
> an extra function in mpcommon.c.

As far as I can see, the only similar code is add_subtitles. There is not
much that can be unified.

> In which way? That seems like a bug to me and would be better fixed
> properly (at least it should be attempted).

There is no bug here. What Joel does is just avoid adding the
expand-by-nothing-and-add-OSD filter, since it is redundant with the ass
filter.

An explicit expand filter on the command line works properly.

> At least that add_subtitles function looks like you could just move it
> into mpcommon.c instead of copying it.

The functions are very similar, but they can not be easily unified, since
the one in mplayer works with a multi-file playlist, and the one in mencoder
with a single file. I really do not see a correct way to unify them.

> That is the part that could cause severe issues in the past I think.
> Maybe enable it only with -ass? Or depending on -correct-pts?

I think I understand the problem. The pts value sent to filter_video is the
value from the source frame. But if the source timestamps are bogus or we
are changing the framerate, then it is not the correct output pts, and the
result will be detected as "badly interleaved".

Furthermore, this only applies if the output encoder takes the pts into
account. For example, lavc does, and I get the "badly interleaved" message,
but XviD does not, and I do not get it.

Adding a filter that drops the pts after the ass filter can also be a way to
fix things: -vf ass,tile=1:1, for examples, avoids the message.

One last thing: with DVD content, which has a lot of bogus timestamps, the
source pts is not suitable to add subtitles. For example, with the sample I
have near at hand, the timestamps go back to 0 at each part of the movie,
and the subtitles do the same.

May I suggest the following:

  - I re-submit the patch, updated to current SVN, with a condition for the
    pts problem, and a warning "ASS with mencoder can cause badly
    interleaved files".

  - I submit a "fixpts" video filter to allow pts transformations.

  - I submit a patch to adapt the warning to the fixpts filter.

What about it?

Regards,

-- 
  Nicolas George



More information about the MPlayer-dev-eng mailing list