Yet another Subtitle .SRT: Invalid data found when processing input

Server Version#: 1.20.3.3437
Player Version#:
Web: 1.20.3.3437
Tizen: 5.2.1

When playing the video, the video may play fine with subtitle. Then at any moment it would stop with transcode error. This happen for both the Tizen and web player. Once the error happened, the video cannot be played anymore even if I try to playback from the beginning. Turning off the subtitle on the web would immediately let the video to be played but on Tizen, I had to restart Plex. The subtitles look fine to me though. Attached are 2 sub files in zip.
Dance of the Sky Empire.2020.Complete.HD1080P.X264.AAC.Mandarin.CHS.BDE4.zip (30.2 KB)

Below is the log from console.

Oct 19, 2020 14:42:30.312 [0x7f0472e6b700] Info — AutoUpdate: no updates available
Oct 19, 2020 14:42:34.002 [0x7f046bfff700] Error — SSDP: Error parsing device schema for http://192.168.2.123:52235/DMS/SamsungDmsDesc.xml
Oct 19, 2020 14:42:40.983 [0x7f0471cd7700] Warning — [Transcode] ClientProfileExtra: unable to find transcode profile for adding or appending codec
Oct 19, 2020 14:42:41.163 [0x7f0469fc5700] Error — [Transcoder] /volume1/Plex/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-6m2fpasus7463viz4wt7tmjo-2b0eb0eb-2ba7-43ed-b6b1-360968843309/temp-0.srt: Invalid data found when processing input
Oct 19, 2020 14:42:41.235 [0x7f0471cd7700] Error — [TranscodeOutputStream] Streaming Session 0x7f040c18e090 appears to have died from under us
Oct 19, 2020 14:42:42.212 [0x7f0469fc5700] Error — Unknown metadata type: folder
Oct 19, 2020 14:42:44.262 [0x7f0471cd7700] Warning — [Transcode] ClientProfileExtra: unable to find transcode profile for adding or appending codec
Oct 19, 2020 14:42:44.272 [0x7f0471cd7700] Warning — [Transcode] Denying access due to session lacking permission to transcode key /library/metadata/31670
Oct 19, 2020 14:43:13.152 [0x7f0469fc5700] Warning — [Transcode] ClientProfileExtra: unable to find transcode profile for adding or appending codec
Oct 19, 2020 14:43:13.214 [0x7f04699e9700] Error — [Transcoder] /volume1/Plex/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-kx0vmff0eir0l4iozcpv50r8-2a2ed966-3e44-4377-bf4b-604b2aa86af3/temp-0.srt: Invalid data found when processing input
Oct 19, 2020 14:43:13.359 [0x7f046bfff700] Error — SSDP: Error parsing device schema for http://192.168.2.123:52235/DMS/SamsungDmsDesc.xml
Oct 19, 2020 14:43:13.573 [0x7f0469fc5700] Error — [TranscodeOutputStream] Streaming Session 0x7f040c8cf5f0 appears to have died from under us
Oct 19, 2020 14:43:14.400 [0x7f0469fc5700] Error — Unknown metadata type: folder
Oct 19, 2020 14:43:16.584 [0x7f0469fc5700] Warning — [Transcode] ClientProfileExtra: unable to find transcode profile for adding or appending codec
Oct 19, 2020 14:43:16.595 [0x7f0469fc5700] Warning — [Transcode] Denying access due to session lacking permission to transcode key /library/metadata/31670
Oct 19, 2020 14:43:44.946 [0x7f046b447700] Warning — QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Oct 19, 2020 14:43:45.567 [0x7f046b447700] Warning — QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Oct 19, 2020 14:43:45.580 [0x7f046b447700] Warning — QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Oct 19, 2020 14:43:52.735 [0x7f046bfff700] Error — SSDP: Error parsing device schema for http://192.168.2.123:52235/DMS/SamsungDmsDesc.xml
Oct 19, 2020 14:44:25.059 [0x7f046bfff700] Error — SSDP: Error parsing device schema for http://192.168.2.123:52235/DMS/SamsungDmsDesc.xml
Oct 19, 2020 14:44:44.512 [0x7f0469fc5700] Error — [Transcoder] /volume1/Plex/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-3mxvejf40zn0rja1186gfykb-72a269a8-c7c3-4fee-ad81-618943446c06/temp-0.srt: Invalid data found when processing input
Oct 19, 2020 14:44:44.514 [0x7f0473fff700] Error — [TranscodeOutputStream] Streaming Session 0x7f040c707e70 appears to have died from under us
Oct 19, 2020 14:44:44.556 [0x7f0469fc5700] Warning — Denying access to direct play of part 41530 due to terminated session
Oct 19, 2020 14:44:44.573 [0x7f0473fff700] Error — Unable to find client profile for device; platform=Tizen, platformVersion=5, device=19_MUSEL_UHD, model=UA65RU7400KXXM
Oct 19, 2020 14:44:44.631 [0x7f0469fc5700] Error — Unable to find client profile for device; platform=Tizen, platformVersion=5, device=19_MUSEL_UHD, model=UA65RU7400KXXM
Oct 19, 2020 14:44:44.650 [0x7f0473fff700] Error — Unknown metadata type: folder
Oct 19, 2020 14:44:47.581 [0x7f0473fff700] Warning — [Transcode] Denying access due to session lacking permission to transcode key /library/metadata/31670

