Creating .nfo file for videoroom recording

410 views
Skip to first unread message

Vincenzo Cucumazzo

unread,
Jan 26, 2017, 11:29:19 AM1/26/17
to meetecho-janus
Hi everyone,
after reading a couple of answers on this group, I managed to record a videoroom session when a user clicks on a button "REC" (for now, I'm only able to record the applicant user's side of the video room, i.e. only the user who clicks the button; but this is a problem I will try to solve later).
I want to play the records using the record/playout plugin and therefore I need the .nfo file which links audio.mjr and video.mjr files: the simple solution of creating it manually works fine, but my aim is to automate the process. So, I tried to modify janus_videoroom.c (located in the folder janus-gateway/plugins in my Home folder) by adding the "creating .nfo file" section taken from janus_recordplay.c, mutatis mutandis.
The application still creates the .mjr files, but unfortunately despite the changes, doesn't produce any .nfo file.
Moreover I tried to "naively" debug the code by adding some lines of JANUS_LOG in the middle of the interested section but I don't obtain any output in the terminal (where janus is running) neither in the console section of the browser.
Can you help me? Thanks in advance

Lorenzo Miniero

unread,
Jan 26, 2017, 11:48:42 AM1/26/17
to meetecho-janus
You're either creating the .nfo file in the wrong place, or the file creation fails for some reason (permission problems?)
If it's the former, you should probably do that in janus_videoroom_recorder_close.

L.

Vincenzo Cucumazzo

unread,
Jan 26, 2017, 11:59:55 AM1/26/17
to meetecho-janus
I've exactly chosen the janus_videoroom_recorder_close function to insert the code, and I think it's not a problem of permissions because I'm trying to save the .nfo file in the same folder in which are saved the .mjr files which is also the same used as source folder by record/playout plugin.

Lorenzo Miniero

unread,
Jan 26, 2017, 12:10:55 PM1/26/17
to meetecho-janus
If you see the "Closed audio recording" and/or "Closed video recording" messages:

then the method is called correctly. If so, try sharing the block of code you're using (pastebin/gist, not inline here) for help on understanding why creating the file is not working.

L.

Vincenzo Cucumazzo

