Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Peter B." <pb@das-werkstatt.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: [FFmpeg-devel] hashing audio streams beyond pcm_s16le
Date: Fri, 18 Nov 2022 20:21:49 +0100
Message-ID: <dafe97d0-16ba-b210-124b-11e3fe0b6b43@das-werkstatt.com> (raw)

Hello everyone :)

I was wondering about the behavior of FFmpeg's hashing muxer for audio 
streams:

For example:
With a 32bit float (f32le) source, FFmpeg seems to be able to generate a 
hash for the f32le source - but only if I explicitly know (and then 
tell) FFmpeg to do so.
By default, I get the hash of a pcm_s16le version (see examples below).

I remember it defaults to "pcm_s16le" (also mentioned in 
https://trac.ffmpeg.org/wiki/framemd5%20Intro%20and%20HowTo), but why is 
that so?

And would it be possible to generate the hash of the source audio, 
without having to know what raw/uncompressed type it is?
I would like to be able to use the hash to compare lossless conversion 
of the content between different audio formats (eg vs FLAC and PCM).



Thank you very much in advance :)
Peter B.


------------------------
Example:

# pcm_f32le defaults to pcm_s16le hash:
$ ffmpeg-git -loglevel quiet -i drums3.wav -f streamhash -hash md5 -
0,a,MD5=08170d6e02fbccc07b61fbf1d7476057

# ...as shown here:
$ ffmpeg-git -loglevel quiet -i drums3.wav -c:a pcm_s16le -f streamhash 
-hash md5 -
0,a,MD5=08170d6e02fbccc07b61fbf1d7476057

#
$ ffmpeg-git -loglevel quiet -i drums3.wav -c:a pcm_f32le -f streamhash 
-hash md5 -
0,a,MD5=1444cdc20cb8ea30874114cb53729797

$ ffmpeg-git -loglevel quiet -i drums3.wav -c:a copy -f streamhash -hash 
md5 -
0,a,MD5=1444cdc20cb8ea30874114cb53729797



$ ffmpeg-git -i drums3.wav -hash md5 -

ffmpeg version N-109029-g1800a0da09 Copyright (c) 2000-2022 the FFmpeg 
developers
   built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
   configuration: --prefix=/usr/local --enable-gpl --enable-nonfree 
--enable-version3 --enable-postproc --enable-ffplay --enable-swscale 
--enable-avfilter --enable-pthreads --enable-bzlib --enable-zlib 
--enable-decoder=png --enable-encoder=png --enable-openssl 
--samples=../fate-suite --enable-libfreetype --enable-libopenjpeg 
--disable-decoder=jpeg2000 --enable-libvpx --enable-libvorbis 
--enable-libx264 --enable-libx265
   libavutil      57. 42.100 / 57. 42.100
   libavcodec     59. 52.100 / 59. 52.100
   libavformat    59. 34.101 / 59. 34.101
   libavdevice    59.  8.101 / 59.  8.101
   libavfilter     8. 50.100 /  8. 50.100
   libswscale      6.  8.112 /  6.  8.112
   libswresample   4.  9.100 /  4.  9.100
   libpostproc    56.  7.100 / 56.  7.100
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, wav, from 'drums3.wav':
   Duration: 00:00:54.25, bitrate: 1536 kb/s
   Stream #0:0: Audio: pcm_f32le ([3][0][0][0] / 0x0003), 48000 Hz, 1 
channels, flt, 1536 kb/s




_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

                 reply	other threads:[~2022-11-18 19:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dafe97d0-16ba-b210-124b-11e3fe0b6b43@das-werkstatt.com \
    --to=pb@das-werkstatt.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git