Live data from Hacker News

FFMPEG from Zero to Hero

ffmpegfromzerotohero.com

91–100 of 140 posts

Re: FFMPEG from Zero to Hero

#91

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 ?

This is the only time I'll admit this, but my favorite book on FFMPEG is called google.com

Just like the rest of the internet, there's probably very little that you could do right now, that someone else has not already done or struggled with as well. Most of the time, it's reading about what people have tried that did not work before which is still incredibly useful in and of itself. It sucks while your under pressure of a deadline, but you eventually you just sort of "get it".

The trick is, you have to use it frequently, and not just every now and then when some task comes up. But that's no different than any other tool. Yes, the commands can get harry and scary looking, but so can SQL statements.

Re: FFMPEG from Zero to Hero

#92

If this book does what it claims to do, it should probably cost more (pls raise the price after I buy it). I strongly believe that inside ffmpeg may be the secret to the cosmos, the universe and life itself

If you google search every title of the contents you will find 10 stackoverflow pages with answers for each of them. Source: I've done all of that. The author didn't try to describe hard things, like, say, how to do distributed encoding of a single video. etc.

Re: FFMPEG from Zero to Hero

#93
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…

It's true, and I feel the same, but to give it some credit: wouldn't that apply to anything you don't use regularly? Programming languages or even regular languages. You have to use it or lose it.

> wouldn't that apply to anything you don't use regularly?

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.

Re: FFMPEG from Zero to Hero

#94
Something weird (IMO) about ffmpeg is that it doesn't do hardware-accelerated encoding or decoding by default unless you compile it with support and pass it some extra command line flags.

If you are using ffmpeg with hardware-accelerated codecs like H.264, remember to take the free 10x speed boost!

Re: FFMPEG from Zero to Hero

#95

Something weird (IMO) about ffmpeg is that it doesn't do hardware-accelerated encoding or decoding by default unless you compile it with support and pass it some extra command line flags. If you are using ffmpeg with hardware-accelerated codecs like H.264, remember to take the free 10x speed boost!

You don't want to necessarily use it by default.

Re: FFMPEG from Zero to Hero

#96
post #95

Something weird (IMO) about ffmpeg is that it doesn't do hardware-accelerated encoding or decoding by default unless you compile it with support and pass it some extra command line flags. If you are using ffmpeg with hardware-accelerated codecs like H.264, remember to take the free 10x speed boost!

You don't want to necessarily use it by default.

You you do want to explain why and not just tell people not to.

Re: FFMPEG from Zero to Hero

#97
post #95

Earlier quoted context omitted.

You don't want to necessarily use it by default.

You you do want to explain why and not just tell people not to.

At least on mac the quality of the encoded h264 video is not the same (same bitrate but lower quality but much faster encoding) and the scope of fine tuning is also limited.

Re: FFMPEG from Zero to Hero

#98
This book looks great.

I'm looking for some easy and beautiful way to generate audio visualization; the books' TOC doesn't seem show much.

Can someone please tell me a bit more what I may get from that chapter?

Thanks

Re: FFMPEG from Zero to Hero

#99

Earlier quoted context omitted.

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.

FTR, I also do that for regular shell scripts.

Re: FFMPEG from Zero to Hero

#100
post #87

I was looking into cutting a file and I came across two flags. Could anybody explain them in layman's terms. -c copy - It doesn't re-encode the file. What does re-encoding mean? -async 1 -which is deprecated in favour of aresample. If the correct syntax is aresample=async=1 then would it just cut off the audio timestamp and match it with video timestamp.

> What does re-encoding mean It's something you may want done or not whenever a decoding step is happening by necessity anyway. The "possible benefit" would be if the original encoding was partially broken somewhere (which players/decoders can handle usually but they complain to stderr) or otherwise sub-par. Not sure about video but audio files floating about out there from the last 25 years are a wild mess, with "mp…

ffmpeg's default mode of operation is to decode the input and re-encode it. Unlike the default of re-encoding, "copy" is extremely fast and doesn't involve loss of quality from the input because it's just, well, copying the streams from the input to the output. The downside is that you can't do lots of things when you're just copying: making any changes to the actual video or audio, or even cutting video accurately at non-keyframes requires the standard decode/re-encode steps.

Typical video-file-related reasons for using the "copy" codec would include just switching between container formats: MP4 vs. Matroska vs. AVI vs. whatever else. As long as the new container supports the types of audio and video you have, just copying them will save both time and quality. Or maybe you want to alter the video but keep the audio untouched, or vice-versa. Or you just want to add a track to something and not disturb the existing ones.

Even doing "copy" for all streams and using the same container can be useful, even though nothing would seem to change in that situation: "remuxing" like this is often all that's necessary to fix a wonky file.

Post reply on HN