Jump to content

Funky m3u8 parsing issue


Recommended Posts

Posted

Hi,

I've got my own stream service local to the network on a device to streaming music. For maybe a year now, I've had no issues running this music through Emby. It's just an internal API I developed taht shares an m3u8 file and then Emby parses that as it gets updated from my service.

The past week, I went to play some music on one of my devices (tv) and had noticed it wasn't working. I tested this on my laptop using the Emby client, and had no issues... So first I thought maybe it was something with my tv and the router/firewall. After some troubleshooting and all that, I then tried it on my phone and web browser - both are apparently failing to play my music stream, but my desktop client is still working flawlessly. From what I can tell, it appears Emby is just letting my laptop client call out to the API directly and letting it handle it from there, whereas any other device attempting to (including the browser), Emby is taking over. The logs are confusing me too. Emby responds with a 404 when using the TV, phone, or browser - but my API shows zero logs of ever being hit in the first place. Did a recent update do any changes to how m3u8 stream files are parsed for music?

Here are some (filtered) logs from embyserver.txt below. Any assistance would be well appreciated!

My desktop client, which *works*:

2022-10-11 01:21:31.749 Info Server: http/1.1 GET https://my.emby.local:8920/emby/Audio/280962/universal?UserId=[myuserid]&DeviceId=[my-computer-name]&MaxStreamingBitrate=140000000&TranscodingContainer=ts&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[session-id]&StartTimeTicks=0&EnableRedirection=true&EnableRemoteMedia=true. UserAgent: libmpv

2022-10-11 01:21:31.753 Info App: User policy for [username]. EnableAudioPlaybackTranscoding: True

2022-10-11 01:21:31.753 Info Server: http/1.1 Response 302 to 192.168.1.x. Time: 4ms. https://my.emby.local:8920/emby/Audio/280962/universal?UserId=[myuserid]&DeviceId=[my-computer-name]&MaxStreamingBitrate=140000000&TranscodingContainer=ts&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[session-id]&StartTimeTicks=0&EnableRedirection=true&EnableRemoteMedia=true

2022-10-11 01:21:31.789 Info Server: http/1.1 GET https://my.emby.local:8920/emby/Audio/280962/universal?UserId=[myuserid]&DeviceId=[my-computer-name]&MaxStreamingBitrate=140000000&TranscodingContainer=ts&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[session-id]&StartTimeTicks=0&EnableRedirection=true&EnableRemoteMedia=true. UserAgent: libmpv

2022-10-11 01:21:31.792 Info App: User policy for [username]. EnableAudioPlaybackTranscoding: True

2022-10-11 01:21:31.792 Info Server: http/1.1 Response 302 to 192.168.1.x. Time: 3ms. https://my.emby.local:8920/emby/Audio/280962/universal?UserId=[myuserid]&DeviceId=[my-computer-name]&MaxStreamingBitrate=140000000&TranscodingContainer=ts&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[session-id]&StartTimeTicks=0&EnableRedirection=true&EnableRemoteMedia=true

2022-10-11 01:21:31.846 Info Server: http/1.1 POST https://my.emby.local:8920/emby/Sessions/Playing?X-Emby-Client=Emby Theater&X-Emby-Device-Name=[my-computer-name]&X-Emby-Device-Id=[my-computer-name]&X-Emby-Client-Version=3.0.15&reqformat=json. UserAgent: [UserAgent]

2022-10-11 01:21:31.848 Info SessionManager: Playback start reported by app Emby Theater 3.0.15 playing MusicStream01. Started at 0 ms

2022-10-11 01:21:31.849 Info Server: http/1.1 Response 204 to 192.168.1.x. Time: 3ms. https://my.emby.local:8920/emby/Sessions/Playing?X-Emby-Client=Emby Theater&X-Emby-Device-Name=[my-computer-name]&X-Emby-Device-Id=[my-computer-name]&X-Emby-Client-Version=3.0.15&reqformat=json

