Their example from the readme:
ffmpeg -i input.mp4 -i overlay.png -filter_complex "[0]trim=start_frame=10:end_frame=20[v0];\
[0]trim=start_frame=30:end_frame=40[v1];[v0][v1]concat=n=2[v2];[1]hflip[v3];\
[v2][v3]overlay=eof_action=repeat[v4];[v4]drawbox=50:50:120:120:red:t=5[v5]"\
-map [v5] output.mp4
Which turns into import ffmpeg
in_file = ffmpeg.input('input.mp4')
overlay_file = ffmpeg.input('overlay.png')
(
ffmpeg
.concat(
in_file.trim(start_frame=10, end_frame=20),
in_file.trim(start_frame=30, end_frame=40),
)
.overlay(overlay_file.hflip())
.drawbox(50, 50, 120, 120, color='red', thickness=5)
.output('out.mp4')
.run()
)
[0] https://github.com/kkroening/ffmpeg-python[1]: https://zfsonlinux.org/manpages/0.8.3/man8/zfs-program.8.htm...
The entire script is executed atomically, with no other administrative operations taking effect concurrently.
Which would be somewhat hard to ensure with an external language. If a fatal error is returned, the channel program may have not executed at all, may have partially executed, or may have fully executed but failed to pass a return value back to userland.
If an external tool is allowed to acquire this kind of exclusive lock, I don't see the difference.That's the whole point, as I understand it. The channel programs are executed in the kernel, in a way that cannot be done by external programs. Some more details here[1].
edit: I also think you should have included the note, which says
Note: ZFS API functions do not generate Fatal Errors when correctly invoked, they return an error code and the channel program continues executing.
So while it's not quite ACID-level, its not as bad as it sounds without that note.
In ffmpeg's case, I would be looking for a GUI beyond just "here's all the command line parameters, only in a form"... the hardest thing is taking something I already know what I want to do, and encoding it into the command line, because the way to encode a graph into a command line is not obvious. It is easy in principle but there are so many degrees of freedom in how it is done that I can never remember it all. This is a perfect time for a visual language.
IMO the best option is the best of both worlds. A GUI that outputs the CLI command along with good documentation would be ideal.
Doesn't apply to well-designed GUI programs. In good GUIs features are discoverable, you don't need prior knowledge or documentation to use software.
Experience speeds things up, e.g. keyboard shortcuts are faster than menus or buttons. That's optional though, one can still use the software without these shortcuts.
For example English orthography is a horrible mess. The inventory of squiggles needed to write English isn't too bad, but the correspondence between the words you know and the correct sequence of squiggles to write them is unnecessarily complicated. No benefit accrues to us from this, and in some other written languages it's much easier.
I'd place ffmpeg somewhere in the not-bad but not-great part of the continuum. As with English orthography of course the problem is if you change things with the intent to make them better you actually introduce a cost for existing users which may be impossible to sustain.
Kinda like running into an old friend you haven’t seen in decades.
This is how I feel about jq, every time I want to parse some JSON I have to re-read their documentation. Their API is not very intuitive (at least to me).
alias sl='fc -ln -1 | sed "s/^\s*//" >> ~/.saved_commands.txt'
alias slg='< ~/.saved_commands.txt grep'
You can also add a comment to the command before saving. For ex: $ foo_cmd args #this command does this awesome thing
$ sl echo ‘!!’ > ~/bin/name-of-script
where !! is the previous command #!/bin/bash
size=${1:-"1920x1080"}
offset=${2:-"0,0"}
name=${3:-"video"}
ffmpeg -video_size $size -framerate 25 -f x11grab -i :0.0+$offset -c:v libx264 -crf 0 -preset ultrafast "$name.mkv"
ffmpeg -i "$name.mkv" -movflags faststart -pix_fmt yuv420p "$name.mp4"Their man page even had a like three line long example for basic stuff. ffmpeg is at least a bit more consistent with syntax though only barely!
eg copying without conversion between different formats isn’t really possible when it looks like it should be, because there’s a lot of incorrect handling of timestamps both in libavformat and in files themselves.
That's my relation with regex.
My relation with it is almost identical to my relation with any bash scripting more than a one-liner: I have to relearn it every time I want to engage with it.