In the log, the first 2 errors are from playback using the web player (Firefox) and the last error is from Samsung TV. As with other “Invalid data found when processing input” threads, the subtitles works fine with VLC and Windows 10 “Movies & TV” app.

May I also ask you re-enable DEBUG logging before recapturing?
DEBUG logging will provide much-needed information.

Also, please be advised that DEBUG enabled does not consume more disk space. Log file sizes are fixed at 10 MB maximum each.

1 Like

As requested.

Log (debug enabled)
Plex Media Server Logs_2020-10-20_00-49-00.zip (2.4 MB)

XML

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="9" librarySectionTitle="Drama (Chinese)" librarySectionUUID="ef80351c-15c2-48f7-86fb-79ce18a8d3f0" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1602676305">
<Video ratingKey="31671" key="/library/metadata/31671" skipParent="1" parentRatingKey="31655" grandparentRatingKey="31654" guid="com.plexapp.agents.thetvdb://385125/1/15?lang=en" parentGuid="com.plexapp.agents.thetvdb://385125/1?lang=en" grandparentGuid="com.plexapp.agents.thetvdb://385125?lang=en" type="episode" title="www.bde4.com" grandparentKey="/library/metadata/31654" parentKey="/library/metadata/31655" librarySectionTitle="Drama (Chinese)" librarySectionID="9" librarySectionKey="/library/sections/9" grandparentTitle="Dance of the Sky Empire" parentTitle="Season 1" summary="" index="15" parentIndex="1" viewOffset="222000" lastViewedAt="1603125488" year="2020" thumb="/library/metadata/31671/thumb/1603088738" grandparentThumb="/library/metadata/31654/thumb/1603088740" duration="2709235" originallyAvailableAt="2020-07-23" addedAt="1601779962" updatedAt="1603088738">
<Media id="40248" duration="2709235" bitrate="2165" width="1920" height="1080" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" videoResolution="1080" container="mp4" videoFrameRate="PAL" optimizedForStreaming="1" audioProfile="lc" has64bitOffsets="0" videoProfile="high">
<Part accessible="1" exists="1" id="41531" key="/library/parts/41531/1601779760/file.mp4" duration="2709235" file="/volume1/video/Drama/China/Dance of the Sky Empire.2020.Complete.HD1080P.X264.AAC.Mandarin.CHS.BDE4/天舞纪.2020.EP15.HD1080P.X264.AAC.Mandarin.CHS.BDE4.mp4" size="733221724" audioProfile="lc" container="mp4" deepAnalysisVersion="4" has64bitOffsets="0" hasThumbnail="1" optimizedForStreaming="1" requiredBandwidths="2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647" videoProfile="high">
<Stream id="112506" streamType="1" default="1" codec="h264" index="0" bitrate="2034" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" codedHeight="1088" codedWidth="1920" colorPrimaries="bt709" colorRange="tv" colorSpace="bt709" colorTrc="bt709" frameRate="25.000" hasScalingMatrix="0" height="1080" level="40" profile="high" refFrames="3" requiredBandwidths="3746,3065,2204,2041,2041,2041,2041,2041" streamIdentifier="2" width="1920" displayTitle="1080p (H.264)" extendedDisplayTitle="1080p (H.264)"/>
<Stream id="112507" streamType="2" selected="1" default="1" codec="aac" index="1" channels="2" bitrate="131" audioChannelLayout="stereo" profile="lc" requiredBandwidths="125,125,125,125,125,125,125,125" samplingRate="44100" streamIdentifier="3" displayTitle="Unknown (AAC Stereo)" extendedDisplayTitle="Unknown (AAC Stereo)"/>
<Stream id="112753" key="/library/streams/112753" streamType="3" selected="1" codec="srt" format="srt" displayTitle="Unknown (SRT External)" extendedDisplayTitle="Unknown (SRT External)"/>
</Part>
</Media>
<Marker type="intro" startTimeOffset="990" endTimeOffset="99625"/>
<Extras size="0"> </Extras>
<Related> </Related>
</Video>
</MediaContainer>