2022-10-11 01:21:31.898 Info Server: http/1.1 POST https://my.emby.local:8920/emby/Sessions/Playing/Progress?X-Emby-Client=Emby Theater&X-Emby-Device-Name=[my-computer-name]&X-Emby-Device-Id=[my-computer-name]&X-Emby-Client-Version=3.0.15&reqformat=json. UserAgent: [UserAgent]

2022-10-11 01:21:31.901 Info Server: http/1.1 Response 204 to 192.168.1.x. Time: 2ms. https://my.emby.local:8920/emby/Sessions/Playing/Progress?X-Emby-Client=Emby Theater&X-Emby-Device-Name=[my-computer-name]&X-Emby-Device-Id=[my-computer-name]&X-Emby-Client-Version=3.0.15&reqformat=json

2022-10-11 01:21:33.960 Info Server: http/1.1 POST https://my.emby.local:8920/emby/Sessions/Playing/Stopped?X-Emby-Client=Emby Theater&X-Emby-Device-Name=[my-computer-name]&X-Emby-Device-Id=[my-computer-name]&X-Emby-Client-Version=3.0.15&reqformat=json. UserAgent: [UserAgent]

2022-10-11 01:21:33.961 Info SessionManager: Playback stopped reported by app Emby Theater 3.0.15 playing MusicStream01. Stopped at 1969 ms

2022-10-11 01:21:33.962 Info Server: http/1.1 Response 204 to 192.168.1.x. Time: 2ms. https://my.emby.local:8920/emby/Sessions/Playing/Stopped?X-Emby-Client=Emby Theater&X-Emby-Device-Name=[my-computer-name]&X-Emby-Device-Id=[my-computer-name]&X-Emby-Client-Version=3.0.15&reqformat=json

My browser (same exact computer), which *fails*:

2022-10-11 01:21:46.201 Info Server: http/1.1 HEAD https://my.emby.local:8920/emby/Audio/280962/universal?UserId=[myuserid]&DeviceId=[device-id]&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,mp2,mp3|mp2,m4a|aac,flac,webma,webm,wav|PCM_S16LE,wav|PCM_S24LE,ogg&TranscodingContainer=aac&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[session-id]&StartTimeTicks=0&EnableRedirection=true. UserAgent: [UserAgent]

2022-10-11 01:21:46.204 Info App: User policy for [username]. EnableAudioPlaybackTranscoding: True

2022-10-11 01:21:46.206 Info Server: http/1.1 Response 200 to 192.168.1.x. Time: 5ms. https://my.emby.local:8920/emby/Audio/280962/universal?UserId=[myuserid]&DeviceId=[device-id]&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,mp2,mp3|mp2,m4a|aac,flac,webma,webm,wav|PCM_S16LE,wav|PCM_S24LE,ogg&TranscodingContainer=aac&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[session-id]&StartTimeTicks=0&EnableRedirection=true

2022-10-11 01:21:46.232 Info Server: http/1.1 GET https://my.emby.local:8920/emby/Audio/280962/universal?UserId=[myuserid]&DeviceId=[device-id]&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,mp2,mp3|mp2,m4a|aac,flac,webma,webm,wav|PCM_S16LE,wav|PCM_S24LE,ogg&TranscodingContainer=aac&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[session-id]&StartTimeTicks=0&EnableRedirection=true. UserAgent: [UserAgent]

2022-10-11 01:21:46.234 Info App: User policy for [username]. EnableAudioPlaybackTranscoding: True

2022-10-11 01:21:46.236 Info Server: http/1.1 Response 200 to 192.168.1.x. Time: 4ms. https://my.emby.local:8920/emby/Audio/280962/universal?UserId=[myuserid]&DeviceId=[device-id]&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,mp2,mp3|mp2,m4a|aac,flac,webma,webm,wav|PCM_S16LE,wav|PCM_S24LE,ogg&TranscodingContainer=aac&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[session-id]&StartTimeTicks=0&EnableRedirection=true

