How mean00/avidemux2 works
Purpose and executable entry points
Avidemux is a cross-platform native video editor/transcoder for Linux, Windows, and macOS. The common application startup and command dispatch live in avidemux/common/main.cpp, avidemux/common/gui_main.cpp, and avidemux/common/gui_action.cpp. It is built into alternative front ends: CLI (avidemux/cli/CMakeLists.txt), GTK (avidemux/gtk/CMakeLists.txt), and Qt-based desktop UI (avidemux/qt4/CMakeLists.txt).
Shared platform and media core
avidemux_core is the lowest-level C/C++ library layer: platform abstraction, threading, dynamic-library loading, crash handling, buffers, timing, preferences, and media primitives. Its exported interfaces create a boundary between reusable core code and application/UI/plugin code. Key paths: avidemux_core/ADM_core/include/ADM_dynamicLoading.h, avidemux_core/ADM_core/src/ADM_dynamicLoading.cpp, avidemux_core/ADM_coreUtils/include/ADM_compressedImage.h.
Project editor and timeline model
The editor owns loaded media, editable segments, selected audio tracks, timestamps, seeking, cached frames, and copy/render behavior. UI actions and scripts manipulate this model rather than containers directly. The primary control flow is: load source through a demuxer, construct an editor timeline/segments, preview or seek through decoded frames, then pass selected output settings to processing/muxing. Key paths: avidemux/common/ADM_editor/include/IEditor.h, avidemux/common/ADM_editor/src/ADM_edit.cpp, avidemux/common/ADM_editor/src/ADM_segment.cpp.
Decode, filter, and encode pipeline
Video passes from demuxed compressed packets through decoder selection, optional filter-chain processing, then either compressed-stream copy or re-encoding. Audio follows equivalent stream, filter, and encoder paths. The muxer gate makes the copy-versus-process decision before emitting packets. Key paths: avidemux/common/ADM_videoCodec/src/ADM_dynVideoDecoder.cpp, avidemux/common/ADM_videoFilter2/src/ADM_videoFilters.cpp, avidemux/common/ADM_muxerGate/src/ADM_videoProcess.cpp.
Dynamic media plugins
Format support and most transformations are supplied as buildable/loadable plugin families rather than embedded in the editor: demuxers, muxers, audio/video codecs, filters, audio devices, and script engines. Plugin APIs and dynamic loaders isolate the application from implementations and allow feature selection at build time. Representative paths: avidemux_plugins/ADM_demuxers/CMakeLists.txt, avidemux_plugins/ADM_muxers/CMakeLists.txt, avidemux_plugins/ADM_videoFilters6/CMakeLists.txt.
User interfaces, preview, and automation
The same common editor/control layer is exposed through headless CLI stubs, GTK widgets, or Qt dialogs/rendering. Qt also includes job management and OpenGL rendering; CLI supplies null UI/render implementations. Scripts can automate editor, codec, filter, and output selection via pluggable JavaScript/Python-like engines. Key paths: avidemux/qt4/ADM_jobs/src/ADM_jobs.cpp, avidemux/qt4/ADM_render_qt/GUI_render.cpp, avidemux_core/ADM_coreScript/src/ADM_ScriptEngineLoader.cpp.
Runtime dependencies and delivery
CMake orchestrates core, UI, and plugin builds; bootstrap scripts create platform-specific build trees. FFmpeg 7.0.2 is vendored and patched for codec/container functionality. Optional hardware paths include VA-API, VDPAU, NVDEC/NVENC, DXVA2, and Apple VideoToolbox; rendering can use OpenGL, SDL, Xv, or platform APIs. SQLite backs core jobs. Packaging targets include Debian/RPM/tarballs, macOS app/DMG, Windows installers, and AppImage. Key paths: avidemux_core/ffmpeg_package/ffmpeg-7.0.2.tar.bz2, avidemux_core/ADM_coreJobs/src/sqlJobs.cpp, appImage/deploy_qt6.sh.
Main entry points: IEditor.h Editor timeline · ADM_dynamicLoading.cpp Dynamic loader · GUI_render.cpp Qt desktop UI · main.cpp Startup & action dispatch
Components 21
Application Control
- Startup & action dispatch · Starts the app and routes commands into shared control logic.
avidemux/common/main.cpp - Editor timeline · Owns media, segments, tracks, seeking, cached frames, and render/copy state.
avidemux/common/ADM_editor/include/IEditor.h - Editor operations
avidemux/common/ADM_editor/src/ADM_edit.cpp - Segment model
avidemux/common/ADM_editor/src/ADM_segment.cpp
Media Pipeline
- avidemux_core · Reusable platform, threading, buffers, timing, preferences, and media primitives.
avidemux_core/ADM_core/include/ADM_dynamicLoading.h - Dynamic loader
avidemux_core/ADM_core/src/ADM_dynamicLoading.cpp - Compressed media primitives
avidemux_core/ADM_coreUtils/include/ADM_compressedImage.h - Video decoder selection
avidemux/common/ADM_videoCodec/src/ADM_dynVideoDecoder.cpp - Video filter chain
avidemux/common/ADM_videoFilter2/src/ADM_videoFilters.cpp - Copy/process muxer gate · Chooses compressed-stream copy or processing before muxing.
avidemux/common/ADM_muxerGate/src/ADM_videoProcess.cpp
Plugin Runtime
- Demuxer plugins · Read source containers into compressed streams.
avidemux_plugins/ADM_demuxers/CMakeLists.txt - Muxer plugins · Write selected output containers.
avidemux_plugins/ADM_muxers/CMakeLists.txt - Filter plugins
avidemux_plugins/ADM_videoFilters6/CMakeLists.txt - Script engine loader · Loads pluggable engines that automate editor and output settings.
avidemux_core/ADM_coreScript/src/ADM_ScriptEngineLoader.cpp
Front Ends
- CLI front end · Uses null UI and rendering implementations.
avidemux/cli/CMakeLists.txt - GTK front end
avidemux/gtk/CMakeLists.txt - Qt desktop UI · Provides dialogs, preview rendering, and job management.
avidemux/qt4/ADM_render_qt/GUI_render.cpp - Job manager
avidemux/qt4/ADM_jobs/src/ADM_jobs.cpp
Build & Delivery
- Vendored FFmpeg · Patched FFmpeg provides codec and container functionality.
avidemux_core/ffmpeg_package/ffmpeg-7.0.2.tar.bz2 - SQLite job store
avidemux_core/ADM_coreJobs/src/sqlJobs.cpp - AppImage packaging
appImage/deploy_qt6.sh
Connections 25
- Startup & action dispatch → Editor timeline: commands
- Editor timeline → Editor operations: implements
- Editor operations → Segment model: edits
- avidemux_core → Dynamic loader: includes
- avidemux_core → Compressed media primitives: provides
- Dynamic loader → Demuxer plugins: loads
- Dynamic loader → Muxer plugins: loads
- Dynamic loader → Filter plugins: loads
- Demuxer plugins → Editor timeline: source streams
- Editor timeline → Video decoder selection: compressed packets
- Video decoder selection → Video filter chain: decoded frames
- Filter plugins → Video filter chain: extends
- Editor timeline → Copy/process muxer gate: timeline and settings
- Video filter chain → Copy/process muxer gate: processed frames
- Copy/process muxer gate → Muxer plugins: output packets
- Script engine loader → Editor timeline: automates
- CLI front end → Startup & action dispatch: invokes
- GTK front end → Startup & action dispatch: invokes
- Qt desktop UI → Startup & action dispatch: invokes
- Qt desktop UI → Editor timeline: preview and edits
- Qt desktop UI → Job manager: manages
- Job manager → SQLite job store: persists
- Vendored FFmpeg → Video decoder selection: codec backend
- Vendored FFmpeg → Demuxer plugins: format backend
- AppImage packaging → Qt desktop UI: packages