Skip to content

[Bug] Long delay before audio works with HE-AAC (mp4a.40.5) #2103

Description

@matthuisman

Describe the problem

When using IA to play an HLS manifest with HE-AAC audio (mp4a.40.5) - there is a large delay before hearing the audio.
There is no such delay when using ffmpeg

Possible fix

No response

Steps to reproduce

  1. Install the Slyguy Trailers addon (https://www.matthuisman.nz/2025/04/slyguy-trailers-kodi-add-on.html)
  2. Enable the use of IA for live streams by editing resources/lib/youtube.py file and uncomment the line
    # inputstream = HLS(live=data.get('is_live', False)), # IA struggles with audio
  3. Go into the addon -> settings -> addon -> test streams (at the bottom) -> YouTube live stream
  4. When asked for the quality - select the lowest 256x144
  5. Observe the long delay before audio starts

Debug log

IA and ffmpeg playing the same stream.
IA has a good 10-15secs before you hear the audio
Enabled a bunch of the audio/video debug components

ia.log.txt
ffmpeg.log.txt

..

Stream manifest file(s)

#EXTM3U
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MEDIA:URI="https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1787465498/ei/ujqKav_0D7-vz7sPm_vaiQw/ip/122.59.4.96/id/mKCieTImjvU.5/itag/233/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/goi/133/sgoap/gir%3Dyes%3Bitag%3D139/rqh/1/hls_chunk_host/rr1---sn-uo1-jijl.googlevideo.com/xpc/EgVo2aDSNQ%3D%3D/playlist_duration/3600/manifest_duration/3600/bui/AR3QkAk77flHynd40av9AnOVZ65FuGcdZRsGbxhJ-Wty6D986hVTOY1QeNskaMyYuIpLbI-tVtm3BIni/spc/KBGBcvsMnTUhbjOi0WB-gGwxoadl8ca3YJEM8IpJmDhuTBJyzPRLVL8ofw/vprv/1/reg/0/playlist_type/DVR/initcwndbps/2232500/met/1787443900,/mh/jb/mm/44/mn/sn-uo1-jijl/ms/lva/mv/m/mvi/1/pl/21/rms/lva,lva/dover/13/pacing/0/short_key/1/keepalive/yes/fexp/51565116/mt/1787443467/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,goi,sgoap,rqh,xpc,playlist_duration,manifest_duration,bui,spc,vprv,reg,playlist_type/sig/AE0s2JYwRQIgXxr-M4Lgd-WdR2ceVifL0K_weiruIbE7FoCh6ldwn80CIQCNJ8HVKnNMBw0Q-FDf_G-ewAL8z1koJ5wWqpE3WMyQCA%3D%3D/lsparams/hls_chunk_host,initcwndbps,met,mh,mm,mn,ms,mv,mvi,pl,rms/lsig/APaTxxMwRQIgE7AOn5WidoiCTRwj5hRknQ3FJvOHogog7oNBgxloPPACIQCRIkr_I5EdQChG7ZfqxzTGFjJDSvt6aL0P6Og24G211A%3D%3D/playlist/index.m3u8",TYPE="AUDIO",GROUP-ID="233",NAME="Default",DEFAULT="NO",AUTOSELECT="YES"
#EXT-X-STREAM-INF:BANDWIDTH=290288,CODECS="avc1.42C00B,mp4a.40.5",RESOLUTION=256x144,FRAME-RATE=15,VIDEO-RANGE=SDR,AUDIO="233",CLOSED-CAPTIONS=NONE
https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1787465498/ei/ujqKav_0D7-vz7sPm_vaiQw/ip/122.59.4.96/id/mKCieTImjvU.5/itag/269/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgovp/gir%3Dyes%3Bitag%3D160/rqh/1/hls_chunk_host/rr1---sn-uo1-jijl.googlevideo.com/xpc/EgVo2aDSNQ%3D%3D/playlist_duration/3600/manifest_duration/3600/bui/AR3QkAk77flHynd40av9AnOVZ65FuGcdZRsGbxhJ-Wty6D986hVTOY1QeNskaMyYuIpLbI-tVtm3BIni/spc/KBGBcvsMnTUhbjOi0WB-gGwxoadl8ca3YJEM8IpJmDhuTBJyzPRLVL8ofw/vprv/1/reg/0/playlist_type/DVR/initcwndbps/2232500/met/1787443900,/mh/jb/mm/44/mn/sn-uo1-jijl/ms/lva/mv/m/mvi/1/pl/21/rms/lva,lva/dover/13/pacing/0/short_key/1/keepalive/yes/fexp/51565116/mt/1787443467/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgovp,rqh,xpc,playlist_duration,manifest_duration,bui,spc,vprv,reg,playlist_type/sig/AE0s2JYwRgIhAMb-GakoNj2lR-urTwtX70TG6sHlZ0YA5eE0MD2jo_9MAiEArrcbIOg4IP0fhGwVtg8hTIndg-930ACL-YFgm5qfhEU%3D/lsparams/hls_chunk_host,initcwndbps,met,mh,mm,mn,ms,mv,mvi,pl,rms/lsig/APaTxxMwRAIgdyL2rmFPJvUBYarlFezA3XIAyVqZ9iveBTOXoTC3SD8CIEw3YJtxQwpu9aDxcMMkJybMwOa9nhO3efl5RGg1DPhF/playlist/index.m3u8

Additional info

No response

Operating system(s)

Windows

Operating system version(s)

11

InputStream Adaptive version(s)

22.3.20

Kodi version(s)

22

Metadata

Metadata

Assignees

No one assigned

    Labels

    Triage: Needed(managed by bot) issue that was just created and needs someone looking at it

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions