Jump to content

Device Profile


Angelblue05

Recommended Posts

Angelblue05

@@Luke

 

I just want to make sure I'm doing the right thing.

 

I have my device profile setup as you know. I wish to transcode video with profile Main 10.

 

I added the following codec profile, is it correct? It seems to work, EXCEPT.

                {
                    'Type': 'Video',
                    'Codec': "h265,hevc",
                    'Conditions': [
                        {
                            'Condition': "EqualsAny",
                            'Property': "VideoProfile",
                            'Value': "main"
                        }
                    ]
                }

The video I am playing is hevc, it transcodes to h264. How do you achieve "partial" transcode with the device profile system? Is there a way to give it a list of possible video and audio codecs supported in one transcoding profile, like below and the server will pick the one that is appropriate? For example, if I transcode the audio for h264, I want it o play h264 with the transcoded audio. But using the profile below causes the video to be transcoded to h265.

{
        	"Container": "m3u8",
                "Type": "Video",
                "AudioCodec": "aac,mp3,ac3,opus,flac,vorbis",
                "VideoCodec": "hevc,h265,h264,mpeg4,mpeg2video",
                "MaxAudioChannels": "6"
        	}
Edited by Angelblue05
Link to comment
Share on other sites

Yes you can do that and list multiple but pay attention to the first ones.

 

Put h264 first as that is what will be used if transcoding is needed.

  • Like 1
Link to comment
Share on other sites

Make sure you add the &AllowVideoStreamCopy=false to the end of the playback URL Emby gives you whenever you want the default(first codec) to transcode. Otherwise(with = true which is default) it would always copy the video stream and produce a remux/directstream. You could still do hevc->hevc and get a full transcode if you want to use hevc. You wanted to use h264 because it was always copying?

 

You may already know that part and if you didn't you know now. :)

Edited by speechles
  • Like 1
Link to comment
Share on other sites

 

 

Make sure you add the &AllowVideoStreamCopy=false to the end of the playback URL

 

No, do not do this for all playback attempts. This is only when you're retrying after failures.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
Angelblue05

@@Luke

 

I have a few users with HTTP playback urls (they are not considered strm by the server).

 

How does the server decides if an HTTP stream can be directly played, direct stream or transcode?

 

I have one user that has playbackinfo return not able to direct Play, another that returns not being able to direct play and stream, only transcode. I have one user where it says all three can be done, so the add-on will try direct play, but the file will not load in Kodi.

 

I can't force HTTP to go through the server, one user's http stream do not work that way. Is there a way to know the deciding factor?

Edited by Angelblue05
Link to comment
Share on other sites

Angelblue05

it's really the exact same logic as regular video files.

So then it's a server error? It should not return SupportsDirectPlay as True when it can't be directly played. Other users have the correct behavior, but with that one user, his HTTP urls returns with SupportsDirectPlay.

 

How to fix this?

Link to comment
Share on other sites

Angelblue05

Here is the media source, but this only works as direct stream (it is possibly a strm to begin with, but no way of knowing that from that media source). Edit: This is indeed a strm file. Looks like the source was scraped and now this is where we land.

