Universalmediaserver: Add support for Philips OLED 55POS9002/12 renderer

Created on 19 Apr 2020  ·  87Comments  ·  Source: UniversalMediaServer/UniversalMediaServer

Hi guys, I really enjoy using UMS and it worked flawlessly up to 9.1.0 with a previous Samsung TV. Now that I upgraded to a Philips OLED 55POS9002/12 I'd like to keep using UMS to serve content from my Win10 x64 laptop to my latest TV.
Now in UMS 9.4.1 my TV is detected as generic Android TV and uses the renderer file Google-Android.conf which seems a bit lacking. It only features these directives:

RendererName = Android
RendererIcon = android.png
UserAgentSearch = Android
UpnpDetailsSearch = Android

TranscodeAudio = MP3
DefaultVBVBufSize = true
MuxDTSToMpeg = true
H264Level41Limited = false
StreamExtensions = mkv,hdmov,hdm,flac,fla,dts,ogg,asf,asx,m2v,mp4,mpg,mpeg,avi,mov,wmv
ChunkedTransfer = true
HalveBitrate = true

which for some reason it's not streaming external subtitles placed with the same name as the movie file in the same directory, it only streams internal MKV english subtitles. My TV lets me choose the subtitles language but it shows only english subtitles available. Even if I go to TRANSCODING directory and stream the file with no transcoding only english subtitles that are probably inside the MKV are displayed. If I play the TRANSCODING file with external subtitles in portuguese, the tv player says it can't find the file.

In Transcoding Settings/Subtitles settings I have portuguese as the main language priority: por, eng, fre, ger, und . In Audio/subtitle language priority I have it setup like: eng, por; *, por; *, und. In Force Language i have it set to pt. I have also enabled Force External Subtitles.

Can you help me ? I've attached the trace logs to this issue.
I think it would be best to create a Renderer file for these Philips TVs specifically, so it works 100% all the time. I've attached a new PNG icon that can be used for these TVs.
I tried creating a renderer with the following directives but with no luck, transcoding starts on supposedly supported file types and nothing ever reaches the TV:

UserAgentSearch = Linux2.6/0.0 UPnP/1.0 PhilipsIntelSDK/1.4 DLNADOC/1.50
UpnpDetailsSearch =

TranscodeVideo = MPEGTS-H264-AAC
TranscodeAudio = MP3

DefaultVBVBufSize = true

UseClosedCaption = true
SubtitleHttpHeader = CaptionInfo.sec
TranscodedVideoFileSize = 100000000000
H264Level41Limited = false
MaxVideoWidth = 3840
MaxVideoHeight = 2160
MaxVideoBitrateMbps = 20

StreamExtensions = mkv,hdmov,hdm,flac,fla,dts,ogg,asf,asx,m2v,mp4,mpg,mpeg,avi,mov,wmv

ChunkedTransfer = true
MediaInfo = true

Supported video formats:

Supported = f:avi v:h264|h265|mpeg2|mp4 a:ac3|mp3|mpa m:video/x-msvideo
Supported = f:mkv v:h264|h265|mpeg2|mp4 a:aac-lc|he-aac|ac3|mp3|mpa m:video/x-matroska
Supported = f:mp4 v:h264|h265|mpeg2|mp4 a:aac-lc|he-aac|ac3|mp3|mpa m:video/h264
Supported = f:mpegps v:h264|h265|mpeg2|mp4 a:ac3|lpcm|mp3|mpa m:video/mpeg
Supported = f:mpegts v:h264|h265|mpeg2|mp4 a:aac-lc|ac3|mpa|lpcm m:video/vnd.dlna.mpeg-tts
Supported = f:wmv v:vc1 a:wma m:video/x-ms-wmv

Supported audio formats:

Supported = f:adts n:2 a:aac-lc m:audio/vnd.dlna.adts
Supported = f:aiff|wav n:2 a:lpcm m:audio/L16
Supported = f:mp3|mpa n:2 m:audio/mpeg
Supported = f:mp4 n:6 a:aac-lc m:audio/mp4
Supported = f:wma n:2 a:wma m:audio/x-ms-wma

Supported subtitles formats:

SupportedExternalSubtitlesFormats = MICRODVD,SAMI,SUBRIP,TEXT

SupportedInternalSubtitlesFormats = MICRODVD,SAMI,SUBRIP,TEXT

ums_dbg.zip
PhilipsOLED

My Philips OLED 55POS9002/12 specifications are the following, from the official spec sheet in the manual at https://download.p4c.philips.com/files/5/55pos9002_12/55pos9002_12_dfu_eng.pdf:

Playback formats

  • Containers: PS, TS, M2TS, TTS, AVCHD, MP4, M4V, MKV, ASF, AVI, 3GP, Quicktime
  • Video Codecs : AVI, MKV, HEVC, H264/MPEG-4 AVC, MPEG-1, MPEG-2, MPEG-4, VP9
  • Audio Codecs : AAC, MP3, WAV, WMA (v2 up to v9.2), WMA-PRO (v9 and v10)
  • Subtitles :

    • Formats : SRT, SUB, TXT, SMI

    • Character encodings : UTF-8, Central Europe and Eastern Europe (Windows-1250), Cyrillic (Windows-1251), Greek (Windows-1253), Turkish (Windows-1254), Western Europe (Windows-1252)

  • Image Codecs : JPEG, GIF, PNG, BMP
  • Limitations :

    • Maximum supported total bit rate for a media file is 30Mbps.

    • Maximum supported video bit rate for a media file is 20Mbps.

    • MPEG-4 AVC (H.264) is supported up to High Profile @ L5.1.

    • H.265 (HEVC) is supported upto Main / Main 10 Profile up to Level 5.1

Thanks a lot for your help.
Best regards,
Carlos Silva

P.S. The Forum is not sending the registration confirmation e-mail.

All 87 comments

@carlosvsilva thanks for sending all these details through, that will make it easier for me to make the config. I'll post it here when I make it

Perfect, i'll await it then :)

@carlosvsilva thanks for sending all these details through, that will make it easier for me to make the config. I'll post it here when I make it

Hi, can I help you any further? How's the config coming? :) Thanks.

@carlosvsilva can you please try this:

#----------------------------------------------------------------------------
# Profile for Philips Android TVs.
# See DefaultRenderer.conf for descriptions of all the available options.
#

RendererName = Philips Android TV
RendererIcon = Philips-POS9002.png

# ============================================================================
# This renderer has sent the following string/s:
#
# friendlyName=Android TV
# manufacturer=Philips
# modelName=Philips TV DMR
# modelNumber=2k15MTK
# ============================================================================
#

UserAgentSearch = Android TV.*Philips
UpnpDetailsSearch = Android TV.*Philips
LoadingPriority = 2

TranscodeVideo = MPEGTS-H264-AAC
TranscodeAudio = MP3

#DefaultVBVBufSize = true
UseClosedCaption = true
SubtitleHttpHeader = CaptionInfo.sec
H264Level41Limited = false
MaxVideoWidth = 3840
MaxVideoHeight = 2160
MaxVideoBitrateMbps = 30
MediaInfo = true

