# GREATSWORD'S CHEATSHEET FOR GOOD VIDEOS!!! ## ffv1: lossless and intra-frame; extra based (will tsar bomba your storage) # converts pictures from PNG sequence into lossless format ffmpeg -framerate 24 -i %04d.png -c:v ffv1 \ -level 3 \ -slices 24 \ -slicecrc 1 \ -threads 0 \ -g 1 \ -context 0 \ -pix_fmt bgra \ lossless-ffv1.mkv ## ffv1: lossless and intra-frame; extra based (definitely will tsar bomba your storage when not used for animation) # converts anything to a ffv1 (probably) ffmpeg -i any.media -c:v ffv1 \ -level 3 \ -slices 24 \ -slicecrc 1 \ -threads 0 \ -g 1 \ -context 0 \ -c:a flac \ ffv1-output.mkv ## h264: plays on basically everything; inter-frame compressed and lossy, patent-encumbered; pragmatic but not based # mp4 for sharing ffmpeg -i someffv1file.mkv -c:v libx264 \ -crf 18 \ -preset veryslow \ -tune animation \ -pix_fmt yuv420p \ -colorspace bt709 \ -color_primaries bt709 \ -color_trc bt709 \ -psy 0 \ -c:a aac \ -movflags +faststart \ h264-crf18-share.mp4 ## vp9: plays on android phones, new iphones, and most browsers; inter-frame compressed and lossy, but free as in freedom; is gud # webm for sharing, mostly here for completeness, you should probably use h264 for normies ffmpeg -i someffv1file.mkv -c:v libvpx-vp9 \ -b:v 0 \ -c:a libopus \ -crf 24 \ -row-mt 1 \ -pix_fmt yuv420p \ -colorspace bt709 \ -color_primaries bt709 \ -color_trc bt709 \ -deadline good \ -cpu-used 0 \ vp9-crf24-share.webm ## vp9 + lossless options: inter-frame compressed, free format, still plays on most things that support vp9; not technically lossless but pretty much a good compromise; very nice and gud # acceptably "lossless" / extremely high quality webm. basically like handing a video png to someone. ffmpeg -i someffv1file.mkv -c:v libvpx-vp9 \ -lossless 1 \ -row-mt 1 \ -pix_fmt yuv420p \ -colorspace bt709 \ -color_primaries bt709 \ -color_trc bt709 \ -deadline good \ -c:a libopus \ -b:a 510k \ vp9-lossless-yuv420p-opus510k-frens.webm ## vp9 + rgb + lossless options + flac: inter-frame compressed, free format; will not play on anything but a computer with something like mpv or vlc; truly. # true lossless distributable (MKV / Matroska gigachad!! put flacs in videos!!!!) ffmpeg -i someffv1file.mkv -c:v libvpx-vp9 \ -lossless 1 \ -row-mt 1 \ -pix_fmt gbrp \ -deadline good \ -c:a flac \ lossless-vp9-rgb.mkv # explanation of each one ffv1, png: i'm an animator, so i oft work with PNG archives, where each frame is a PNG file. this should preserve all data in the PNG. WARN: AVOID USING ADAM7 INTERLACING! IT TENDS TO CAUSE ISSUES IN KDENLIVE! (white flashes) ffv1: good command for turning anything into a ffv1 file, which will preserve everything. bgra could be seen as inefficient, considering most sources will not have alpha channels (in fact, vp9 and h264 don't even support alpha channels lmao), but i prefer using bgra just to be maximally sure that _everything_ is saved. h264: this is your "give to the general public" file. h264 is used for two main reasons: it plays on everything, and it plays on everything very well. lots of devices have hardware accelerated decoders that make h264 play very well. (this is why h264ify extension makes youtube so good on old crummy devices, it usually plays poorly because it has to rely on non-accelerated vp9 decoding, and that's awful. apple devices notably do not support vp9, so this is also an essential reason why h264 is chosen, so that apple chuds can play it. note that when i say "give to the general public", i mean you're directly sending the file to the public (i.e. xmpp muc, protondrive, discord channel, what have you.) if you're uploading it to something like youtube, where they will convert the video for you, just be based like me and chuck the ffv1 file at them and make their clankers do extra work (WHICH IS WHAT I WOULD DO IF I WEREN'T BANNED LMAO) crf 18 is used because the general public does not care about lossless quality, so crf 18 is a good quality. vp9: inspired by h264 item, but for vp9 instead! mostly here for completeness and for software freedom; if i'm gonna not use the cool lossless features of vp9, i might as well just use h264. i would pretty much use this entirely for giving compressed videos to my friends on xmpp, or some other niche option. (also you should use Constrict, its a fantastic program) vp9 + lossless opts: Oh Yeah, now we're getting into the good stuff. this is what i would give to frens who care about lossless quality; the lossless mode is on, and while the audio isn't _technically_ lossless, its stupidly high quality that it'll be good enough anyway. yuv420p is technically not lossless, but i use it because i think its a good form of compression where the difference between it and something like yuv444p is nearly the same, because of the ways our eyes work; also, yuv420p reduces file size a fair bit. still uses the great compression benefits of vp9, and vp9 is pretty widely supported. i give this to my friends and in my xmpp art channel. vp9 + rgb + lossless options + flac: The Tsar Bomba of videos (actually that would be ffv1- SHUT THE FUCK UP!) Matroska, gbrp, vp9, and flac audio, the perfect lossless but still compressed experience, basically the PNG of video formats (minus the compatibility!) this WILL NOT PLAY on anything but a computer, running something like mpv or vlc! i'm not even sure if it'll play on browsers! for fellow videochuds like me :D i may troll my friends by giving them this lol, make them stop being filthy phoneposters.