Opened 11 years ago
Closed 10 years ago
#4712 closed defect (fixed)
shorten decoder is not lossless
| Reported by: | ami_stuff | Owned by: | |
|---|---|---|---|
| Priority: | important | Component: | avcodec |
| Version: | git-master | Keywords: | shorten regression |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | yes | |
| Analyzed by developer: | no |
Description
it looks like the last frame of the audio is not decoded compared to the official decoder
I did this:
ffmpeg -i test.shn ffmpeg.wav
shorten -x test.shn shorten.wav
ffmpeg -i shorten.wav shorten_ff.wav
and then compared "ffmpeg.wav" vs "shorten_ff.wav"
in hex editor ("shorter_ff.wav" file is a bit longer)
http://www.datafilehost.com/d/e5b57ea1
C:\>ffmpeg -i test.shn out.wav
ffmpeg version N-73510-g033dc39 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
ble-decklink --enable-zlib
libavutil 54. 28.100 / 54. 28.100
libavcodec 56. 47.100 / 56. 47.100
libavformat 56. 40.100 / 56. 40.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 21.100 / 5. 21.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, shn, from 'test.shn':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Audio: shorten, 44100 Hz, 2 channels, s16p
Output #0, wav, to 'out.wav':
Metadata:
ISFT : Lavf56.40.100
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16
, 1411 kb/s
Metadata:
encoder : Lavc56.47.100 pcm_s16le
Stream mapping:
Stream #0:0 -> #0:0 (shorten (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Multiple frames in a packet from stream 0
size= 5170kB time=00:00:30.00 bitrate=1411.5kbits/s
video:0kB audio:5170kB subtitle:0kB other streams:0kB global headers:0kB muxing
overhead: 0.001473%
Change History (7)
follow-up: 2 comment:1 by , 11 years ago
comment:2 by , 11 years ago
Replying to Cigaes:
FFmpeg includes some metadata in WAVE files that other software rarely use, your comparison may be detecting just that. You need to extract to raw PCM to be sure.
Ok thanks for the info, but in this case output from ffmpeg and shorten still doesn't match:
ffmpeg -i test.shn -f s16le ffmpeg.pcm
shorten -x test.shn shorten.wav
ffmpeg -i shorten.wav -f s16le shorten_ff.pcm
follow-up: 5 comment:3 by , 11 years ago
| Component: | undetermined → avcodec |
|---|---|
| Keywords: | shorten added |
| Reproduced by developer: | set |
| Status: | new → open |
| Version: | unspecified → git-master |
The FFmpeg output is 512 bytes shorter than the shorten output.
comment:4 by , 11 years ago
also the output from:
https://samples.mplayerhq.hu/A-codecs/lossless/luckynight.mlp
https://samples.mplayerhq.hu/A-codecs/lossless/luckynight.rmvb
doesn't match (some differences at the end of the file):
https://samples.mplayerhq.hu/A-codecs/lossless/luckynight.wav.bz2
comment:5 by , 10 years ago
Replying to cehoyos:
The FFmpeg output is 512 bytes shorter than the shorten output.
looks like regression
ffmpeg -i test.shn -f s16le ffmpeg.pcm
ffmpeg 0.8 - 5294592
ffmpeg 1.0.1 - 5294080
comment:6 by , 10 years ago
| Keywords: | regression added |
|---|---|
| Priority: | normal → important |
For the given sample this is a regression since b4b58485135dbc37a6cf8a57196157b1d67d13e1 related to ticket #1250
comment:7 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | open → closed |
Fixed in 966d43d7786d1a95162e3feff1d5bfbcb58e571f.



FFmpeg includes some metadata in WAVE files that other software rarely use, your comparison may be detecting just that. You need to extract to raw PCM to be sure.