# Supported video formats:
Supported = f:3g2|3gp   v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9   a:aac-lc|ac3|he-aac|mp3|wav|wma
Supported = f:avi       v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9   a:aac-lc|ac3|he-aac|mp3|wav|wma
Supported = f:mkv       v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9   a:aac-lc|ac3|he-aac|mp3|wav|wma
Supported = f:mp4       v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9   a:aac-lc|ac3|he-aac|mp3|wav|wma
Supported = f:mpegps    v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9   a:aac-lc|ac3|he-aac|mp3|wav|wma
Supported = f:mpegts    v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9   a:aac-lc|ac3|he-aac|mp3|wav|wma
Supported = f:wmv       v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9   a:aac-lc|ac3|he-aac|mp3|wav|wma

# Supported audio formats:
Supported = f:adts       n:2   a:aac-lc   m:audio/vnd.dlna.adts
Supported = f:aiff|wav   n:2   a:lpcm     m:audio/L16
Supported = f:mp3|mpa    n:2              m:audio/mpeg
Supported = f:mp4        n:6   a:aac-lc   m:audio/mp4
Supported = f:wma        n:2   a:wma      m:audio/x-ms-wma

# Supported subtitles formats:
SupportedExternalSubtitlesFormats = MICRODVD,SAMI,SUBRIP,TEXT
SupportedInternalSubtitlesFormats = MICRODVD,SAMI,SUBRIP,TEXT

Hi I won't be able to test the new renderer (thanks!) for the next few days, but as soon as I have a chance I will run it and let you know how it goes. Thanks :)

@carlosvsilva no problem, thanks for letting me know :)

So I had to remove "Android TV" from:
UserAgentSearch = Android TV.Philips
UpnpDetailsSearch = Android TV.
Philips
Because that was just the customizable name that came with the TV that the owner can change freely.
Just with .*Philips in those 2 fields the renderer file loaded. But two standard videos at least gave me "format not supported" in the TV native dlna player. In Kodi they played with transcoding which should be unnecessary.
I'm attaching here the debug logs. I tried UMS 9.5.0. Although 9.2.0 was the last version where the correct subtitles loaded in general.
I'm looking forward for the next version of this renderer file with new edits. Thanks for the help.

Best regards,
Carlos Silva
ums_dbg.zip

@carlosvsilva I can only see one file attempted to play in those logs, Tolkien. Did it play successfully? I will need to know what are those two standard video files so I can modify the config to transcode them.

It is unfortunate that Philips has given no way to really identify the TV, because using "Philips" will match any device from that brand and that's not desirable. I think the only way we have is to use that name that is possible to change. That's not ideal but it is better than detecting all Philips devices as OLED TVs

So I tried playing many of the video files I have with the following results with this renderer (trace logs attached)
ums_dbg_20200609 - Philips-POS9002.zip
:

Movies that do play:
Tolkien but with english subtitles despite {Portuguese subtitles} in title
(Dolby Digital)

Yesterday (Dolby Pulse) no subtitles despite {Portuguese subtitles} in title

Shpongle (Dolby Digital Plus)

Californication 712 no subtitles despite {Portuguese subtitles} in title

How To Make it in America 208 (Dolby Digital) no subtitles

Lancaster Skies (Dolby Pulse) no subtitles despite {Unknown subtitles} in title

The Gentlemen {Portuguese subtitles} Dolby Digital. no subtitles despite {Portuguese subtitles} in title

Avengers Endgame Dolby Pulse no subtitles

These files don't even begin playing at all:

Empire.Of.The.Sun.1987.1080p.BluRay.x265-RARBG - Format Not Supported upon playing, doesn't display preview frame nor starts playing from the DLNA browser.
Stream 0:
Codec: MPEG-H Part2/HEVC (H.265) (hev1)
Resolution: 1920x1080
FPS: 23,9976216
Stream 1:
Codec: MPEG AAC Audio (mp4a)
Language: English
Channels: 3F2R/LFE
Frequency: 48000Hz
Bits per sample: 32
Stream 2:
Codec: Text subtitles with various tags (subt)
Language: x265-RARBG

Suits.S09E10.One.Last.Con.1080p.AMZN.WEBRip.DDP5.1.x264-BTN[rarbg] - Format Not Supported upon playing, doesn't display preview frame nor starts playing from the DLNA browser.
Stream 0:
Codec: H264 - MPEG-4 AVC (part 10) (avc1)
Resolution vídeo: 1920x1080
FPS: 23.976216
Primary color: ITU-R BT.709
Color transfer function: ITU-R BT.709
Colorspace: Intervalo ITU-R BT.709
Chroma location: Left
Stream 1:
Codec: A/52 B Audio (aka E-AC3) (eac3)
Language: English
Channels: 3F2M/LFE
Frequency: 48000 Hz
Bits per sample: 32
Stream 2-4:
Codec: Text subtitles with various tags (subt)
Language: English

The.Nun.2018.2160p.UHD.BluRay.X265-IAMABLE - Format Not Supported upon playing, doesn't display preview frame nor starts playing from the DLNA browser.
Stream 0:
Codec: MPEG-H Part2/HEVC (H.265) (hevc)
Video resolution: 3840x1606
FPS: 23.976216
Primary color: ITU-R BT.2020
Color transfer function: SMPTE ST2084 (PQ)
Colorspace: ITU-R BT.2020
Luminance máx.: 4000.0000 cd/m²
Luminance mín.: 0.0050 cd/m²
Primary Red: x=0.6800 y=0.3200
Primary Green: x=0.2650 y=0.6900
Primary Blue: x=0.1500 y=0.0600
White Point: x=0.3127 y=0.3290
MaxCLL: 568 cd/m²
MaxFALL: 141 cd/m²
Stream 1:
Codec: TrueHD Audio (trhd)
Language: English
Channels: 3F2M2R/LFE
Frequency: 48000 Hz
Bits per sample: 32
Stream 2:
Codec: A52 Audio (aka AC3) (a52 )
Language: English
Description: AC-3 5.1
Frequency: 48000 Hz
Stream 3:
Codec: DTS Audio (dts )
Language: English
Description: DTS-HD MA 5.1
Frequency: 48000 Hz
Bits per sample: 24
Stream 4-5:
Codec: Text subtitles with various tags (subt)
Stream 6-8:
Codec: BD PGS subtitles (bdpg)

The.Good.Doctor.S03E20.REPACK.1080p.WEB.H264-MEMENTO[rarbg] - Format Not Supported upon playing, doesn't display preview frame nor starts playing from the DLNA browser.
Stream 0:
Codec: H264 - MPEG-4 AVC (part 10) (avc1)
Resolution vídeo: 1920x1080
FPS: 23.976216
Primary color: ITU-R BT.709
Color transfer function: ITU-R BT.709
Colorspace: ITU-R BT.709
Stream 1:
Codec: A/52 B Audio (aka E-AC3) (eac3)
Language: English
Channels: 3F2M/LFE
Frequency: 48000 Hz
Bits per sample: 32
Stream 2-3:
Codec: Text subtitles with various tags (subt)

