>>90873716Don't use the whole video with audio in the sound catbox. It's heavy to load for no reason. If the video is mp4, extract the aac, if it's webm, extract the ogg. Webm example: `ffmpeg -i video.webm -nv -c:a copy -map_metadata -1 sound.ogg`, mp4: `ffmpeg -i video.mp4 -nv -c:a copy -map_metadata -1 sound.aac`
As for squeezing as much as possible from a LONG video, here's how to do it, with ffmpeg.
First, using mp4 is fine if the video is smaller than 4MB so that you don't have to re-encode, and you can just use the mp4 as-is. But if you need to re-encode, which is the assumption with LONG videos, use webm, as it can be compressed further.
Here is the 2pass-constant-quality-maxbitrate-capped-webm command I used to get this video to 960x450 with really no drop in quality:
ffmpeg -i meetup.mp4 -vf format=yuv420p,scale="iw/2:-1:flags=lanczos",setsar=sar=1 -an -c:v libvpx-vp9 -deadline best -b:v "0.56466MiB" -crf 50 -pass 1 -map_metadata -1 -f null /dev/null && \
ffmpeg -i meetup.mp4 -vf format=yuv420p,scale="iw/2:-1:flags=lanczos",setsar=sar=1 -an -c:v libvpx-vp9 -deadline best -b:v "0.56466MiB" -crf 50 -pass 2 -map_metadata -1 meetup.webm
The number in `-b:v "0.56466MiB"` is the result of "3.9 / length in seconds", which is the cap for the bitrate to insure the video will never be go over 4.0MiB, approximately.
`-deadline best` is quite slow, but it does extra compression. If you don't have time, remove it, or use the default `-deadline good`.
`-crf 60` is extreme low quality and it made a video that was only 3.09MiB, and it was passable for this video as there was not much movement, but there was still some more visible artifacting on the mouth, and I wanted to make a point to preserve as much quality as much as possible so I didn't use it. `-crf 30` or `-crf 50` are ones I usually use. (Anything below 30 I only use in /a/ to really preserve the quality).
`scale="iw/2:-1:flags=lanczos"` divides the dimensions of the video by 2, to 960x450
>2pass, crf and bitrate cap at the same time with VP9?Yeah, for some reason I get better results when doing the 2pass, even though ffmpeg's VP9 documentation doesn't specifically recommend using it with crf + bitrate cap