Coder Social home page Coder Social logo

video-compare's Introduction

video-compare

GitHub release

Split screen video comparison tool written in C++14 using FFmpeg libraries and SDL2.

video-compare can be used to visually compare, e.g., the effect of codecs and resizing algorithms on two video files played in sync. The tool is flexible, allowing videos of differing resolutions, frame rates, scanning methods, color formats, container formats, codecs, or durations.

A movable slider enables easy viewing of the difference across any region of interest.

Thanks to the versatility of FFmpeg, it is actually also possible to use video-compare to compare two images. The common PNG and JPEG formats have been successfully tested to work.

Installation

Arch Linux

Install via AUR:

git clone https://aur.archlinux.org/video-compare.git
cd video-compare
makepkg -sic

Homebrew

Install via Homebrew:

brew install video-compare

Pre-compiled Windows 10 binaries

Pre-built Windows 10 x86 64-bit releases are available from this page. Download and extract the .zip-archive on your system, then run video-compare.exe from a command prompt.

Compile from source

Build it yourself.

Screenshots

Visual compare mode: Visual compare mode

Subtraction mode (plus time-shift, 200% zoom, and magnification): Subtraction mode"

Vertically stacked mode: Stacked mode"

Credits

video-compare was created by Jon Frydensbjerg (email: [email protected]). The code is mainly based on the excellent video player GitHub project: https://github.com/pockethook/player

Many thanks to the FFmpeg, SDL2 and stb authors.

Usage

Launch using the operating system's DPI setting. Video pixels are doubled on devices like a Retina 5K display; therefore, it is the preferred option for displaying HD 1080p videos on such screens:

video-compare video1.mp4 video2.mp4

Allow high DPI mode on systems which supports that. Video pixels are displayed "1-to-1". Useful for e.g. displaying UHD 4K video on a Retina 5K display:

video-compare -d video1.mp4 video2.mp4

Increase bit depth to 10 bits per color component (8 bits is the default). Fidelity is increased while performance takes a hit. Significantly reduces visible banding on systems with a higher grade display and driver support for 30-bit color:

video-compare -b video1.mp4 video2.mp4

Use a specific window size instead of deriving the window size from the video dimensions. The video frame will be scaled to fit. If either width or height is left out, the missing value will be calculated from the other specified dimension so that aspect ratio is maintained. Useful for downscaling high resolution video onto a low resolution display:

video-compare -w 1280x720 video1.mp4 video2.mp4

Shift the presentation time stamps of the right video instead of assuming the videos are aligned. A positive amount has the effect of delaying the left video while negative values conversely delays the right video. Useful when videos are slightly out of sync:

video-compare -t 0.080 video1.mp4 video2.mp4

Display videos stacked vertically at full size without a slider (hstack for horizontal stacking is also supported):

video-compare -m vstack video1.mp4 video2.mp4

Preprocess one or both inputs via a list of FFmpeg video filters specified on the command line (see FFmpeg's video filters documentation). The Swiss Army knife for cropping/padding (comparing videos with different aspect ratios), adjusting colors, deinterlacing, denoising, speeding up/slowing down, etc.:

video-compare -l crop=iw:ih-240 -r format=gray,pad=iw+320:ih:160:0 video1.mp4 video2.mp4

Select a demuxer that cannot be auto-detected (such as VapourSynth):

video-compare --left-demuxer vapoursynth script.vpy video.mp4

Explicit decoder selection for the right video:

video-compare --right-decoder h264_cuvid video1.mp4 video2.mp4

Set the hardware acceleration type for the left video:

video-compare --left-hwaccel videotoolbox video1.mp4 video2.mp4

Perform simpler comparison of a video with itself using double underscore (__) as a placeholder. This enables tasks such as comparing the video with a time-shifted version of itself or testing various sets of filters, without the need to enter the same, potentially long path twice:

video-compare some/very/long/and/complicated/video/path.mp4 __

The above features can be combined in any order, of course. Launch video-compare without any arguments to see all supported options.

Controls

  • Space: Toggle play/pause
  • Comma ,: Toggle bidirectional in-buffer loop/pause
  • Period .: Toggle forward-only in-buffer loop/pause
  • Escape: Quit
  • Down arrow: Seek 15 seconds backward
  • Left arrow: Seek 1 second backward
  • Page down: Seek 600 seconds backward
  • Up arrow: Seek 15 seconds forward
  • Right arrow: Seek 1 second forward
  • Page up: Seek 600 seconds forward
  • J: Reduce playback speed
  • L: Increase playback speed
  • S: Swap left and right video
  • A: Move to the previous frame in the buffer
  • D: Move to the next frame in the buffer
  • F: Save both frames as PNG images in the current directory
  • P: Print mouse position and pixel value under cursor to console
  • Z: Magnify area around cursor (result shown in lower left corner)
  • C: Magnify area around cursor (result shown in lower right corner)
  • R: Re-center and reset zoom to 100% (x1)
  • 1: Toggle hide/show left video
  • 2: Toggle hide/show right video
  • 3: Toggle hide/show HUD
  • 5: Zoom 50% (x0.5)
  • 6: Zoom 100% (x1)
  • 7: Zoom 200% (x2)
  • 8: Zoom 400% (x4)
  • 0: Toggle video/subtraction mode
  • Plus +: Time-shift right video 1 frame forward
  • Minus -: Time-shift right video 1 frame backward

Move the mouse horizontally to adjust the movable slider position.

Use the mouse wheel to zoom in/out on the pixel under the cursor. Pan the view by moving the mouse while holding down the right button.

Left-click the mouse to perform a time seek based on the horizontal position of the mouse cursor relative to the window width (the target position is shown in the lower right corner).

Hold the SHIFT key while pressing D to decode and move to the next frame.

Hold CTRL while time-shifting with +/- for faster increments/decrements of 10 frames per keystroke. Similarly, hold down the ALT key for even bigger time-shifts of 100 frames.

Build

Requirements

Requires FFmpeg headers and development libraries to be installed, along with SDL2 and its TrueType font rendering add on (libsdl2_ttf). SDL2 version 2.0.10 or later is now specifically required for subpixel accuracy rendering capabilities. Users may need to upgrade their existing SDL2 installation before compiling.

On Debian GNU/Linux the required development packages can be installed via apt:

apt install libavformat-dev libavcodec-dev libavfilter-dev libavutil-dev libswscale-dev libswresample-dev libsdl2-dev libsdl2-ttf-dev

Instructions

Compile the source code via GNU Make:

make

The linked video-compare executable will be created in the soure code directory. To perform a system wide installation:

make install

Note that root privileges are required to perform this operation in most environments (hint: use e.g. sudo).

Notes

  1. Audio playback is not supported.

  2. Keep time-shifts below a few seconds for the best experience.

  3. Seeks require re-synchronization on the closest keyframe (i.e., I-frame).

Practical tips

Send To integration in Windows File Explorer

You can fire up the tool directly from the File Explorer when you don't need to specify any other arguments than the inputs via Right click -> Send To -> video-compare.

Here is how this integration works:

tg6c1m.mp4

You can do that quickly by selecting two files, then right clicking any of them, pressing N (focuses send to), then V (selects video-compare).

To get video-compare to appear in the Send To field you will need to open the send to folder, which you can access by typing shell:sendto in Run (Windows + R), then simply make a shortcut to video-compare.exe.

Thanks to couleurm for the sharing this tip and creating the screen recording above.

video-compare's People

Contributors

evaristegalois11 avatar feschber avatar jonfryd avatar patrik-csak avatar pockethook avatar thomasbachem avatar unitof avatar utzcoz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

video-compare's Issues

Solution for Odd Scaling Behaviour

I have a 2880 x 1800 Laptop Screen and was trying to play 1080p video file.

However, even after supplying the dimension via -w 2880x, I was getting cropped video.
For some reason, it scaled right with -w 1440x, but with visible pixelation.
As such, I figured it was the scaling behavior problem mentioned in readme.md but I couldn't find a setting for "disallow high DPI mode".

You need to do the following for it to work well :

Go to video-compare.exe, right-click and select its Properties.
Navigate to the Compatibility tab, select Change high-DPI settings > High DPI scaling override
Select the Override high DPI scaling behaviour option and choose Application in the menu.

This should solve this issue.

image

Videos with different aspect ratios

Hi there. I was hoping you could add support for comparing videos with different aspect ratios due to letterboxing or cropping on one of the videos.

For example:

  • Video A is 1920x800 px
  • Video B is 1920x1080 px with letterboxing - 140 px horizontal black bars on the top and bottom. The content itself is the same size as Video A - 1920x800 px

Currently, Video A will be stretched vertically to match Video B's aspect ratio and the content itself won't line up.

It would be great if there was some way you could support different aspect ratios without stretching - either by cropping one or letterboxing the other. I use video-compare all the time and this is the only problem I have with it. Thanks.

[Feature Request] yt-dlp integration

I often get sent similar videos via the discord cdn (links to raw video files) and find myself downloading both of them with yt-dlp/aria2 before firing up video-compare to check the differences

Give yt-dlp a look if integrating it to video-compare sounds like a good idea to you

(ps: yes yt-dlp can download on many more sites than YouTube, including video files hosted on discord's cdn)

ffmpeg filter only applying to one video and not both

I'm trying to compare two videos with different bit-depths, one is 8-bit and another is 10-bit. I noticed that when comparing both videos with different bit-depths, the 10-bit one has a colour shift in certain scenes. When using StaxRip to compare the videos, the colour shift is not there.

To combat this, I tried using -r format=yuv420p to convert all the videos to 8-bit when comparing. However, it only works in a certain order.
For example, launching with video-compare -r format=yuv420p 8bit.mkv 10bit.mkv works but launching with video-compare -r format=yuv420p 10bit.mkv 8bit.mkv doesn't work.

Is there a way to make the filter apply to both videos or am I comparing videos with different bit-depths incorrectly?

compile failing on Debian/SID w/ FFMPEG 5

It seems that FFMPEG 5 has deprecated the av_register_all() command, which causes demuxer.cpp to fail to make. Removing that function call corrected the issue on my system.

Also, there are two dependencies on Debian not mentioned in the readme: libavformat-dev, libswscale-dev. You might also consider noting SDL2 and SDL2-tiff are libsdl2-dev and libsdl2-ttf-dev for linux users.

Great tool, thank you!

Rotation Flag Is Being Ignored

Rotated videos are displayed in their physical orientation which makes is really hard to compare them to re-encoded, non-rotated videos (default ffmpeg behavior is to change the physical orientation and remove the rotation flag).
If you ever get the chance to fix it, that'd be great. This program is what I've been searching for for a while.
Cheers for the effort!

Fix for compiling on recent macOS / Apple Silicon (M1) with Homebrew

For users having issues compiling video-compare on macOS Big Sur / Monterey having ffmpeg installed via Homebrew that run into this error when running make:

In file included from demuxer.cpp:1:
./demuxer.h:4:11: fatal error: 'libavformat/avformat.h' file not found
        #include "libavformat/avformat.h"
                 ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [demuxer.o] Error 1

This is because the compiler can't find the required libav dependencies from your ffmpeg install.

To make compilation work, you'll need to replace the paths referring to /opt/local/ with /opt/homebrew/ in the makefile.

I just stumbled over this when setting up my new M1 Max MacBook Pro and hope this helps others running into this issue :).

Allow frame by frame navigation by buffering on-demand

Problem definition

It seems that in order to perform frame-by-frame navigation with the A and D keys, frames have to be buffered already. When navigating to some point in the clip(s) with the mouse or any of the key-shortcuts, the buffer is empty, so frame-by-frame navigation isn't possible. In order to get the frame navigation to work, the user has to use the following cumbersome process:

  1. Find interesting spots in the clips to be analyzed by jumping around with the available seek-options.
  2. Once a spot has been found, jump back one keyframe (e.g. - key).
  3. Press play until the buffer fills up to 50 frames, and be quick on the trigger to pause the video.
  4. Navigate back with the A key until the specific frame of interest is found.

Proposed improvement

Get rid of steps 2-4 by either:

  • A) Optimal UX: buffering the surrounding frames automatically. E.g. 25 frames on each side and have the code re-buffer automatically if frame navigation reaches either end of the buffer (buffer position 0 or (left|right)_frames.size()-1)
  • B) OK UX: providing two new key shortcuts (e.g. shift-A & shift-D) that the user can trigger to automate step 2-3 above. I.e. seek backward one key-frame and then decode the frames up until the current position. Similarly for forward buffering where the buffering would work exactly like playing for 50 frames, with the exception that the views get rendered from the first item in the buffer. I.e. the same as performing steps 2-4 above, and navigating all the way back to the beginning of the buffer using the A key.

With option A, the user could navigate the entire clip frame-by-frame seamlessly.
With option B, they'd have to buffer manually, but would still allow pretty much uninterrupted workflow with just one extra key to press every now and then.

The reason I even mentioned option B was that after looking at the code, it might be easier to implement. Whatever improvement can be done in terms of frame-by-frame navigation would be greatly appreciated.

PS. fantastic tool. Just discovered it and am kicking myself for not finding it sooner.

m2v mpeg2 issue

Hi,
Does video-compare support m2v mpeg2 video only media playback?
The original source is a DVD.
Playback is starting but unable to seek in file as other video player can. It always starts to playback from the beginning.
If I start video-compare it shows 720x576, 00:00:00.000, mpeg2video, yuv420p, mpegvideo
If I start to compare with itself, both starts playback.
If I start it with the m2v and a h264 mkv file, the mkv file playback does not start at all (black screen)

Add ffmpeg vulkan support

There is vulkan implementation in some builds of ffmpeg.

Would be possible to decode video by hardware, thus accelerating the output?

unicode filename... not work...

use Send To integration in Windows File Explorer

dos command...

video-compare.exe "japanese filename include a" "japanese filename include a"

return Invalid argument

etc japanese chinese

i use korean windows 11

Error: SDL font open

Trying to run the pre-built binaries results only in this message being printed to console, then the program quits.
Error: SDL font open

This is using video-compare-20210827-win64. IIRC I tried video-compare-20200724-win64 a couple of months ago with the same results.

FFmpeg and SDL2 are supposed to be fully bundled in the binaries, I assume?

Edition Windows 10 Pro
Version 21H1
Installed on ‎19.‎12.‎2020
OS build 19043.1110
Experience Windows Feature Experience Pack 120.2212.3530.0

difficult syncing videos, add hotkey to increment right frame only

in order to sync videos which are offset slightly requires a ton of trial and error using the -t flag.
first guessing a value, then observing the offset then closing the program, trying another value then closing the program, etc.

propose adding a feature where a hotkey will increment or decrement the right frame only.

Add feature: Play buffered frames in loop

First, I must say that this tool is the best for me of comparing videos after capturing or encoding. It's realy great !!!

I have a suggestion for an additional feature that allows to automatically play a short sequence - the buffered 50 frames - in loop.
Maybe two modes can be select:
A: Play fom start to end and beginn again from start....
B: Play from start to end and then backward from end to start and so on... (forward-backward-forward-backward....)
All controlled by shortkeys.

For me this would be a very useful feature, as i often compare the quality at a certain position of the movie in motion. At the moment i need navigate manual with the 'A' + 'D 'keys, so this feature will be great !

Thanks !

'Error: SDL font open' on Linux Mint 19.3 (Ubuntu 18.04 based)

Hello,
I compiled last release (20211223) as well as last master branch (fa3be28) without issue, but when running either version with
./video-compare myvid.avi myvid.mkv, i get the following error:

Error: SDL font open

For reference, my .avi file is mencoder raw acquisition format - stated as Packed YUV in VLC - and my .mkv file is h265 transcoded with ffmpeg from the .avi file.
I also tried running the same command between two different avi file of same codec or between two different mkv file of same codec, but all tries led to the same error.

I couldn't see any window popping up/video playing. Nothing seems to happen apart from the terminal output.

frame shift not support mkv

version: cc35c7e
os: archlinux

I use default obs settings to record two mkv videos, which are not synced. The -t works for time sync, but -+ doesn't, it can cause dual side shift and random time jumping.

I tried on two mp4 videos, and -+ works.

Add black bars instead of stretching

If I compare two videoes where 1 video has black bars and the other doesn't, the one without gets stretched to match aspect ratio of the one with. This happens a lot when I'm comparing my encodes to the original original file as I always crop out black bars when encoding. It would be usefull if video-compare could add an equal amount of black bars to the top/bottom of a video instead of stretching it so that the correct aspect ratio is maintained.

sync and time control issues when framerates are not identical

Your tool would really be a godsend, but I cannot get it to work properly. In my tests, the side-by-side comparison works in sync during playback, but when pausing, the videos slip out of snyc.

When I pause the videos and drag the slider left/right, it is obvious that the frames are not in sync. So I tried the +/- hotkeys. They way I understand them to work is: Left video is frozen and right video goes forward/backward frame-by-frame. But on my computer, both videos jump to another position.

This is unfortunate, because it is difficult to compare a moving image (only) and I cannot compare still images when they are out of sync.

Prevent window size to be bigger than desktop resolution

If I have a 1080p monitor and then open a 1080p file, the window size is so big I can't see the window's title bar anymore and because of that I can't resize the window. Similar happens if I open a 4K video file, with those I can't even see the entire window.

To add to this, as with 4K files if I hold click and drag the mouse the title bar appears and then I can resize, after resizing the slider is not well synchronized with the mouse.

Major stuttering during AV1 Playback

I was comparing two videos, one encoded with HEVC and another with AV1.
However, it plays like a slideshow.
Why is this the case?

My laptop has a dedicated GPU and the files run just fine in other players so that isn't the problem here.

image

Crashes on win7

On win 10 though its working from browser, not on win7, just blackscreen, and
video-compare.exe h264.mp4 h265.mp4
from cmd results in crash

File names not showing up

Hi!
When i run 1080p clips on my 1920 1200 monitor the names are outside the screen.
Is there any way to bypass Windows scaling on the exe? I can't quite get it to work on this app.
...or a way to know which file is to the left.
Many thanks!
Arty

pre-built windows binary crashed while loading

I downloaded video-compare-20220812-win10-x86_64.zip from the Releases section.
When ran video-compare.exe on Windows 10 the application crashed while loading. Below is the output from the Debug option.
I know the crash info is not much to go on but does anyway one know how I can overcome this problem?

'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\video-compare.exe'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\libgcc_s_seh-1.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\SDL2_ttf.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\SDL2.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\libstdc++-6.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\libwinpthread-1.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\avformat-59.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\avutil-57.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\crypt32.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\bcrypt.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\avcodec-59.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\ws2_32.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\libfreetype-6.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\swscale-6.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\IPHLPAPI.DLL'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\ncrypt.dll'.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\swresample-4.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\mfplat.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\userenv.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\iconv.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\libbz2-1.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\zlib1.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\util\video-compare\libpng16-16.dll'. Module was built without symbols.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\winmm.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\cryptbase.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\cryptsp.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\rsaenh.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\RTWorkQ.dll'.
'video-compare.exe' (Win32): Loaded 'C:\Windows\System32\ntasn1.dll'.
The thread 0x3c84 has exited with code 0 (0x0).
Unhandled exception at 0x00000001400113F6 in video-compare.exe: 0xC000001D: Illegal Instruction.

--
Here is the dissambly

00000001400113B5 mov rax,qword ptr [rsp+80h]
00000001400113BD mov rbx,rcx
00000001400113C0 mov rcx,rdx
00000001400113C3 mov rdx,r8
00000001400113C6 mov r8d,dword ptr [rsp+90h]
00000001400113CE vmovq xmm2,r9
00000001400113D3 vmovq xmm3,rcx
00000001400113D8 mov qword ptr [rsp+48h],0
00000001400113E1 mov dword ptr [rbx+20h],r8d
00000001400113E5 vpinsrq xmm1,xmm2,rax,1
00000001400113EB vpinsrq xmm0,xmm3,rdx,1
00000001400113F1 mov dword ptr [rsp+28h],r8d
00000001400113F6 vinserti128 ymm0,ymm0,xmm1,1
00000001400113FC mov r8d,dword ptr [rsp+88h]
0000000140011404 mov qword ptr [rsp+40h],0
000000014001140D mov qword ptr [rsp+38h],0
0000000140011416 mov dword ptr [rsp+30h],4
000000014001141E mov dword ptr [rsp+20h],eax
0000000140011422 vmovdqu ymmword ptr [rbx],ymm0
0000000140011426 vzeroupper
0000000140011429 call 00000001400185E0
000000014001142E mov qword ptr [rbx+28h],rax
0000000140011432 add rsp,50h
0000000140011436 pop rbx
0000000140011437 ret

Crashes when resizing/maximizing the window

Upon opening two low res video files (480p both) and then maximizing the window, the app crashes.

If I try to resize the window several times making it bigger every time there is a point where the app crashes, and one time it throw an error about "memory couldn't be read" or something similar.

Overlaying histograms on both videos

At times, I need to overlay the RGB or YUV color histogram of both videos onto the source to examine for saturated pixels and/or quantization. To facilitate this task, I've developed a compact bash script that presents a small histogram of the three color channels in the bottom left and right corners. It may prove helpful to other members of the community.

#!/bin/bash

# RGB formats: gbrp, gbrp9, gbrp10 - 256, 512, 1024 bins
# YUV formats: yuv444p, yuv444p9le, yuv444p10le - 256, 512, 1024 bins
PIX_FMT_L=gbrp
PIX_FMT_R=gbrp

HIST_OUT_FMT=yuva444p

DISPLAY_MODE=stack # stack, parade, overlay
LEVEL_HEIGHT=100 # 50-2048
LEVELS_MODE=linear # linear, logarithmic
ALPHA=0.75 # 0.0-1.0

video-compare -l "split=2[a][b],[b]format=$PIX_FMT_L,histogram=display_mode=$DISPLAY_MODE:colors_mode=coloronblack:level_height=$LEVEL_HEIGHT:levels_mode=$LEVELS_MODE:fgopacity=1:bgopacity=1,format=$HIST_OUT_FMT,colorchannelmixer=aa=$ALPHA[hh],[a][hh]overlay=20:main_h-overlay_h-50" \
              -r "split=2[a][b],[b]format=$PIX_FMT_R,histogram=display_mode=$DISPLAY_MODE:colors_mode=coloronblack:level_height=$LEVEL_HEIGHT:levels_mode=$LEVELS_MODE:fgopacity=1:bgopacity=1,format=$HIST_OUT_FMT,colorchannelmixer=aa=$ALPHA[hh],[a][hh]overlay=main_w-overlay_w-20:main_h-overlay_h-50" \
              "$@"

In the future, I may consider incorporating native histogram support into video-compare so that FFmpeg filters are not required. However, for now, I am content with this approach.

You are welcome to adapt this script into a Windows Batch file and share the outcome here.

Hotkey support for tenkeyless keyboards

Some keyboards (tenkeyless or smaller) won't have a '+' key available. Could '=' be set up as an alternative hotkey to shift the right video forward 1 frame? The existing '-' key works fine.

At the moment the only workaround I've found is to use the windows on-screen keyboard.

It looks like the code

video-compare/display.cpp

Lines 881 to 890 in dfc6725

case SDLK_PLUS:
case SDLK_KP_PLUS:
if (event_.key.keysym.mod & KMOD_ALT) {
shift_right_frames_ += 100;
} else if (event_.key.keysym.mod & KMOD_CTRL) {
shift_right_frames_ += 10;
} else {
shift_right_frames_++;
}
break;
already references the non-keypad '+', but this doesn't seem to be working. Possibly an issue with it being a shift modifier?

Proposed change would be to add the below to the referenced case statement.
case SDLK_EQUALS:

Seeking when adding delay - delay is not conserved upon resume

I have two files I'm comparing. One is slightly out of sync with the other. It works fine with the offset when I initially start but soon as I seek ahead the delay is no longer respected.

Is that a known issue?

This is happening on a SD Rec 709 MKV remux

Can not handle custom DPI properly

OS: Win10 21H1
Version: video-compare-20210827-win64
My display DPI has been set to 118%, this is what I should get:

This is what I get from video-compare:

Why not using 'video-compare-20210907-win64':
When launching with './video-compare.exe', it tells me '. is not recognized as an internal or external command'.
When launching with 'video-compare.exe', it shows SDL error.

