FFMS / ffms2

An FFmpeg based source library and Avisynth/VapourSynth plugin for easy frame accurate access
Other
579 stars 105 forks source link

Subtitle Problem with 4:4:4 Chroma #284

Closed DaRealJacob closed 7 years ago

DaRealJacob commented 7 years ago

I'm almost sure this is a ffms2 problem because it works with later versions of ffms2 but not this version

tgoyne commented 7 years ago

What is the problem?

DaRealJacob commented 7 years ago

The problem is that video encoded in 4:4:4 chroma will encode but if subtitles (TextSub) is in the script the subtitles will not show. I've googled it over and over again trying to find out why the subs won't show and it said something about not being able to handle colorspaces so that's why subtitles won't show up.

DaRealJacob commented 7 years ago

I may be wrong tho. I'm just looking for a fix or atleast a reason why it'll work with video encoded in 4:4:2 but not full chroma

qyot27 commented 7 years ago

Let me guess what you're doing, since you've not said anything about which FFMS2 versions or AviSynth versions you're using:

1) You had been using AviSynth 2.5, or at least a version of the main FFMS2 C++ plugin that hadn't added support for 2.6's pixel formats. Thus, when it encountered 4:4:4, the plugin would downsample to 4:2:0 or 4:2:2/packed, since AviSynth 2.5 (nor the 2.5-only versions of FFMS2) supported 4:4:4 or planar 4:2:2.

2) You upgraded to a version of FFMS2 that supports 2.6's pixel formats (or the even newer version with support for Plus' high bit depth pixel formats). These versions leave 4:4:4 as-is, so this problem in VSFilter is being exposed. Instead of TextSub emitting an error message to AviSynth from VSFilter.dll, it just silently fails to draw subtitles on 4:4:4 inputs into the subtitle filter.

In other words, the bug is in TextSub, not FFMS2. The only way to avert it is to throw a ConvertToYV12/ConvertToYUV420 before the subtitle filter.

The real problem here is that you're using VSFilter/TextSub, and not a proper subtitling filter like AssRender­¹ (xy-VSFilter might be okay, since I think it's still actively developed, but the AviSynth plugin interface that provides TextSub itself may not have been updated with the rest of the code and the bug² would still exist).

¹Make sure to use the debuglevel parameter so you can see the Fontconfig caching process when running the script in avsmeter or mpv. It only has to cache the fonts the first time you run it (or more precisely, the first time after you install new fonts to the system), but if you have a lot of fonts installed, having no output could make you think the program's frozen even though it hasn't.

²Or a variation of it, if xy-VSFilter could do 8-bit 4:4:4 but not >8-bit 4:4:4 for avsplus and still silently fails rather than give off a showstopping error message to let you know something's gone south.

amayra commented 7 years ago

@qyot27 sadly xy-VSFilter is dying like many fork of guliverkli @DaRealJacob stop using TextSub this function is gone for good

myrsloik commented 7 years ago

Probably not a ffms2 bug