{
  u'PlaySessionId': u'cac9adfb5ccb4c21824626395f3759c0',
  u'MediaSources': [
    {
      u'SupportsDirectStream': True,
      u'Container': u'mkv',
      u'RequiresClosing': False,
      u'DefaultAudioStreamIndex': 2,
      u'MediaStreams': [
        {
          u'IsInterlaced': False,
          u'Title': u'cred.II.2018.2160p.BluRay.x265.10bit.SDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ',
          u'AverageFrameRate': 23.9760246,
          u'Width': 3840,
          u'VideoRange': u'SDR',
          u'Codec': u'hevc',
          u'IsForced': False,
          u'AspectRatio': u'2.40:1',
          u'Type': u'Video',
          u'IsTextSubtitleStream': False,
          u'Profile': u'Main 10',
          u'DisplayTitle': u'4K HEVC',
          u'SupportsExternalStream': False,
          u'CodecTimeBase': u'1001/24000',
          u'RealFrameRate': 23.9760246,
          u'Level': 153,
          u'RefFrames': 1,
          u'TimeBase': u'1/1000',
          u'BitRate': 26119005,
          u'IsDefault': True,
          u'IsAnamorphic': False,
          u'Protocol': u'File',
          u'Index': 0,
          u'Height': 1608,
          u'PixelFormat': u'yuv420p10le',
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'English Dolby Digital 5.1',
          u'ChannelLayout': u'5.1',
          u'Language': u'eng',
          u'Title': u'cred.II.2018.2160p.BluRay.x265.10bit.SDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ',
          u'Index': 1,
          u'Type': u'Audio',
          u'DisplayLanguage': u'English',
          u'Level': 0,
          u'Channels': 6,
          u'Codec': u'ac3',
          u'SupportsExternalStream': False,
          u'CodecTimeBase': u'1/48000',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'SampleRate': 48000,
          u'BitRate': 448000,
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'English TRUEHD 7.1 (Default)',
          u'ChannelLayout': u'7.1',
          u'Language': u'eng',
          u'Title': u'cred.II.2018.2160p.BluRay.x265.10bit.SDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ',
          u'Index': 2,
          u'DisplayLanguage': u'English',
          u'Level': 0,
          u'IsTextSubtitleStream': False,
          u'Channels': 8,
          u'Codec': u'truehd',
          u'SupportsExternalStream': False,
          u'CodecTimeBase': u'1/48000',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'SampleRate': 48000,
          u'Type': u'Audio',
          u'BitDepth': 24,
          u'IsDefault': True,
          u'IsExternal': False
        },
        {
          u'Profile': u'DTS-HD MA',
          u'IsInterlaced': False,
          u'DisplayTitle': u'DTS 7.1',
          u'BitDepth': 24,
          u'ChannelLayout': u'7.1',
          u'Title': u'cred.II.2018.2160p.BluRay.x265.10bit.SDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ',
          u'Index': 3,
          u'IsForced': False,
          u'Level': 0,
          u'Channels': 8,
          u'Codec': u'dts',
          u'SupportsExternalStream': False,
          u'CodecTimeBase': u'1/48000',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'SampleRate': 48000,
          u'Type': u'Audio',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'English (Default SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'eng',
          u'Title': u'English-SRT',
          u'Index': 4,
          u'DisplayLanguage': u'English',
          u'Score': 11221,
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': True,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'English (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'eng',
          u'Title': u'English-SDH-SRT',
          u'Index': 5,
          u'DisplayLanguage': u'English',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'English (PGSSUB)',
          u'SupportsExternalStream': False,
          u'Language': u'eng',
          u'Title': u'English-PGS',
          u'Index': 6,
          u'DisplayLanguage': u'English',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'French (PGSSUB)',
          u'SupportsExternalStream': False,
          u'Language': u'fre',
          u'Title': u'French-PGS',
          u'Index': 7,
          u'DisplayLanguage': u'French',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Spanish (PGSSUB)',
          u'SupportsExternalStream': False,
          u'Language': u'spa',
          u'Title': u'Spanish-PGS',
          u'Index': 8,
          u'DisplayLanguage': u'Spanish',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Danish (PGSSUB)',
          u'SupportsExternalStream': False,
          u'Language': u'dan',
          u'Title': u'Danish-PGS',
          u'Index': 9,
          u'DisplayLanguage': u'Danish',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Finnish (PGSSUB)',
          u'SupportsExternalStream': False,
          u'Language': u'fin',
          u'Title': u'Finnish-PGS',
          u'Index': 10,
          u'DisplayLanguage': u'Finnish',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Norwegian (PGSSUB)',
          u'SupportsExternalStream': False,
          u'Language': u'nor',
          u'Title': u'Norwegian-PGS',
          u'Index': 11,
          u'DisplayLanguage': u'Norwegian',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Swedish (PGSSUB)',
          u'SupportsExternalStream': False,
          u'Language': u'swe',
          u'Title': u'Swedish-PGS',
          u'Index': 12,
          u'DisplayLanguage': u'Swedish',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Greek, Modern (1453-) (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'gre',
          u'Index': 13,
          u'DisplayLanguage': u'Greek, Modern (1453-)',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Spanish (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'spa',
          u'Index': 14,
          u'DisplayLanguage': u'Spanish',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Finnish (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'fin',
          u'Index': 15,
          u'DisplayLanguage': u'Finnish',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'French (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'fre',
          u'Index': 16,
          u'DisplayLanguage': u'French',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Croatian (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'hrv',
          u'Index': 17,
          u'DisplayLanguage': u'Croatian',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Hungarian (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'hun',
          u'Index': 18,
          u'DisplayLanguage': u'Hungarian',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Dutch (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'dut',
          u'Index': 19,
          u'DisplayLanguage': u'Dutch',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Norwegian (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'nor',
          u'Index': 20,
          u'DisplayLanguage': u'Norwegian',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Polish (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'pol',
          u'Index': 21,
          u'DisplayLanguage': u'Polish',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Portuguese (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'por',
          u'Index': 22,
          u'DisplayLanguage': u'Portuguese',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Romanian (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'rum',
          u'Index': 23,
          u'DisplayLanguage': u'Romanian',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Swedish (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'swe',
          u'Index': 24,
          u'DisplayLanguage': u'Swedish',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Turkish (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'tur',
          u'Index': 25,
          u'DisplayLanguage': u'Turkish',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Arabic (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'ara',
          u'Index': 26,
          u'DisplayLanguage': u'Arabic',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsForced': False,
          u'IsInterlaced': False,
          u'DisplayTitle': u'Danish (SUBRIP)',
          u'SupportsExternalStream': True,
          u'Language': u'dan',
          u'Index': 27,
          u'DisplayLanguage': u'Danish',
          u'DeliveryMethod': u'Embed',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'Protocol': u'File',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'Index': 28,
          u'Width': 1067,
          u'Codec': u'mjpeg',
          u'IsForced': False,
          u'AspectRatio': u'16:9',
          u'Type': u'EmbeddedImage',
          u'IsTextSubtitleStream': False,
          u'Profile': u'192',
          u'BitDepth': 8,
          u'SupportsExternalStream': False,
          u'ColorSpace': u'bt470bg',
          u'CodecTimeBase': u'0/1',
          u'RealFrameRate': 90000,
          u'Level': -99,
          u'RefFrames': 1,
          u'TimeBase': u'1/90000',
          u'IsDefault': False,
          u'IsAnamorphic': False,
          u'Protocol': u'File',
          u'Height': 600,
          u'PixelFormat': u'yuvj444p',
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'Index': 29,
          u'Width': 120,
          u'Codec': u'mjpeg',
          u'IsForced': False,
          u'Type': u'EmbeddedImage',
          u'IsTextSubtitleStream': False,
          u'Profile': u'192',
          u'BitDepth': 8,
          u'SupportsExternalStream': False,
          u'ColorSpace': u'bt470bg',
          u'CodecTimeBase': u'0/1',
          u'RealFrameRate': 90000,
          u'Level': -99,
          u'RefFrames': 1,
          u'TimeBase': u'1/90000',
          u'IsDefault': False,
          u'IsAnamorphic': False,
          u'Protocol': u'File',
          u'Height': 176,
          u'PixelFormat': u'yuvj444p',
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'Index': 30,
          u'Width': 213,
          u'Codec': u'mjpeg',
          u'IsForced': False,
          u'AspectRatio': u'16:9',
          u'Type': u'EmbeddedImage',
          u'IsTextSubtitleStream': False,
          u'Profile': u'192',
          u'BitDepth': 8,
          u'SupportsExternalStream': False,
          u'ColorSpace': u'bt470bg',
          u'CodecTimeBase': u'0/1',
          u'RealFrameRate': 90000,
          u'Level': -99,
          u'RefFrames': 1,
          u'TimeBase': u'1/90000',
          u'IsDefault': False,
          u'IsAnamorphic': False,
          u'Protocol': u'File',
          u'Height': 120,
          u'PixelFormat': u'yuvj444p',
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'Index': 31,
          u'Width': 600,
          u'Codec': u'mjpeg',
          u'IsForced': False,
          u'Type': u'EmbeddedImage',
          u'IsTextSubtitleStream': False,
          u'Profile': u'192',
          u'BitDepth': 8,
          u'SupportsExternalStream': False,
          u'ColorSpace': u'bt470bg',
          u'CodecTimeBase': u'0/1',
          u'RealFrameRate': 90000,
          u'Level': -99,
          u'RefFrames': 1,
          u'TimeBase': u'1/90000',
          u'IsDefault': False,
          u'IsAnamorphic': False,
          u'Protocol': u'File',
          u'Height': 882,
          u'PixelFormat': u'yuvj444p',
          u'IsExternal': False
        }
      ],
      u'Type': u'Default',
      u'ReadAtNativeFramerate': False,
      u'RequiresLooping': False,
      u'Path': u'http://xx.xxxxxx.xxx:80/movie/dsfsf580/vsdfsdfd/26390.mkv',
      u'RequiresOpening': False,
      u'Bitrate': 26119005,
      u'IsRemote': True,
      u'Name': u'credII(2018) - 4K UHD',
      u'RequiredHttpHeaders': {
        
      },
      u'SupportsTranscoding': True,
      u'SupportsDirectPlay': True,
      u'Formats': [
        
      ],
      u'Protocol': u'Http',
      u'IsInfiniteStream': False,
      u'RunTimeTicks': 78004910000L,
      u'DefaultSubtitleStreamIndex': 4,
      u'SupportsProbing': False,
      u'Id': u'81fbc4e37b7b467131109e850aed7e23',
      u'Size': 25467633722L
    }
  ]
}
Edited by Angelblue05
Link to comment
Share on other sites

Why do you think there's a server error? I don't quite understand, sorry.

Link to comment
Share on other sites

Angelblue05

Ok I'll try to be clearer, sorry. The media source I posted above comes from a user that has HTTP urls. The server returns SupportsDirectPlay True BUT that is wrong. Because I try to direct play the file, and it fails. If it direct stream, it works. So SupportsDirectPlay should be False hence server error in my mind.

 

Here is the media source for other another user with HTTP urls. But look, his return False for both SupportsDirectPlay and SupportsDirectStream as it should, playback transcodes and we are good.

 

So my question is, why is the first one returning SupportsDirectPlay True, and how do we make it return SupportsDirectPlay False like that second user..

{
  u'PlaySessionId': u'87b94b3dfc344c71ac7a32623f1c581d',
  u'MediaSources': [
    {
      u'SupportsDirectStream': False,
      u'Container': u'mkv',
      u'RequiresClosing': False,
      u'IgnoreDts': False,
      u'IgnoreIndex': False,
      u'DefaultAudioStreamIndex': 1,
      u'SupportsDirectPlay': False,
      u'TranscodingUrl': u'/videos/716479/stream.m3u8?DeviceId=8D973CDCEF1A4A1995A6C349CD45B8F7&MediaSourceId=2e84a4d513c198d4950de52095699d1e&VideoCodec=h264,h265,hevc,mpeg4,mpeg2video&AudioCodec=aac,mp3,ac3,opus,flac,vorbis&VideoBitrate=39360000&AudioBitrate=640000&PlaySessionId=87b94b3dfc344c71ac7a32623f1c581d&api_key={emby-token}&AudioStreamIndex=1&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6',
      u'MediaStreams': [
        {
          u'IsInterlaced': False,
          u'Index': 0,
          u'AverageFrameRate': 23.976024599999999,
          u'Width': 1920,
          u'VideoRange': u'SDR',
          u'Codec': u'vc1',
          u'IsForced': False,
          u'AspectRatio': u'16:9',
          u'Type': u'Video',
          u'IsTextSubtitleStream': False,
          u'Profile': u'Advanced',
          u'DisplayTitle': u'1080p VC1',
          u'SupportsExternalStream': False,
          u'CodecTimeBase': u'1001/48000',
          u'RealFrameRate': 23.976024599999999,
          u'CodecTag': u'WVC1',
          u'Level': 3,
          u'RefFrames': 1,
          u'TimeBase': u'1/1000',
          u'BitRate': 28985488,
          u'IsDefault': True,
          u'IsAnamorphic': False,
          u'Height': 1080,
          u'PixelFormat': u'yuv420p',
          u'IsExternal': False
        },
        {
          u'Profile': u'DTS',
          u'IsInterlaced': False,
          u'DisplayTitle': u'Ger DTS 5.1 Default',
          u'ChannelLayout': u'5.1',
          u'Language': u'ger',
          u'Index': 1,
          u'Type': u'Audio',
          u'IsForced': False,
          u'Level': 0,
          u'Channels': 6,
          u'Codec': u'dts',
          u'SupportsExternalStream': False,
          u'CodecTimeBase': u'1/48000',
          u'TimeBase': u'1/1000',
          u'SampleRate': 48000,
          u'BitRate': 768000,
          u'IsTextSubtitleStream': False,
          u'IsDefault': True,
          u'IsExternal': False
        },
        {
          u'Profile': u'DTS-HD MA',
          u'IsInterlaced': False,
          u'DisplayTitle': u'Eng DTS 5.1',
          u'ChannelLayout': u'5.1',
          u'Language': u'eng',
          u'Index': 2,
          u'IsForced': False,
          u'Level': 0,
          u'IsTextSubtitleStream': False,
          u'Channels': 6,
          u'Codec': u'dts',
          u'SupportsExternalStream': False,
          u'CodecTimeBase': u'1/48000',
          u'TimeBase': u'1/1000',
          u'SampleRate': 48000,
          u'Type': u'Audio',
          u'BitDepth': 24,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Ger Default',
          u'SupportsExternalStream': True,
          u'Language': u'ger',
          u'Title': u'forced SRT',
          u'Index': 3,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'subrip',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': True,
          u'IsDefault': True,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Ger',
          u'SupportsExternalStream': False,
          u'Language': u'ger',
          u'Title': u'forced PGS',
          u'Index': 4,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Ger',
          u'SupportsExternalStream': False,
          u'Language': u'ger',
          u'Title': u'PGS',
          u'Index': 5,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Ger',
          u'SupportsExternalStream': False,
          u'Language': u'ger',
          u'Title': u'VOBSUB',
          u'Index': 6,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'DVDSUB',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Eng',
          u'SupportsExternalStream': False,
          u'Language': u'eng',
          u'Title': u'PGS',
          u'Index': 7,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Eng',
          u'SupportsExternalStream': False,
          u'Language': u'eng',
          u'Title': u'VOBSUB',
          u'Index': 8,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'DVDSUB',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        }
      ],
      u'Type': u'Default',
      u'ReadAtNativeFramerate': False,
      u'RequiresLooping': False,
      u'Path': u'http://usa-cl1.monkeydevices.com:9989/default.py?kv=uufWPB+ukimINQbi6sneWlr8OWHmwD---U3TWvXlEQLGjMyKmpOxc6A0mhh4+0wbCf2e6QDraARycIfpsrfeMiQp3ZebkXGaoSNjElDeYBPHsa9cCU5Q794Ryh---ZrpGHsj76gycKuObJTDG5C2i7+zuapsTtFAdQpvaeBT+nJKoQDAVXEcNST208iYvdPsDmVuZxNEdbIbJZKyOjY2vb4DZAufXpQSU6n7TAPHhas6mI---ijUrJ5g3tTQpWeWjPDz6CoVYiZZKibND423NrC1UpsdEJU9KJxFyB4UOGhM6H3RfrBkQv6YrBw2vvTpueAQoInCLaDvKn0Mpkq3gQrjTwkQ==',
      u'RequiresOpening': False,
      u'Bitrate': 28985488,
      u'IsRemote': True,
      u'Name': u'original 1080p',
      u'TranscodingContainer': u'm3u8',
      u'RequiredHttpHeaders': {
        
      },
      u'SupportsTranscoding': True,
      u'DiscardCorruptPts': False,
      u'Formats': [
        
      ],
      u'Protocol': u'Http',
      u'IsInfiniteStream': False,
      u'RunTimeTicks': 64558718976L,
      u'FillWallClockDts': False,
      u'DefaultSubtitleStreamIndex': -1,
      u'SupportsProbing': True,
      u'Id': u'2e84a4d513c198d4950de52095699d1e',
      u'Size': 23390825227L
    },
    {
      u'SupportsDirectStream': False,
      u'Container': u'mkv',
      u'RequiresClosing': False,
      u'IgnoreDts': False,
      u'IgnoreIndex': False,
      u'DefaultAudioStreamIndex': 1,
      u'SupportsDirectPlay': False,
      u'TranscodingUrl': u'/videos/716479/stream.m3u8?DeviceId=8D973CDCEF1A4A1995A6C349CD45B8F7&MediaSourceId=6a9825f8c13201cbf3651f2673b7fc7c&VideoCodec=h264,h265,hevc,mpeg4,mpeg2video&AudioCodec=aac,mp3,ac3,opus,flac,vorbis&VideoBitrate=39616000&AudioBitrate=384000&PlaySessionId=87b94b3dfc344c71ac7a32623f1c581d&api_key={emby-token}&AudioStreamIndex=1&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6',
      u'MediaStreams': [
        {
          u'IsInterlaced': False,
          u'Title': u'MPEG-H HEVC Video / 62863 kbps / 2160p / 23.976 fps / 16:9 / Main 10 Profile 5.1 High / 4:2:0 / 10 bits / HDR / BT.2020',
          u'AverageFrameRate': 23.976024599999999,
          u'Width': 3840,
          u'VideoRange': u'HDR',
          u'Codec': u'hevc',
          u'IsForced': False,
          u'AspectRatio': u'16:9',
          u'Type': u'Video',
          u'IsTextSubtitleStream': False,
          u'Profile': u'Main 10',
          u'TimeBase': u'1/1000',
          u'SupportsExternalStream': False,
          u'ColorSpace': u'bt2020nc',
          u'CodecTimeBase': u'1001/24000',
          u'ColorTransfer': u'smpte2084',
          u'RealFrameRate': 23.976024599999999,
          u'Language': u'eng',
          u'Level': 153,
          u'ColorPrimaries': u'bt2020',
          u'RefFrames': 1,
          u'DisplayTitle': u'4K HEVC',
          u'BitRate': 67609810,
          u'IsDefault': True,
          u'IsAnamorphic': False,
          u'Index': 0,
          u'Height': 2160,
          u'PixelFormat': u'yuv420p10le',
          u'IsExternal': False
        },
        {
          u'Profile': u'DTS-HD MA',
          u'IsInterlaced': False,
          u'DisplayTitle': u'Eng DTS 7.1 Default',
          u'ChannelLayout': u'7.1',
          u'Language': u'eng',
          u'Title': u'DTS:X / 7.1 / 48 kHz / 4213 kbps / 24-bit',
          u'Index': 1,
          u'IsForced': False,
          u'Level': 0,
          u'IsTextSubtitleStream': False,
          u'Channels': 8,
          u'Codec': u'dts',
          u'SupportsExternalStream': False,
          u'CodecTimeBase': u'1/48000',
          u'TimeBase': u'1/1000',
          u'SampleRate': 48000,
          u'Type': u'Audio',
          u'BitDepth': 24,
          u'IsDefault': True,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Eng Dolby Digital stereo',
          u'ChannelLayout': u'stereo',
          u'Language': u'eng',
          u'Title': u'Commentary by director John Singleton',
          u'Index': 2,
          u'Type': u'Audio',
          u'IsForced': False,
          u'Level': 0,
          u'Channels': 2,
          u'Codec': u'ac3',
          u'SupportsExternalStream': False,
          u'CodecTimeBase': u'1/48000',
          u'TimeBase': u'1/1000',
          u'SampleRate': 48000,
          u'BitRate': 192000,
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Eng',
          u'SupportsExternalStream': False,
          u'Language': u'eng',
          u'Title': u'SDH',
          u'Index': 3,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Fre',
          u'SupportsExternalStream': False,
          u'Language': u'fre',
          u'Index': 4,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Jpn',
          u'SupportsExternalStream': False,
          u'Language': u'jpn',
          u'Index': 5,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Por',
          u'SupportsExternalStream': False,
          u'Language': u'por',
          u'Title': u'Brazilian',
          u'Index': 6,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Spa',
          u'SupportsExternalStream': False,
          u'Language': u'spa',
          u'Title': u'Latin American',
          u'Index': 7,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Eng',
          u'SupportsExternalStream': False,
          u'Language': u'eng',
          u'Title': u'Commentary by director John Singleton',
          u'Index': 8,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Jpn',
          u'SupportsExternalStream': False,
          u'Language': u'jpn',
          u'Title': u'Commentary by director John Singleton',
          u'Index': 9,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Por',
          u'SupportsExternalStream': False,
          u'Language': u'por',
          u'Title': u'Commentary by director John Singleton - Brazilian',
          u'Index': 10,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        },
        {
          u'IsInterlaced': False,
          u'DisplayTitle': u'Spa',
          u'SupportsExternalStream': False,
          u'Language': u'spa',
          u'Title': u'Commentary by director John Singleton - Latin American',
          u'Index': 11,
          u'IsForced': False,
          u'DeliveryMethod': u'Encode',
          u'Codec': u'PGSSUB',
          u'CodecTimeBase': u'0/1',
          u'TimeBase': u'1/1000',
          u'Level': 0,
          u'Type': u'Subtitle',
          u'IsTextSubtitleStream': False,
          u'IsDefault': False,
          u'IsExternal': False
        }
      ],
      u'Type': u'Default',
      u'ReadAtNativeFramerate': False,
      u'RequiresLooping': False,
      u'Path': u'http://xxx.xxxxxx.xxx:xxxx/default.py?kv=uufWPB+ukimINQbi6sneWlr8OWHmwD---U3TWvXlEQLGjMyKmpOxc6A0mhh4+0wbCf2e6QDraARycIfpsrfeMiQp3ZebkXGaoSNjElDeYBPHsa9cCU5Q794Ryh---ZrpGHsj76gycKuObJTDG5C2i7+zuapsTtFAdQpvaeBT+nJKoQBi35Ps8SZBJYmLr+mtJISH7Gvy78Qjb2CYepmCq+MKRwufXpQSU6n7TAPHhas6mI9JbKD6un+FK891Q0UkgSqZWJMoE3NxCSx3ouXtnYfx0FWxffuYpcFJ80DxVk7U4xd7XRwL+VisIRpsCi6397Z0yUCE8Si4hByGm6GpnMlA5Q==',
      u'RequiresOpening': False,
      u'Bitrate': 67609810,
      u'IsRemote': True,
      u'Name': u'original_2 2160p',
      u'TranscodingContainer': u'm3u8',
      u'RequiredHttpHeaders': {
        
      },
      u'SupportsTranscoding': True,
      u'DiscardCorruptPts': False,
      u'Formats': [
        
      ],
      u'Protocol': u'Http',
      u'IsInfiniteStream': False,
      u'RunTimeTicks': 64548651008L,
      u'FillWallClockDts': False,
      u'DefaultSubtitleStreamIndex': -1,
      u'SupportsProbing': True,
      u'Id': u'6a9825f8c13201cbf3651f2673b7fc7c',
      u'Size': 54551525188L
    }
  ]
}
Edited by Angelblue05
Link to comment
Share on other sites

 

 

The server returns SupportsDirectPlay True BUT that is wrong. 

Why is it wrong? You have the Path property there pointing to the correct remote url.

  • Like 1
Link to comment
Share on other sites

Angelblue05

Because when I try to direct play the HTTP url it fails to play. Only direct stream or transcode allows for the file to play.

The way I had fixed it in the past was I ignored SupportSDirectPlay for Http protocol. But then, I have another user which has HTTP urls that should in fact, be directly played in Kodi. So ignoring SupportsDirectPlay for Http is not a viable solution?

Edited by Angelblue05
Link to comment
Share on other sites

 

 

Because when I try to direct play the HTTP url it fails to play.

 

There's no way for Emby Server to predict that will happen. If it is a client-side problem, then it is app-specific. If it is a problem with that remote url, then I expect it will fail no matter what the playback method is.

 

 

 

So ignoring SupportsDirectPlay for Http is not a viable solution?

 

The best solution would be to try the direct play, then if it fails, handle that and automatically switch to the next best method. If you do this, then not only can you support both ways, but you also won't need to have any user settings about playback method.

  • Like 1
Link to comment
Share on other sites

Angelblue05

There's no way for Emby Server to predict that will happen. If it is a client-side problem, then it is app-specific. If it is a problem with that remote url, then I expect it will fail no matter what the playback method is.

 

 

The best solution would be to try the direct play, then if it fails, handle that and automatically switch to the next best method. If you do this, then not only can you support both ways, but you also won't need to have any user settings about playback method.

So how or why did one user’s playbackinfo return False? Can the user change something to get the same results with his?

 

Unfortunately it’s not something that can be done with Kodi. By the time we know it failed, it’s already stopped playback or moved on to the next item in playlist.

 

I guess I’ll have to add a setting just for that then. To force http urls to not direct play.

Link to comment
Share on other sites

 

 

So how or why did one user’s playbackinfo return False?

 

We'd have to look at it in detail, but it takes into consideration all of the same criteria as regular video file playback.

  • Like 1
Link to comment
Share on other sites

So how or why did one user’s playbackinfo return False? Can the user change something to get the same results with his?

 

Unfortunately it’s not something that can be done with Kodi. By the time we know it failed, it’s already stopped playback or moved on to the next item in playlist.

 

I guess I’ll have to add a setting just for that then. To force http urls to not direct play.

 

Paths. The path determines direct play. For the Roku for example like you did I always disregard that direct play because it is always going to use https. There is no way to play the file path be it windows file system, unix-style file system, or otherwise on the Roku. It is an http/https path world only. But it is the Path that determines direct play. Like mentioned the only way to know when direct play will fail is to try that first then fallback to next best method.

Edited by speechles
Link to comment
Share on other sites

Angelblue05

Yeah unfortunately I can’t do that in Kodi. There is no callback after the add-on tells it to play a path or url. I have to know ahead of playback cus I only get one shot at it.

 

But good to know, thanks.

Link to comment
Share on other sites

It might make a good developer api feature request, to be able to get notified of player events and handle them in different ways.

  • Like 1
Link to comment
Share on other sites

Angelblue05

I do get play events but when sending the play request, there’s no playback failure feedback. If playback fails, it just moves on to the next item in playlist, it’s too late to react. But I’ll make a request for it for Kodi 19.

Link to comment
Share on other sites

  • 3 weeks later...
roblav96

Yeah unfortunately I can’t do that in Kodi. There is no callback after the add-on tells it to play a path or url. I have to know ahead of playback cus I only get one shot at it.

 

But good to know, thanks.

 

Track the users Item views as they browse the library, save state to a LevelDB or something.

 

Also if you want to merge all possible audio and video Codecs from a users session:

https://github.com/roblav96/futon-media/blob/e095fb9e84f4f3a29872e3f1c708a7c0bb893079/src/emby/emby/sessions.ts#L42

get Codecs() {
	let { audio, video } = { audio: '', video: '' }
	let cpath = 'Capabilities.DeviceProfile.CodecProfiles'
	let cprofiles = _.get(this, cpath, []) as CodecProfiles[]
	audio += `${_.join(cprofiles.filter(v => v.Type == 'Audio').map(v => v.Codec), ',')},`
	audio += `${_.join(cprofiles.filter(v => v.Type == 'VideoAudio').map(v => v.Codec), ',')},`
	video += `${_.join(cprofiles.filter(v => v.Type == 'Video').map(v => v.Codec), ',')},`
	let dpath = 'Capabilities.DeviceProfile.DirectPlayProfiles'
	let dprofiles = _.get(this, dpath, []) as DirectPlayProfiles[]
	audio += `${_.join(dprofiles.map(v => v.AudioCodec).filter(Boolean), ',')},`
	video += `${_.join(dprofiles.map(v => v.VideoCodec).filter(Boolean), ',')},`
	let tpath = 'Capabilities.DeviceProfile.TranscodingProfiles'
	let tprofiles = _.get(this, tpath, []) as TranscodingProfiles[]
	audio += `${_.join(tprofiles.map(v => v.AudioCodec).filter(Boolean), ',')},`
	video += `${_.join(tprofiles.map(v => v.VideoCodec).filter(Boolean), ',')},`
	let Codecs = {
		audio: _.sortBy(_.uniq(audio.toLowerCase().split(',')).filter(Boolean)).map(v =>
			v.startsWith('-') ? utils.minify(v) : v
		),
		video: _.sortBy(_.uniq(video.toLowerCase().split(',')).filter(Boolean)).map(v =>
			v.startsWith('-') ? utils.minify(v) : v
		),
	}
	if (Codecs.audio.includes('dts') && this.isHD) {
		Codecs.audio.push('truehd') && Codecs.audio.sort()
	}
	return Codecs
}

Gives you something that looks like:

{
  Age: 257,
  Audio: '["aac","ac3","alac","eac3","flac","lpcm","mp2","mp3","opus","vorbis","wma","wmapro","wmav2"]',
  Bitrate: '110 MB/s',
  Channels: 6,
  Client: 'Roku SG',
  DeviceName: '55' TCL Roku TV',
  IsStreaming: false,
  Quality: 'SD',
  UserName: 'John',
  Video: '["h264","hevc","mpeg1","mpeg1video","mpeg2","mpeg2video","mpeg4","vp9"]'
}
Edited by roblav96
Link to comment
Share on other sites

Angelblue05

I don’t get how that will help? If the user plays a playlist, and playback fails then it’s too late because Kodi has moved on to the next item?

Link to comment
Share on other sites

roblav96

My apologies, I'm unfamiliar with developing on the Kodi platform. If you're able to catch that the playback failed programmatically, then the most recent media Item viewed will give you somewhat of a guess as to what should be retried.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...