Opened 6 years ago

Closed 6 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)

comment:1 by Nicolas George, 6 years ago

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.

in reply to:  1 comment:2 by ami_stuff, 6 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

comment:3 by Carl Eugen Hoyos, 6 years ago

Component: undeterminedavcodec
Keywords: shorten added
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

The FFmpeg output is 512 bytes shorter than the shorten output.

in reply to:  3 comment:5 by ami_stuff, 6 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 Carl Eugen Hoyos, 6 years ago

Keywords: regression added
Priority: normalimportant

For the given sample this is a regression since b4b58485135dbc37a6cf8a57196157b1d67d13e1 related to ticket #1250

comment:7 by Elon Musk, 6 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.