Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#3524 closed defect (invalid)

FFmpeg MD5 output different with same data

Reported by: ahthovaikied Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: aac
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I have 2 different PC with builds of FFmpeg 2.2, that produce different md5 from same input data.

First machine (Ubuntu 12.04, core i7 950) :

$ wget -q http://www.auby.no/files/video_tests/h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv

$ md5sum h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv
4ce24d5155d6d4619c6233aa15b21aef  h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv

$ ffmpeg -loglevel quiet -i /tmp/h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv -f md5 -
MD5=5710038a7ea42277e67eb76631efff04

$ ffmpeg -version
ffmpeg version 2.2
built on Apr  2 2014 23:03:07 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --disable-runtime-cpudetect --disable-ffserver --disable-encoder=vorbis --disable-encoder=aac --enable-x11grab --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --disable-debug --cpu=corei7
libavutil      52. 66.100 / 52. 66.100
libavcodec     55. 52.102 / 55. 52.102
libavformat    55. 33.100 / 55. 33.100
libavdevice    55. 10.100 / 55. 10.100
libavfilter     4.  2.100 /  4.  2.100
libswscale      2.  5.102 /  2.  5.102
libswresample   0. 18.100 /  0. 18.100
libpostproc    52.  3.100 / 52.  3.100

$ gcc -v
Utilisation des specs internes.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configuré avec: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Modèle de thread: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5

Second machine (Ubuntu 14.04, core i7 3537U) :

$ wget -q http://www.auby.no/files/video_tests/h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv

$ md5sum h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv
4ce24d5155d6d4619c6233aa15b21aef  h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv

$ ffmpeg -loglevel quiet -i h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv -f md5 -
MD5=997b3168ffc48bbd83ae869a43e59232

$ ffmpeg -version
ffmpeg version 2.2
built on Apr  2 2014 23:23:24 with gcc 4.8 (Ubuntu 4.8.2-17ubuntu2)
configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --disable-runtime-cpudetect --disable-ffserver --disable-encoder=vorbis --disable-encoder=aac --enable-x11grab --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --disable-debug --cpu=core-avx-i
libavutil      52. 66.100 / 52. 66.100
libavcodec     55. 52.102 / 55. 52.102
libavformat    55. 33.100 / 55. 33.100
libavdevice    55. 10.100 / 55. 10.100
libavfilter     4.  2.100 /  4.  2.100
libswscale      2.  5.102 /  2.  5.102
libswresample   0. 18.100 /  0. 18.100
libpostproc    52.  3.100 / 52.  3.100

$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-17ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-17ubuntu2)

I also can also reproduce this with git master builds.

Change History (14)

comment:1 Changed 5 years ago by cehoyos

  • Component changed from ffmpeg to avcodec
  • Keywords aac added; md5 ffmpeg removed

Please understand that bugreports with -loglevel quiet are always invalid, but I wonder why a floating point decoder should output identical data with different compilers.

Please confirm that you get identical md5 values with -an but different output with -vn.

For future reports: Please always test (and report) current FFmpeg git head.

comment:2 follow-up: Changed 5 years ago by jamal

Don't rely on checksum to validate decoding of float data.

Core i7 950 is a Nehalem CPU. Core i7 3537U is an Ivy Bridge CPU.
The former supports only up to SSE4.2 instruction set, whereas the latter supports AVX.
The aac and mp3 float decoders use a couple of functions that have AVX implementations, which will give a different output than the non-AVX counterparts (The ones used by the i7 950).

comment:3 in reply to: ↑ 2 ; follow-up: Changed 5 years ago by cehoyos

Replying to jamal:

The aac and mp3 float decoders use a couple of functions that have AVX implementations, which will give a different output than the non-AVX counterparts (The ones used by the i7 950).

Do you have a sample for which --disable-avx produces different output on an Ivy Bridge?

comment:4 in reply to: ↑ 3 ; follow-up: Changed 5 years ago by jamal

Replying to cehoyos:

Do you have a sample for which --disable-avx produces different output on an Ivy Bridge?

Any float audio stream will output different md5 values depending on arch and instructions used. That's why the relevant FATE tests use tiny_psrn, as it's not bit exact.

comment:5 in reply to: ↑ 4 ; follow-up: Changed 5 years ago by cehoyos

Replying to jamal:

Replying to cehoyos:

Do you have a sample for which --disable-avx produces different output on an Ivy Bridge?

