VLC Transcoding Freezes; Plays multiple subtitles

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
KiyoshiTeppei
Posts: 3
Joined: Mon Jan 01, 2024 10:48 pm

VLC Transcoding Freezes; Plays multiple subtitles

Post by KiyoshiTeppei »

Whenever playing a video encoded through VLC, it shows in UMS as if it's still playing under the status window, but about twenty minutes into most files the video and audio both freeze.

I've tried adjusting the TranscodedVideoFileSize in my VLCForDesktop conf, as adjusting that setting had once fixed some problems in the past where it would just stop as if the file ended and continue to the next one, but this is a new type of problem. See Log ending in 37.

Thanks for anyone who takes a look.

I've also noticed if an MKV has multiple subs, VLC will try to play all the sub files; I don't get this issue with other transcoders. Notably I have the number of live subs limited to one. This is in the secondary log (45), though it's easy enough to work around as it works with all other encoders. For the VLC-freezing one, I have a series of videos which only seems to work in VLC (and they only have one subtitle file). (MEncoder plays audio only on that. If I pause, I see the black screen with the correctly timed subtitles, but no picture, and as soon as I hit play, it ceases to show even the subtitles, playing only the audio. I don't think that's UMS related, I think that's just that only VLC can play that, but you all are the experts.)
Attachments
ums_dbg_2024-01-01-12-45.zip
(2.74 MiB) Downloaded 51 times
ums_dbg_2024-01-01-12-37.zip
(2.13 MiB) Downloaded 52 times
User avatar
mik_s
Moderator
Posts: 1130
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: VLC Transcoding Freezes; Plays multiple subtitles

Post by mik_s »

I see that VLC is detected correctly and determined that all your videos will be streamed, but I see when they are being played there are transcoded.
Are you playing from the #--TRANSCODE--# folder? VLC can play just about every format and handles subtitles itself so there is no need to transcode.

Another issue could be you are not using FFmpeg as a transcoding engine but the VLC one. UMS is better at working with FFmpeg engine over the older VLC engine and this is probably why it freezes.

The second issue of it playing all the subs do you mean that they all display on the screen at the same time? I have seen this mentioned before but no-one posted logs to track this bug down. Which video is this happening on in your logs so I can see if there is anything wrong.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
KiyoshiTeppei
Posts: 3
Joined: Mon Jan 01, 2024 10:48 pm

Re: VLC Transcoding Freezes; Plays multiple subtitles

Post by KiyoshiTeppei »

I had played from the Transcode folder since I had changed the default encoder so family could watch things. When repeating the tests for logs, I just went to the transcode folder to get the original issues to repeat, since they only happen when forcing encoding through VLC. Why not just use other encoders all the time? Because it seems *only* VLC can transcode at least two series of videos I have properly, with subtitles.