unread,
Jan 26, 2017, 12:33:55 PM1/26/17
to meetecho-janus
I see the mentioned messages and I know also that the corresponding files are actually created. This (http://pastebin.com/TWux9scH) is the block of code I'm using. To avoid errors, I moved the    participant->arc = NULL;    participant->vrc = NULL;
instructions to the end of the method. I substituted the recordings_path and the recording id used in "janus_recordplay.c" with participant->room->rec_dir and participant->room->room_id respectively; I 've then initialized the current date and lastly used this latter information along with participant->room->room_id, "tempname"(a temporary name chosen for the record), participant->arc->filename and participant->vrc->filename to set the .nfo file's fields

Lorenzo Miniero

unread,
Jan 26, 2017, 12:34:38 PM1/26/17
to meetecho-janus
You're accessing arc and vrc after they've been freed with janus_recorder_free, you need to create the file before that.

L.

Vincenzo Cucumazzo

unread,
Jan 26, 2017, 12:41:44 PM1/26/17
to meetecho-janus
Following your advice, I tryed to move the two freeing instructions right before the corresponding set null ones, but then again unfortunately no .nfo file is produced.

Horsetopus

unread,
Jan 26, 2017, 1:06:25 PM1/26/17
to meetecho-janus
I know it's stupid, but just to make sure:
Are you sure your are building correctly? Are the binaries updated?
You need to call both make and make install.

Vincenzo Cucumazzo

unread,
Jan 26, 2017, 1:16:03 PM1/26/17
to meetecho-janus
Probably this is the lack in my process.. even if it may be a stupid question, since I don't want to lose any update I made to original file: do these commands only apply the changes or in some way "restore the original configuration"?
And then, in which folder should I call make and make install?

Vincenzo Cucumazzo

unread,
Jan 27, 2017, 3:42:15 AM1/27/17
to meetecho-janus
I tried to apply make and make install in the janus-gateway folder in my home directory.
Unfortunately it didn't work: it showed several errors in the terminal and then when I tried to test the changes I noticed that the "REC" button which I added in videoroom html page had disappeared; in fact the make and make install commands had the effect to replace all the html and javascript files included the whom I had modified.
Do you have any idea?

Lorenzo Miniero

unread,
Jan 27, 2017, 4:20:27 AM1/27/17
to meetecho-janus
If you see errors in the terminal you have C syntax errors.
Don't use the html folder in the installation for your tests, as it will be overwritten by make install. Either use the html folder in the sources, or copy it somewhere else for your modifications.

L.

Vincenzo Cucumazzo

unread,
Jan 27, 2017, 4:52:13 AM1/27/17
to meetecho-janus
I have modified nothing but what I showed you: however, in the terminal I have C errors indeed( referring to lines I haven't actually edited).
Apart from that, I haven't understood well where to call make and make install commands.
If you want this is the terminal output after using make and make install in janus-gateway folder (I'm using a different machine for all trials) : http://pastebin.com/FaMfniHF

Lorenzo Miniero

unread,
Jan 27, 2017, 5:13:06 AM1/27/17
to meetecho-janus
janus_videoroom_st* session

This is not something we wrote, and that structure doesn't exist. Maybe you did some replacing that ended up modifying other parts of the code as well, or patched the code somehow? Try starting fresh from a brand new git clone, and applying your changes there.

As to where to do the make and make install, you obviously have to do that from the project root, exactly as when you installed it the first time...

L.

Vincenzo Cucumazzo

unread,
Jan 27, 2017, 10:14:00 AM1/27/17
to meetecho-janus
Actually there was something odd in the .c file I was warking on. As you suggested I started fresh from a new git clone and also on another machine: I applied my changes; make and make install don't produce errors, but still I can't get any nfo output file.
I noticed that there are several copies of the same file and so I'm wondering what are the ones used by the application.
Probably it may appear a silly question but nothing is working despite my attempts: so, if I want to apply some changes, what .c, .html and .js files should I modify? Basically I have:
- .html and .js files both in /opt/janus/share/janus/demos/ , in  [folder in which I extraxcted the github archive]/html and  [folder in which I extraxcted the github archive]/janus-gateway/html
- .c files in [folder in which I extraxcted the github archive]/plugin and [folder in which I extraxcted the github archive]/janus-gateway/plugin
- .cfg files in /opt/janus/etc/janus , [folder in which I extraxcted the github archive]/conf and [folder in which I extraxcted the github archive]/janus-gateway/conf
- recordings folder in [folder in which I extraxcted the github archive]/plugins , [folder in which I extraxcted the github archive]/janus-gateway/plugins and opt/janus/share/janus
When I installed the first time I launched make and make install from [folder in which I extraxcted the github archive]/janus-gateway/.
One last thing: I'm launching a userspace web server from [folder in which I extraxcted the github archive]/janus-gateway/html.
To sum up, my questions are: is there any error in what I do? What files should I modify among the ones I mentioned above?
Thank you for your patience and your commitment to the project.

Lorenzo Miniero

unread,
Jan 27, 2017, 10:35:34 AM1/27/17
to meetecho-janus
.c files change the behaviour of the core and/or plugins; .html files how the demos look like; .js files the client side logic of the demos.
Since you want to generate the nfo files, you want to modify the behaviour of the plugin, so .c file editing. If any change on the UI side is needed (e.g., new button that starts/stop recording) then that's basic webapp stuff (js+html).

L.

Vincenzo Cucumazzo

unread,
Jan 27, 2017, 10:45:29 AM1/27/17
to meetecho-janus
Ok, this is clear: so, now, what of the copies of .c file mentioned before in my previuos message should I have to modify?
Message has been deleted

Vincenzo Cucumazzo

unread,
Jan 28, 2017, 5:43:01 AM1/28/17
to meetecho-janus
Update:
Finally I really got your previous suggestions (horsetopus' make and make install and lorenzo miniero's advice to modify .js and .html files in a place other than the one in which installation places them): I managed to create an .nfo file ( for the moment only with fixed room_id and title ) with correct information in it; I can open it while the videoroom plugin is still running - in this way I checked the data inside it - but I come across another problem.
When I stop the plugin clicking on the relative button, I get this error in the terminal:
Segmentation fault (core dumped)
it shows only after clicking the stop button( it closes without any problem audio and video recording and it also detaches handle for JANUS videoroom plugin).
Moreover after getting this error Janus crashes and the .nfo file just created results empty.
Can you help me once again?

Lorenzo Miniero

unread,
Jan 28, 2017, 5:44:47 AM1/28/17
to meetecho-janus
Sorry, you'll have to do your own debugging I'm afraid, especially since it's custom code... here's a few tips,

Lorenzo

Vincenzo Cucumazzo

unread,
Jan 30, 2017, 3:43:42 AM1/30/17
to meetecho-janus
Hi Lorenzo, I managed to create the .nfo file with correct data in it and then to see the recording through the recorder/playout.
Thank you!
Reply all
Reply to author
Forward
0 new messages