Skip to content

Commit

Permalink
[mirotalksfu] - fix ffmpeg in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpejic85 committed Jul 1, 2024
1 parent 89f7ed9 commit 18520e4
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 12 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN apt-get update \
build-essential \
python3 \
python3-pip \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*

# Copy package.json and install npm dependencies
Expand Down
5 changes: 3 additions & 2 deletions app/src/RtmpFile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use strict';

const config = require('./config');
const ffmpegPath = config.server.rtmp && config.server.rtmp.ffmpeg ? config.server.rtmp.ffmpeg : '/usr/bin/ffmpeg';
const ffmpeg = require('fluent-ffmpeg');
const ffmpegInstaller = require('@ffmpeg-installer/ffmpeg');
ffmpeg.setFfmpegPath(ffmpegInstaller.path);
ffmpeg.setFfmpegPath(ffmpegPath);

const Logger = require('./Logger');
const log = new Logger('RtmpFile');
Expand Down
5 changes: 3 additions & 2 deletions app/src/RtmpStreamer.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
'use strict';

const config = require('./config');
const { PassThrough } = require('stream');
const ffmpeg = require('fluent-ffmpeg');
const ffmpegInstaller = require('@ffmpeg-installer/ffmpeg');
ffmpeg.setFfmpegPath(ffmpegInstaller.path);
const ffmpegPath = config.server.rtmp && config.server.rtmp.ffmpeg ? config.server.rtmp.ffmpeg : '/usr/bin/ffmpeg';
ffmpeg.setFfmpegPath(ffmpegPath);

const Logger = require('./Logger');
const log = new Logger('RtmpStreamer');
Expand Down
5 changes: 3 additions & 2 deletions app/src/RtmpUrl.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use strict';

const config = require('./config');
const ffmpegPath = config.server.rtmp && config.server.rtmp.ffmpeg ? config.server.rtmp.ffmpeg : '/usr/bin/ffmpeg';
const ffmpeg = require('fluent-ffmpeg');
const ffmpegInstaller = require('@ffmpeg-installer/ffmpeg');
ffmpeg.setFfmpegPath(ffmpegInstaller.path);
ffmpeg.setFfmpegPath(ffmpegPath);

const Logger = require('./Logger');
const log = new Logger('RtmpUrl');
Expand Down
2 changes: 1 addition & 1 deletion app/src/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies: {
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - [email protected]
* @version 1.4.76
* @version 1.4.77
*
*/

Expand Down
2 changes: 2 additions & 0 deletions app/src/config.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ module.exports = {
- apiSecret: The API secret for streaming WebRTC to RTMP through the MiroTalk API.
- expirationHours: The number of hours before the RTMP URL expires. Default is 4 hours.
- dir: Directory where your video files are stored to be streamed via RTMP.
- ffmpeg: Path of the ffmpeg installation on the system (which ffmpeg)
Important: Ensure your RTMP server is operational before proceeding. You can start the server by running the following command:
- Start: npm run nms-start - Start the RTMP server.
Expand All @@ -94,6 +95,7 @@ module.exports = {
apiSecret: 'mirotalkRtmpApiSecret',
expirationHours: 4,
dir: 'rtmp',
ffmpeg: '/usr/bin/ffmpeg',
},
},
middleware: {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mirotalksfu",
"version": "1.4.76",
"version": "1.4.77",
"description": "WebRTC SFU browser-based video calls",
"main": "Server.js",
"scripts": {
Expand Down Expand Up @@ -55,7 +55,6 @@
"node": ">=18"
},
"dependencies": {
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"@sentry/integrations": "7.114.0",
"@sentry/node": "7.114.0",
"axios": "^1.7.2",
Expand Down
4 changes: 2 additions & 2 deletions public/js/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - [email protected]
* @version 1.4.76
* @version 1.4.77
*
*/

Expand Down Expand Up @@ -4032,7 +4032,7 @@ function showAbout() {
imageUrl: image.about,
customClass: { image: 'img-about' },
position: 'center',
title: 'WebRTC SFU v1.4.76',
title: 'WebRTC SFU v1.4.77',
html: `
<br />
<div id="about">
Expand Down
2 changes: 1 addition & 1 deletion public/js/RoomClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - [email protected]
* @version 1.4.76
* @version 1.4.77
*
*/

Expand Down

0 comments on commit 18520e4

Please sign in to comment.