-
Notifications
You must be signed in to change notification settings - Fork 242
Dev. FAQ
This list provides helps and where possible solutions for problems that a developer may encounter.
Problems:
- Streams language names displayed with wrong/incomplete descriptions on Kodi OSD settings
- How to get downloaded manifests files
- How to debug license data
- How to get stacktrace of a Kodi crash on linux
Errors:
- Decrypt Sample returns failure!
- Unable to initialize MediaDrm
- HTTP error 401
- HTTP error 403
- HTTP error 404
- HTTP error 400 - Provisioning server returned failure
- License request - HTTP error 400
- License request - HTTP error 500
- Failed: Peer certificate cannot be authenticated with given CA certificates
Most video services usually provide streams with language code in ISO 639-1 format, well accepted in Kodi (example es
Spanish).
But nowadays a new standard is being adopted the IETF BCP 47, which provides subtags (like region code) for example es-ES
for Spanish-Spain,
but this new format is not supported in Kodi, leading to some problems.
All Kodi versions until v19 (Matrix) are affected by the worst problem and will results in wrong display of language names, for example:
-
es-ES
will be displayed on Kodi OSD settings asSpanish-Spanish
-
pt-BR
will be displayed on Kodi OSD settings asPortuguese-Breton
- and so on...
but the situation has been improved a bit from Kodi v20 (Nexus), see below.
Solutions for Kodi v19 and older
For these Kodi versions, the only workaround is to use a proxy to intercept the manifest and rename the language codes of each audio/subtitle stream, so you have to set a custom subtag to something that does not exist, for example:
-
es-ES
renamed toes-Spain
will be displayed asSpanish-Spain
-
pt-BR
renamed topt-Brazil
will be displayed asPortuguese-Brazil
- and so on...
as you can see the final result is that the custom subtags are kept as is, but still there will always be problems with the Kodi language selection done by Kodi when playback starts.
Solutions for Kodi v20 and newer
From this Kodi version has been improved the support for language code with subtags, then unrecognized language codes are displayed in Kodi GUI menus as is without descriptions, for example:
-
es-ES
will be displayed asSpanish-es
-
pt-BR
will be displayed asPortuguese-br
- and so on...
therefore no manifest alterations are required, but if the final user want a better language descriptions and selection when playback starts, must perform one of these operations:
- Install skin language packs of each language code you need (if are available)
- Provide to Kodi the missing language code with description by using
Advancedsettings.xml
. Read Kodi Wiki to know how to do https://kodi.wiki/view/Advancedsettings.xml#languagecodes
To save downloaded stream manifests to disk during playback, open the settings and in the Expert category enable Save stream manifests. The files will be stored in the user data folder of InputStream Adaptive. Each manifest file will be saved in sequential download order using timestamps, the filename can also be identified in the Kodi debug log to verify when it was saved. All existing manifest files will be deleted at the start of each video playback.
You can debug license data by enabling Save license data from the add-on Expert settings. If enabled, the license data will be saved to disk when playback starts, these files will be stored in the "cdm" folder under Kodi data folder.
Filenames are composed as: CDM_identifier.type_of_data
Some Widewine examples:
- EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED.challenge -> The challenge (key request) obtained from CDM initialization
- EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED.init -> The initial (pssh) data used for the license request
- EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED.request -> The license request data [Kodi v22 or above]
- EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED.response -> The license response data
Every time a new video is played, these files will be overwritten.
To try determinate the cause of a crash, you need to use gdb debugger to obtain the stacktrace log.
- Install gdb
sudo apt-get install gdb
- Run Kodi with gdb
gdb /my/executable/path/kodi.bin
(examplegdb /usr/lib/kodi/kodi.bin
) - Make Kodi crash
- On gdb terminal, type
bt
to get the stacktrace log - On gdb terminal, type
bt > stacktrace.txt
to save the stacktrace log
This error may occurs when the inputstream.adaptive.license_key
property is configured with wrong content, then may happen that the video plays for a few seconds before stopping with this error. We suggest you investigate the HTTP requests/responses of your video service provider, in order to understand the right license configuration.
This error occurs when the device used has an invalid or corrupted DRM library, could be the case when you use a custom firmware, or running the application on a virtual environment. In any case it is an external problem not related to the add-on.
This error could be raised when a video service requires an appropriate user-agent HTTP header.
So make sure that you have set the user-agent string in to property:
inputstream.adaptive.manifest_headers
and if required also on inputstream.adaptive.stream_headers
(see Integration page for details).
But the root of the problem may be also influenced by the Kodi core, which makes an early request for the URL address, thus executing an HTTP HEAD request in order to determine the mimetype. So to avoid this, make sure you have add these properties:
- If you are using an add-on:
listitem.setMimeType('application/dash+xml')
andlistitem.setContentLookup(False)
- If you are using a playlist file such as STRM/M3U8:
#KODIPROP:mimetype=application/dash+xml
We know two common reasons that can lead to an HTTP error 403:
You can recognise this type of protection by analysing HTTP requests/responses which should contain the word Cloudflare. This anti-bot protection does not allow us to download files, there is currently no known solution.
There is currently no known solution. For more info see Verified Media Path (VMP) page.
This can usually happen when for some reason the add-on tries to download the wrong stream segments.
If you are trying to play a LIVE content, its possible that the manifest updating is not working, in this use case you could try set inputstream.adaptive.manifest_update_parameter
property, see Integration page. Otherwise it could be an add-on bug.
Your device may have some problem with the DRM library, could happens for example when using Android custom ROM's.
Possible known solutions:
- Try to verify the headers set to the
inputstream.adaptive.license_key
property, may be missing or URL encoded in an incorrect way. - You are using an operating system other than Android, it is possible that you are using Widevine libraries that are too old, try updating them by using the InputStream Helper add-on.
This error can occurs when is missing some headers in the license request. An example could be Content-Type: application/octet-stream
or for missing user agent. See inputstream.adaptive.license_key
property to know how set the license headers.
This error can occurs when service have a faulty or expired SSL CA certificate. You can try solve the problem by disabling verification of CA certificates by using ssl_verify_peer
configuration of inputstream.adaptive.config
property.
User Documentation
Developer Documentation
- Integration
- Integration DRM
- Integration DRM (old)
- Stream selection types properties
- How to test a stream
- Test samples python addon
- How to provide custom manifest and license
- Supported containers and codecs
- Verified Media Path (VMP)
- Set resolution limits for DRM streams
- Custom DASH manifest tags
- Audio Subtitles track properties
- Dev. FAQ
- Widevine ARM64 support
- Add‐on WIP status
Development