Any float audio stream will output different md5 values depending on arch and instructions used. That's why the relevant FATE tests use tiny_psrn, as it's not bit exact.

What I meant was: I tested several different aac samples with and without --disable-avx on an Ivy Bridge and was unable to find a difference in the output of ffmpeg -i input.aac -f crc -.
Do you have a sample that produces different output with and without avx?

Last edited 5 years ago by cehoyos (previous) (diff)

comment:6 Changed 5 years ago by ahthovaikied

I am getting a segfault with a build from git master (commit fd2bcfc4d6967588168443849b9bc365c78bb9af), only for the second machine (I am opening another bug report for this), so I am unable to compare the results.

Here are the results with full log output, for the first PC:

First machine (core i7 950), audio and video :

$ ./ffmpeg -i h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv -f md5 -
ffmpeg version N-62058-gfd2bcfc Copyright (c) 2000-2014 the FFmpeg developers
  built on Apr  3 2014 12:55:32 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-static --disable-runtime-cpudetect --disable-encoder=vorbis --disable-encoder=aac --enable-x11grab --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-debug --cpu=corei7
  libavutil      52. 71.100 / 52. 71.100
  libavcodec     55. 56.107 / 55. 56.107
  libavformat    55. 36.101 / 55. 36.101
  libavdevice    55. 11.100 / 55. 11.100
  libavfilter     4.  3.100 /  4.  3.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, matroska,webm, from 'h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv':
  Metadata:
    title           : Harry Potter 4[Eng-Hindi]Dual.Audio BRRIP 720p-=[champ_is_here]=-
    encoder         : libebml v1.0.0 + libmatroska v1.0.0
    creation_time   : 2011-01-07 07:42:53
  Duration: 00:00:57.61, start: 0.000000, bitrate: 613 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x528 [SAR 1:1 DAR 80:33], 25 fps, 25 tbr, 1k tbn, 47.95 tbc
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:1(eng): Audio: aac, 48000 Hz, stereo, fltp
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:2(hin): Audio: mp3, 48000 Hz, stereo, s16p, 160 kb/s
    Metadata:
      title           : -=[champ_is_here]=-
Output #0, md5, to 'pipe:':
  Metadata:
    title           : Harry Potter 4[Eng-Hindi]Dual.Audio BRRIP 720p-=[champ_is_here]=-
    encoder         : Lavf55.36.101
    Stream #0:0(eng): Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x528 [SAR 1:1 DAR 80:33], q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:1(eng): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      title           : -=[champ_is_here]=-
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> rawvideo)
  Stream #0:1 -> #0:1 (aac -> pcm_s16le)
Press [q] to stop, [?] for help
MD5=5710038a7ea42277e67eb76631efff04  0kB time=00:00:54.78 bitrate=   0.0kbits/s
frame= 1439 fps=451 q=0.0 Lsize=       0kB time=00:00:57.60 bitrate=   0.0kbits/s
video:1424610kB audio:11256kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

First machine (core i7 950), no video:

$ ./ffmpeg -i h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv -vn -f md5 -
ffmpeg version N-62058-gfd2bcfc Copyright (c) 2000-2014 the FFmpeg developers
  built on Apr  3 2014 12:55:32 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-static --disable-runtime-cpudetect --disable-encoder=vorbis --disable-encoder=aac --enable-x11grab --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-debug --cpu=corei7
  libavutil      52. 71.100 / 52. 71.100
  libavcodec     55. 56.107 / 55. 56.107
  libavformat    55. 36.101 / 55. 36.101
  libavdevice    55. 11.100 / 55. 11.100
  libavfilter     4.  3.100 /  4.  3.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, matroska,webm, from 'h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv':
  Metadata:
    title           : Harry Potter 4[Eng-Hindi]Dual.Audio BRRIP 720p-=[champ_is_here]=-
    encoder         : libebml v1.0.0 + libmatroska v1.0.0
    creation_time   : 2011-01-07 07:42:53
  Duration: 00:00:57.61, start: 0.000000, bitrate: 613 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x528 [SAR 1:1 DAR 80:33], 25 fps, 25 tbr, 1k tbn, 47.95 tbc
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:1(eng): Audio: aac, 48000 Hz, stereo, fltp
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:2(hin): Audio: mp3, 48000 Hz, stereo, s16p, 160 kb/s
    Metadata:
      title           : -=[champ_is_here]=-
