Re: Error in streamed MPEG4 handling - Movie.pm or Audio::Scan error ?

philippe_44 <philippe_44.admzfb-NUepA2SMhDQqspMVqqL2D+4xXEVPTSb/[email protected]>
Newsgroups gmane.music.equipment.slimdevices.devel
Organization Logitech Squeezebox Forums
Message-ID <[email protected]>
bpa wrote: 
> 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.net/classical2/londonoratorysc_sacredtreasures_07_salvatormundii.m4a
> 
> When downloaded as a file, the file plays OK on both an Receiver (i.e.
> faad MP4-&gt;Flc transcode) and a DAC32 (i.e. MP4-&gt;aac) 
> 
> When played as an URL
> - no output on Receiver - faad (-q removed) produces an error -
> Duration, speed and channel all are wrong.
> > 
Code:
--------------------
  >   > 
  > Streamed input format  samplerate 22050 channels 0.
  > - file info:
  > ADTS, 1.000 sec, 16 kbps, 44100 Hz
  > 
  > Error: Bitstream value not allowed by specification
  > 
--------------------
> > 
> 
> - DAC32 error  following error is logged 
> > 
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
  > 
--------------------
> > 
> 
> On examination an extra 4 bytes of zeroes had been inserted by LMS
> into the created ADTS audio stream from MPEG-4 file.
> 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::Dump::dump of variable $info (returned from Audio::Scan) 
> > 
Code:
--------------------
  >   > 
  > [22-01-02 16:38:20.1771] Slim::Formats::Movie::findFrameBoundaries (198)  Dump of info from AudioScan do {
  > require MIME::Base64;
  > {
  > audio_offset      =&gt; 22_092,
  > audio_size        =&gt; 880_370,
  > avg_bitrate       =&gt; 62_768,
  > compatible_brands =&gt; ["M4A ", "mp42", "isom", "\0\0\0\0"],
  > dlna_profile      =&gt; "AAC_ISO_192",
  > file_size         =&gt; 22_116,
  > major_brand       =&gt; "mp42",
  > minor_version     =&gt; 0,
  > mv_timescale      =&gt; 90_000,
  > samplerate        =&gt; 22_050,
  > seek_header       =&gt; MIME::Base64::decode("
  > .
  > .(deleted)
  > .
  > "),
  > seek_offset       =&gt; 22_108,
  > song_length_ms    =&gt; 224_351,
  > tracks            =&gt; [
  > {
  > audio_object_type =&gt; 2,
  > audio_type        =&gt; 64,
  > bits_per_sample   =&gt; 16,
  > channels          =&gt; 1,
  > duration          =&gt; 224_351,
  > encoding          =&gt; "mp4a",
  > handler_name      =&gt; "Sound Media Handler",
  > handler_type      =&gt; "soun",
  > id                =&gt; 1,
  > max_bitrate       =&gt; 37_608,
  > samplerate        =&gt; 22_050,
  > },
  > { duration =&gt; 224_351, id =&gt; 1 },
  > ],
  > };
  > 
  > 
--------------------
> > 
> Audio::Scan - the length of $info-&gt;{seek_header} is 22,100
> 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.

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
------------------------------------------------------------------------
philippe_44's Profile: http://forums.slimdevices.com/member.php?userid=17261
View this thread: http://forums.slimdevices.com/showthread.php?t=115678

_______________________________________________
developers mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/developers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.