2022-10-11 01:21:46.252 Info Server: http/1.1 GET https://my.emby.local:8920/emby/Audio/280962/live.m3u8?UserId=[myuserid]&DeviceId=[device-id]&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,mp2,mp3|mp2,m4a|aac,flac,webma,webm,wav|PCM_S16LE,wav|PCM_S24LE,ogg&TranscodingContainer=aac&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[session-id]&EnableRedirection=true&SegmentContainer=aac&AudioBitrate=384000&TranscodeReasons=ContainerNotSupported. UserAgent: [UserAgent]

2022-10-11 01:21:46.253 Info Server: http/1.1 Response 404 to 192.168.1.x. Time: 1ms. https://my.emby.local:8920/emby/Audio/280962/live.m3u8?UserId=[myuserid]&DeviceId=[device-id]&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,mp2,mp3|mp2,m4a|aac,flac,webma,webm,wav|PCM_S16LE,wav|PCM_S24LE,ogg&TranscodingContainer=aac&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[session-id]&EnableRedirection=true&SegmentContainer=aac&AudioBitrate=384000&TranscodeReasons=ContainerNotSupported

2022-10-11 01:21:46.284 Info Server: http/1.1 POST https://my.emby.local:8920/emby/Sessions/Playing?X-Emby-Client=Emby Web&X-Emby-Device-Name=[name]&X-Emby-Device-Id=[device-id]&X-Emby-Client-Version=4.7.8.0&reqformat=json. UserAgent: [UserAgent]

2022-10-11 01:21:46.285 Info SessionManager: Playback start reported by app Emby Web 4.7.8.0 playing MusicStream01. Started at 0 ms

2022-10-11 01:21:46.286 Info Server: http/1.1 Response 204 to 192.168.1.x. Time: 2ms. https://my.emby.local:8920/emby/Sessions/Playing?X-Emby-Client=Emby Web&X-Emby-Device-Name=[name]&X-Emby-Device-Id=[device-id]&X-Emby-Client-Version=4.7.8.0&reqformat=json

2022-10-11 01:21:46.433 Info Server: http/1.1 POST https://my.emby.local:8920/emby/Sessions/Playing/Stopped?X-Emby-Client=Emby Web&X-Emby-Device-Name=[name]&X-Emby-Device-Id=[device-id]&X-Emby-Client-Version=4.7.8.0&reqformat=json. UserAgent: [UserAgent]

2022-10-11 01:21:46.434 Info SessionManager: Playback stopped reported by app Emby Web 4.7.8.0 playing MusicStream01. Stopped at 0 ms

2022-10-11 01:21:46.435 Info Server: http/1.1 Response 204 to 192.168.1.x. Time: 2ms. https://my.emby.local:8920/emby/Sessions/Playing/Stopped?X-Emby-Client=Emby Web&X-Emby-Device-Name=[name]&X-Emby-Device-Id=[device-id]&X-Emby-Client-Version=4.7.8.0&reqformat=json

My TV, which *fails* (and repeats 404s in the logs every 1 second or so):

2022-10-11 01:21:59.665 Info Server: http/1.1 GET https://my.emby.local:8920/emby/Audio/280962/universal?UserId=[userid]&DeviceId=[device-id]&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,mp2,mp3|mp2,aac|aac,m4a|aac,mp4|aac,flac,webma,webm,wma,asf,wav|PCM_S16LE,ogg&TranscodingContainer=aac&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[sessionid]&StartTimeTicks=0&EnableRedirection=true. UserAgent: [UserAgent]

2022-10-11 01:21:59.669 Info App: User policy for [username]. EnableAudioPlaybackTranscoding: True

