Add an ai_disclosure_av submodule: labelled video and audio renditions with FFmpeg
Problem/motivation
A deep-fake video or audio file has to carry its label in the file, which needs FFmpeg. Rendering takes seconds to minutes, too long for a save request, and many hosts do not have the ffmpeg binary. So it belongs in its own submodule, with a queue. The video and audio specifics follow in their own issues.
Proposed resolution
- Settings: ffmpeg and ffprobe paths, the stream wrapper for renditions (private by default), and a maximum duration.
- Status report: binaries found, their versions, and the
overlayandconcatfilters. - Queue: on media save, when the resolved disclosure (#57 (closed)) requires a label and the hash of file and disclosure is new, queue a job. A worker renders on cron. A Drush command works through a backlog.
- Processes run through Symfony Process with an argument array, never a shell string. ffprobe gives size and duration.
- Storage:
private://ai_disclosure/renditions/{fid}-{hash}.{ext}, and a tableai_disclosure_rendition(fid, hash, uri, status, ffmpeg version, created). Old renditions are removed when the hash changes or the file is deleted. - The video and audio formatters use the rendition once it is ready.
ai_disclosure_auditlogs each rendition when it is enabled.
No PHP library is needed: Symfony Process ships with core.
Remaining tasks
- Submodule, settings form and schema
- Requirements check
- Queue worker, Drush command, rendition table and cleanup
- Formatter swap
- Kernel tests with a stub ffmpeg, plus one test against the real binary when present
- Docs: installing FFmpeg
User interface changes
A settings form for FFmpeg.
API changes
None.
Data model changes
New table ai_disclosure_rendition.
Part of #56 (closed).
Edited by Giorgio Alfredo Pagano