On the first one tested, "My Home Hero," only VLC will show any video, as described. Not encoding at all (as it's mkv) does not show video. Mencoder or no transcoding will play audio and, when paused, show the subtitles, but no video. FFmpeg would not work at all.


On the second, when looking for if this original problem had already been solved somewhere, I had read someone remark in another thread that VLC shows multiple subtitles if they're there, and thought: "I think I've seen that" and thought I'd see if I could recreate on a video I knew had multiple sub tracks. Lo and behold! -- I can make this into a separate thread if that will be useful to you as well.

I've made new logs in case it makes it more clear:

Attached are:
1. Playing the video that will not play unless forcefully transcoded. It plays audio only. If I pause, it shows the subtitles.
After that, even if i go to the transcode folder and try to force it to play via VLC, they will not. It just never starts, and kicks me back to the menu to select a video from the Transcode folder until I reset UMS. This is exactly what I did in 2.


2. I reset UMS, telling it to force transcode mkvs, with VLC as the first choice. It plays properly, until about twenty minutes in which is about when every 'normal' video I try to force transcode through VLC stops. This is true on episodes (themselves about 24 minutes total) and movies (it stopped right around the twenty minute mark).

I then also tried to run a video untranscoded which will not default the subtitles on, because they're undefined ("blank" rather than "undef" or "unk" or such). VLC notably will play these subtitles properly by default if run with that, though it will also freeze at 20 minutes in or so. This is another reason I'm inclined to use VLC force transcode if I can.

Not shown in the logs, but FYI: I tried another very low quality video much smaller that's about 24 minutes, less than 100 MB and it played through to the end on VLC. This lead me to try to change what it expects the file size to be in case it was cutting out early via TranscodedVideoFileSize--but neither TranscodedVideoFileSize = 900000000 nor TranscodedVideoFileSize = -1 fixes this freezing issue.

I suspect if I put a language tag in the undefined subtitles with MKVToolnix, it'll work like all the others do. And if I re-encode the video which only shows via VLC transcoding as a different video codec, it can play untranscoded without VLC. But it makes the file sizes larger and if possible I'd like to avoid having to do this for every video which VLC can otherwise handle without issue.




3. I reset UMS, leaving a force transcode with VLC as the first choice. I ran two videos which had multiple subtitles and see it indeed tries to run all subs actively. On the first, if the subs don't have exact overlap, it'll play whichever has the last 'call' to a subtitle line. On the first, you see the English flicker for a brief second before the French takes over. On the second (actually third; the first video pick just kinda blipped and went on to the next video instead, which only has one set of subs; I moved to episode 2 to get the overlapping sybs), the Engilsh subs are usually dominant, but sometimes we'll get a flicker of the Russian ones, particularly on signs or episode titles.

(Note: each log zip was larger than the maximum file size of 5mb and had another 11mb zip inside of it; I believe the meat of what is useful is outside of those, so I deleted them but I can re-run these tests and get those sub-zips back if useful.)
Attachments
ums_dbg_2024-01-02-10-15 - VLC Multiple Subs showing.zip
(2.75 MiB) Downloaded 49 times
ums_dbg_2024-01-02-10-11 - Force transcode and then no transcode no subs default.zip
(2.17 MiB) Downloaded 41 times
ums_dbg_2024-01-02-09-43 - Play without Transcode (attempt with a few times).zip
(587.52 KiB) Downloaded 37 times
User avatar
mik_s
Moderator
Posts: 1130
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: VLC Transcoding Freezes; Plays multiple subtitles

Post by mik_s »

VLC can play MKV files fine naively so they do not need to be transcoded. There may be a subtitle format not supported but it should just ignore that.
If there is one that you want it to transcode that has unsupported subtitles then it is better identify exactly what it is then alter the .conf file to tell UMS to always transcode that one.

Transcoding should be avoided when ever possible as it has its downsides like some devices can't seek and only able to have one subtitle burnt in to the video stream.

I checked your logs where you say you played with no transcoding but it is still transcoding using the VLC engine. Did you still play from within the #--TRANSCODE--# folder?
I discovered a bug wile testing v14 with playing subtitles from the #--TRANSCODE--# folder on my PS4, it was always picking the last subtitle stream in the video and not the option I was selecting. This may have existed in previous versions. I only noticed it as I was watching something that had a foreign language dialogue in one part but there were no subtitles, and when trying to forcing it to use the right one it would always appear in Turkish. I found that every option was using the same ID, even "no transcoding".

Try playing normally outside of the #--TRANSCODE--# folder so it is streamed and see if it works.
I looked at the mediainfo of "My Home Hero" and it uses ASS subtitle format which is very common so VLC will support it. Its listed as supported in the .conf

Code: Select all

SupportedInternalSubtitlesFormats = ASS,DIVX,DVBSUB,MICRODVD,SAMI,SUBRIP,TEXT,TX3G,USF,VOBSUB
Just because you are using VLC to play videos does not mean you should use the VLC transcoding engine. FFmpeg will work better in just about any situation. If other things don't work right on other renderers it may be because UMS is using the wrong conf file for it. I see a UN32H5203 Samsung TV which is newer than my F series and that works fine with FFmpeg if you don't want to seek. There is also warnings about the VLC engine in the logs, I don't know enough about it to know exactly what it means though.

Code: Select all

DEBUG 2024-01-02 09:42:11.476 [vlc.exe-24-2] [0000016e336d3620] main libvlc error: stale plugins cache: modified C:\Program Files\VideoLAN\VLC\plugins\access\libaccess_concat_plugin.dll
...

...
DEBUG 2024-01-02 09:42:11.627 [vlc.exe-24-2] [0000016e336d3620] main libvlc error: stale plugins cache: modified C:\Program Files\VideoLAN\VLC\plugins\visualization\libvisual_plugin.dll
DEBUG 2024-01-02 09:42:11.627 [vlc.exe-24-2] [0000016e339cdf70] dummy interface: using the dummy interface module...
DEBUG 2024-01-02 09:42:11.627 [vlc.exe-24-2] [0000016e3378beb0] idummy demux: command `quit'
DEBUG 2024-01-02 09:42:11.627 [vlc.exe-24-2] [0000016e3376d730] ps mux: Open
DEBUG 2024-01-02 09:42:11.627 [vlc.exe-24-2] [0000016e33794140] mjpeg demux error: cannot peek
DEBUG 2024-01-02 09:42:11.627 [vlc.exe-24-2] [0000016e3376d730] ps mux: Close
TRACE 2024-01-02 09:42:11.695 [vlc.exe-24] EOF

Another factor that could be causing problems is the network speed to the VLC renderer is low, it's 11mb/s. This might be fine for streaming depending on the bitrate of the video, and if not then could be why the picture is black as the data is not getting there in time. When transcoding UMS will limit the quality of the video to stay under this speed. How is your network configured? Is the computer you are using VLC on connected via wireless?

I don't see anything odd with the VLC transcoding command in the third logs, but I am not familiar with it. Which video had all the subs showing? I can't see when in the video it happens as that sort of thing is not included, and I filter the logs to just the important parts as it is too much to scan though. It would also be helpful if you posted a picture of this happening.

The format used in the videos are AV1 which I think needs more processing power to play. What is the specs of the computer running VLC?
Have you tried the web player? You will need FFmpeg for that though.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
KiyoshiTeppei
Posts: 3
Joined: Mon Jan 01, 2024 10:48 pm

Re: VLC Transcoding Freezes; Plays multiple subtitles

Post by KiyoshiTeppei »

I checked your logs where you say you played with no transcoding but it is still transcoding using the VLC engine. Did you still play from within the #--TRANSCODE--# folder?
The only ones that should be transcoded during the logs are
1. The chunk from 2024-01-02-10-15 -- This is to show this specific transcoder does play multiple subtitles at once/defaults to the 'lowest' one on the list. "Odd Taxi" and "Eizoken ni wa te wo dasu na" both played both sets of subs when transcoded. (When not transcoded, both play fine with only one sub track. The solution here is obviously 'don't transcode' but I thought I'd try to capture it happening as a point of interest.)

On Eizoken ni wa te wo dasu na, it shows the first sub in English for about a split second (too fast to easily capture) and then switches to French (track 2) which it continues to show throughout.

On Odd Taxi, it will first show the music note which is exclusively on the Japanese sub track (a closed caption track, which has a music note to denote to viewers a song is playing), and then the English subtitles for the song itself kick in (which is ONLY translated on the English track). But when the episode proper starts, it all goes to Russian (the last sub track by track number on the video). So I suspect it's doing what you'd said and playing the last subtitle stream, and I'm only seeing the other types (Japanese, English) when they don't have a Russian alternative at that timestamp. (And all the other language tracks would be empty during the opening, thus not showing).

2. Part from 2024-01-02-10-11 -- Attempting to play "Kids on the Slope" (Kids.on.the.Slope.S01E01.mkv) which has internal .ass subs with no language tag, which do not automatically play *unless* transcoded. They do automatically play if played through any encoder from the #--TRANSCODE--# folder. The solution here seems to be either 'transcode through something besides VLC' or 'go add a language or forced tag' since VLC transcoding will freeze about 20 minutes in, but still odd. I favored VLC because it's the only one I could get to play My Home Hero with video.

This leads us to...

2024-01-02-09-43 shows playing My Home Hero without transcoding, which has the blank video. I am positive I'm not playing from the Transcode folder here, and mkvs are not set to transcode by default or the like on this run. The computer the files/UMS are running off of may be a factor? It has 16GB Ram and an i7 processor which I think are decent, but it's not got its own video card or the like. This runs okay on VLC (kinda choppy picture) if forced to transcode but will always freeze around the 20 minute mark.

The computer running UMS and transcoding the videos is attached through ethernet, but the devices it's streaming to (VLC on a Firestick) are connected via wifi, which I had thought was fine enough since the Firestick plays shows without issue most of the time, and plays untranscoded videos from UMS without too much issue (besides the My Home Hero video issue). If it's a hardware problem, nothing to be done for it, but it'd be nice to narrow it down to that.
Attachments
FrecnhSubs.PNG
FrecnhSubs.PNG (803.52 KiB) Viewed 2322 times
User avatar
mik_s
Moderator
Posts: 1130
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: VLC Transcoding Freezes; Plays multiple subtitles

Post by mik_s »

If the subtitles do not automatically play on VLC when the video is being streamed then you just have to turn them on within VLC.
Some subtitles have a forced tag that will automatically turn them on, usually for when there is foreign language parts that have subtitles.

for "Kids.on.the.Slope.S01E01.mkv" the subs are not forced.

Code: Select all

Searching for subtitles without considering audio language for "Kids.on.the.Slope.S01E01.mkv"
Looking for subtitles with the highest priority from und, eng, jpn
Returning subtitles with priority Embedded, id: 0, type: ASS, lang: und, default: false, forced: false: {}
I think the forced tag may be ignored when transcoding in UMS, that was what lead me to find the other issues with the subtitles in V14. That may have existed in v13 too
You could try the beta for V14, you can see the links to it here, if you want to do some testing.

The subtitle priority may also prevent the subs being selected when transcoding. Have a look at the subtitle settings and the option "Audio/subtitles language priority:", read the tooltip for what it means but TBH this could be made easier to setup.

Your hardware should be good enough to keep up with playing though, I have a similar setup but only the 2nd generation of the i7.
I'm not sure about the firestick though depending on the version. It may not be fast enough for AV1 decoding.
I had a quick look at some firestick specs and only the "Fire TV Stick 4K Max" series lists AV1. This is probably hardware decoding so if this is not the one you have then VLC is trying to use software decoding and struggling to keep up. I was going to suggest you copy videos that don't play properly to a USB drive and play them directly on the target device but I don't think you can do this on the firestick.

I had a look at available confs as I thought I saw one for the fire stick, and found Amazon-FireTVStick-VimuPlayer.conf
I don't know anything about VimuPlayer but might be better to use this and UMS will now what will need transcoding.
Maybe you could even alter this to be used on VLC instead by changing UserAgentSearch and UpnpDetailsSearch to the VLC ones

Have you tried the web player instead? I'm assuming the firestick has a web browser and is hopefully a decent one. UMS will transcode everything but using HLS which will give you the option to change subtitle, audio tracks etc anytime while playing. Its similar to what YouTube uses.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
Post Reply