Neos-Metaverse / NeosPublic

A public issue/wiki only repository for the NeosVR project
197 stars 9 forks source link

[Feature] Add support for subtitles on videos #1260

Open StarfishHidari opened 3 years ago

StarfishHidari commented 3 years ago

It would be really nice to be able to use subtitles on videos in some way, potentially with subtitles included in video files or an external subtitle file?

Not going into specifics as I don't really know what would go into implementing this. There have been attempts to implement this through logix but it is typically quite heavy and can be difficult to set up quickly for each video.

TehTurk commented 3 years ago

I think the Video Containers might have to be reworked to support it 🤔 There are .srt and other subtitle files out there, but it also would come down to I'd think the support of the LibVLC whenever we'd get it swapped.

uyjulian commented 3 years ago

Shouldn't libvlc already support ass and srt subtitles?

libvlc_video_set_spu to select the subtitle track in the file

RoxyBoxxy commented 3 years ago

Up Vote

DovahDoVolom commented 3 years ago

Defiantly something id put my hat into to keep updated on this. Virtually all of my video files are mkv with multiple subtitle tracks and audio tracks to support different languages.

Frooxius commented 3 years ago

I've looked into this, but it seems that with the current UMP library there's no way to get the subtitles through the API unfortunately. We might need to wait until we upgrade to the official libVLCsharp.

Frooxius commented 3 years ago

We've added external subtitle import support in 2021.8.29.1240. Embedded subtitles aren't supported yet, as that requires more integration with the video playback, keeping this open for that now.

Enverex commented 3 years ago

This unfortunately doesn't work with my use-case. I'm swapping out video and image URLs with Logix. This doesn't work for the subtitles here because Neos appears to convert the subtitles to AnimX on manual import, there's no way of providing a SRT/SSA/ASS subtitle file as a URL to Neos and use this functionality which is what's needed for real dynamic functionality.

Frooxius commented 3 years ago

I could add a "DynamicSubtitleProvider" component for that purpose, that would do the conversion on the fly from a given aset URL.

Enverex commented 3 years ago

That would be perfect Froox, thank you.

Frooxius commented 3 years ago

That would be perfect Froox, thank you.

This has been added in 2021.9.1.665 now!

Enverex commented 3 years ago

DynamicSubtitleProvider doesn't appear to work properly. It doesn't seem to update when I replace the URL with a new one and just continues to serve content from the original URL instead, or nothing if I disconnect everything and reconnect it all. Nothing relevant appears to have been logged regarding this.

EDIT: Jeana noticed that resetting the Text field target (selected in the screenshot) seems to get it working again, at least until something breaks it again.

image

Frooxius commented 3 years ago

Should be fixed in 2021.9.3.1281 now.

StarfishHidari commented 3 years ago

Would it ever be possible to get support for subtitles in a livestream?

I'm not sure how subtitles are normally included with streams so I don't really know what the underlying technical aspects of it are, but it would be nice to be able to use that to encode information through a stream and parse it out in neos.

Also thanks a lot for adding subtitle support, it is very very appreciated.

Frooxius commented 3 years ago

That should be done implicitly with the support for embedded subtitles from the video player. VLC should decode any subtitles from a video stream if they're part of it.

And no problem, glad they help!

StarfishHidari commented 2 years ago

That should be done implicitly with the support for embedded subtitles from the video player. VLC should decode any subtitles from a video stream if they're part of it.

Sorry I think I may be a little confused on what your reply here meant, does this mean that it is currently possible, or that it can be made possible in the future?

towneh commented 2 years ago

Just add to this request, but still in scope of the original ask, please can you also provide EIA-608/CTA-708 support using libVLC for embedded closed captions found within the video stream data.

An example of this is the sample video found at https://sampleplatform.ccextractor.org/sample/4

in a static file in VLC you should be able to see it appear like this:-

image

STREAM TEST

Using https://github.com/ratwithacompiler/OBS-captions-plugin I am able to encode closed caption data in OBS on to an RTSP stream hosted on VRCDN, which then appears on VLC as a sub track option:-

image

image

towneh commented 2 years ago

Additionally this is also true for Twitch streams. More and more users are now using closed captions for including less able viewers. e.g. https://critrole.com/live-closed-captions-on-twitch/

image

image

ModernBalloonie commented 2 years ago

I would love youtube subtitle support. As someone who sometimes has trouble hearing, i would love to see this added in some way.