Allow avisynth as input

I'd really like to have .avs files support (AVS+ scripts).

As your project use ffmpeg, in my naive brain I supposed it could be easy to implement.

How about it?

Can't open AV1 webm file

Hi, I tried to open AV1 webm file but it won't open. MP4 and MKV is working fine.

Console Log:

PS C:\Users\LazyGeniusMan\Downloads\video-compare-20211127-win10-x86_64> ./video-compare 1.webm 2.webm
terminate called after throwing an instance of 'ffmpeg::Error'

The file mediainfo:

General
Complete name                            : 1.webm
Format                                   : WebM
Format version                           : Version 4
Overall bit rate                         : 6 978 b/s
Writing application                      : Lavf58.65.101
Writing library                          : Lavf58.65.101
IsTruncated                              : Yes

Video
ID                                       : 1
Format                                   : AV1
Format/Info                              : AOMedia Video 1
Format profile                           : [email protected]
Codec ID                                 : V_AV1
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Writing library                          : Lavc58.119.100 libaom-av1
Default                                  : Yes
Forced                                   : No
Color range                              : Limited

Audio
ID                                       : 2
Format                                   : Opus
Codec ID                                 : A_OPUS
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 32 bits
Compression mode                         : Lossy
Writing library                          : Lavc58.119.100 libopus
Language                                 : Japanese
Default                                  : Yes
Forced                                   : No

MPV stat:
image

Thanks

EDIT: I tried running video with ffplay command and it's working fine, so the problem isn't on FFmpeg installed on my PC. Does this app using built-in FFmpeg in the releases?

EDIT2: I'm using latest ffmpeg nightly build

Synchronizing videos

Hey, I like to compare videos that are sometimes out of sync by a few frames

What I usually do is open up Vegas, make a 3840x1080 project and take the time to place the two videos correctly then adjust them

Could it be possible to add keybinds to go back/forth a few frames on a single video?

Allow .vpy inputs

As the topics
ffmpeg should be able to handle .vpy quite easily so it should be possible?

thanks

Using video-compare via Send To

Not sure if anyone thought of this before, but here's a quick tutorial of how I use video-compare when I don't need to specify any other args than input:

Right click -> Send To -> video-compare, here's an example

To get video-compare to appear in the Send To field you'll need to open the send to folder, which you can access by typing shell:sendto in Run (Windows+R) then a folder will open, simply make a shortcut to video-compare.exe and you're done

PS: You can do that very fast by selecting two files, then right clicking any of them, pressing N (focuses send to), then V (selects video-compare)
^ Though the Notepad++ context menu with interfere if you have it

The video narrows when using "-w 1280x720p"

image

As you can see, the video ends up distorted, how do I prevent it from looking like this and how do I make it look good? I want to adjust the window because otherwise the video goes out of my screen, the video is in 1080p resolution, and my screen is 1440p resolution, it is not big enough to be able to see the whole video.

pre-built windows exe is missing from zip archive as of 8/14/2022

Notes say "Pre-built Windows 10 64-bit releases are available from this page (simply extract the .zip-archive and run video-compare.exe from a command prompt)." Unfortunately, the binaries are missing from the zip archive and I'm not in the position of compiling the source files myself. I would like to run the software. Is the window binary available?

Hi I Created Multi File Comparer Without Command :)

Hi Firstly Thank You For Created Awsome Comparer, I Also Wanted To Contribute This Good Project,And I Created Multi File Comparer Without Any Command Just Create video-compare.exe Folder, Folder Named "Input" And Put 2 Video Files Here
Like This
HEIZ4Qn.md.png
After Paste This Command For Batch File And Start Batch This Command Automatically Get File And Compare 2 Video
This Code Tested Win 11 22H2 22621.819
Code İs Here And Share For Free :

