video-compare tool wrapper, adding support for drag'n'drop from SMB drives on KDE systems. Made from the own issue
It's just simple wrapper to add the SMB support. Details about how to do that is pending
Basically you will need to or compile the video-compare from source with the right FFmpeg config, or compile FFmpeg from source, installing the video-compare from brew and editing PATH to add the own build of FFmpeg, or... (There's a lot of configurations how to do that, I'll leave what I did - unideal but works)
- Install video-compare from brew: ``
- Get an latest source of FFmpeg (warning! you may need specific versions of libs that included in FFmpeg, you will see what exactly on first attempt to run the video-compare after all the things done):
wget https://ffmpeg.org/releases/ffmpeg-8.0.1.tar.xz && tar xf ffmpeg-8.0.1.tar.xz && cd ffmpeg-8.0.1 - Configure the FFmpeg with
--enable-libsmbclientoption to enable SMB support:./configure --enable-libsmbclient --enable-gpl --enable-version3 --enable-shared --prefix=/usr/local - Compile FFmpeg with
make -j$(nproc) - Install it:
sudo make install Copy to bin folder- Add new FFmpeg build to the PATH:
(automatically handled? need a test on fresh system to avoid weird things to happen) Delete FFmpeg from dependencies in brew (actually just change the PATH- Try to run video-compare
If after everything that was made, video-compare complaints about the missing libs - do from the 2nd to 10th steps again, but use the FFmpeg version that comes with those libs
The "complete" (untested) instruction:
This guide shows how to set up video-compare with SMB network share support and Dolphin file manager integration on KDE Neon (Ubuntu-based systems).
- FFmpeg with SMB: Allows direct access to videos on network shares (like
smb://server/share/video.mkv) - KIO-fuse integration: Works with KDE's native file mounting system
- Dolphin context menu: Compare two videos by right-clicking them in the file manager
- KDE Neon or Ubuntu-based system
- Basic terminal knowledge
- Network share accessible via SMB
# Update package list
sudo apt update
# Install build tools and libraries
sudo apt install -y build-essential yasm nasm pkg-config \
libsmbclient-dev libdav1d-dev wgetcd ~/Downloads
wget https://ffmpeg.org/releases/ffmpeg-8.0.1.tar.xz
tar xf ffmpeg-8.0.1.tar.xz
cd ffmpeg-8.0.1# Configure with SMB and AV1 support
./configure \
--enable-libsmbclient \
--enable-gpl \
--enable-version3 \
--enable-shared \
--enable-libdav1d \
--prefix=/usr/local
# Compile (this takes 10-30 minutes)
make -j$(nproc)
# Install
sudo make install
# Update library cache
sudo ldconfig# Check if SMB protocol is available
/usr/local/bin/ffmpeg -protocols 2>&1 | grep smb
# You should see:
# smb
# smb# Install via Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Add Homebrew to PATH (if not already done)
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
source ~/.bashrc
# Install video-compare
brew install video-compareVideo-compare needs to use the custom FFmpeg libraries:
# Make custom FFmpeg libraries available
echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/ffmpeg-custom.conf
sudo ldconfig
# Verify libraries are found
ldconfig -p | grep libavformat
# You should see libavformat.so.62 in the listmkdir -p ~/binThis converts smb:// URLs to KIO-fuse paths.
nano ~/bin/video-compare-smbPaste this content:
#!/bin/bash
# Convert smb:// URLs to KIO-fuse paths
convert_path() {
local url="$1"
if [[ "$url" == smb://* ]]; then
# Find the actual kio-fuse directory
local kio_dir=$(ls -t /run/user/$UID/ | grep '^kio-fuse-' | head -n1)
# Remove smb:// prefix and reconstruct path
local smb_path="${url#smb://}"
echo "/run/user/$UID/$kio_dir/smb/$smb_path"
else
echo "$url"
fi
}
ARG1=$(convert_path "$1")
ARG2=$(convert_path "$2")
echo "Left: $ARG1"
echo "Right: $ARG2"
video-compare "$ARG1" "$ARG2"Save (Ctrl+X, Y, Enter) and make executable:
chmod +x ~/bin/video-compare-smbThis handles multiple file selection from Dolphin.
nano ~/bin/video-compare-dolphinPaste this content:
#!/bin/bash
# Dolphin video compare wrapper
# Convert all arguments
FILES=()
for arg in "$@"; do
if [[ "$arg" == smb://* ]]; then
kio_dir=$(ls -t /run/user/$UID/ | grep '^kio-fuse-' | head -n1)
smb_path="${arg#smb://}"
FILES+=("/run/user/$UID/$kio_dir/smb/$smb_path")
else
FILES+=("$arg")
fi
done
# Check if we have exactly 2 files
if [ ${#FILES[@]} -ne 2 ]; then
kdialog --error "Please select exactly 2 video files to compare"
exit 1
fi
# Run video-compare with absolute path
/home/linuxbrew/.linuxbrew/bin/video-compare "${FILES[0]}" "${FILES[1]}"Save and make executable:
chmod +x ~/bin/video-compare-dolphin# Edit bash configuration
nano ~/.bashrc
# Add this line at the end:
export PATH="$HOME/bin:$PATH"
# Save and reload
source ~/.bashrc
# Verify
which video-compare-smb# Create directory if it doesn't exist
mkdir -p ~/.local/share/kio/servicemenus/
# Create the service menu
nano ~/.local/share/kio/servicemenus/video-compare.desktopPaste this content:
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
MimeType=video/*
Actions=compareVideos
[Desktop Action compareVideos]
Name=Compare Videos
Icon=kdenlive
Exec=/home/USERNAME/bin/video-compare-dolphin %UImportant: Replace USERNAME with your actual username! Or use:
# Automatically set the correct path
sed -i "s|/home/USERNAME|$HOME|" ~/.local/share/kio/servicemenus/video-compare.desktopkillall dolphin
dolphin &# Using wrapper for SMB URLs
video-compare-smb 'smb://user@server/share/video1.mkv' 'smb://user@server/share/video2.webm'
# Using KIO-fuse paths directly
video-compare '/run/user/1000/kio-fuse-XXXXX/smb/user@server/share/video1.mkv' '/run/user/1000/kio-fuse-XXXXX/smb/user@server/share/video2.mkv'- Open Dolphin and navigate to your network share
- Select exactly 2 video files (Ctrl+Click to select multiple)
- Right-click on one of the selected files
- Choose "Compare Videos" from the context menu
- The comparison window will open automatically
Solution: Make sure the script is executable and in your PATH:
chmod +x ~/bin/video-compare-smb
echo $PATH | grep "$HOME/bin"Solution: Update library cache:
echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/ffmpeg-custom.conf
sudo ldconfig
ldconfig -p | grep libavformatYou should see libavformat.so.62 in the output.
Solution: Make sure libdav1d was installed and FFmpeg was configured with --enable-libdav1d:
sudo apt install -y libdav1d-dev
# Then rebuild FFmpeg (Part 2)Solution: Include password in the URL or set up credentials file:
# Option 1: Password in URL
video-compare-smb 'smb://username:password@server/share/video.mkv' '...'
# Option 2: Create credentials file
nano ~/.smbcredentials
# Add:
# username=your_username
# password=your_password
chmod 600 ~/.smbcredentialsSolution:
- Verify the service menu file exists and has correct username
- Restart Dolphin completely
- Make sure you're selecting video files (the menu is filtered by MIME type)
ls -la ~/.local/share/kio/servicemenus/video-compare.desktop
killall dolphin && dolphin &- KDE's KIO-fuse: When you open network shares in Dolphin, KDE automatically mounts them at
/run/user/UID/kio-fuse-*/smb/ - Wrapper scripts: Convert
smb://URLs (from drag-and-drop) to local KIO-fuse paths - Custom FFmpeg: Has libsmbclient support to handle SMB protocol directly if needed
- Service menu: Integrates everything into Dolphin's right-click menu
- The KIO-fuse paths are temporary and change each session
- The wrapper scripts automatically detect the current KIO-fuse mount point
- You need to keep the network share mounted in Dolphin for the comparison to work
- For best performance with large files, the KIO-fuse approach is more reliable than direct SMB access through FFmpeg
- FFmpeg: https://ffmpeg.org/
- video-compare: https://github.com/pixop/video-compare
- libsmbclient: Part of Samba project
- dav1d: VideoLAN AV1 decoder
This guide is provided as-is for educational purposes. Individual software components have their own licenses.