mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.16k stars 2.89k forks source link

mpv doesn't accept ASS scripts without a [Script Info] line #2846

Open bodayw opened 8 years ago

bodayw commented 8 years ago

As the title suggests, mpv won't load the ASS subtitle if it doesn't contain a [Script Info] line, not even when the user manually drag the file into the mpv window.

I recently came across some ASS scripts like that, in which the first few lines in the file - including the first line that says [Script Info] - are commented out by semicolons. Manually delete the semicolon in the first line solves the issue.

I know this is unlikely to be a bug on mpv's (or libass's) side, as one could argue that commenting out the first section-defining line makes the file an invalid ASS script after all. But I still decided to post this as an issue here because while these ASS subtitles have been on the web for quite a while and downloaded by thousands of people already, I haven't seen anyone complaining about this problem, so I assume those video players used by most people (like MPC-HC, PotPlayer, VLC etc.) can play those subtitles just fine. Maybe mpv should also tolerate those kind of ASS scripts just for compatibility's sake? What do you think?

(The info in those files say the script is generated by Aegisub, but I'm not sure whether Aegisub is the culprit here. It could well be that the files were edited in other text editors afterwards and the first line got accidentally commented out, and nobody noticed/thought this will actually be an issue...)

ghost commented 8 years ago

Affects the ffmpeg ass demuxer.

bodayw commented 8 years ago

Oops, didn't see there is already #2821. Now it does seem like a bug...

sdvcrx commented 8 years ago

See also #2506

ghost commented 8 years ago

Needs a sample file.

bodayw commented 8 years ago

OK. In this particular case, the beginning of the script (before [V4+ Styles])is like the following:

; [Script Info]
; Script generated by Aegisub 3.0.4
; http://www.aegisub.org/
; Title:PSYCHO-PASS #01_chs
; Original Script:TxxZ&A.I.R.nesSub
; 翻译:千草未萌 | 校对:Cute-Tina | 时间:朽木绯真 | 后期:村汉
============================================================
Synch Point:0
ScriptType:v4.00+
PlayResX:1280
PlayResY:720
Timer:100.0000

Removing the ; in the first line solves the issue.

ghost commented 8 years ago

I think we'd prefer a complete script, so we can determine what could be used for autodetection.

bodayw commented 8 years ago

There you go: https://dl.dropboxusercontent.com/u/3988935/%5BVCB-Studio%5DPSYCHO-PASS%5B01%5D%5BHi10p_1080p%5D%5Bx264_flac%5D.TxxZ%26A.I.R.nesSub.ass

astiob commented 5 years ago

Can the ASS demuxer be forced when handing over .ass and .ssa to FFmpeg? Or perhaps forced as a fallback after letting FFmpeg try and fail the regular autodetection mechanism.