multi-service-rtmp-broadcaster
multi-service-rtmp-broadcaster copied to clipboard
Add transcoding or ability to set format for local recording
Looks like files are saved as FLV by default when saving a local copy of the recording. Would it be possible to set the output format of the file as something else i.e. mkv? I know I can remux afterwards but it would be nice to have it done on the fly. I attempted to add an argument in nginx-template.conf.j2 to accomplish this, but I can't seem to figure it out. See below. It might be a simple fix I am missing.
rtmp {
server {
listen 1935;
chunk_size 4096;
notify_method get;
application {{ endpoint_name }} {
on_publish http://127.0.0.1/auth;
live on;
record {{ record_mode }};
record_path /var/www/html/recordings;
record_unique on;
exec ffmpeg -i rtmp://127.0.0.1:1935/{{endpoint_name}} -c:v copy -c:a copy -f mkv /var/www/html/recordings/`date +%s`.mkv ;
The reason the file format is flv
format is because that is what OBS produces (for the live stream) and what the various platforms expect and what is sent by OBS itself (assuming you are using OBS as the stream source) to this project's software, and all this software is doing is just recording the bit stream as is, and it happens to be flv
. Given that, we could probably make a transcoding option to specific format and then make the recording file a specific destination like the various platforms are now 🤔 I'll look into it when I get a chance.