rigaya / QSVEnc

QSVによる高速エンコードの性能実験
http://rigaya34589.blog135.fc2.com/blog-category-10.html
Other
313 stars 28 forks source link

conversion fails when subtitle WebVTT is inside MKV #117

Closed nanigoyou closed 1 month ago

nanigoyou commented 1 year ago

The conversion of a mkv-file fails if subtitles in specific format is muxed: WebVTT (Netflix)

Mediainfo says: Format : S_TEXT/WEBVTT Codec-ID : S_TEXT/WEBVTT

Outputfile is size of zero bytes

手伝って下さい。

rigaya commented 1 year ago

I'm not sure of WebVTT subtitles, are there a sample input file out I can test?

Or would you provide the full log which runs into error?

nanigoyou commented 1 year ago

Thank you for looking into this issue.

Here is a Sample of a Subtitle Die.Fuchsjagt.zip

Here is errorlog debug level. (Similar error happens also when I try transcoding on another machine using Intel Arcs AV1.) log.txt

Mediainfo Mediainfo.zip

This is the errormessage: grafik

rigaya commented 1 year ago

Thank you for the sample and the log!

I'll check if this can be fixed.

rigaya commented 1 year ago

I checked further, and it seems like the libavformat demuxer (which QSVEnc uses) does not support webvtt (S_TEXT/WEBVTT) in mkv, and therefore unfortunately this problem cannot be avoided.

Below are the details.

WebVTT in mkv is stored as codec id "S_TEXT/WEBVTT" (below).

image

However, libavformat demuxer does not support "S_TEXT/WEBVTT", but supports "D_WEBVTT/SUBTITLES". This mismatch is cause of the problem. https://github.com/FFmpeg/FFmpeg/blob/n5.1.1/libavformat/matroska.c#L68

This looks like a known issue for libavformat, but not yet proceeded. https://trac.ffmpeg.org/ticket/5641

I might be able to make it avoid error, but will be difficult to be able to copy webVTT subs, as libavformat seems to not support it as I described previously.

rigaya commented 1 year ago

QSVEnc 7.35 should be able to avoid this error.

Please note that QSVEnc 7.35 simply ignores WebVTT subtitles; WebVTT subtitles will not be copied, due to the reason mentioned in the previous conversation.

nanigoyou commented 1 year ago

Thank you for you effords. I hope as soon libav corrects the issue it will automatically imported in QSVEnc. :-)

rigaya commented 1 month ago

I'll close this issue, as workaround is already applied to QSVEnc.