Mp3 streams in mp4s do not have trimming/delay information extracted
Categories
(Core :: Web Audio, enhancement, P3)
Tracking
()
People
(Reporter: bryce, Unassigned)
References
Details
Attachments
(1 file)
|
3.66 KB,
video/mp4
|
Details |
If an mp3 is packed into an mp4 we do not read trimming information (as we do for mp3 files since bug 1566389). I suspect this is extremely niche and I'm not even 100% sure how the trimming information is stored in an mp4.
- Are the mp3 tags preserved in some way?
- Can encoders use something like the edit list (
elst) to communicate the same information?
For the second point I note that the attached file does have a non-zero offset for the initial media_time, which suggests to me it's possible the edit list is being used to communicate an offset.
Test file created using from dom/media/webaudio/testhalf-a-second-48000.mp3 via ffmpeg.exe -i half-a-second-48000.mp3 -c:a copy half-a-second-48000.mp4.
Edit: I don't think there's a huge need for this, but wanted a tracking bug to collect information on and point to.
| Reporter | ||
Comment 1•5 years ago
|
||
This code in the mp4parser specifically doesn't surface any mp3 specific info. So if we do need mp3 specific tag info we may need to do it here. However, if we can use generic mp4 data like the edit list, we may already have the needed info.
Comment 2•5 years ago
|
||
ffmpeg itself doesn't round-trip this file correctly between mp3 and WAV:
$ ffmpeg -i half-a-second-48000.mp4 half-a-second-48000.wav
[...]
$ soxi half-a-second-48000.wav
Input File : 'half-a-second-48000.wav'
Channels : 2
Sample Rate : 48000
Precision : 16-bit
Duration : 00:00:00.50 = 24239 samples ~ 37.8734 CDDA sectors
File Size : 97.0k
Bit Rate : 1.54M
Sample Encoding: 16-bit Signed Integer PCM
This should be 24000 samples, it is when decoding from an mp3 directly:
$ ffmpeg -i dom/media/webaudio/test/half-a-second-48000.mp3 half-a-second-48000.wav
[...]
$ soxi half-a-second-48000.wav
Input File : 'half-a-second-48000.wav'
Channels : 2
Sample Rate : 48000
Precision : 16-bit
Duration : 00:00:00.50 = 24000 samples ~ 37.5 CDDA sectors
File Size : 96.1k
Bit Rate : 1.54M
Sample Encoding: 16-bit Signed Integer PCM
$ ffmpeg -i half-a-second-48000.wav half-a-second-48000.mp3
[...]
$ ffmpeg -i half-a-second-48000.mp3 half-a-second-48000.wav
[...]
$ soxi half-a-second-48000.wav
Input File : 'half-a-second-48000.wav'
Channels : 2
Sample Rate : 48000
Precision : 16-bit
Duration : 00:00:00.50 = 24000 samples ~ 37.5 CDDA sectors
File Size : 96.1k
Bit Rate : 1.54M
Sample Encoding: 16-bit Signed Integer PCM
Description
•