Also, I had a look at the subtitle content and found that they have something like this,

1
1
00:00:05,000 --> 00:00:15,000
[English subtitles are available]


2
2
00:01:41,590 --> 00:01:44,870
Dance of the Sky Empire

Notice the duplicate indexes (the 1 and the 2)? If I remove all the duplicates, then playback will continue normally.

Well, that would be one “solution”, but I believe a lot of people will or may have this problem too currently or in the future and not many can actually can fix this as there are hundreds of indexes in a subtitle file. To do it manually would be a lot of work, say hundreds of indexes per subtitle file and there are 30+ episodes? I believe Plex should be “improved” to be more resilient to such “incorrectness”.

Of course there are tools out there that can fix it, but not many “users” are capable of doing this as it involves downloading and installing tool(s).

Additionally, what if the subtitle files downloaded directly from opensubtitles.org by Plex agent contain such “incorrectness”? In this case, the users can’t easily edit the subtitles as they are located inside Plex database/cache/or whatever it is called. This will give users a living hell, no?

As a programmer myself, I see that this can be easily fixed in Plex. However, on user side, this caused lots of problems and user dissatisfaction. In this particular case, my wife was freaking out when she tried playing the show on the TV in our living room (it has subtitle turned on) and Plex kept showing the error messages. There are 2 types of error message when the video is played. One of it says transcoding error and the other stating that the file cannot be reached. She told me that the TV in the bedroom (it has subtitle turned off) can play without any problem. I tried it on web player and it played fine and started to get annoyed with my wife as I was working (from home). It took me a while to replicate the issue on the web player when I tried turning on the subtitle. On my wife side, she already made up her mind that the TV in our living room is the root cause of the issue which is not true. For me, the error messages are “confusing” as I can see that it was using the “play direct” thing, so why transcode error? It took me hours of trial and error to discover the “duplicate index” thing is the the problem. Then it took more some more time to find a tool that can batch fix the issue as it’s impossible to manually fix all the subs.

@programatix

I’d like to ask where the above subtitle fragment came from? Was it downloaded external to Plex or by Plex itself?

Would you mind sharing how you would approach solving this problem?
Might you have a logic flow outline (sequence of steps) which can be written out?

I ask because, an automaton can be created, I will write it all up and submit it to Engineering.

The subtitles are downloaded from a private website uploaded by members. So, they are external SRT files.

I resolved it by using SubtitleEdit (https://github.com/SubtitleEdit/subtitleedit) using its “Fix common errors” tool. It can perform batch fix by using its “Batch convert” tool.

The source code for subtitle fixes are at https://github.com/SubtitleEdit/subtitleedit/tree/master/libse/Forms/FixCommonErrors.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.