简体   繁体   English

如何在nginx-rtmp模块中向ffmpeg添加时间戳

[英]How to add timestamp to ffmpeg in nginx-rtmp-module

I use nginx-rtmp-module and ffmpeg to record rtmp video stream to mp4 file, but I want to know how to add timestamp to the mp4 file. 我使用nginx-rtmp-module和ffmpeg将rtmp视频流记录到mp4文件中,但是我想知道如何将时间戳添加到mp4文件中。

My config as below: 我的配置如下:

rtmp
{
    server
    {
        listen 1935;
        timeout 10s;
        application mylive   {
            live on;
            exec /usr/bin/ffmpeg -i rtmp://localhost/$app/$name -vcodec copy -acodec copy -f mp4 /home/ubuntu/video/${name}.mp4;
        }
    }
}

I want to record the file with the name as ${name}-`date +%Y%m%d_%H%M%S`, but how can i do? 我想记录名称为$ {name} -`date +%Y%m%d_%H%M%S`的文件,但是我该怎么办?

Solved 解决了

application mylive {
    live on;
    recorder all {
        record all;
        record_max_size 100000K;
        record_path /var/video/mylive;
        record_suffix -%Y%m%d_%H%M%S.mp4;
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM