So, in order to copy the streams with ffmpeg, you'd do: ffmpeg -i video.mp4 -codec copy video.avi ( As Peter.O mentioned, option order is important, so that's where -codec copy must go. That will do a straight copy of the audio stream without re-encoding. If you're concerned with quality, a good rule of thumb is to avoid reencoding the streams when possible. moment0instant03d.jpeg -vcodec mpeg4 movienoqual.mp4 Specify a high quality ffmpeg -i. You can tweak these settings, see the h.264 encoding guide for instructions on what knobs to twiddle.Īnd if you're using the audio as-is, add c:a copy. ffmpeg is an all-in-one video conversion swiss army knife. Note that the speed presets don't change the quality of the encoded file, just the efficiency, meaning a slower encode will result in a smaller file of the same quality and a faster encode will mean a larger file of the same quality. the slow preset is a shortcut for a bunch of encoder settings that means it puts a bit more effort into it than the default (medium).crf 20 uses the Constant Rate Factor quantiser (which paradoxially means variable bit rate, but constant quality) with a value of 20 (pretty good quality lower is better quality / larger files, higher is crappier / smaller)-default is 23,.-c:v libx264 tells it to use the libx264 encoder, this is the default now, no need to specify it.Try adding -c:v libx264 -crf 20 -preset slow to the command. You can, of course tweak to your heart's desire. With a recent (as in later than 2017) build of ffmpeg you don't need to specify anything more than input and output files to achieve good useable results. The default settings for ffmpeg are very low quality, and since you don't specify any codec or quality parameters it's just using the defaults (I don't know why the devs don't fix that because it generates a lot of questions on forums everywhere).Įdit: the defaults are now quite sane. I know from experience that ffmpeg is an excellent tool, so I must be screwing up the options/parameters somehow. Video:842kB audio:123kB global headers:0kB muxing overhead 0.421047% Incompatible pixel format 'yuvj420p' for codec 'mpeg4', auto-selecting format 'yuv420p' I tried running ffmpeg -i orig.mp4 -vf scale=1920:1080 smaller.mp4īut the result is very poor quality, with the entire image being composed of square "tiles" as if I was magnifying 4:1.
I have some 4K 3840x2160 footage in MP4 format that I need to bring down to 1080p.