2022-10-11 01:21:59.671 Info Server: http/1.1 Response 200 to 192.168.1.x. Time: 6ms. https://my.emby.local:8920/emby/Audio/280962/universal?UserId=[userid]&DeviceId=[device-id]&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,mp2,mp3|mp2,aac|aac,m4a|aac,mp4|aac,flac,webma,webm,wma,asf,wav|PCM_S16LE,ogg&TranscodingContainer=aac&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[sessionid]&StartTimeTicks=0&EnableRedirection=true

2022-10-11 01:21:59.775 Info Server: http/1.1 GET https://my.emby.local:8920/emby/Audio/280962/universal?UserId=[userid]&DeviceId=[device-id]&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,mp2,mp3|mp2,aac|aac,m4a|aac,mp4|aac,flac,webma,webm,wma,asf,wav|PCM_S16LE,ogg&TranscodingContainer=aac&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[sessionid]&StartTimeTicks=0&EnableRedirection=true. UserAgent: [UserAgent]

2022-10-11 01:21:59.779 Info App: User policy for [username]. EnableAudioPlaybackTranscoding: True

2022-10-11 01:21:59.781 Info Server: http/1.1 Response 200 to 192.168.1.x. Time: 6ms. https://my.emby.local:8920/emby/Audio/280962/universal?UserId=[userid]&DeviceId=[device-id]&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,mp2,mp3|mp2,aac|aac,m4a|aac,mp4|aac,flac,webma,webm,wma,asf,wav|PCM_S16LE,ogg&TranscodingContainer=aac&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[sessionid]&StartTimeTicks=0&EnableRedirection=true

2022-10-11 01:21:59.790 Info Server: http/1.1 GET https://my.emby.local:8920/emby/Audio/280962/live.m3u8?UserId=[userid]&DeviceId=[device-id]&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,mp2,mp3|mp2,aac|aac,m4a|aac,mp4|aac,flac,webma,webm,wma,asf,wav|PCM_S16LE,ogg&TranscodingContainer=aac&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[sessionid]&EnableRedirection=true&SegmentContainer=aac&AudioBitrate=384000&TranscodeReasons=ContainerNotSupported. UserAgent: [UserAgent]

2022-10-11 01:21:59.790 Info Server: http/1.1 Response 404 to 192.168.1.x. Time: 1ms. https://my.emby.local:8920/emby/Audio/280962/live.m3u8?UserId=[userid]&DeviceId=[device-id]&MaxStreamingBitrate=140000000&Container=opus,mp3|mp3,mp2,mp3|mp2,aac|aac,m4a|aac,mp4|aac,flac,webma,webm,wma,asf,wav|PCM_S16LE,ogg&TranscodingContainer=aac&TranscodingProtocol=hls&AudioCodec=aac&PlaySessionId=[sessionid]&EnableRedirection=true&SegmentContainer=aac&AudioBitrate=384000&TranscodeReasons=ContainerNotSupported

 

Posted

HI, how are you importing the m3u8 into emby server?

Posted (edited)

I'm using a strm file named "MusicStream01.strm", which is a text file containing the following:

http://my.streamer.local:19080/streams/MusicStream01

Example output when hitting that api endpoint:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:5
#EXT-X-MEDIA-SEQUENCE:2959
#EXTINF:4.992289,
MusicStream01?tsfile=output2959.ts
#EXTINF:5.015511,
MusicStream01?tsfile=output2960.ts
#EXTINF:4.992289,
MusicStream01?tsfile=output2961.ts
#EXTINF:4.992289,
MusicStream01?tsfile=output2962.ts
#EXTINF:5.015511,
MusicStream01?tsfile=output2963.ts
#EXTINF:4.992289,
MusicStream01?tsfile=output2964.ts
#EXTINF:4.992289,
MusicStream01?tsfile=output2965.ts
#EXTINF:5.015511,
MusicStream01?tsfile=output2966.ts
#EXTINF:4.992300,
MusicStream01?tsfile=output2967.ts
#EXTINF:4.992278,
MusicStream01?tsfile=output2968.ts
Edited by mbfan01
Posted

OK please attach the complete emby server log from a failing example. Thanks.

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...