srs DVR: Why is the saved MP4 frame rate is 14.939948?

km0tfn4u  于 2022-12-31  发布在  其他
关注(0)|答案(1)|浏览(260)

Description
Pushed the stream by ffmpeg and it was set to 15fps.
The saved MP4 frame rate is 14.939948 in the VLC, while 15fps is what I wanted.
It doesn't look like a big problem. But when I received the stream and saved as another MP4 file, they were not synchronized.
Then I put both MP4 files into Adobe Premeire and changed the frame rate to 15 fps of the SRS saved MP4 file, they were synchronized. Method
What should I do to get the expected fps? Appreciate for your time!

  1. Version: 3
  2. Config:
# main config for srs.
# @see full.conf for detail config.

listen              1935;
max_connections     1000;
srs_log_tank        console;
daemon              off;
http_api {
    enabled         on;
    listen          1985;
}
http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;

    https {
        # Whether enable HTTPS Streaming.
        # default: off
        enabled on;
        # The listen endpoint for HTTPS Streaming.
        # default: 8088
        listen 8088;
        # The SSL private key file, generated by:
        #       openssl genrsa -out server.key 2048
        # default: ./conf/server.key
        key /usr/local/srs/trunk/server.key;
        # The SSL public cert file, generated by:
        #       openssl req -new -x509 -key server.key -out server.crt -days 3650 -subj "/C=CN/ST=Beijing/L=Beijing/O=Me/OU=Me/CN=ossrs.net"
        # default: ./conf/server.crt
        cert /usr/local/srs/trunk/server.crt;
    }

}
stats {
    network         0;
    disk            sda sdb xvda xvdb;
}
vhost __defaultVhost__ {
    hls {
        enabled         on;
    }
    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }

    dvr {
        enabled      on;
        dvr_path     /xxxxx/isa/data/video/[app]/[2006]/[01]/[02]/[stream]/[timestamp].mp4;
        dvr_plan     session;
    }

    http_hooks {
        enabled         on;
        on_dvr          https://192.168.0.146/iuba/v2/video/record;
    }

}
b1uwtaje

b1uwtaje1#

Replay this issue, caused by the fixed TBN 1k, see https://stackoverflow.com/a/70373364/17679565

There is a workaround, to use FFmpeg to transmux the MP4 file.

But, it's caused by the DTS/PTS changed, so it's not a good solution to use fixed TBN 1k, which is FLV tbn.

相关问题