Looking at feasibility of an Accuradio plugins and was checking the audio streams.
I've having a problem playing some MPEG-4 streaming URLs. Tests are on a Ubuntu system LMS 8.3 (2Jan)
It looks like a bug in either LMS MPEG-4 Handling of InitialAudioBlock or in Audio::Scan
Example URL.
https://d1qg6pckcqcdk0.cloudfront.ne...atormundii.m4a
When downloaded as a file, the file plays OK on both an Receiver (i.e. faad MP4->Flc transcode) and a DAC32 (i.e. MP4->aac)
When played as an URL
- no output on Receiver - faad (-q removed) produces an error - Duration, speed and channel all are wrong.
- DAC32 error following error is loggedCode:Streamed input format samplerate 22050 channels 0. - file info: ADTS, 1.000 sec, 16 kbps, 44100 Hz Error: Bitstream value not allowed by specification
On examination an extra 4 bytes of zeroes had been inserted by LMS into the created ADTS audio stream from MPEG-4 file.Code:[22-01-02 16:58:25.3427] Slim::Player::Squeezebox2::statHandler (156) Error: 7c:9e:bd:2b:52:94: Decoder does not support file format, code 0
It seems there is padding in the m4a file and so the value of "seek offset" to start of audio and length of MPEG4 header are not the same.
In Movie::findFrameBoundaries - Audio ::Scan is called on initial Audio block of m4a stream.
Data:ump::dump of variable $info (returned from Audio::Scan)
Audio::Scan - the length of $info->{seek_header} is 22,100Code:[22-01-02 16:38:20.1771] Slim::Formats::Movie::findFrameBoundaries (198) Dump of info from AudioScan do { require MIME::Base64; { audio_offset => 22_092, audio_size => 880_370, avg_bitrate => 62_768, compatible_brands => ["M4A ", "mp42", "isom", "\0\0\0\0"], dlna_profile => "AAC_ISO_192", file_size => 22_116, major_brand => "mp42", minor_version => 0, mv_timescale => 90_000, samplerate => 22_050, seek_header => MIME::Base64::decode(" . .(deleted) . "), seek_offset => 22_108, song_length_ms => 224_351, tracks => [ { audio_object_type => 2, audio_type => 64, bits_per_sample => 16, channels => 1, duration => 224_351, encoding => "mp4a", handler_name => "Sound Media Handler", handler_type => "soun", id => 1, max_bitrate => 37_608, samplerate => 22_050, }, { duration => 224_351, id => 1 }, ], };
Audio::Scan - audio_offset is at 22,092 but seek_offset to start of audio is 22,108
LMS seems to be streaming from end of MPEG4 header when it should be streaming from seek_offset which is start of audio.
Not sure if the error is in Audio::Scan or Movie.pm.
I'll try to come up with a solution but any suggestions welcome. I need to check Audio::Scan documentation to see if the returned values are correct and expected.
Results 1 to 10 of 22
Hybrid View
-
2022-01-02, 10:03 #1
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,536
Error in streamed MPEG4 handling - Movie.pm or Audio::Scan error ?
-
2022-01-02, 11:06 #2
- Join Date
- May 2008
- Location
- Canada
- Posts
- 7,880
Error in streamed MPEG4 handling - Movie.pm or Audio::Scan error ?
The error is probably in movie.pm where I calculate the offset. From memory, I don’t rely on Audio::Scan when header is at the end of the file and I need to do an HTTP range to reach it. I assume I made a mistake and some files have an extended mdat header (or a similar issue) and I can’t just add 8 to the mdat position.
LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3
-
2022-01-02, 11:39 #3
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,536
The URL is streamable and so the header is at the start but there is padding at end (maybe a "free" atom) which is throwing things off.
After looking at AudioScan soc, it says "seek_header - A rewritten MP4 header that can be prepended to the audio data" - I interpret "rewritten" to means "not the same as source" (e.g. "free" atom removed) and so I think the problem lies in Movie.pm.
I now need to remember all the MPEG4 and InitialAudioBlock stuff to create a fix.
-
2022-01-02, 13:13 #4
- Join Date
- May 2008
- Location
- Canada
- Posts
- 7,880
LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3
-
2022-01-02, 13:48 #5
- Join Date
- May 2008
- Location
- Canada
- Posts
- 7,880
LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3
-
2022-01-02, 14:18 #6
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,536