[FFmpeg-trac] #6937(undetermined:new): When converting from APE program eats up 4 bytes.

FFmpeg trac at avcodec.org
Sat Dec 30 15:23:27 EET 2017


#6937: When converting from APE program eats up 4 bytes.
-------------------------------------+-------------------------------------
             Reporter:  sokoloff     |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
              Version:  git-master   |  undetermined
             Keywords:  APE seek     |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by sokoloff):

 >Is the issue reproducible with current FFmpeg git head? Afaict, you
 tested 3.2.4 for the relevant command.
 Sorry.
 {{{
 [sokoloff at sokoloff-home bug]$ ./ffmpeg -y -accurate_seek -ss 5 -t 30 -i
 in.wav -f wav from_wav.wav
 ffmpeg version N-89656-g0c78b6a416 Copyright (c) 2000-2017 the FFmpeg
 developers
   built with gcc 4.9.4 (Linaro GCC 4.9-2017.01) 20160726 (ROSA)
   configuration:
   libavutil      56.  7.100 / 56.  7.100
   libavcodec     58.  9.100 / 58.  9.100
   libavformat    58.  3.100 / 58.  3.100
   libavdevice    58.  0.100 / 58.  0.100
   libavfilter     7.  8.100 /  7.  8.100
   libswscale      5.  0.101 /  5.  0.101
   libswresample   3.  0.101 /  3.  0.101
 Guessed Channel Layout for Input Stream #0.0 : stereo
 Input #0, wav, from 'in.wav':
   Metadata:
     encoder         : Lavf57.56.101
   Duration: 00:09:34.00, bitrate: 1411 kb/s
     Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz,
 stereo, s16, 1411 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
 Press [q] to stop, [?] for help
 Output #0, wav, to 'from_wav.wav':
   Metadata:
     ISFT            : Lavf58.3.100
     Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz,
 stereo, s16, 1411 kb/s
     Metadata:
       encoder         : Lavc58.9.100 pcm_s16le
 size=    5168kB time=00:00:30.00 bitrate=1411.2kbits/s speed=1.09e+03x
 video:0kB audio:5168kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 0.001474%

 [sokoloff at sokoloff-home bug]$ ./ffmpeg -y -accurate_seek -ss 5 -t 30 -i
 in.ape -f wav from_ape.wav
 ffmpeg version N-89656-g0c78b6a416 Copyright (c) 2000-2017 the FFmpeg
 developers
   built with gcc 4.9.4 (Linaro GCC 4.9-2017.01) 20160726 (ROSA)
   configuration:
   libavutil      56.  7.100 / 56.  7.100
   libavcodec     58.  9.100 / 58.  9.100
   libavformat    58.  3.100 / 58.  3.100
   libavdevice    58.  0.100 / 58.  0.100
   libavfilter     7.  8.100 /  7.  8.100
   libswscale      5.  0.101 /  5.  0.101
   libswresample   3.  0.101 /  3.  0.101
 Input #0, ape, from 'in.ape':
   Duration: 00:09:34.00, start: 0.000000, bitrate: 699 kb/s
     Stream #0:0: Audio: ape (APE  / 0x20455041), 44100 Hz, stereo, s16p
 Stream mapping:
   Stream #0:0 -> #0:0 (ape (native) -> pcm_s16le (native))
 Press [q] to stop, [?] for help
 Output #0, wav, to 'from_ape.wav':
   Metadata:
     ISFT            : Lavf58.3.100
     Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz,
 stereo, s16, 1411 kb/s
     Metadata:
       encoder         : Lavc58.9.100 pcm_s16le
 size=    5168kB time=00:00:30.00 bitrate=1411.2kbits/s speed= 233x
 video:0kB audio:5168kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 0.001474%

 [sokoloff at sokoloff-home bug]$ ls -l from*.wav
 -rw-rw-r-- 1 sokoloff sokoloff 5292074 дек 30 16:05 from_ape.wav
 -rw-rw-r-- 1 sokoloff sokoloff 5292078 дек 30 16:04 from_wav.wav
 }}}

 > Why do you believe that the output files have to have the same length?
 > I expect that this is not how seeking works in general, or is it?


 '''Theory'''
 Files have a CD-quality, two-channel signed 16-bit Linear PCM sampled at
 44,100 Hz. The audio bit rate for a Red Book audio CD is 1,411,200 bits
 per second or 176400 bytes per second; 2 channels × 44,100 samples per
 second per channel × 16 bits per sample. We extract 30 seconds, so audio
 data size must be 5292000 bytes (176400*30). The WAV header has a 78 bytes
 size, so the total size of file must be 5292078 bytes. For the
 from_wav.wav file is true, but from_ape.wav is smaller.

 '''Pactic'''
 I did the same experiment for flac, wv, tta files.
 {{{
 [sokoloff at sokoloff-home bug]$ ls -l from*.wav
 -rw-rw-r-- 1 sokoloff sokoloff 5292074 дек 30 16:05 from_ape.wav
 -rw-rw-r-- 1 sokoloff sokoloff 5292078 дек 30 16:20 from_flac.wav
 -rw-rw-r-- 1 sokoloff sokoloff 5292078 дек 30 16:21 from_tta.wav
 -rw-rw-r-- 1 sokoloff sokoloff 5292078 дек 30 16:04 from_wav.wav
 -rw-rw-r-- 1 sokoloff sokoloff 5292078 дек 30 16:21 from_wv.wav
 }}}

 All files have a size of 5292078, except the from_ape.wav.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6937#comment:4>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list