Topic: FFMPEG Presets

Posted under General

If anyone uses ffmpeg for encoding i wanna know what you all use
i have one made for gifs, using mp4 to make a palette and using both to make a gif, tho it's not recommended for directors

ffmpeg -i input.mp4 -filter_complex "[0:v] palettegen" -y palette.png 
ffmpeg -i input.mp4 -i palette.png -filter_complex "[0:v][1:v] paletteuse" -y converted.gif 

(use "code" with [])

Updated

Whenever i have to convert mp4 to webm, i just use this (seems to work good enough for me without any visible loss of quality)

ffmpeg -i input.mp4 -b:v 0 -crf 30 -pass 1 -an -f webm -y NUL
ffmpeg -i input.mp4 -b:v 0 -crf 30 -pass 2 output.webm

technical-grid said:
Whenever i have to convert mp4 to webm, i just use this (seems to work good enough for me without any visible loss of quality)

for ffmpeg to do webm encoding i use this

ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 16 -b:v 0 -row-mt 1 -pass 1 -an -y -f null NUL
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 16 -b:v 0 -row-mt 1 -pass 2 -b:a 128k -c:a libopus Output.webm

and this one if it has no audio

ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 16 -b:v 0 -row-mt 1 -pass 1 -an -y -f null NUL
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 16 -b:v 0 -row-mt 1 -pass 2 -an Output-no-audio.webm

flowersylveon said:
for ffmpeg to do webm encoding i use this

CRF 16 is very overkill for VP9. It's supposed to allow for higher CRF values compared to H264 without much quality loss, and for H264 somewhere around 18-22 CRF is the norm. So for VP9 you really want to go 24+, especially with multi-pass encoding.
Also try using a proper "preset"

-deadline

- https://trac.ffmpeg.org/wiki/Encode/VP9#DeadlineQuality

Protip, use lossless or professional codecs for all your intermediate files: ProRes, FFV1 and lossless H264 will do. Otherwise you'll lose quality on every re-encode you do before the final one.

ayokeito said:
CRF 16 is very overkill for VP9. It's supposed to allow for higher CRF values compared to H264 without much quality loss, and for H264 somewhere around 18-22 CRF is the norm. So for VP9 you really want to go 24+, especially with multi-pass encoding.

Also try using a proper "preset"

-deadline

- https://trac.ffmpeg.org/wiki/Encode/VP9#DeadlineQuality

Protip, use lossless or professional codecs for all your intermediate files: ProRes, FFV1 and lossless H264 will do. Otherwise you'll lose quality on every re-encode you do before the final one.

i used to be a uploader for e621 which this is what i used for when uploading video by other artists, it's a decent preset for most cases and never had a problem with it
i wanna point out keyword artists, which sometimes and usually just a few flat colors or even just black and white, so it's not that bad

i only change it if i needed to, or if Mairo were banging at my door for some sort of stupidity either for me going to cause or did cause, i dont think we got along and i was a bit stupid at the time and for me he was just saying magic words

I mean, no harm in uploading files larger than they could be, it's just that CRF16 is not that far from lossless for VP9.

ayokeito said:
I mean, no harm in uploading files larger than they could be, it's just that CRF16 is not that far from lossless for VP9.

its moreso about accuracy for archiving(as that's the goal for e621) not filesize