Node-Media-Server icon indicating copy to clipboard operation
Node-Media-Server copied to clipboard

How to record mp4 with dynamic name like streamKey_videoId

Open siddhantranjan opened this issue 3 years ago • 3 comments

siddhantranjan avatar Dec 08 '22 13:12 siddhantranjan

can anyone solve this issue please

siddhantranjan avatar Dec 08 '22 16:12 siddhantranjan

@illuspas

siddhantranjan avatar Dec 08 '22 16:12 siddhantranjan

Looks like you will have to modify the code yourself. I'm in the process of doing that because I see most questions go unanswered here. You will need to fork it and update the

src\node_trans_session.js around line 48

let mp4FileName = dateFormat('yyyy-mm-dd-HH-MM-ss') + '.mp4';

And try this

let mp4FileName = `${this.conf.streamName}_${this.conf.videoId}.mp4`;

then open src\node_trans_server.js

and around line 66 add this new line

conf.videoId = id;

Then run it from you own code. Hopefully that will help you.

I also don't like the mp4 name using the date and needed it to be the name of the streamkey/streamName.

Note: Github uses ticks to show things as code however, I had to use quote because the code actually contains ticks.

tolew1 avatar Jan 15 '23 02:01 tolew1