expectingtofly wrote: 
> Thank you for the explanation.   I'm a bit confused how that all works
> on a variable bit rate file.  Take this example where we are having the
> problem :
> 
> The (verified) content length is : 
> > 
Code:
--------------------
  >   > 
  > "content-length"            => 64_062_386,
  >   > 
Code:
--------------------
    >     > 
    > 
    > LMS reads the MP4 headers as such :
    >     > 
Code:
--------------------
      >       > 
      > my $a = {
      > audio_offset      => 931_526,
      > audio_size        => 63_180_833,
      > avg_bitrate       => 46_792,
      > compatible_brands => ["isom", "M4A ", "mp42"],
      > dlna_profile      => "AAC_ISO_192",
      > fh                => bless(\*File::Temp::$fh, "File::Temp"),
      > file_size         => 931_542,
      > jenkins_hash      => "1280117999",
      > major_brand       => "M4A ",
      > minor_version     => 1,
      > mv_timescale      => 600,
      > processors        => { aac => sub { "???" } },
      > samplerate        => 22_050,
      > song_length_ms    => 10_800_020,
      > tracks            => [
      > {
      > audio_object_type => 2,
      > audio_type        => 64,
      > bits_per_sample   => 16,
      > channels          => 2,
      > duration          => 10_800_020,
      > encoding          => "mp4a",
      > handler_name      => "SoundHandler",
      > handler_type      => "soun",
      > id                => 1,
      > max_bitrate       => 51_944,
      > samplerate        => 22_050,
      > },
      > ],
      > };
      > 
--------------------
    >     > 
    > 
    > So, 931526 + 63180833 = 64,112,359  which is obviously greater than size 
of the file.  Which is why we are getting the Range error.
    > 
    > But how does it work out the audio size?   Does the average bit rate come 
from the Mp4 header or is it worked out from a sample?    If it's the latter, 
would that be accurate enough to be used for the Range calculation?
    > 
    > [EDIT]  In fact thinking about it, would it ever be accurate enough even 
if it did come from the MP4 header?  >   > 
  > 
  > I will recheck mp4 specs but AFAIR, the audio size is not at all from the 
average but rate but is indicated in the file itself, by the size of the atom 
the contains the audio data (mdat), so it is an exact value that is set by the 
encoder itself. This is for example how you parse a mp4 with header at the end. 
If you reach the mdat atom before the header, then you jump by the mdat audio 
size.
  > 
  > The most likely hypothesis is an error in the encoder or in the HTTP 
content_length. All other mp4 content provider work like that, and there are a 
few now, so I think if there was an issue we would have seen it already.



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=115070

_______________________________________________
Squeezecenter mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/squeezecenter

Reply via email to