[Bug Report] 1.17.0.1709 - Long Videos Won't Stream - XML Errors

Server Version#: 1.17.0.1709

When attempting to play a video that is 4:30:44 long, Plex is throwing a ton of XML errors and the transcode/stream won’t start. I tested with shorter shows (22 minutes), and it started right away without issue.

I rebooted the server several times, attempted to “Optimize” the database.
Downgraded to 1.15.8.1163 and the issue is not present.
Upgraded to 1.16.6.1592 and the issue is not present.
Upgraded to 1.17.0.1709 and the issue is present.
Downgraded to 1.16.6.1592 and the issue is not present.

From the logs, it looks like the codec is set to some weird non-unicode character and that is causing the issues.

Timestamp: Sep 29, 2019 04:19:13.518 [0x7fc7627fc700]

Sep 29, 2019 04:19:13.518 [0x7fc7627fc700] ERROR - XML: Entity: line 26:
Sep 29, 2019 04:19:13.518 [0x7fc7627fc700] ERROR - XML: parser
Sep 29, 2019 04:19:13.518 [0x7fc7627fc700] ERROR - XML: error :
Sep 29, 2019 04:19:13.518 [0x7fc7627fc700] ERROR - XML: invalid character in attribute value
Sep 29, 2019 04:19:13.518 [0x7fc7627fc700] ERROR - XML: <Representation id=“1” mimeType=“audio/mp4” codecs=“” bandwidth=“130125” aud

Plex Media Server.log (4.4 MB)

Here’s the mediainfo on the file in question.

General
ID                                       : 1 (0x1)
Complete name                            : Episode Name.mp4
Format                                   : MPEG-TS
File size                                : 12.0 GiB
Duration                                 : 4 h 30 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 6 338 kb/s
FileExtension_Invalid                    : ts m2t m2s m4t m4s tmf ts tp trp ty

Video
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : 27
Duration                                 : 4 h 30 min
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 29.970 (30000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive

Audio
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format version                           : Version 4
Format profile                           : LC
Muxing mode                              : ADTS
Codec ID                                 : 15
Duration                                 : 4 h 30 min
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -60 ms

Text #1
ID                                       : 257 (0x101)-CC1
Menu ID                                  : 1 (0x1)
Format                                   : EIA-608
Muxing mode                              : SCTE 128 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 4 h 30 min
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)
CaptionServiceName                       : CC1

Text #2
ID                                       : 257 (0x101)-CC3
Menu ID                                  : 1 (0x1)
Format                                   : EIA-608
Muxing mode                              : SCTE 128 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 4 h 30 min
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)
CaptionServiceName                       : CC3

Text #3
ID                                       : 257 (0x101)-1
Menu ID                                  : 1 (0x1)
Format                                   : EIA-708
Muxing mode                              : SCTE 128 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 4 h 30 min
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)

Menu
ID                                       : 4096 (0x1000)
Menu ID                                  : 1 (0x1)
Duration                                 : 4 h 30 min
List                                     : 256 (0x100) (AAC) / 257 (0x101) (AVC) / 258 (0x102) ()

can you please use dd to carve off about 15MB sample of the file and attach here?

It looks like the file itself has issues where the header and the content disagree.
This is why I would like to examine it

It’s been a hot minute since I’ve had to use dd, so hopefully the attached file is correct. I had to zip it to allow upload here.

CarvedFile.zip (13.1 MB)

@ChuckPa - I know your a busy guy, did you have a chance to look into this any further?

Not a pressing issue since I can continue to use an older version for now, but want to ensure I can safely upgrade in the future.

I try to take some time off for a weekend every other month or so. :rofl:
I’ll look at it tonight.

1 Like

There is something going on in there. It locks my vlc player (Linux).

This is MPEG-2 in a MP4 file deliberately?

In the sample, I immediately found two issues which shouldn’t exist:

[00007f91bcc01f60] faad decoder warning: decoded zero sample
[00007f919c0919a0] main video output error: video output creation failed
[00007f91bcc23350] main decoder error: failed to create video output
[00007f919c106db0] main video output error: video output creation failed
[00007f91bcc23350] main decoder error: failed to create video output
[00007f91bcc23350] main decoder error: buffer deadlock prevented
[000055acb5978790] pulse audio output warning: starting late (-6309 us)

The zero-sample points to metadata . Even VLC didn’t like it
It also reported the audio started late.

I will suggest this be run through handbrake to clean up the timing, then retry that new output while preserving the original input file in some place safe

@ChuckPa - Thanks for taking a look. Sorry to take up your time on the weekend.

I tested the file out (CarvedFile.mp4) on VLC in Windows and it didn’t return any errors. It started normally and played through to the end. I then spun up an Ubuntu 18.04.1 Desktop VM, installed VLC and didn’t have issues playing the file.

