[FFmpeg-trac] #10229(undetermined:new): Wrong data size for WAV (RIFF) format
FFmpeg
trac at avcodec.org
Fri Mar 10 20:20:20 EET 2023
#10229: Wrong data size for WAV (RIFF) format
-------------------------------------+-------------------------------------
Reporter: polochon | Owner: (none)
Type: defect | Status: new
Priority: normal | Component:
| undetermined
Version: unspecified | Resolution:
Keywords: pcm_u8 RIFF | Blocked By:
WAV |
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by polochon):
Not sure to understand the point: what is the audacity bug you are
talking?
Regarding this file:
- mediainfo says 1876 samples
- according to you, Adobe audition says 1876 samples (if you count from 0
to 1875, the result is still 1876).
=> both tools says the same thing.
So why the data size encoded to the file by ffmpeg is 0x0753 => 1875?
Basically, if you do a memcpy(dest,src,size) or a for(i=0; i<size; i++),
you right size value is 1876, not 1875 or you will miss a sample.
I've attached to the ticket a new file which is correctly encoded by
ffmpeg: aston.wav (source) and astonEncoded.wav (converted by ffmpeg).
This file is read correctly by my robot firmware.
mediainfo output:
{{{
Channel(s) : 1 channel
Sampling rate : 8000
Sampling rate : 8 000 Hz
Samples count : 51972
}}}
output of converted file:
{{{
00000000 52 49 46 46 28 cb 00 00 57 41 56 45 66 6d 74 20
|RIFF(...WAVEfmt |
00000010 10 00 00 00 01 00 01 00 40 1f 00 00 40 1f 00 00
|........ at ...@...|
00000020 01 00 08 00 64 61 74 61 04 cb 00 00 83 83 83 83
|....data........|
00000030 81 81 81 81 80 7d 7e 7f 7e 80 80 81 81 80 7e 7e
|.....}~.~.....~~|
00000040 7e 7e 80 81 81 80 81 81 7f 7d 7e 7e 7d 7e 7e 7e
|~~.......}~~}~~~|
00000050
}}}
0xCB04 => 51972 samples, exactly the size computed by mediainfo.
To resume:
So, when ffmpeg encode the right size:
- all the tools says are aligned on the same size value
- I can compute the same value with the formula "file size - 44 bytes" (in
my case without metadatas):
- there is no issue on the thymio robot
When ffmpeg miss 1 byte is the size field: thymio robot can't play the
sound
If I manually edit the size field to put the same value than mediainfo ->
the robot can play the file
Maybe it's an issue on certain conditions, maybe this is becauce the
8000Hz data-rate, but I still highly suspect that ffmpeg miss 1 byte in
the data size field sometimes
Pol
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10229#comment:6>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list