Trim a video into multiple clips to the millisecond with ffmpeg, mpv and emacs
NapoleonWils0n
Using emacs to capture timestamps from mpv using the mpv.el package, converting the timestamps into start time and duration with awk and then creating the video clips with ffmpeg
You can use the mpv.el emacs package to control mpv and inset the playheads currernt position as a timestamp into an org file
you can then export the timestamp and convert them into start time and duration with the clip-time script and use the output of that script with the scene-cut script to trim the video clips to the milliseconds with ffmpeg
or run capture the timestamps with the mpv.el package store them in an org document and run some source code blocks and run ffmpeg from within the org file and trim all the clips without leaving emacs or using the terminal
I forgot to mention you need enable org babel support with the following code in your emacs config
https://github.com/NapoleonWils0n/ubuntu-dotfiles/blob/master/.config/emacs/init.el#L323
; org-babel shell script (org-babel-do-load-languages 'org-babel-load-languages '((shell . t)))
;; org babel supress do you want to execute code message (setq org-confirm-babel-evaluate nil org-src-fontify-natively t org-src-tab-acts-natively t)
emacs mpv and hydra install: https://github.com/NapoleonWils0n/cerberus/blob/master/emacs/mpv-timer.org
edit videos with ffmpeg, mpv and emacs https://github.com/NapoleonWils0n/cerberus/blob/master/emacs/edit-videos-with-ffmpeg-mpv-emacs.org
clip-time script https://raw.githubusercontent.com/NapoleonWils0n/ffmpeg-scripts/master/clip-time
scene-cut script: https://raw.githubusercontent.com/NapoleonWils0n/ffmpeg-scripts/master/scene-cut
ffmpeg scripts: https://github.com/NapoleonWils0n/ffmpeg-scripts
my emacs config: https://github.com/NapoleonWils0n/ubuntu-dotfiles/blob/master/.config/emacs/init.el ... https://www.youtube.com/watch?v=3YgIX7Sdd0w
150238833 Bytes