Output #0, md5, to 'pipe:':
  Metadata:
    title           : Harry Potter 4[Eng-Hindi]Dual.Audio BRRIP 720p-=[champ_is_here]=-
    encoder         : Lavf55.36.101
    Stream #0:0(eng): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      title           : -=[champ_is_here]=-
Stream mapping:
  Stream #0:1 -> #0:0 (aac -> pcm_s16le)
Press [q] to stop, [?] for help
MD5=d6546e9096364f2c8c496f4a890f9119
size=       0kB time=00:00:57.60 bitrate=   0.0kbits/s
video:0kB audio:11256kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

First machine (core i7 950), no audio:

$ ./ffmpeg -i h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv -an -f md5 -
ffmpeg version N-62058-gfd2bcfc Copyright (c) 2000-2014 the FFmpeg developers
  built on Apr  3 2014 12:55:32 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-static --disable-runtime-cpudetect --disable-encoder=vorbis --disable-encoder=aac --enable-x11grab --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-debug --cpu=corei7
  libavutil      52. 71.100 / 52. 71.100
  libavcodec     55. 56.107 / 55. 56.107
  libavformat    55. 36.101 / 55. 36.101
  libavdevice    55. 11.100 / 55. 11.100
  libavfilter     4.  3.100 /  4.  3.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, matroska,webm, from 'h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv':
  Metadata:
    title           : Harry Potter 4[Eng-Hindi]Dual.Audio BRRIP 720p-=[champ_is_here]=-
    encoder         : libebml v1.0.0 + libmatroska v1.0.0
    creation_time   : 2011-01-07 07:42:53
  Duration: 00:00:57.61, start: 0.000000, bitrate: 613 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x528 [SAR 1:1 DAR 80:33], 25 fps, 25 tbr, 1k tbn, 47.95 tbc
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:1(eng): Audio: aac, 48000 Hz, stereo, fltp
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:2(hin): Audio: mp3, 48000 Hz, stereo, s16p, 160 kb/s
    Metadata:
      title           : -=[champ_is_here]=-
Output #0, md5, to 'pipe:':
  Metadata:
    title           : Harry Potter 4[Eng-Hindi]Dual.Audio BRRIP 720p-=[champ_is_here]=-
    encoder         : Lavf55.36.101
    Stream #0:0(eng): Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x528 [SAR 1:1 DAR 80:33], q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Metadata:
      title           : -=[champ_is_here]=-
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> rawvideo)
Press [q] to stop, [?] for help
MD5=eeb51ec63c5c7db6ce70e9cebe7cb7e6  0kB time=00:00:55.72 bitrate=   0.0kbits/s
frame= 1439 fps=464 q=0.0 Lsize=       0kB time=00:00:57.56 bitrate=   0.0kbits/s
video:1424610kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

comment:7 in reply to: ↑ 5 ; follow-up: Changed 5 years ago by jamal

Replying to cehoyos:

What I meant was: I tested several different aac samples with and without --disable-avx on an Ivy Bridge and was unable to find a difference in the output of ffmpeg -i input.aac -f crc -.
Do you have a sample that produces different output with and without avx?

No, just checked and can't find any where the output is different. It seems that only LTP profile aac files use our handwritten AVX functions for that matter.

Also, as you said ahthovaikied used two different compiler versions. On top of that one configured with --cpu=corei7 and the other --cpu=core-avx-i, so even more chances for different float output.

comment:8 follow-up: Changed 5 years ago by ahthovaikied

Now that my segfault problem is gone, here is the other half of the results:

Second machine (core i7 3537U), with audio and video:

$ ./ffmpeg -i h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv -f md5 -
ffmpeg version N-62058-gfd2bcfc Copyright (c) 2000-2014 the FFmpeg developers
  built on Apr  3 2014 21:19:55 with gcc 4.8 (Ubuntu 4.8.2-17ubuntu2)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-runtime-cpudetect --disable-ffserver --disable-encoder=vorbis --disable-encoder=aac --enable-x11grab --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --disable-debug --cpu=core-avx-i
  libavutil      52. 71.100 / 52. 71.100
  libavcodec     55. 56.107 / 55. 56.107
  libavformat    55. 36.101 / 55. 36.101
  libavdevice    55. 11.100 / 55. 11.100
  libavfilter     4.  3.100 /  4.  3.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, matroska,webm, from 'h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv':
  Metadata:
    title           : Harry Potter 4[Eng-Hindi]Dual.Audio BRRIP 720p-=[champ_is_here]=-
    encoder         : libebml v1.0.0 + libmatroska v1.0.0
    creation_time   : 2011-01-07 07:42:53
  Duration: 00:00:57.61, start: 0.000000, bitrate: 613 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x528 [SAR 1:1 DAR 80:33], 25 fps, 25 tbr, 1k tbn, 47.95 tbc
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:1(eng): Audio: aac, 48000 Hz, stereo, fltp
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:2(hin): Audio: mp3, 48000 Hz, stereo, s16p, 160 kb/s
    Metadata:
      title           : -=[champ_is_here]=-
Output #0, md5, to 'pipe:':
  Metadata:
    title           : Harry Potter 4[Eng-Hindi]Dual.Audio BRRIP 720p-=[champ_is_here]=-
    encoder         : Lavf55.36.101
    Stream #0:0(eng): Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x528 [SAR 1:1 DAR 80:33], q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:1(eng): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      title           : -=[champ_is_here]=-
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> rawvideo)
  Stream #0:1 -> #0:1 (aac -> pcm_s16le)
Press [q] to stop, [?] for help
MD5=997b3168ffc48bbd83ae869a43e59232  0kB time=00:00:56.86 bitrate=   0.0kbits/s
frame= 1439 fps=403 q=0.0 Lsize=       0kB time=00:00:57.60 bitrate=   0.0kbits/s
video:1424610kB audio:11256kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Second machine (core i7 3537U), no video:

$ ./ffmpeg -i h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv -vn -f md5 -
ffmpeg version N-62058-gfd2bcfc Copyright (c) 2000-2014 the FFmpeg developers
  built on Apr  3 2014 21:19:55 with gcc 4.8 (Ubuntu 4.8.2-17ubuntu2)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-runtime-cpudetect --disable-ffserver --disable-encoder=vorbis --disable-encoder=aac --enable-x11grab --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --disable-debug --cpu=core-avx-i
  libavutil      52. 71.100 / 52. 71.100
  libavcodec     55. 56.107 / 55. 56.107
  libavformat    55. 36.101 / 55. 36.101
  libavdevice    55. 11.100 / 55. 11.100
  libavfilter     4.  3.100 /  4.  3.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, matroska,webm, from 'h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv':
  Metadata:
    title           : Harry Potter 4[Eng-Hindi]Dual.Audio BRRIP 720p-=[champ_is_here]=-
    encoder         : libebml v1.0.0 + libmatroska v1.0.0
    creation_time   : 2011-01-07 07:42:53
  Duration: 00:00:57.61, start: 0.000000, bitrate: 613 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x528 [SAR 1:1 DAR 80:33], 25 fps, 25 tbr, 1k tbn, 47.95 tbc
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:1(eng): Audio: aac, 48000 Hz, stereo, fltp
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:2(hin): Audio: mp3, 48000 Hz, stereo, s16p, 160 kb/s
    Metadata:
      title           : -=[champ_is_here]=-
Output #0, md5, to 'pipe:':
  Metadata:
    title           : Harry Potter 4[Eng-Hindi]Dual.Audio BRRIP 720p-=[champ_is_here]=-
    encoder         : Lavf55.36.101
    Stream #0:0(eng): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      title           : -=[champ_is_here]=-
Stream mapping:
  Stream #0:1 -> #0:0 (aac -> pcm_s16le)
Press [q] to stop, [?] for help
MD5=cd7298a49504ca810b8e8e8cdcd417b2
size=       0kB time=00:00:57.60 bitrate=   0.0kbits/s
video:0kB audio:11256kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Second machine (core i7 3537U), no audio:

