[FFmpeg-user] ffmpeg md5 muxer different outputs on ARM and x86

Nathan of Guardian nathan at guardianproject.info
Fri Nov 15 15:33:06 CET 2013


I am working on a project that using the ffmpeg md5 muxer to ensure that
video captured on an Android phone has not manipulated between the time
it was captured, and when it is received on a remote server. To do this,
we want to use the md5 and framemd5 muxers to hash the actual video
contents, and not the entire file itself.

I've built the exact same version of ffmpeg (0.11.1) for Android (ARM)
and my Linux desktop (x86), but when I run the md5 muxer on the exact
same file (ffmpeg -i foo.mp4 -f md5 -), I receive different md5 hashes.

Logs for both posted below

DESKTOP OUTPUT:
ffmpeg -i VID_20131109_104011.mp4 -f md5 -ffmpeg version 0.11.1
Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov 15 2013 00:10:11 with gcc 4.6.3
  configuration: --target-os=linux --enable-runtime-cpudetect --prefix=
--enable-pic --disable-shared --enable-static --enable-version3
--enable-gpl --disable-doc --enable-yasm --enable-decoders
--enable-encoders --enable-muxers --enable-demuxers --enable-parsers
--enable-protocols --enable-filters --enable-avresample
--enable-libfreetype --disable-indevs --enable-indev=lavfi
--disable-outdevs --enable-hwaccels --enable-ffmpeg --disable-ffplay
--disable-ffprobe --disable-ffserver --disable-network --enable-libx264
--enable-zlib --enable-muxer=md5
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID_20131109_104011.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isom3gp4
    creation_time   : 2013-11-09 15:40:32
  Duration: 00:00:19.84, start: 0.000000, bitrate: 8208 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuv420p, 1280x720, 8055 kb/s, SAR 65536:65536 DAR 16:9,
30.29 fps, 30.33 tbr, 90k tbn, 180k tbc
    Metadata:
      creation_time   : 2013-11-09 15:40:32
      handler_name    : VideoHandle
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono,
s16, 96 kb/s
    Metadata:
      creation_time   : 2013-11-09 15:40:32
      handler_name    : SoundHandle
[buffer @ 0x2d02a40] w:1280 h:720 pixfmt:yuv420p tb:1/90000
sar:65536/65536 sws_param:flags=2
[buffersink @ 0x2d02f20] No opaque field provided
Output #0, md5, to 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isom3gp4
    creation_time   : 2013-11-09 15:40:32
    encoder         : Lavf54.6.100
    Stream #0:0(eng): Video: rawvideo (I420 / 0x30323449), yuv420p,
1280x720 [SAR 65536:65536 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 30.33 tbc
    Metadata:
      creation_time   : 2013-11-09 15:40:32
      handler_name    : VideoHandle
    Stream #0:1(eng): Audio: pcm_s16le, 48000 Hz, mono, s16, 768 kb/s
    Metadata:
      creation_time   : 2013-11-09 15:40:32
      handler_name    : SoundHandle
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> rawvideo)
  Stream #0:1 -> #0:1 (aac -> pcm_s16le)
Press [q] to stop, [?] for help
MD5=3fb1aee08ce60d37b786a1d494f80b45  0kB time=00:00:19.45 bitrate=
0.0kbits/s dup=1 drop=0
frame=  594 fps=106 q=0.0 Lsize=       0kB time=00:00:19.58 bitrate=
0.0kbits/s dup=1 drop=0
video:801900kB audio:1860kB global headers:0kB muxing overhead -99.999996%


ANDROID OUTPUT:

adb shell /data/local/tmp/ffmpeg -i
/sdcard/DCIM/Camera/VID_20131109_104011.mp4 -f md5 -
ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov 15 2013 00:50:10 with gcc 4.6 20120106 (prerelease)
  configuration: --arch=arm --cpu=cortex-a8 --target-os=linux
--enable-runtime-cpudetect --enable-small
--prefix=/data/data/info.guardianproject.ffmpeg/app_opt --enable-pic
--disable-shared --enable-static
--cross-prefix=/home/n8fr8/dev/android/ndk//toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
--sysroot=/home/n8fr8/dev/android/ndk//platforms/android-3/arch-arm
--extra-cflags='-I../x264 -mfloat-abi=softfp -mfpu=neon'
--extra-ldflags=-L../x264 --enable-version3 --enable-gpl --disable-doc
--enable-yasm --enable-decoders --enable-encoders --enable-muxers
--enable-demuxers --enable-parsers --enable-protocols --enable-filters
--enable-avresample --enable-libfreetype --disable-indevs
--enable-indev=lavfi --disable-outdevs --enable-hwaccels --enable-ffmpeg
--disable-ffplay --disable-ffprobe --disable-ffserver --disable-network
--enable-libx264 --enable-zlib --enable-muxer=md5
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'/sdcard/DCIM/Camera/VID_20131109_104011.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isom3gp4
    creation_time   : 2013-11-09 15:40:32
  Duration: 00:00:19.84, start: 0.000000, bitrate: 8208 kb/s
    Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p,
1280x720, 8055 kb/s, SAR 65536:65536 DAR 16:9, 30.29 fps, 30.33 tbr, 90k
tbn, 180k tbc
    Metadata:
      creation_time   : 2013-11-09 15:40:32
      handler_name    : VideoHandle
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono,
s16, 96 kb/s
    Metadata:
      creation_time   : 2013-11-09 15:40:32
      handler_name    : SoundHandle
[buffer @ 0x2427a20] w:1280 h:720 pixfmt:yuv420p tb:1/90000
sar:65536/65536 sws_param:flags=2
[buffersink @ 0x2427bf0] No opaque field provided
Output #0, md5, to 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isom3gp4
    creation_time   : 2013-11-09 15:40:32
    encoder         : Lavf54.6.100
    Stream #0:0(eng): Video: rawvideo (I420 / 0x30323449), yuv420p,
1280x720 [SAR 65536:65536 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 30.33 tbc
    Metadata:
      creation_time   : 2013-11-09 15:40:32
      handler_name    : VideoHandle
    Stream #0:1(eng): Audio: pcm_s16le, 48000 Hz, mono, s16, 768 kb/s
    Metadata:
      creation_time   : 2013-11-09 15:40:32
      handler_name    : SoundHandle
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> rawvideo)
  Stream #0:1 -> #0:1 (aac -> pcm_s16le)
Press [q] to stop, [?] for help
MD5=ce52a8eefa56a09633428acd1ab62b59  0kB time=00:00:19.13 bitrate=
0.0kbits/s dup=1 drop=0
frame=  594 fps= 28 q=0.0 Lsize=       0kB time=00:00:19.58 bitrate=
0.0kbits/s dup=1 drop=0
video:801900kB audio:1860kB global headers:0kB muxing overhead -99.999996%


More information about the ffmpeg-user mailing list