I'm almost positively sure that these files should be playing well via DLNA I will test with Google Android TV default renderer to see which ones do play with that Google config and will reply with the results. Thanks

So I tried Google-Android.conf renderer changing Search values:
RendererName = Android
RendererIcon = android.png
UserAgentSearch = Philips
UpnpDetailsSearch = Philips

TranscodeAudio = MP3
DefaultVBVBufSize = true
MuxDTSToMpeg = true
H264Level41Limited = false
StreamExtensions = mkv,hdmov,hdm,flac,fla,dts,ogg,asf,asx,m2v,mp4,mpg,mpeg,avi,mov,wmv
ChunkedTransfer = true
HalveBitrate = true

And all the files began playing, streaming well, immediately without transcoding but with the wrong subtitles:
Empire.Of.The.Sun.1987.1080p.BluRay.x265-RARBG (Dolby Pulse)
The.Good.Doctor.S03E20.REPACK.1080p.WEB.H264-MEMENTO[rarbg] (Dolby Digital) - english subtitles
The.Nun.2018.2160p.UHD.BluRay.X265-IAMABLE (HDR - Dolby Digital) - english subtitles
Suits.S09E10.One.Last.Con.1080p.AMZN.WEBRip.DDP5.1.x264-BTN[rarbg] (Dolby Digital) - english subtitles
ums_dbg_20200610 - Google Android.zip

Thanks.

Ok so Empire of the Sun is failing because of bit depth 10, The Good Doctor is eac3, The Nun has truehd in it, and Suits was eac3.
The bigger problem we seem to have is that transcoding is failing for you, so we should fix that. I've made an attempt to fix the failures mentioned, please test https://raw.githubusercontent.com/UniversalMediaServer/UniversalMediaServer/92c0f4b2f4e042b0127fba33bfa7a5e3c0dc2cef/src/main/external-resources/renderers/Philips-AndroidTV
Also please intentionally transcode something via the #--TRANSCODE--# folder, to test if that works now.

@valib this seems to be another case of external subtitles not working since recent refactoring, can you please look into it? I can see in the logs that it thinks the TV does not support external SRT subtitles, but I added SupportedExternalSubtitlesFormats = MICRODVD,SAMI,SUBRIP,TEXT, is there something else needed? Possibly the same as https://github.com/UniversalMediaServer/UniversalMediaServer/issues/2052

Great, there was progress, with that latest version the TV shows started playing again (with only internal subtitles) but the movies still don't play. Here's what's happening:
Empire of the Sun: Preview displays in DLNA browser but when playing it says it can't find or read the file and doesn't start
Opening transcode FFMPEG file, it displays the same message and doesn't start.

The Good Doctor {Portuguese subtitles} plays, albeit with internal english subtitles.

The Nun: Preview displays in DLNA browser but when playing it says it can't find or read the file and doesn't start
Opening transcode FFMEG file with TrueHD/AC3/DTS audio, it displays the same message and doesn't start.

Suits 910{Portuguese subtitles}: Displays preview and plays successfully. Albeit with internal english subtitles.

The Verve Glastonbury can't find file but displays preview in dlna browser.

Gentlemen{Portuguese subtitles} plays but with no subtitles

Avengers Endgame{Portuguese subtitles} likewise.

