Mpv: SDH filter not working on Mac

Created on 27 Nov 2019  Â·  12Comments  Â·  Source: mpv-player/mpv

mpv version and platform

0.30.0, MacOS

Reproduction steps

Added 'sub-filter-sdh=yes' to config file, played video with captions.

Expected behavior

SDH labels removed from captions.

Actual behavior

Nothing removed. Harder variant also does not work.

Log file

output.txt

Sample files

subtitle

All 12 comments

that log is useless you are not loading a file. also a sample file would be helpful.

There was a commit some time ago that changed so same ass handling was done both for external as internal files. For external subtitles this changed the format of subtitle data.
The filer have to skip correct number of fields to work. And now the number of fields have changed. The code have to be fixed like this:
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -249,7 +249,7 @@ static void decode(struct sd *sd, struct demux_packet *packet)
for (int n = 0; r && r[n]; n++) {
char *ass_line = r[n];
if (sd->opts->sub_filter_SDH)
- ass_line = filter_SDH(sd, track->event_format, 0, ass_line, 0);
+ ass_line = filter_SDH(sd, track->event_format, 1, ass_line, 0);
if (ass_line)
ass_process_chunk(track, ass_line, strlen(ass_line),
llrint(sub_pts * 1000),

The SDH filter is also broken on Windows with the latest 0.30 builds.

Even where there is no content to filter, the option now messes with a lot of dialogue sequences by not enforcing line breaks after commas when two lines are displayed.

Subtitles lines like

If you ask me if I am trustworthy,
I am not.

are now displayed as

If you ask me if I am trustworthy,I am not.

I commented out lines in my config file until I poinpointed the culprit, which is indeed the sub-filter-sdh option.

Everything works fine with the 0.29 builds with the option activated.

@lalattefr Does the filter currently remove text enclosed in brackets* for you? See this comment, doesn't seem to work at all with at least SRT subtitles.

*e.g.

[PHONE RINGING]
[THUNDER]

@lalattefr Does the filter currently remove text enclosed in brackets* for you? See this comment, doesn't seem to work at all with at least SRT subtitles.

*e.g.

[PHONE RINGING]
[THUNDER]

Indeed, just tested with my 0.31 build on Windows and the HI subtitles are not filtered at all. I still have the [THUNDER] [PHONE RINGING] lines while adding sub-filter-sdh=yes in my conf file.

I've recently noticed that the filter does take out a slight few bracketed words.

On Jan 23, 2020, at 1:24 PM, lalattefr notifications@github.com wrote:

@lalattefr https://github.com/lalattefr Does the filter currently remove text enclosed in brackets* for you? See this comment https://github.com/mpv-player/mpv/issues/7378#issuecomment-577694609, doesn't seem to work at all with at least SRT subtitles.

*e.g.

[PHONE RINGING]
[THUNDER]

Indeed, just tested with my 0.31 build on Windows and the HI subtitles are not filtered at all. I still have the [THUNDER] [PHONE RINGING] lines.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/mpv-player/mpv/issues/7188?email_source=notifications&email_token=AHZF4UWNRW6S734OXCW532TQ7H4IRA5CNFSM4JR7Q4U2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJYXEUY#issuecomment-577860179, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHZF4UUDOUSFLD7LSPXBWUDQ7H4IRANCNFSM4JR7Q4UQ.

@BDF2500 Can you modify the issue title as both Mac and Windows have been verified to be affected? Additionally someone should test Linux.

I am affected on Linux.

If any of you compile the code you can try to change in sub/sd_ass.c
the line
ass_line = filter_SDH(sd, track->event_format, 0, ass_line, 0);

to
ass_line = filter_SDH(sd, track->event_format, 1, ass_line, 0);

This changes the number of commas skipped and is needed as a previous commit change the format of the lines for .srt (and other non ass subtitles).

@DanOscarsson would you mind making a PR?

most likely fixed with #7447. if it still persists let me know.

I wonder when a new build arrives, I don't think that I can compile.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sant527 picture sant527  Â·  4Comments

fitipe picture fitipe  Â·  3Comments

thebunnyrules picture thebunnyrules  Â·  3Comments

olivergondza picture olivergondza  Â·  3Comments

xanadupark picture xanadupark  Â·  3Comments