Live data from Hacker News

FFMPEG from Zero to Hero

ffmpegfromzerotohero.com

71–80 of 140 posts

Re: FFMPEG from Zero to Hero

#72
post #33

Earlier quoted context omitted.

If you don't perform a task frequently, a discoverable interface (e.g. GUI) is dramatically more productive than reading documentation.

Conversely, if you perform a task frequently you want to be able to script it out and automate it away.

Why not both? GUIs can be built that can emit the command-line equivalent.

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.

Re: FFMPEG from Zero to Hero

#73
post #57

Earlier quoted context omitted.

I battled with this a lot with https://github.com/umaar/video-everyday and still haven't found a better solution. What I don't understand is, how can professional video editing tools trim accurately (and very quickly)? What are they doing differently to ffmpeg? If do things the "fast way" with ffmpeg, the exported video has random black frames which I think is related to the keyframe issue you mention. If I do things…

All of the proprietary tools I know of for doing frame-perfect cuts (VideoRedo, TMPGEnc, SolveigMM) work by determining (guessing?) the original encoding parameters and then only reencoding the first and last GOP. The rest of the video is just remuxed.

x264 encoded streams have the original encoding parameters included by default.

Re: FFMPEG from Zero to Hero

#74

The part of the book that covers raw[0] image conversion is lacking. It suggests ImageMagick or SIPS (on macOS), completely ignoring the difficulty of properly converting image from scene-referred to output-referred format. The result is probably going to be of limited usefulness in most cases involving interpretation of raw footage. If the author is here, I suggest looking into RawTherapee. It offers a GUI for autho…

Is there any book you’d recommend for scripting vfx/media pipelines using tools like ffmpeg , imagemagick , etc ?

Re: FFMPEG from Zero to Hero

#75

Earlier quoted context omitted.

All of the proprietary tools I know of for doing frame-perfect cuts (VideoRedo, TMPGEnc, SolveigMM) work by determining (guessing?) the original encoding parameters and then only reencoding the first and last GOP. The rest of the video is just remuxed.

x264 encoded streams have the original encoding parameters included by default.

Encoding settings metatag can be striped.

Regardless, I don't think these software are "matching" anything. TMPGEnc for example has settings to choose what quality you want for these re-encoded frames.

Re: FFMPEG from Zero to Hero

#76
post #72

Earlier quoted context omitted.

Conversely, if you perform a task frequently you want to be able to script it out and automate it away.

Why not both? GUIs can be built that can emit the command-line equivalent. 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…

there is winff(not sure of its state today) its totally just a gui frontend even shows you it working in console for an example of something already written. scripting can help with more complicated operations but just for common shorthand there are aliases which can be written out scripts single command lines and pointing to script files.

Re: FFMPEG from Zero to Hero

#77
post #2

Might have come in handy while I was struggling to type out ffmpeg -i part0.mp4 -i part1.mp4 -filter_complex "[1:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2[v1]; [0:v] [0:a] [v1] [1:a] concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" out.mp4 to concatenate two videos with different sizes today. My relation with it is almost identical to my relation with any bash scripting m…

I never had to use it since I never had anything complicated enough, but next time you relearn things, I've heard good things about ffmpeg-python [0] , it supports multiple inputs, outputs, custom filters, etc. 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][v…

I find that ffmpeg's regular command lines are easier to mentally parse if I include additional \ to separate things out onto their own lines. That's what I've done in several shell scripts that do complicated things with ffmpeg, along with comment lines and echoing commentary on what it's doing to the terminal.

Re: FFMPEG from Zero to Hero

#78

Earlier quoted context omitted.

At this point I'd prefer it if ffmpeg included Lua and allowed you to pass Lua scripts, kinda like what ZFS did[1]. [1]: https://zfsonlinux.org/manpages/0.8.3/man8/zfs-program.8.htm...

I feel like it's better to embed the tool in a language, or many community supported languages than embed a programming language in the tool.

Per the docs on zfs program:

    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.

Re: FFMPEG from Zero to Hero

#80
post #13
post #2

Might have come in handy while I was struggling to type out ffmpeg -i part0.mp4 -i part1.mp4 -filter_complex "[1:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2[v1]; [0:v] [0:a] [v1] [1:a] concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" out.mp4 to concatenate two videos with different sizes today. My relation with it is almost identical to my relation with any bash scripting m…

I just grep through my bash history ;)

I have shortcuts to save last (sl) executed command and another to grep that file.

    alias sl='fc -ln -1 | sed "s/^\s*//" >> ~/.saved_commands.txt'
    alias slg='
You can also add a comment to the command before saving. For ex:

    $ foo_cmd args #this command does this awesome thing
    $ sl
Post reply on HN