Technical Documentation: Right-Click Video Frame Extraction
Target System: Windows 10 / Windows 11
Core Dependencies: FFmpeg & Windows Registry
Functionality: Instant extraction of high-quality JPG images from the first or last frame of a video file via the File Explorer context menu.
Disclaimer
Use at Your Own Risk: The following instructions involve modifying the Windows Registry and running custom batch scripts. While these steps are designed to be safe, any modifications to system settings carry a risk of unintended behavior. Ensure you have a system backup before proceeding. The author is not responsible for any data loss or system instability resulting from these procedures. Created with Google Gemini & David Rader II.
1. Prerequisites: FFmpeg Installation
FFmpeg must be installed and properly configured in your system path for these tools to function.
To check: Open a Command Prompt and type
ffmpeg -version
- To install: If FFmpeg is not recognized, run the following command in an Administrator Command Prompt:
winget install ffmpeg
- Note: You may need to restart your computer or the Windows Explorer process after installation to update the system path.
2. Script Configuration
Create a dedicated folder for your custom scripts (e.g., C:\Program Specials\) and save the following two files inside it. Pay special attention to this folder, as its exact path is throughout the scritpt.
A. Export Last Frame Script (export_lastframe.bat)
Code snippet
@echo off set "input=%~1" set "output=%~dpn1_lastframe.jpg" ffmpeg -sseof -1 -i "%input%" -update 1 -q:v 2 "%output%" -y
B. Export First Frame Script (export_firstframe.bat)
Code snippet
@echo off set "input=%~1" set "output=%~dpn1_firstframe.jpg" ffmpeg -i "%input%" -frames:v 1 -q:v 2 "%output%" -y
3. Context Menu Integration
To add these options to your right-click menu, create the following registry files.
Installer (AddVideoTools.reg)
Save this code as a .reg file and double-click it to apply. Note: If you used a different folder for your scripts, ensure you update the paths below using double backslashes (e.g., C:\\Scripts\\).
Code snippet
Windows Registry Editor Version 5.00 ; Generic Video Association [HKEY_CLASSES_ROOT\SystemFileAssociations\video\shell\ExportLastFrame] @="Export Last Frame" "Icon"="imageres.dll,-68" [HKEY_CLASSES_ROOT\SystemFileAssociations\video\shell\ExportLastFrame\command] @="\"C:\\Program Specials\\export_lastframe.bat\" \"%1\"" [HKEY_CLASSES_ROOT\SystemFileAssociations\video\shell\ExportFirstFrame] @="Export First Frame" "Icon"="imageres.dll,-68" [HKEY_CLASSES_ROOT\SystemFileAssociations\video\shell\ExportFirstFrame\command] @="\"C:\\Program Specials\\export_firstframe.bat\" \"%1\"" ; Specific Extension Overrides (MP4/MOV) [HKEY_CLASSES_ROOT\SystemFileAssociations\.mp4\shell\ExportLastFrame] @="Export Last Frame" [HKEY_CLASSES_ROOT\SystemFileAssociations\.mp4\shell\ExportLastFrame\command] @="\"C:\\Program Specials\\export_lastframe.bat\" \"%1\"" [HKEY_CLASSES_ROOT\SystemFileAssociations\.mov\shell\ExportLastFrame] @="Export Last Frame" [HKEY_CLASSES_ROOT\SystemFileAssociations\.mov\shell\ExportLastFrame\command] @="\"C:\\Program Specials\\export_lastframe.bat\" \"%1\""
Uninstaller (UninstallVideoTools.reg)
Save this code as a .reg file to cleanly remove the options from your menu at any time.
Code snippet
Windows Registry Editor Version 5.00 [-HKEY_CLASSES_ROOT\SystemFileAssociations\video\shell\ExportLastFrame] [-HKEY_CLASSES_ROOT\SystemFileAssociations\video\shell\ExportFirstFrame] [-HKEY_CLASSES_ROOT\SystemFileAssociations\.mp4\shell\ExportLastFrame] [-HKEY_CLASSES_ROOT\SystemFileAssociations\.mp4\shell\ExportFirstFrame] [-HKEY_CLASSES_ROOT\SystemFileAssociations\.mov\shell\ExportLastFrame] [-HKEY_CLASSES_ROOT\SystemFileAssociations\.mov\shell\ExportFirstFrame]
5. Usage Instructions
- Navigate to a video file in File Explorer.
- Right-click the file.
- Select Export First Frame or Export Last Frame.
- The extracted JPG will appear in the same folder as the original video.
Also, posted on my LinkedIn profile (David)
