mpv icon indicating copy to clipboard operation
mpv copied to clipboard

select.lua: `select-subtitle-line` doesn't consider ordered chapters

Open norinoriko opened this issue 1 year ago • 3 comments
trafficstars

mpv Information

mpv v0.38.0-511-g42a4c306 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Jun 20 2024 12:13:10
libplacebo version: v7.349.0 (v7.349.0-rc1-2-gbc9de9c-dirty)
FFmpeg version: N-115881-g0ae157b36
FFmpeg library versions:
   libavutil       59.24.100
   libavcodec      61.8.100
   libavformat     61.3.104
   libswscale      8.2.100
   libavfilter     10.2.102
   libswresample   5.2.100

Other Information

  • Windows version: Windows 11 Version 10.0.22631.3737
  • GPU model, driver and version: AMD 24.5.1
  • Source of mpv: zhongfly
  • Introduced in version: N/A

Reproduction Steps

  1. Load matroska file with ordered chapters
  2. Input g-l
  3. Seek to any subtitle line after the ordered chapter

Expected Behavior

Subtitles and timestamp align

Actual Behavior

Subtitles and timestamp don't align

Log File

mpv.log

Sample Files

Can be provided if necessary. but ffmpeg doesn't support ordered chapters so it's hard to make small samples without mangling the files.

I carefully read all instruction and confirm that I did the following:

  • [X] I tested with the latest mpv version to validate that the issue is not already fixed.
  • [X] I provided all required information including system and mpv version.
  • [X] I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • [X] I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • [X] I attached the full, untruncated log file.
  • [X] I attached the backtrace in the case of a crash.

norinoriko avatar Jun 21 '24 16:06 norinoriko

select.lua just uses whatever timestamps ffmpeg returns so to fix this either ffmpeg needs to support ordered chapters or we need to implement subtitle extraction within mpv.

guidocella avatar Jun 21 '24 19:06 guidocella

The ticket for segmented .mkv support seems stalled in ffmpeg so RIP I suppose. https://trac.ffmpeg.org/ticket/3123

ghost avatar Jun 21 '24 19:06 ghost

or we need to implement subtitle extraction within mpv.

Yep, we need to do that at some point.

kasper93 avatar Jun 21 '24 19:06 kasper93

https://github.com/zenwarr/mpv-config/blob/master/scripts/subtitle-search.lua This script supports extracting subtitles embedded in mkv and also pulls from youtube videos then can search them once they're external subs.

mrfragger avatar Aug 31 '24 20:08 mrfragger

That script still uses ffmpeg for sub extraction.

ghost avatar Aug 31 '24 21:08 ghost