HydrogenAudio

Digital Audio/Video => General A/V => Topic started by: Porcus on 2018-07-10 11:33:02

Title: Video compare utility?
Post by: Porcus on 2018-07-10 11:33:02
Is there any utility that can compare two files and check if they contain the same stream(s)? Kinda like foo_bitcompare, but for video?

Say, an mp4 and an mkv (I did some remuxing and argh, now I have a lot of duplicates ...)
Title: Re: Video compare utility?
Post by: danadam on 2018-07-10 14:25:27
I have this for audio:
Code: [Select]
ffmpeg -i "input" -map 0:a -f md5 - 2>/dev/null
With "0:v" will probably work for video too.
Title: Re: Video compare utility?
Post by: Porcus on 2018-07-11 12:29:41
Then it seems to me that ffmpeg remuxing adds delay or something like that, which obviously alters hashes ...
Title: Re: Video compare utility?
Post by: andy o on 2018-07-13 09:38:56
Not to insult the nice smart people the guy mentions, but this Bob person and the other dummies he's shilling for remind me of this

(https://i.imgur.com/eipugIu.jpg)
Title: Re: Video compare utility?
Post by: Porcus on 2018-07-13 09:47:02
Sounds like wrong thread, @andy o.
Title: Re: Video compare utility?
Post by: andy o on 2018-07-13 10:14:17
yup haha had two tabs open... oh well. It was meant for this thread https://hydrogenaud.io/index.php/topic,116249.msg959464/
"AudioCon gone bad"
Title: Re: Video compare utility?
Post by: polemon on 2018-07-13 12:06:26
The naïve approach would be to extract the video stream of the two files you want to compare with ffmpeg and -vcodec copy and compare those. If the codec in question is H.264 for instance, ffmpeg supports the format "h264", which is a raw H.264 stream.

Raw HEVC (H.265), and raw MPEG-4 video is also supported. For VP8 or VPx/VP9, I'm not so sure, ffmpeg --formats doesn't list any raw formats for that. You could probably use the format "rawvideo" or "data" for raw formats that aren't otherwise supported by ffmpeg.

So, something like:
Code: [Select]
ffmpeg -i file1.mp4 -c:v copy -an file1.h264
ffmpeg -i file2.mkv -c:v copy -an file2.h264
diff file1.h264 file2.h264
diff will tell you if the two binary files differ or not. However, I'm not sure what sort of header if any ffmpeg puts at the top of a .h264 file.