Results 11 to 20 of 22
-
2022-01-02, 16:12 #11
- 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, 16:27 #12
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,536
Yes - I posted too quickly.
From your previous post
Code:00 0D 6E F2 6D 64 61 74 00 00 00 00 00 00 00 00 00 D0 35 03 m d a t
Maybe sample table offset (or similar) has something interesting.
I'll look at it again tomorrow with fresh eyes.
-
2022-01-03, 11:36 #13
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,536
Quick status on the problem.
I was trying find out where Audio::Scan gets its value for audio_offset (i.e how does Audio::Scan know to skip the extra zeroes in the mdat)
Looking at the MPEG4-Spec for mdat - the 2nd para in 8.1.1.1 for mdat
Code:There may be any number of these boxes in the file (including zero, if all the media data is in other files). The metadata refers to media data by its absolute offset within the file (see subclause 8.7.5, the Chunk Offset Box); so Media Data Box headers and free space may easily be skipped, and files without any box structure may also be referenced and used.
Code:The chunk offset table gives the index of each chunk into the containing file. There are two variants, permitting the use of 32‐bit or 64‐bit offsets. The latter is useful when managing very large presentations. At most one of these variants will occur in any single instance of a sample table. Offsets are file offsets, not the offset into any box within the file (e.g. Media Data Box). This permits referring to media data in files without any box structure. It does also mean that care must be taken when constructing a self‐contained ISO file with its metadata (Movie Box) at the front, as the size of the Movie Box will affect the chunk offsets to the media data.
I'm currently trying to do a quick fix in Movie.pm to test this out.
-
2022-01-03, 15:07 #14
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,536
I have a patched Movie.pm which seems to play The problem URLs and a random m4a podcast which has a "normal" mdat. Need more example to test.
I used Audio::Scan seek_offset to update the "audio_offset" rather than first data in mdat.
Code:/slimserver-public-8.3/Slim/Formats$ diff org-Movie.pm Movie.pm 270a271,274 > > $fh->seek(0, 0); > my $seek_offset = Audio::Scan->find_frame_fh_return_info( mp4 => $fh, 0 )->{'seek_offset'}; > 277c281 < $info->{audio_offset} = $args->{_mdat_} + 8; --- > $info->{audio_offset} = $seek_offset;
Code:# finally got it, add 'moov' size it if was last atom # finally got it, add 'moov' size it if was last atom substr($args->{_scanbuf}, $args->{_offset} + ($args->{_atom} eq 'moov' ? $arg substr($args->{_scanbuf}, $args->{_offset} + ($args->{_atom} eq 'moov' ? $arg # put at least 16 bytes after mdat or it confuses audio::scan (and header cre # put at least 16 bytes after mdat or it confuses audio::scan (and header cre my $fh = File::Temp->new( DIR => Slim::Utils::Misc::getTempDir); my $fh = File::Temp->new( DIR => Slim::Utils::Misc::getTempDir); $fh->write($args->{_scanbuf} . pack('N', $args->{_audio_size}) . 'mdat' . ' ' $fh->write($args->{_scanbuf} . pack('N', $args->{_audio_size}) . 'mdat' . ' ' > > $fh->seek(0, 0); > my $seek_offset = Audio::Scan->find_frame_fh_return_info( mp4 => $fh, 0 )->{'seek_offset'} > $fh->seek(0, 0); $fh->seek(0, 0); my $info = Audio::Scan->scan_fh( mp4 => $fh )->{info}; my $info = Audio::Scan->scan_fh( mp4 => $fh )->{info}; $info->{fh} = $fh; $info->{fh} = $fh; # the offset is *after* the mdat atom, make size consistent # the offset is *after* the mdat atom, make size consistent $info->{audio_offset} = $args->{_mdat_} + 8; | $info->{audio_offset} = $seek_offset; $info->{audio_size} -= 8; $info->{audio_size} -= 8; # MPEG-4 audio = 64, MPEG-4 ADTS main = 102, MPEG-4 ADTS Low Complexity = 10 # MPEG-4 audio = 64, MPEG-4 ADTS main = 102, MPEG-4 ADTS Low Complexity = 10 # MPEG-4 ADTS Scalable Sampling Rate = 104 # MPEG-4 ADTS Scalable Sampling Rate = 104 if ($info->{tracks}->[0] && $info->{tracks}->[0]->{audio_type} == 64) { if ($info->{tracks}->[0] && $info->{tracks}->[0]->{audio_type} == 64) { $info->{processors} = { 'aac' => \&setADTSProcess }; $info->{processors} = { 'aac' => \&setADTSProcess }; } } return $info; return $info;
Last edited by bpa; 2022-01-03 at 15:14.
-
2022-01-08, 14:31 #15
- 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-08, 15:20 #16
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,536
I think it assumed that audio data starts at first byte of mdat which if I read the stco explanation does not have to be the case.
Given that it seems to work when the Audio::Scan offset calculation is used, my explanation not be correct but the "fix" doesn't seem to break MP4 streaming. I have tested with a few MP4 audio podcast.
I don't use Tidal so will set up a trial account to test Tidal MP4 streaming to see if it still works.
-
2022-01-08, 18:12 #17
- 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-13, 19:02 #18
- Join Date
- May 2008
- Location
- Canada
- Posts
- 7,880
I've pushed that PR https://github.com/Logitech/slimserver/pull/749, let me know if this works for you
Last edited by philippe_44; 2022-01-13 at 19:49.
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-13, 23:17 #19
Error in streamed MPEG4 handling - Movie.pm or
> I've pushed that PR https://github.com/Logitech/slimserver/pull/749
Thanks a lot philippe_44! I'll wait for bpa's thumbs up before merging. Ok?
-
2022-01-14, 01:21 #20
- 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