Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to combine audio and video mjr files to generate one file?

I am using janus-gateway for recording in web-browser. Once the recording is completed, two files are generated, one is audio and another is a video. Both have format mjr. How can I combine both these files to create a single file?

like image 816
Anuj Avatar asked Mar 17 '23 04:03

Anuj


1 Answers

I was dealing with the same need.

If you did the default janus-gateway install you only miss these steps:

run this on the folder where you downloaded the git sources:

./configure --enable-post-processing

then

make
(sudo) make install

then run this for each file you want to convert them to audio/video formats:

./janus-pp-rec /opt/janus/share/janus/recordings/video.mjr /opt/janus/share/janus/recordings/video.webm

./janus-pp-rec /opt/janus/share/janus/recordings/audio.mjr /opt/janus/share/janus/recordings/audio.opus

if you don't have ffmpeg installed run this (i'm on Ubuntu, on other distros ffmpeg might be already in apt-get repositories)

sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next
sudo apt-get update
sudo apt-get install ffmpeg

and then finally to merge audio with video:

(sudo) ffmpeg -i audio.opus -i video.webm  -c:v copy -c:a opus -strict experimental mergedoutput.webm

from there you can build a shell script to convert all mjr files automatically on a cron

like image 91
Macumbaomuerte Avatar answered Apr 01 '23 07:04

Macumbaomuerte