On the callback of the completion of the fluent-ffmpeg transcoding of nodejs.

  node.js, question

Recently, when learning nodejs, there was a need to transcode video and audio. The first thought was to use ffmpeg (I have heard of it before, and it is also the first time to use this plug-in). Now the transcoding operation is implemented according to the online tutorial, but after the success, you need to return the information to the front end, which is stuck here and you don’t know where there is a callback.
In the tutorial, the callback method is written in saveToFile’s input, but it has no effect. I hope people who know it can help me.
The code is as follows:

var trans = new ffmpeg({ source:file_url })
 .withAspect(b)
 .withSize(_size)
 .applyAutopadding(true, 'white')
 . saveToFile("./public/files/ "plus req.session.user.name plus"/"plus new_name plus'.' plus new _ format, function (retcode, error) {
 var result = {
 "success":true,
 "data": {"URL": "... public/files/"plus req.session.user.name plus "/"plus new_name plus'.' plus new_format}
 };
 var resultString = JSON.stringify(result);
 res.write(resultString);
 res.end();
 });

var trans = new ffmpeg({ source:file_url })

.withAspect(b)
 .withSize(_size)
 .applyAutopadding(true, 'white')
 . saveToFile("./public/files/ "plus req.session.user.name plus"/"plus new_name plus'.' plus new _ format, function (retcode, error) {
 //Move
 }).on('end', function() {
 //here is the result after processing
 console.log('Finished processing');
 })