@echo off
setlocal EnableDelayedExpansion
echo --------------------------------------------------------------
echo               �[1m�[5m�[32mDark Frost \ Dark Blade�[0m
echo --------------------------------------------------------------
set CompareOptions=-m split
set CompareWindowsize=-w 1920x1080
set Supportedformat="*.*"
set InputFolder="Input\"
set InputFolderCD=%cd%\Input\
echo --------------------------------------------------------------
echo            �[1m�[5m�[34mStart File Checking Please Wait�[0m
echo --------------------------------------------------------------
:: commandA && commandB Run commandA, if it succeeds then run commandB
:: commandA || commandB Run commandA, if it fails then run commandB
dir /b /s "Input\" | findstr .>nul && (goto :Compare)
dir /b /s "Input\" | findstr .>nul || (goto :Error)
::::: -------------------------------------------------------------
:Compare
echo --------------------------------------------------------------
echo            �[1m�[5m�[31mStart Video Compare Please Wait�[0m
echo --------------------------------------------------------------
:: Thanks "jeb" For Folder Line Reader "https://stackoverflow.com/questions/31035636/batch-store-command-output-to-a-variable-multiple-lines"
@echo on 
set "output_cnt=0"
for /F "delims=" %%f in ('dir /b "%InputFolder%\%Supportedformat%"') do (
    set /a output_cnt+=1
    set "output[!output_cnt!]=%%f"
)
for /L %%n in (1 1 !output_cnt!) DO echo !output[%%n]!
set Out1=!output[1]!
set Out2=!output[2]!
video-compare %CompareWindowsize% %CompareOptions% "%InputFolderCD%%Out1%" "%InputFolderCD%%Out2%"
@echo off
echo --------------------------------------------------------------
echo            �[1m�[5m�[32mVideo Compare Complete�[0m
echo --------------------------------------------------------------
Goto :Finish
:Error
echo --------------------------------------------------------------
echo      �[1m�[5m�[31mFile Not Found Please Put File "Input" Folder�[0m
echo --------------------------------------------------------------
Goto :Finish
:Finish
Pause

Best Regards
Fatih Çakır

Mixing input from url and from disk

Whatever type of uri/path is the first is assumed for the second, could that be fixed so file paths and urls be mixed and matched?
e.g:

video-compare ./video.mp4 https://cdn.discordapp.com/attachments/840243812269162516/1083506586158379028/i444.mp4

Add Homebrew formula

Great utility to compare results of enhanced videos, thanks for sharing it!

I was about to create a Homebrew formula for it for Mac users, but for some reason that cannot be done easily if the GitHub Repository is a fork, see discussion here.

Since pixop/video-compare isn't really an actual fork of pockethook/player in the typical sense, maybe you could ask GitHub to defork it like described in the thread linked above?

Here's the Homebrew formula btw, it can be created and used locally, but not committed/pushed yet:

class VideoCompare < Formula
  desc "Split screen video comparison tool using FFmpeg and SDL2"
  homepage "https://github.com/pixop/video-compare"
  url "https://github.com/pixop/video-compare/archive/refs/tags/20200724.tar.gz"
  sha256 "9cc3dc2f95a3677316eea7850793cbe2eaf41f620c65474b8c25d2a0f17625fb"
  license "GPL-2.0-only"

  depends_on "ffmpeg"
  depends_on "sdl2"
  depends_on "sdl2_ttf"

  def install
    system "make"
    bin.install "video-compare"
  end

  test do
    output = shell_output("#{bin}/video-compare 2>&1")
    assert_match "Usage: ", output
  end
end

I will keep an eye on this, but am also fine with anyone else committing it to Homebrew.

Comparing videos with different color ranges.

I am converting A:
Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709, progressive), ...

Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709), ...

(updated: using another sample video)

to B:

Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709), ...

When being played respectively in ffplay, they looks almost the same.
While in video-compare, B is darker than A.

Some filter might be added when comparing, but I couldn't figure it out.

Thanks for helping.

[Feature Request]

Could I request for features here?
One of them would be to have a shortcut that allows us to save PNGs at the point of the video
Full PNGs of both videos saved in the working directory or something similar

Another feature would be to allow two videos to be side by side but full-res
So instead of a slider they would be two seperate videos playing at their full-res

Thanks in advance

print control hotkeys

How is it possible to view the keyboard mapping (controls) from inside the program ?

If there currently is no method yet, I suggest the following:

  • add a command line parameter such as --print-controls
  • add a hotkey (maybe H for help) that shows an overlay window listing all the keyboard controls

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.