Nginx-rtmp-module: Does this module record to MP4?

Created on 23 May 2018  路  4Comments  路  Source: arut/nginx-rtmp-module

The features are

RTMP Video on demand FLV/MP4, playing from local filesystem or HTTP
Stream relay support for distributed streaming: push & pull models
Recording streams in multiple FLVs

The first line mentions MP4 but the third only record to FLV. So Im not sure if it does record to MP4, I have not found it in the documentation. Does anybody know a way to record to MP4 with this module?

The exec command seems interesting, it can be used to execute ffmpeg? So can I use it to convert all files into mp4 although it seems kind of wasteful? Does exec execute any ffmpeg command?

Most helpful comment

Yeah you need to use ffmpeg to convert the recording to .mp4, typically on exec_record_done

All 4 comments

Yeah you need to use ffmpeg to convert the recording to .mp4, typically on exec_record_done

OKay! but is there any way to automatically cleanup the .flv files after converting it to mp4?

this is my config:

            live on;
            record all;
            record_interval 15s;
            record_path /opt/data/record;
            # record_max_size 100000K;
            record_unique on;
            record_suffix -%d-%b-%y-%T.flv;

            exec_record_done ffmpeg -i $path -c copy /opt/data/record/$basename.mp4;

@neelduttahere you can use bash script in exec_record_done.

Such as:

#!/bin/bash

on_die ()
{
    # kill all children
    pkill -KILL -P $$
}

trap 'on_die' TERM
    ffmpeg -i $path -c copy /opt/data/record/$basename.mp4 
    && # delete file after convert &
wait

ok! Is there any way to set the record path to another system in local network?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DaveZheng picture DaveZheng  路  3Comments

sheldonbaker picture sheldonbaker  路  5Comments

WayneShao picture WayneShao  路  3Comments

ama-ableton picture ama-ableton  路  6Comments

hennn picture hennn  路  6Comments