H.264 H.265 一些知识


H.264/AVC

H.265/HEVC    高效率视频编码High Efficiency Video Coding,简称HEVC


stackoverflow 上ffmpeg 转码命令:

https://stackoverflow.com/questions/58742765/convert-videos-from-264-to-265-hevc-with-ffmpeg


Convert 4k to 1080 (no change in codec)

ffmpeg -i input4kvid.mp4 -vf scale=1920:1080 -c:a copy output1080vid.mp4

Convert h.264 to h.265 (no change in resolution)

ffmpeg -i input.mp4 -c:v libx265 -vtag hvc1 -c:a copy output.mp4

Convert 4k(h.264) to 1080(h.265)

Downscaling + Change in compression codec

ffmpeg -i input.mp4 -c:v libx265 -vtag hvc1 -vf scale=1920:1080 -crf 20 -c:a copy output.mp4

Options Explained

-i input file name or file path

-c:v libx265 -vtag hvc1 selecting compression. Default is libx264

-vf scale=1920:1080 specifying output resolution

-c:a copy copy audio as it is without any compression

-preset slow ask compression algorithm to take more time & look for more areas for compression. Default is medium. Other options are faster, fast, medium, slow, slower

-crf 20 Compression quality

-crf 0 high-quality, low compression, large file

-crf 23 default

-crf 51 low-quality, high compression, small file

-vtag hvc1 use codec hvc1 (a.k.a. HEVC or h.265) during conversion.

If -vtag isn't specified (like in the first snippet), it will then use the codec used in the src file.


FFmpeg 视频处理入门教程

作者: 阮一峰

https://www.ruanyifeng.com/blog/2020/01/ffmpeg.html



Web端H.265播放器研发解密

https://fed.taobao.org/blog/taofed/do71ct/web-player-h265/

posted @ 2022-12-09 14:22  katago  阅读(309)  评论(0)    收藏  举报