Kodi Community Forum
Leia Beta1 - ACC encoded files in playlist not play - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Music Support (https://forum.kodi.tv/forumdisplay.php?fid=263)
+--- Thread: Leia Beta1 - ACC encoded files in playlist not play (/showthread.php?tid=335368)



Leia Beta1 - ACC encoded files in playlist not play - thestig - 2018-09-09

(Split out of https://forum.kodi.tv/showthread.php?tid=335367 as new issue)
Build 18.0+git20180828.0901-beta1-0bionic

The major caveat to that is, plenty of playlists were causing kodi to crash immediately on triggering them.  Whether in Yatse, or via JSON.  With some, the log error was:
Quote:14:51:18.444 T:140305338988288  NOTICE: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder aac
14:51:38.398 T:140304042600192   ERROR: Could not find suitable input format: application/octet-stream

A few others would generate
Quote:16:55:51.422 T:140653948131072   ERROR: CAudioDecoder: Unable to Init Codec while loading file /path/to/foo.m4a

The playlists in question contain AAC encoded .m4a files that were generated from youtube-dl, a CLI that can scrape a/v streams.  I wrap it in a cron to periodically grab some weekly shows off mixcloud.com, and regenerate those .m3u playlists. 

What I've found today is that Kodi plays the individual AAC/M4A tracks no problem, but it crashes trying to run playlists comprised of those same tracks.  

So here's where it gets really wild - if I take those .m4a files and rename them to .mp3, and edit the crashing .M3U playlist to change .m4a to .mp3, then the playlist runs.  

This...shouldn't happen?  In linux world the filename and extension are primarily for us meatbags, right?.  The players recognize and decode the format from the internal headers/structure of the file contents, not the extension.  

Also strange - my initial "workaround" for this fix was, 'let's just name all the AAC files as mp3 when I create them, so at least the playlists will play'.  And they do - but the audio quality is different when I play the AAC "mp3's" from a playlist, than if I navigate to the folder containing the files and trigger them as individual songs. 

What I mean by 'different': From a playlist, the gain is higher, and it sounds as though some adaptive resampling is happening, as you can kind of hear the pitch hunting around, particularly in the first few seconds of the playlist starting.  Sort of like streaming video does with the adaptive rtmp inputs kodi has added, where the player struggles to sync everything up.  

Without a playlist,  it makes no difference whether the AAC file Kodi plays is named foo.m4a or foo.mp3 - they both play with the same sound quality/gain, and without the distorted openings, no matter if I trigger the track from GUI/JSON/Yatse. 




Logs......

Here's the log from selecting a single track renamed as an mp3 - it looks the same when opening a playlist of AAC's renamed as MP3's, so if the distortion I head via the playlist is real, it wouldn't appear to be the result of a different codec or properties.  
Quote:17:04:02.241 T:140656503867520  NOTICE: VideoPlayer::OpenFile: /path/to/foo.mp3
17:04:02.241 T:140654155839232  NOTICE: Creating InputStream
17:04:02.243 T:140654155839232  NOTICE: Creating Demuxer
17:04:02.253 T:140654155839232  NOTICE: Opening stream: 0 source: 256
17:04:02.253 T:140654155839232  NOTICE: Finding audio codec for: 86018
17:04:02.254 T:140654155839232  NOTICE: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder aac
17:04:02.254 T:140654155839232  NOTICE: Creating audio thread
17:04:02.254 T:140653983086336  NOTICE: running thread: CVideoPlayerAudio:Tonguerocess()
17:04:02.255 T:140653983086336  NOTICE: Creating audio stream (codec id: 86018, channels: 2, sample rate: 44100, no pass-through)

And here it is trying to open the .M3U where the files are named with a .m4a extension:
Quote:16:58:58.616 T:140656503867520  NOTICE: VideoPlayer::OpenFile: special://profile/playlists/music/foo.m3u
16:58:58.619 T:140654155839232  NOTICE: Creating InputStream
16:58:58.619 T:140654155839232   ERROR: CVideoPlayer::OpenInputStream - error opening [special://profile/playlists/music/foo.m3u]
16:58:58.619 T:140654155839232  NOTICE: CVideoPlayer::OnExit()
16:58:58.786 T:140654575335168   ERROR: EXCEPTION: XBMC is not playing any media file
16:58:58.786 T:140654575335168   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.RuntimeError'>
                                            Error Contents: XBMC is not playing any media file
                                            Traceback (most recent call last):
                                              File "/home/xbmc/.kodi/addons/plugin.video.youtube/resources/lib/youtube_plugin/kodion/utils/player.py", line 74, in onPlayBackStarted
                                                self.current_video_total_time = self.getTotalTime()
                                            RuntimeError: XBMC is not playing any media file
                                            -->End of Python script error report<--


Here's are output of ffmpeg -i and mp4info looking at an example track:
Quote:me@computer:/path/to/# ffmpeg -i 'foo_artist - foo_track.m4a'
ffmpeg version 3.4.4-0ubuntu0.18.04.1 Copyright © 2000-2018 the FFmpeg developers
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'foo_artist - foo_track.m4a':
  Metadata:
    major_brand     : M4A
    minor_version   : 1
    compatible_brands: M4A mp42isom
    creation_time   : 2018-09-04T18:45:24.000000Z
    iTunSMPB        :  00000000 00000920 000002A0 0000000006538440 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    title           : foo_track
    artist          : foo_artist
    album           : foo_album
    genre           : Drum & Bass
    date            : 2018
    track           : 9
    encoder         : Nero AAC codec / 1.5.4.0
  Duration: 01:20:13.59, start: 0.052971, bitrate: 73 kb/s
    Chapter #0:0: start 0.105941, end 4813.642449
    Metadata:
      title           :
    Stream #0:0(und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 71 kb/s (default)
    Metadata:
      creation_time   : 2018-09-04T18:45:24.000000Z
      handler_name    : Sound Media Handler
 
Quote:me@computer:/path/to# mp4info 'foo_artist - foo_track.m4a'
mp4info version -r
foo_artist - foo_track.m4a:
Track    Type    Info
1    audio    MPEG-4 AAC LC, 4813.589 secs, 72 kbps, 22050 Hz
 Name: foo_track
 Artist: foo_artist
 Encoded with: Nero AAC codec / 1.5.4.0
 Release Date: 2018
 Album: foo_album
 Track: 9 of 0
 Genre: Drum & Bass



RE: Leia Beta1 - ACC encoded files in playlist not play - DaveBlake - 2018-09-09

Forgive the post editing I did to split this into a new topic  @thestig 

You have now found an issue in Beta1 involving playback of AAC encoded .m4a files from playlists. I will need to gather some example files and clear instructions on how to reproduce the issue from you before asking my player expert colleagues to investigate.

As for changing file ext, AFAIK file ext does matter and does have some impact on what codec the player tries to use, although yes it also examines the stream itself. I think there is also a fallback procedure to try and play things somehow, but not exactly sure of what route that will have taken with what you tried. It is fair to say that files with changed ext may not play right.

The first thing I want to know is if this issue can be reproduced just using GUI rather than when the playlist is run using kodi-send or JSON?