Now if only the movies start playing too with the forced external subtitles that would be perfect.
My settings have currently in Transcoding/Subtitles:
Subtitles language priority: por, fre, ger, und
Forced language: pt
Audio/Subtitles language priority: eng,por;eng,und;*,por;*,und
Auto load *.srt/*.sub subtitles with the same filename checked.
Force External subtitles checked.

ums_dbg-20200610-v2.zip

@carlosvsilva please disable Use info from www.OpenSubtitles.org because the log is full of errors and try it again. Thanks

@SubJunk I think that we should disable this feature until the UMS API will be released. It is broken

Here I ran the same suite of tests as my previous post, but with the option "Use info from www.OpenSubtitles.org" disabled. See attached file. Thanks
ums_dbg_20200610_2215.zip

@carlosvsilva I'll make you a test build with more fixes soon

Cool, looking forward to it.

@carlosvsilva please try this, it should fix a bug you helped us identify where video bit depth limits were not being enforced properly
https://www.universalmediaserver.com/uploads/UMS-2087-VideoBitDepth-df9be40.exe
Note that installing it will overwrite any changes you have done to the renderer config, and I have not included any changes to that

Hi I just tried it and the renderer file stayed the same, so it worked. Empire of the Sun started playing albeit with the video a bit stuttery, audio was fine. The Nun still doesn't play, the dlna browser can't find or read the file. The Verve Glastonbury isn't playing either. Thanks.
ums_dbg_20200618_0955.zip

@carlosvsilva we are making progress, thanks! I'll look at the other problems soon

Ok so this is the description we are sending your TV when transcoding The Nun:

<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" bitrate="2873084" colorDepth="10" duration="1:36:34.624" nrAudioChannels="8" protocolInfo="http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_HD_EU;DLNA.ORG_OP=01" resolution="3840x1606" sampleFrequency="48000">http://192.168.1.15:5001/get/317/The.Nun.mkv_transcoded_to.ts</res>

Then we transcode with:

ffmpeg -y -loglevel info -hwaccel auto -threads 1 -i The.Nun.mkv -filter_complex [0:v][0:s:3]overlay -map 0:V -map 0:a:0 -bufsize 60000k -maxrate 59000k -crf 23 -ac 2 -ab 320k -c:a aac -c:v libx264 -tune zerolatency -preset ultrafast -level 31 -pix_fmt yuv420p -f mpegts

I can see a couple of potential problems there. The first is that FFmpeg will be outputting a color depth of 8 but we told the TV it would be 10. Also we are using MPEG_TS_HD_EU when the TV may not support that. I've uploaded a test build for you to try, it includes some updates to the renderer config as well as the program code itself.

If that doesn't work, I would also be interested to see what happens if you remove the line TranscodeVideo = MPEGTS-H264-AAC from the renderer file, which will make it use MPEG-PS instead of MPEG-TS

https://www.universalmediaserver.com/uploads/UMS-PhilipsAndroidTV-8c293e8.exe

This build produced really interesting results. All transcodes failed in either MPEGPS or MPEGTS mode. But, opening "The Nun" in DLNA browser, opening the "No Transcoding" file at the top of Transcoding folder with the line TranscodeVideo = MPEGTS-H264-AAC enabled in the renderer file, the movie streamed perfectly, albeit with english subtitles. In the separate -thenewpope.zip file i just tried to play an episode from The New Pope (2020) in default mode it didn't play, but again, going to Transcoding folder, to the first file forcing No Transcode, it streamed perfectly. Every other file tried streamed well but with internal english or no subtitles at all.
Empire of The Sun played too but with a very low fps count, like 5 fps, really slowly. I've attached the debug files here.
So I think UMS shouldn't try to transcode these supported codecs and then, only subtitles need fixing! Thanks!
ums_dbg_2020-07-01-23-26_mpegps.zip
ums_dbg_2020-07-01-23-36_mpegts.zip
ums_dbg_2020-07-01-23-50-thenewpope.zip

@carlosvsilva the DLNA browser means what?

@carlosvsilva there are several different aspects to consider with this:

1) Transcoded videos aren't accepted by your TV, but there must be a reason for that, and it is important for us to figure out why, because a lot of other devices are having that problem too
2) We should keep tweaking your config so that transcoding only happens when it really needs to
3) UMS has logic to transcode videos to burn subtitles that devices do not support, and that uses your audio/subtitle language preferences set in the GUI

Point #1 is the most important because it's much better for a video to unnecessarily transcode, but succeed at playing, than a file just failing to play.

I can see from your logs that we have fixed the incorrect colorDepth value.
I also noticed that you have a setting to transcode audio to 2 channels. Can you please change that to 6 in the UI?

Can you please try transcoding on https://www.universalmediaserver.com/uploads/UMS-PhilipsAndroidTV-ae28e63.exe
and if that doesn't work can you try the MPEG-PS change again?

@valib By DLNA Browser I mean the Philips TV's native Multimedia browser used to play media files from usb disks and DLNA servers and other sources.

@SubJunk This latest build doesn't show any files or directories available for browsing on "Played Recently" and "Videos" sections at the root of Universal Media Server section in my TV.
The only folders available with content to browse was Root/Web/*
So I went into Root/Web/Youtube Channels/Saturday Night Live and tried to play a few of those videos which display a preview picture with file size and video length.
I think all of them tried to start transcoding and all of them failed, with the TV displaying a message "Can't find or play this file".
I switched the audio channels from 2 to 6.
I also tried MPEGTS and MPEGPS modes and all of these combinations with DLNAOrgPN = false and true. None worked.
Please see attached debug files. Thanks.
ums_dbg_2020-07-02-19-13.zip

@SubJunk this renderer supports only SD resolution for the mpegts and maybe the same is applied for mpegps but the video resolution is 3840x1606. It seems that we don't have implemented this restriction to encoders.

@carlosvsilva you can try to add w:1920 h:1080 to the mpegps and mpegts lines in your conf and test it. I am not sure if it should work but this can give as the clue how to continue.

I've started to look into improving our support for DLNA ORG_PN values and I'll put that into this branch too. That work is way overdue and it would be good to know if these problems still happen even when we are sending the correct ORG_PN.
I'll post a test build for you soon with that

@carlosvsilva there is a partial implementation of that in https://www.universalmediaserver.com/uploads/UMS-PhilipsAndroidTV-003f2fc.exe
Hopefully it will be enough to see if this will make a difference for your TV playing transcoded videos

Hi, testing that latest build with and without the aforementioned @valib suggestions to add w:1920 h:1080 to the mpegps and mpegts lines of the renderer file I got the following results:
File browsing is working again.
MPEGTS: Plays files again apart from transcodes and subtitles. Forcing no transcoding streams the 4k The Nun and 1080P The New Pope video file well. Transcoding fails, even tho I see transcoder processes launching in Task Manager.
MPEGPS: Same result as above.
MPEGTS 1080p in conf file: Same result as above
MPEGPS 1080p in conf file: Same result as above
I attach here the 4 debug files. Thanks
ums_dbg_2020-07-03-19-28-mpegts-original.zip
ums_dbg_2020-07-03-19-39-mpegps.zip
ums_dbg_2020-07-03-19-48-mpegts-1080p-limit.zip
ums_dbg_2020-07-03-19-56-mpegps-1080p-limit.zip

The reason that The Nun is transcoding by default is because it is matching French subtitles which is in your preferences.

From the logs:

Looking for subtitles with the highest priority from por, fre, ger, und
Returning subtitles with priority Embedded, id: 3, type: PGS, lang: fre: {}
Matched internal subtitles track: Embedded, id: 3, type: PGS, lang: fre
Reading SupportedInternalSubtitlesFormats: "MICRODVD,SAMI,SUBRIP,TEXT" (default: "")
This video has embedded subtitles that must be transcoded

and your settings:

subtitles_languages = por, fre, ger, und
audio_subtitles_languages = eng,por;eng,und;*,por;*,und
audio_languages = eng,por,fre,ger,und

For that file the audio is English, so if you don't want French subtitles with English audio, maybe try setting audio_subtitles_languages = eng,por;eng,und;*,por;*,und;eng,off
Our subtitles preferences could really benefit from having a better GUI with dropdowns, it's on our very long to-do list :)

But then we still haven't solved transcoding not working. I can see that now we are sending this to the TV:

<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" bitrate="2873084" colorDepth="8" duration="1:36:34.624" nrAudioChannels="6" protocolInfo="http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_HD_AAC_EU;DLNA.ORG_OP=01" resolution="3840x1606" sampleFrequency="48000">http://192.168.1.15:5001/get/37/The.Nun.mkv_transcoded_to.ts</res>

Which is closer to what we want but we can do better.

In the MPEG-PS one we are sending:

<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" bitrate="2873084" colorDepth="8" duration="1:36:34.624" nrAudioChannels="6" protocolInfo="http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=01" resolution="3840x1606" sampleFrequency="48000">http://192.168.1.15:5001/get/170/The.Nun.mkv_transcoded_to.mpg</res>

and then we transcode using:

"C:\Program Files (x86)\Universal Media Server\win32\ffmpeg64.exe" -y -loglevel info -hwaccel auto -threads 1 -i C:\Users\carlo\Videos\The.Nun.mkv -filter_complex [0:v][0:s:3]overlay -map 0:V -map 0:a:0 -bufsize 7000k -maxrate 59000k -g 25 -qmax 7 -qmin 2 -ac 6 -ab 448k -c:a ac3 -c:v mpeg2video -f vob \\.\pipe\ffmpegvideo_134_1593801612299

and your TV told us it can play the format:

http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_FLAGS=8d700000000000000000000000000000

which seems good to me. So I'm not sure why your TV doesn't like that one. Maybe it wants us to also send the ORG_FLAGS part so let's try that before ruling that one out. Would you please try the following build with MPEG-TS and MPEG-PS transcoding?

If they don't work you could try limiting the TranscodeHeight and TranscodeWidth to 720x480. I don't like it as a final solution but it would be useful to know.

https://www.universalmediaserver.com/uploads/UMS-PhilipsAndroidTV-carlosvsilva.exe

So running this latest build I found a way for transcoding with ffmpeg at least to start working and burning in the correct subtitles:
I changed TranscodeVideo to MPEGTS-H264-AC3, as AAC yelds a message Format Not Supported on the TV and added TranscodedVideoFileSize = 1195000000 (the TV rejects values above this one).

TranscodeVideo = MPEGTS-H264-AC3 works (with FFMPEG, other transcoders don't work). In MPEG PS mode, transcoding doesn't seem to work with any transcoder on The Nun, but works with The New Pope but subjective quality looks inferior.

Browsing files, the TV media browser displays the file size passed in TranscodedVideoFileSize. I found the max size accepted tops out at 1195000000, roughly 1,11 Gb. The problem is the TV player stops playing upon reaching this media size played. I can see that because with a smaller value, the video stops earlier, with a larger value like this, the video stops later.

So there must be a way for the TV to transcode an entire video without stopping before the end. Count with my help to find it. Now, streaming the subtitles should work aswell. And I think UMS should try to read the external subtitle present at play time, not at program launch time. Thanks.

I also attach here the debug logs and two tcpdump packet captures of the transcoding ending early, and a successful streaming after. One for MPEGTS and another for MPEGPS. The packet captures should be relatively clean of network noise. They can be viewed in Wireshark . On this program open the .pcap file and right click any http packet and select Follow Stream to read the entire conversation in a clear window.
ums_dbg_2020-07-04-21-46_mpegps.zip
pcap-ums-mpegps-thenewpope-transcode-then-stream.zip
ums_dbg_2020-07-04-21-39_mpegts.zip
pcap-ums-mpegts-thenewpope-transcode1st-then-streaming.zip

Here are the debug and pcap files of a failed transcoding session with the option TranscodedVideoFileSize = 4000000000 .
pcap-ums-mpegps-thenewpope-transcode4Gb.zip
ums_dbg_2020-07-04-22-26-mpegts-4Gb.zip
ums_dbg_2020-07-04-22-31-mpegps-4Gb.zip
pcap-ums-mpegts-thenewpope-transcode4Gb.zip

The problem is the TV player stops playing upon reaching this media size played.

@carlosvsilva this gives me an idea about another bug we have with PlayStation 4. You're even helping us with other renderers :)
I'm glad we are finally able to transcode! I need to go AFK and will look at the logs later. Thanks

@carlosvsilva
Most of the renderers support AC3 instead of AAC so it is the first thing to change when I see [MPEGTS-H264-AAC] is used. About the file size limit. About the filesize limit I don't expect there is a hardcoded limit so small (for both streamed or transcoded files). Maybe we must change some other properties to make it work. E.g. try using -1 for [TranscodedVideoFileSize] what means to not send any filesize. Or try 0. Btw. I think when no size is sent you must to use (non)chunked transfer so try to play with this settings too [ChunkedTransfer=true/false] as I am not sure UMS code does it automatically.
@SubJunk what is the known bug with PS4 you mentioned? 😎

@ExSport the bug is that the PS4 sends a Stop message to us after roughly 20 minutes, but the time varies. There is a big thread on the forum https://www.universalmediaserver.com/forum/viewtopic.php?f=5&t=5563

@ExSport I tried changing TranscodedVideoFileSize to -1 and 0 and none of them worked. The only way the TV plays the transcoding is giving it a value below 1195000000. Setting ChunkedTransfer = true (I had already tested it before set to the default false) didn't change anything, upon reaching the TranscodedVideoFileSize the TV stops playing the video. Streaming seems ok apart from not streaming subtitles.
Do you have any more ideas ? Thanks

@carlosvsilva 1195000000 is a terribly strange "limit". Try 2147483647. If that works but 2147483648 fails, its limited 32 bit signed integers. If that's the case, it's a major flaw by Philips... which could probably be solved with a firmware update, if they actually tries to fix it.

@Nadahar The TV fails to display the file size at all in the media browser and fails to play it if the value is above 1195000000. So let's say I set it to 1200000000, it fails. Might be something else other than the 32bit integer, like the way UMS sends the information with the preview picture and file size to the TV when a file is selected. Because when streaming instead of transcoding everything works as supposed apart from the subtitles. Thanks.

Is this limit of 1195000000 specific for one particular file, or this a generic limit across different media? I could be some calculation based on the specified bitrate and duration that doesn't add up, but I can't quite find a correlation that would make this a logical limit. Have you tried 1195000001? I mean, is it this value exactly that is the limit, or is it just "in the area"?

This is the information UMS sent in one of the failed 4GB attempts above:

<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" bitrate="1260264" colorDepth="8" duration="0:46:30.480" nrAudioChannels="6" protocolInfo="http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_SD_AC3_EU_ISO;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=8d700000000000000000000000000000" resolution="1920x1080" sampleFrequency="48000" size="4000000000">http://192.168.1.15:5001/get/33/video.mkv_transcoded_to.ts</res>

I have a hard time to see exactly how these numbers (bitrate, duration and size) can lead to any specific limit around 1195000000. That said, one can't blame the renderer for expecting these values to actually make sense, which they certainly don't. You should be able to calculate the third from the other two, and this fails spectacularly, so it's not too surprising that the logic in the renderer might be "confused" and reject it.

Here is UPnP's definition of the three parameters:

'size' type: unsignedLong use: optional. The size, in bytes, of the resource.
'duration' type: string use: optional. The 'duration' attribute identifies the duration of the playback of the resource, at normal speed. The form of the duration string is: H*:MM:SS.F*, or H*:MM:SS.F0/F1 where :
  - H* means any number of digits (including no digits) to indicate elapsed hours
  - MM means exactly 2 digits to indicate minutes (00 to 59)
  - SS means exactly 2 digits to indicate seconds (00 to 59)
  - F* means any number of digits (including no digits) to indicate fractions of seconds
  - F0/F1 means a fraction, with F0 and F1 at least one digit long, and F0 < F1

  The string may be preceded by an optional + or – sign, and the decimal point itself may be omitted if there are no fractional second digits.
'bitrate' type: unsignedInt use: optional. The bitrate in bytes/second of the resource.

Please note the brilliant definition of bitrate:

The bitrate in bytes/second of the resource

Regardless, this means that size should be 3516136560 bytes calculated from bitrate and duration, so I don't understand how this would lead to a cap at 1195000000. It might be the other way around though, that it uses size and duration and concludes that this will lead to a too high bitrate for the renderer to handle, and thus rejects the file. Therefor it would be interesting to see if this "limit" is higher for another media with a longer duration.

So I found out that if I input 1200000000 as the limit, transcoding fails (and no proper filesize is displayed next to the file preview image). But 1195000000 enables both to play and display a file size. This happens for both The Nun 4K and The New Pope 105 FullHD, different codecs (H265 and H264).

Very peculiar. I can't help but think that this must be something with the TV. Can it handle larger sizes when not transcoding? I mean, have you tried streaming some video that is larger than 1.2 Gb?

yes, The Nun is around 16Gb if i'm not mistaken and streams perfectly despite the large size.

That means it's not the size itself, it must be some combination of information it receives that it rejects. That said, the DLNA profile used is wrong: DLNA.ORG_PN=AVC_TS_SD_AC3_EU_ISO. Combining this with resolution="1920x1080" is an obvious contradiction, in addition I can't even find that such a profile exists in the DLNA specification.

@carlosvsilva can you please try changing the audio codec to AC3 in the previous version (https://www.universalmediaserver.com/uploads/UMS-PhilipsAndroidTV-003f2fc.exe) and see if transcoding still works? I want to know if the progress with transcoding is related to the things I did in the latest build, or just that AC3 change.

I'll make you a new build for testing tomorrow

I tried that build 003f2fc and transcoding also worked using AC3 instead of AAC. I also specified SendSDOrgPN = false and it worked nonetheless. But I had to give it a small TranscodedVideoFileSize for transcoding to work. With large values it failed to transcode and display any filesize on the preview in the media browser. I attach here the debug files. Thanks.
ums_dbg_2020-07-08-20-13.zip

@carlosvsilva ah cool, so possibly even the latest official release would work the same way with AC3 :) Would you be able to confirm that too please? I know it's a lot of testing for you, sorry about that.

The bug we are left with is that transcoding duration issue. I have an idea about it - to not send the bitrate (which is wrong anyway) for transcoded videos. I'm on a mac at the moment and it's not set up for Windows builds, but I'll do that one in a few hours

@carlosvsilva that file that disable bitrate while transcoding is https://www.universalmediaserver.com/uploads/UMS-PhilipsAndroidTV-5654daf.exe

Hi I don't mind the testing, it's quick and I hope it will lead to a working version eheh
So I tried the latest 9.7.1 official version and with AC3 and TranscodedVideoFileSize = 5000000 and it worked aswell.
I then tried your version 9.7.2-SNAPSHOT with different parameters for TranscodedVideoFileSize (commented out, 5M, and 4Gb) and only TranscodedVideoFileSize = 5000000 worked (like before). I also tried with and without ChunkedTransfer = true and nothing changed. I'm attaching the respective debug logs. Thanks
ums_dbg_9.7.1-2020-07-09-21-28-T5M.zip
ums_dbg_9.7.2-SNAPSHOT-2020-07-09-21-41-NoTSize.zip
ums_dbg_9.7.2-SNAPSHOT-2020-07-09-21-43-T5M.zip
ums_dbg_9.7.2-SNAPSHOT-2020-07-09-21-45-T4Gb.zip

Thanks, I have another file which changes the bitrate we report to be the duration divided by the transcoded size. I hope that makes the math match up on the TV. Worth a try anyway: https://www.universalmediaserver.com/uploads/UMS-PhilipsAndroidTV-4f6707e.exe

The problem I'm trying to fix here is transcoded videos not playing all the way

Edit: A newer one https://www.universalmediaserver.com/uploads/UMS-PhilipsAndroidTV-054672c.exe

Hi I tried your newest one, UMS-PhilipsAndroidTV-054672c.exe and with TranscodedVideoFileSize = 4200000000 it failed to display file size and play. Without TranscodedVideoFileSize it also failed to play at all.
But with TranscodedVideoFileSize = 5000000 it played only the beggining but I noticed if I click "Resume TheNewPope 105" in the media browser, it played the next 5Mb of video, even after the initial 5Mb played. But it still doesn't play continuously from the beggining to the end. The Nun failed to play at all with T = 5Mb the TV went dark and a spinning wheel was displayed but never actually started to play the file. Check attached debug files. Thanks.
ums_dbg_2020-07-12-00-51-noTsize.zip
ums_dbg_2020-07-12-00-58-T4GbChunked.zip
ums_dbg_2020-07-12-01-09-T5M.zip

Here's what we sent to the TV:

<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" bitrate="1260264" colorDepth="8" duration="0:46:30.480" framerate="25p" nrAudioChannels="6" protocolInfo="http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_EU_ISO;DLNA.ORG_OP=01" resolution="1920x1080" sampleFrequency="48000" size="5000000">http://192.168.1.19:5001/get/144/pope.mkv_transcoded_to.ts</res>

<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" bitrate="862" colorDepth="10" duration="1:36:34.624" framerate="24p" nrAudioChannels="8" protocolInfo="http-get:*:video/x-matroska:DLNA.ORG_OP=01" resolution="3840x1606" sampleFrequency="48000" size="16648446456">http://192.168.1.19:5001/get/102/nun.mkv</res>

so obviously I didn't do my intended change correctly, I think I know what to change. Unfortunately now I'm away from my PC for a few days so I can't do a new test build until then, unless maybe @valib could compile and upload a build for you if I do the code change?

@SubJunk I can try.

@valib great, thanks. Could you please build 9e02c77 from the PhilipsAndroidTV branch?

@SubJunk I made it but I don't have permission to upload it to the https://www.universalmediaserver.com/uploads/

Could you use dropbox or mega or something? Otherwise I could send you ftp details

@valib thanks!

@carlosvsilva by the way, for testing, I think you can just do one test with no modifications, since we have established that your TV needs the transcoded size to be sent

Hi I've tested this latest build and the same thing happened. The New Pope plays just until the TranscodedVideoFileSize ends, but The Nun is also playing the beggining again. With 4Gb on TranscodedVideoFileSize nothing transcodes, only streams, chunked or non chunked. I'm attaching the debug files. If you need extra packet captures also let me know, because at 4Gb the player on TV goes dark, a spinning wheel starts spinning, and seems to be getting ready to start playing, but after a short while it goes back to the media browser stating it's not possible to find or read the file. Thanks.
ums_dbg_2020-07-13-23-37-T5M-Chunked.zip
ums_dbg_2020-07-13-23-42-T4Gb-Chunked.zip

I did some further testing and found a configuration that seemed to have played the video all the way altough with less than optimal quality: MPEGPS with TranscodedVideoFileSize = 100Gb and ChunkedTransfer = true. Can't we create a MPEGPS-H264-AC3 profile ? That would probably work in many renderers besides mine.

Here's what happened after I removed most configuration directives:

With MPEGTS-H264-AC3:
TranscodedVideoFileSize = 100000000000 (100Gb) displays file size of 1,13 Gb
With TranscodedVideoFileSize = 10000000000 (10Gb) displays filesize of 1,31 Gb
ffmpeg starts but quits after a few seconds but on the TV a dark screen with a wheel that keeps spinning as if buffering video to display when full.
chunkedtransfer = true seems to help, when false the browser will give up after some time of the buffering spinning wheel and says it can't find or play the file. when true the tv will be on the dark screen with spinning wheel forever.

With MPEGPS: it works as in out of a total of 46:30 length, 42:04 were played successfully (in fast forward maybe thats why it didn't finish after the correct length of time). Quality seems to suffer.

Renderer file that worked:

RendererName = Philips Android TV
RendererIcon = Philips-AndroidTV.png

UserAgentSearch = Android TV.Philips
UpnpDetailsSearch = Android TV.
Philips
LoadingPriority = 2

TranscodeAudio = MP3

TranscodedVideoFileSize = 100000000000
ChunkedTransfer = true
AccurateDLNAOrgPN = true

UseClosedCaption = true
SubtitleHttpHeader = CaptionInfo.sec
H264Level41Limited = false
MediaInfo = true

Supported = f:3g2|3gp v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9 a:aac-lc|ac3|eac3|he-aac|mp3|truehd|wav|wma vbd:8|10 m:video/3gpp
Supported = f:avi v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9 a:aac-lc|ac3|eac3|he-aac|mp3|truehd|wav|wma vbd:8|10 m:video/avi
Supported = f:mkv v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9 a:aac-lc|ac3|eac3|he-aac|mp3|truehd|wav|wma vbd:8|10 m:video/x-matroska
Supported = f:mp4 v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9 a:aac-lc|ac3|eac3|he-aac|mp3|truehd|wav|wma vbd:8|10 m:video/mp4
Supported = f:mpegps v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9 a:aac-lc|ac3|eac3|he-aac|mp3|truehd|wav|wma vbd:8|10 m:video/mpeg
Supported = f:mpegts v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9 a:aac-lc|ac3|eac3|he-aac|mp3|truehd|wav|wma vbd:8|10 m:video/vnd.dlna.mpeg-tts
Supported = f:wmv v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9 a:aac-lc|ac3|eac3|he-aac|mp3|truehd|wav|wma vbd:8|10 m:video/x-ms-wmv

Supported = f:adts n:2 a:aac-lc m:audio/vnd.dlna.adts
Supported = f:aiff|wav n:2 a:lpcm m:audio/L16
Supported = f:mp3|mpa n:2 m:audio/mpeg
Supported = f:mp4 n:6 a:aac-lc m:audio/mp4
Supported = f:wma n:2 a:wma m:audio/x-ms-wma

SupportedExternalSubtitlesFormats = MICRODVD,SAMI,SUBRIP,TEXT
SupportedInternalSubtitlesFormats = MICRODVD,SAMI,SUBRIP,TEXT

Debug files:
ums_dbg_2020-07-14-01-10-MPEGPS-T100Gb-ChunkedTrue.zip
ums_dbg_2020-07-14-01-01-MPEGTS-T100Gb.zip
ums_dbg_2020-07-14-01-01-MPEGTS-T100Gb-ChunkedFalse.zip

@carlosvsilva thanks. Here's are some snippets from the logs for reference:

MPEG-TS:

<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" bitrate="1791" colorDepth="8" duration="0:46:30.480" framerate="25p" nrAudioChannels="6" protocolInfo="http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_EU_ISO;DLNA.ORG_OP=01" resolution="1920x1080" sampleFrequency="48000" size="5000000">http://192.168.1.15:5001/get/181/the.new.pope.mkv_transcoded_to.ts</res>
HEADER:
  HTTP/1.1 200 OK (non-chunked)
  TransferMode.DLNA.ORG: Streaming
  Content-Type: video/vnd.dlna.mpeg-tts
  Accept-Ranges: bytes
  Connection: keep-alive
  Server: Windows_10-amd64-10.0, UPnP/1.0 DLNADOC/1.50, UMS/9.7.3-SNAPSHOT

HEADER:
  Cache-Control: no-cache
  transferMode.dlna.org: Streaming
  User-Agent: OkHttpConnection/2.3.0 (Linux;Android 6.0)
  Pragma: no-cache
  Accept-Encoding: gzip
  Range: bytes=1195278608-
  Host: 192.168.1.15:5001
  Connection: Keep-Alive



md5-5abfac5cda4cb0cab2277fb63ddd5d28



<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" bitrate="35836128" colorDepth="8" duration="0:46:30.480" framerate="25p" nrAudioChannels="6" protocolInfo="http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=01" resolution="1920x1080" sampleFrequency="48000" size="100000000000">http://192.168.1.15:5001/get/205/the.new.pope.mkv_transcoded_to.mpg</res>



md5-88e28344bfdaf62dc7bc0e7a09b181c4



HEADER:
  HTTP/1.1 200 OK (non-chunked)
  TransferMode.DLNA.ORG: Streaming
  Content-Type: video/mpeg
  Accept-Ranges: bytes
  Connection: keep-alive
  Server: Windows_10-amd64-10.0, UPnP/1.0 DLNADOC/1.50, UMS/9.7.3-SNAPSHOT

HEADER:
  Cache-Control: no-cache
  transferMode.dlna.org: Streaming
  User-Agent: OkHttpConnection/2.3.0 (Linux;Android 6.0)
  Pragma: no-cache
  Accept-Encoding: gzip
  Host: 192.168.1.15:5001
  Connection: Keep-Alive

We can try adding H.264 to MPEG-PS but I think we have done that before and it didn't work.
Can you try going to the General Settings tab and unchecking "HTTP Engine V2", and trying with MPEGTS-H264-AC3 again?

Another thing to try is changing the MIME type for MPEG-TS to match MPEG-PS in the renderer config, so it would be:
Supported = f:mpegts v:divx|h264|h265|mpeg1|mpeg2|mp4|vp9 a:aac-lc|ac3|eac3|he-aac|mp3|truehd|wav|wma vbd:8|10 m:video/mpeg

Hi! I tested again following your suggestions and it led to these results:
With MPEGTS, and HTTP V2 disabled and with and without MIME Type video/mpeg in mpegts line:

The TV stays black with a spinning wheel forever when I play the file.
When I open http://192.168.1.15:5001/get/181/the.new.pope.mkv_transcoded_to.ts with VLC only a frame is displayed and nothing more (but it could belong to another file).

With MPEGPS-H264-AC3 and HTTP V2 enabled, things work but the quality is very inferior to MPEGTS. The video becomes really blocky with visible squares. See attached debug files. Thanks.

ums_dbg_2020-07-14-13-29-MPEGTS-NoHTTPv2.zip
ums_dbg_2020-07-14-13-41-MPEGTS-NoHTTPv2-video-mpeg-mime.zip
ums_dbg_2020-07-14-13-53-MPEGPS-H264-HTTP2-blocky.zip

@SubJunk seems that this renderer supports only those combinations for MPEG-TS

  http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU;DLNA.ORG_FLAGS=8d700000000000000000000000000000
  http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000
  http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_EU_ISO;DLNA.ORG_FLAGS=8d700000000000000000000000000000
  http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_60_L2_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000
  http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_60_AC3_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000
  http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_50_L2_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000
  http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_50_AC3_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000

For DLNA.ORG_PN=MPEG_TS_SD_EU_ISO the mime is video/mpeg for the rest is video/vnd.dlna.mpeg-tts
Also it supports only SD resolution so the resolution 1920x1080 is above this. It could be 720 x 480 or 720 x 576 for PAL

I tried many combinations of HTTP server v2 off, SendSDOrgPN = true, AccurateDLNAOrgPN = true, m:video/mpeg and m:video/vnd.dlna.mpeg-tts but couldn't get the current configuration of MPEGTS to really work, as the screen always goes dark with a spinning wheel spinning without playing the actual video.
I think the answer might be in MPEGPS with higher quality settings for transcoding.
The other issue is this filetype/codec shouldn't trigger a transcode, it should stream and display streamed subtitles. Thanks.

@carlosvsilva thanks for trying those. If you're on a wired network or you want to try your luck on a fast wireless network, you can improve the quality of MPEG-2 transcoding (which is still being used with MPEGPS-H264-AC3 since that profile doesn't exist) via the Transcoding Settings tab, change the Transcoding quality (MPEG-2) to Automatic (Wired), as you now have it set to Automatic (Wireless).
If you actually are on wireless though, I doubt it will be fast enough to do 4k or usually even 1080p with MPEG-2 video at that wired quality setting. Worth a try though.

We can see if we can hack together H.264 inside MPEG-PS container soon. It would be a hack but if it lets your TV play it it would be worth it.

@carlosvsilva I have uploaded mpegps-h264 to https://www.universalmediaserver.com/uploads/UMS-mpegpsh264.exe
I'm not even sure if FFmpeg will output that at all but it's worth a try

@carlosvsilva are you still with us? :)

Yes I am, but on holidays away from the TV for now. I tried the MPEGPS-H264 and it worked great (apart from some color corruption some minutes into the show), but it cut the transmission short, I guess around the 1,13Gb which is the filesize reported in the TVs media browser. Even with the TranscodedVideoFileSize = 100000000000 (100Gb).

Ok, cool. I hope you have a good holiday. I'll put together another test soon to try to alter that 1.13Gb value

I think I will need the logs when you're ready

Thanks, I'm back and ready to test new builds :)

Here are the logs of MPEGPS-H264-AC3 of a file playing which displays 1,13Gb filesize in the browser and cuts the transmission short.
ums_dbg_2020-08-10-18-52-MPEGPS-H264-AC3-limitedfilesize.zip

@carlosvsilva thanks. By the way we are getting a lot of good feedback about version 9.8.0 thanks to you - a lot of the changes I've made based on your testing got released.

I can see in your logs that http_engine_v2 is false. Can you try with that set to true? Since that is the default, and is the one that is usually maintained

@carlosvsilva are you still around?

Yes! I'm really happy my efforts have been contributing to the new releases :) I'd like to keep it going, I wasn't around the Philips TV lately but now I am, I will send you the logs with http_engine_v2 set to true soon. Thanks.

Hi here are the logs with http_engine_v2 set to true. I played the file with 9.7.3-custom and 9.8.1-release. Thanks.
ums_dbg_9.7.3-mpegps-h264-slightcorruption-1.13filesize-2020-09-12-13-52.zip
ums_dbg_9.8.1-mpegps-h264-1.13gb-filesize-2020-09-12-13-57.zip

Using UMS 9.8.1 I still can't stream subtitles to the Philips Android TV native dlna player using no transcoding option, so I worked around it by replacing every subtitle in the .mkv file itself with the portuguese srt subtitles using this command from package mkvtoolnix in Linux/WSL:
mkvmerge -o output.mkv -S movie.mkv --sub-charset "0:utf-8" --language 0:por subtitles.srt
utf-8 must be replaced with the output of file -b --mime-encoding subtitles.srt
Took about 2 minutes to run on a 4K/H265 HDR movie, since it only remuxes the MKV, doesn't reencode anything.

Another issue that happens with a 4K/H265 movie is in Kodi it shows up squashed , and even KeepAspectRatio didn't work. I don't know where the bug is, but since only Kodi plays subtitles from UMS easily, it was my last hope to watch movies without trouble on the Philips OLED in the current state of things.

So when watching this 4K/H265 movie with "No transcoding/portuguese subrip subtitles" mode, the TV dlna player stops midfilm and doesn't play past an arbitrary point, different in each try. Sometimes, after trying to watch the movie again the TV can't play the file anymore from UMS even after restarting it. I even had to unplug the TV power and plug it back on to be able to play the movie from UMS again successfully.

It's a big inconvenient having the movies interrupted in the middle like it happens currently. Can you please try to fix it? Thanks.
Here are the logs:
ums_dbg_2020-10-04-19-16-Cant-find-the-file.zip
ums_dbg_2020-10-04-20-28-ums-doesnt-work-anymore-fresh-start.zip
ums_dbg_2020-10-04-19-16-stopped midfilm.zip
ums_dbg_2020-10-04-19-16-cantfindorreadthefile.zip
ums_dbg_2020-10-04-19-16-stopped midfilm with wired settings.zip

Another issue that happens with a 4K/H265 movie is in Kodi it shows up squashed , and even KeepAspectRatio didn't work. I don't know where the bug is, but since only Kodi plays subtitles from UMS easily, it was my last hope to watch movies without trouble on the Philips OLED in the current state of things.

Apparently this bug was fixed in the latest version of Philips firmware, i just updated the TV.

That is certainly strange that it stops mid way, I use UMS every day and haven't experienced that. I will look at your logs

There are a lot of "Connection reset" errors appearing which seems to come from a dependency of ours. I do have one thing to try with that, I'll upload a test file

TRACE 2020-10-04 19:32:00.417 [HTTPv2 Request Worker 9] net.pms.network.RequestHandlerV2 
java.net.SocketException: Connection reset
    at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(Unknown Source)
    at java.base/sun.nio.ch.SocketChannelImpl.read(Unknown Source)
    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
    at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
    at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
    at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)

Can you try https://www.universalmediaserver.com/uploads/UMS-connection_reset-10f263f.exe

Yes I installed it and it's still displaying a lot of connection reset exceptions. Logs attached.
ums_dbg_2020-10-11-17-49-conn-reset-by-peer.zip

The same 4K/H.265 movie stopped playing around the 50m mark like before. Then the media browser can't no longer find or read the file. Logs attached.
ums_dbg_2020-10-11-17-49-movie-interrupted-at-50m-playtime.zip

ums_dbg_2020-10-11-17-49-cant-find-or-read-the-file.zip

I noticed in the logs that the exception seems to happen whenever we let the renderer know about subtitles. So we do:

TRACE 2020-10-11 17:50:40.124 [HTTPv2 Request Worker 2] net.pms.network.RequestV2 Transfer response sent to Philips OLED [Philips Android TV]:

HEADER:
  HTTP/1.1 206 Partial Content (non-chunked)
  TransferMode.DLNA.ORG: Streaming
  CaptionInfo.sec: http://192.168.1.51:5001/get/140/subtitle0000.srt
  Content-Type: video/x-matroska
  Content-Range: bytes 1080069-13213994183/13213994184
  Accept-Ranges: bytes
  Connection: keep-alive
  Server: Windows_10-amd64-10.0, UPnP/1.0 DLNADOC/1.50, UMS/9.8.2-SNAPSHOT
  Content-Length: 13212914115

Which is then following by:

TRACE 2020-10-11 17:50:40.264 [HTTPv2 Request Worker 1] net.pms.network.RequestHandlerV2 
java.net.SocketException: Connection reset
    at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(Unknown Source)
    at java.base/sun.nio.ch.SocketChannelImpl.read(Unknown Source)
    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
    at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
    at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
    at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)

Usually about 120-150ms later.

Would you please try editing the renderer config file Philips-AndroidTV.conf to remove the lines:

UseClosedCaption = true
SubtitleHttpHeader = CaptionInfo.sec

Edit: That can just be done using our latest release

Edit 2: If that doesn't fix it, please try disabling subtitles via the Transcoding Settings tab in the program settings, just for testing

Hi seems to still happen with subtitles completely disabled both in conf file and in Transcoding options. Logs are attached.
ums_dbg_2020-11-01-11-08-noclosedcaptions.zip
ums_dbg_2020-11-01-11-10-nosubsatall-9.8.2.zip

@carlosvsilva thanks, what about if you set ChunkedTransfer to false in the renderer config?

Another idea I had is to try another renderer like using the VLC app on your phone, or anything, to see if the connection resets are unique to your TV

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SubJunk picture SubJunk  ·  42Comments

onon765trb picture onon765trb  ·  37Comments

chrismoberly picture chrismoberly  ·  43Comments

MediaMania1 picture MediaMania1  ·  40Comments

Tyestor picture Tyestor  ·  53Comments