$ ./ffmpeg -i h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv -an -f md5 -
ffmpeg version N-62058-gfd2bcfc Copyright (c) 2000-2014 the FFmpeg developers
  built on Apr  3 2014 21:19:55 with gcc 4.8 (Ubuntu 4.8.2-17ubuntu2)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-runtime-cpudetect --disable-ffserver --disable-encoder=vorbis --disable-encoder=aac --enable-x11grab --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --disable-debug --cpu=core-avx-i
  libavutil      52. 71.100 / 52. 71.100
  libavcodec     55. 56.107 / 55. 56.107
  libavformat    55. 36.101 / 55. 36.101
  libavdevice    55. 11.100 / 55. 11.100
  libavfilter     4.  3.100 /  4.  3.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, matroska,webm, from 'h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv':
  Metadata:
    title           : Harry Potter 4[Eng-Hindi]Dual.Audio BRRIP 720p-=[champ_is_here]=-
    encoder         : libebml v1.0.0 + libmatroska v1.0.0
    creation_time   : 2011-01-07 07:42:53
  Duration: 00:00:57.61, start: 0.000000, bitrate: 613 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x528 [SAR 1:1 DAR 80:33], 25 fps, 25 tbr, 1k tbn, 47.95 tbc
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:1(eng): Audio: aac, 48000 Hz, stereo, fltp
    Metadata:
      title           : -=[champ_is_here]=-
    Stream #0:2(hin): Audio: mp3, 48000 Hz, stereo, s16p, 160 kb/s
    Metadata:
      title           : -=[champ_is_here]=-
Output #0, md5, to 'pipe:':
  Metadata:
    title           : Harry Potter 4[Eng-Hindi]Dual.Audio BRRIP 720p-=[champ_is_here]=-
    encoder         : Lavf55.36.101
    Stream #0:0(eng): Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x528 [SAR 1:1 DAR 80:33], q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Metadata:
      title           : -=[champ_is_here]=-
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> rawvideo)
Press [q] to stop, [?] for help
MD5=eeb51ec63c5c7db6ce70e9cebe7cb7e6  0kB time=00:00:50.28 bitrate=   0.0kbits/s
frame= 1439 fps=418 q=0.0 Lsize=       0kB time=00:00:57.56 bitrate=   0.0kbits/s
video:1424610kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

The MD5 match when ignoring the audio stream. It seems you are right and this is a decoding difference in the audio, thank you for pointing me this.

I think you can close this bug then.

Do you know if there is a way to compute the MD5 of the streams with FFmpeg before decoding? A full file checksum is not an option because I need to be able to select only some streams for the calculation.

comment:9 in reply to: ↑ 8 Changed 5 years ago by jamal

Replying to ahthovaikied:

Do you know if there is a way to compute the MD5 of the streams with FFmpeg before decoding? A full file checksum is not an option because I need to be able to select only some streams for the calculation.

./ffmpeg -i h264_720p_hp_3.1_600kbps_aac_mp3_dual_audio_harry_potter.mkv -vn -c:a copy -f md5 -

Should give you the md5 of the aac stream as it is stored in the file, without decoding it.

comment:10 Changed 5 years ago by ahthovaikied

Thank you :)

comment:11 in reply to: ↑ 7 ; follow-up: Changed 5 years ago by cehoyos

  • Resolution set to invalid
  • Status changed from new to closed

Replying to jamal:

Also, as you said ahthovaikied used two different compiler versions.

I had tested with a newer and an older gcc version than ahthovaikied (but not the same) and could not reproduce a difference.

On top of that one configured with --cpu=corei7 and the other --cpu=core-avx-i, so even more chances for different float output.

I also tested the different configure options and saw no difference.

Or to say it differently: We both agree that AAC is not necessarily bit-exact but I would still like to know how to reproduce this issue (while I find it less interesting to know which commit broke library upwards-compatibility).

comment:12 in reply to: ↑ 11 ; follow-up: Changed 5 years ago by jamal

Replying to cehoyos:

Or to say it differently: We both agree that AAC is not necessarily bit-exact but I would still like to know how to reproduce this issue (while I find it less interesting to know which commit broke library upwards-compatibility).

ahthovaikied, could you upload the sample you used above so we can test and try to reproduce this?

comment:13 in reply to: ↑ 12 Changed 5 years ago by cehoyos

Replying to jamal:

ahthovaikied, could you upload the sample you used above so we can test and try to reproduce this?

http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket3524/
See the original description...

comment:14 Changed 5 years ago by jamal

Missed the link, my bad.

Tried gcc 4.7.3 x86_64 Gentoo and 4.8.2 x86_64 Windows on both avx and non-avx machines and the md5 was the same as the one from the i7 3537U.
Only way i was able to get a different result was with an x86_32 build, but that's not relevant here.

If time permits I'll try to run a live cd of Ubuntu 12.04 or install it and use its compiler.

Note: See TracTickets for help on using tickets.