Full history, these files are pulled from Twitch.tv, which is why they’re reporting as MPEGTS (HLS). Previously the show was hosted on a different platform (and the files were huge 20+GB), so I was using Handbrake to transcode the HLS stream to mp4. I just checked, and those older files play in 1.17, and they report in Plex that they are MP4. Transcoding the files from Twitch with Handbrake resulted in files larger than the original, so I just left them as is and they played, so I didn’t think much of it.

It confuses me though as to why Plex 1.16 has no issues playing the files, but 1.17 chokes and dies. Does 1.17 not support MPEGTS files while 1.16 does?

I ran ffprobe on the file
$ ffprobe ./CarvedFile.mp4
ffprobe version 4.1.4 Copyright (c) 2007-2019 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.10.44.4)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.4_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags=-I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/ --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-nonfree --enable-libaom --enable-libbluray --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, mpegts, from '/Users/nibbles/Downloads/CarvedFile.mp4':
  Duration: 00:00:20.01, start: 65.911000, bitrate: 6287 kb/s
  Program 1 
    Stream #0:0[0x100]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 122 kb/s
    Stream #0:1[0x101]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:2[0x102]: Data: timed_id3 (ID3  / 0x20334449)
Unsupported codec with id 100358 for input stream 2

I didn’t like that stream when I saw it yesterday. VLC-3.0.7.1 plays it here. I’m curious if this works when it’s removed.

1 Like

From a quick search of the old gargler, apparently that timed_id3 data is part of the HLS specification.

Any info on how I could try and remove that single stream to see if it resolves the issue? Retranscoding 100+ hours of media to mp4 with Handbrake to strip it isn’t something I’d look forward to.

I use mkvtoolnix-gui.
I drag the film onto the gui.
I uncheck the tracks I don’t want
and I process it.
As it’s only remuxing, it doesn’t transcode and only takes a minute or two.
What I noticed isn’t meant to move you away from following Chuck’s advice.
I just thought that stream was novel.

I have 3 tools in my video arsenal I use frequently.
Handbrake, mkvtoolnix-gui, and Avidemux.
good luck!

I think you’re on to something! Maybe Plex previously ignored other streams, but now it’s trying to parse a stream that it isn’t familiar with and it’s causing the errors.

After remuxing the CarvedFile.mp4 to CarvedFile.mkv, it plays on version 1.17. Looks like you were correct that it’s the timed_id3 data that is causing issues. Hopefully this gives Chuck some ideas, and maybe there is a backend fix for this?

I’m pulling down a full episode (12GB) to my Windows box and I’ll see what the average time to remux it is. Remuxing all the “broken” files is going to be time consuming through.

Looks like I can just use ffmpeg to remux the files as well, so I could script it to an extent.

ffmpeg -i <input> -map 0:0 -map 0:1 -vcodec copy -acodec copy <output>

I was thinking similar,

ffmpeg -i <input> -map 0 -sn -dn -c:v copy -c:a copy output.mkv

not super well read myself on maps but something was supposed to keep chapters xD

Mkvtoolnix comes in two flavors. Command line and GUI.

Get both. Do it from the GUI. I can spin through 50 GB in nothing flat to the QNAP

Regarding “Backend fix”. This isn’t broken. One doesn’t fix something when the input is out of spec. It’s being more strict about it now. Sorry :man_shrugging:

I understand your point, but I do want to point out that it’s supposedly in spec for MPEGTS/HLS according to the information above.

I’ll work on remuxing my library. The slow part is mainly pulling down ~500GB worth of media, remuxing, and pushing it back to my NAS.

You do have a point there. I stand corrected.

I’m going to pass this up to the team who knows much more than I.
Find out what changed.

1 Like

Very cool. So I loaded CarvedFile.mp4 into avidemux-2.7.4 because I trust the developer, who goes by the name mean, is a brilliant coder who single handedly brought that software along for what a decade at the cutting edge of all codecs and platforms.

Anyway avidemux should remux the file into a new container if I want, and copy the video and audio. If it finds something bad in there, it will detail it exhaustively. I told avidemux to put it into an mkv, and I was given:

CarvedFile.mkv
CarvedFile.mp4.idx2

Just thought I’d mention that. No errors, just makes a 2-track mkv and a sidecar. Never seen that.

@ShadowBlade72

I pinged one of the team members last night who happened to be online.
He took a look and found it almost immediately.

He made the correction which will be released in an upcoming build.

Thank you for spotting and reporting it.

1 Like

@ChuckPa - Thanks for your assistance with this! Glad to hear that it was a relatively quick fix on the backend.

I appreciate the time you spent running down the issue. Thanks to @nibbles as well for the big push in the right direction.

Sorry for being slow on the uptake. Technology and I have be at odds this weekend.
Sounds like I should avail myself of more time off? :slight_smile: