BabitMF / bmf

Cross-platform, customizable multimedia/video processing framework. With strong GPU acceleration, heterogeneous design, multi-language support, easy to use, multi-framework compatible and high performance, the framework is ideal for transcoding, AI inference, algorithm integration, live video streaming, and more.
https://babitmf.github.io/
Apache License 2.0
807 stars 71 forks source link

运行人脸检测demo时会一直打印:[info] *** dropping frame 7 at ts 3584。请问:dropping frame是什么意思?是检测时抽帧检测的吗?谢谢 #113

Open QQiangren opened 6 months ago

QQiangren commented 6 months ago

我的代码如下: import torch import torch.nn.functional as F import numpy as np import sys import time import tensorrt as trt import bmf.hml.hmp as mp from nms import NMS import PIL from PIL import Image

def main(): graph1 = graph({'dump_graph':1})

video = graph1.decode({
    "input_path": "./face.mp4",
    #"video_params": {
    #    "hwaccel": "cuda",
    #}
})["video"]

video = video.module("trt_face_detect", {
    "model_path": "./version-RFB-640.engine",
    "label_to_frame": 1,
    "input_shapes": {
        "input": [1, 3, 480, 640]
    }}, entry="trt_face_detect.trt_face_detect")

video = video.encode(
    None, {
        "output_path": "./trt_out.mp4",
        "video_params": {
            "codec": "h264_nvenc",
            "bit_rate": 5000000,
        }
    })

video.run()

if name == "main": main()

sfeiwong commented 6 months ago

这是编码(video.encode)时默认按照25 fps的帧率根据你的输入视频帧率来决定是否丢帧的策略。

QQiangren commented 6 months ago

麻烦请问编码时默认的25 fps帧率是否可以修改?在哪里可以设置。谢谢

sfeiwong commented 6 months ago

可以在encode的参数中配置: "video_params": { "max_fr": 30 }, 参考bmf文档:https://babitmf.github.io/docs/bmf/api/encode_module/

QQiangren commented 6 months ago

感谢指导,增加max_fr参数后,可以达到预期目标