FFmpeg: Difference between revisions
(2 intermediate revisions by the same user not shown) | |||
Line 359: | Line 359: | ||
==My Preferences== | ==My Preferences== | ||
My preferences for encoding video | My preferences for encoding video | ||
===AV1=== | |||
Prefer AV1 for encoding video on on modern devices. | |||
===H265/HEVC=== | ===H265/HEVC=== | ||
H264/HEVC is now a good tradeoff between size, quality, and | H264/HEVC is now a good tradeoff between size, quality, and compatibility. | ||
This has been supported on devices since Android 5.0 (2014). | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
ffmpeg -i $1 -c:v libx265 -crf 23 -preset slow -pix_fmt yuv444p10le -c:a libopus -b:a 128K $2 | ffmpeg -i $1 -c:v libx265 -crf 23 -preset slow -pix_fmt yuv444p10le -c:a libopus -b:a 128K $2 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
;Notes | ;Notes | ||
* The pixel format <code>yuv444p10le</code> is 10 bit color without chroma subsampling. If your source is lower, you can use <code>yuv420p</code> instead for 8-bit color and 4:2:0 chroma subsampling. | * The pixel format <code>yuv444p10le</code> is 10 bit color without chroma subsampling. If your source is lower, you can use <code>yuv420p</code> instead for 8-bit color and 4:2:0 chroma subsampling. | ||
=== | ===H264=== | ||
If you need compatability with very old and low end devices. | |||
<syntaxhighlight lang="bash"> | |||
ffmpeg -i $1 -c:v libx264 -crf 28 -preset medium -pix_fmt yuv420p -c:a libfdk_aac -b:a 128K $2 | |||
</syntaxhighlight> | |||
===Opus=== | |||
For streaming: | |||
<syntaxhighlight lang="bash"> | |||
ffmpeg -i input.wav -c:a libopus -b:a 96k output.opus | |||
</syntaxhighlight> | |||
See https://wiki.xiph.org/Opus_Recommended_Settings |