357  
查询码:00000304
ffmpeg 降低CPU消耗2
作者: 戴海林 于 2020年08月27日 发布在分类 / 物联网组 / 公司消息中心 / 开发 下,并于 2020年08月27日 编辑

ffmpeg 降低CPU消耗2

一、利用子码流播放

弘阳60路子码流统计:

    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuv420p(progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 90k tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuv420p(progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25.08 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 90k tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 640x360, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 704x576, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25.08 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 fps, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 tbr, 90k tbn, 180k tbc
    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 352x288, 25 tbr, 90k tbn, 180k tbc


可以看到59路为h264,还有一路密码错误未连接上。


flv.js描述

FLV container with H.264 + AAC / MP3 codec playback

nginx-rtmp-module描述

H264/AAC support


二、优化思路

当CPU使用率达一定比率的时候,使用子码流推流。 



 推荐知识

 历史版本

修改日期 修改人 备注
2020-08-27 17:41:38[当前版本] 戴海林 其他原因...
2020-08-27 17:27:06 戴海林 创建版本

  目录
    知识分享平台 -V 4.8.7 -wcp