Server-side MP3 jam encoding?

Some people have occasionally asked me if it would be possible to have my Ninjam server record jams the way the Ninbot servers do. But the Ninbot servers seem to only encode jams of people actually jamming.

I run my little Ninjam server along with the "NinjamCast" bot client which sends the server audio to my Icecast live stream. So I have been trying out the StreamRipper program, which directly rips the live Icecast stream to MP3.

However in using Streamripper, there is no way I believe to have it NOT record silent jams, where people are apparently continually performing the famous John Cage piece 4′33″ or other jams featuring as what Quincy Jones calls "no-playing mofos" etc. Although StreamRipper from what I understand, does use silence detection for split points, ironically I don't think this can be used to only encode jams of people actually playing etc.

I also notice that this "NinjamCast" bot client can generate temporary session folders of multiple .ogg files and the Ninjam server itself can regularly generate session archive files, even including a clipsort.log file. Yet I don't know how one could perhaps somehow use these to selectively perform server-side concatenation/encoding of jams containing actual audio.

So if anyone here could maybe enlighten me as to specifically how to do this, I would sincerely appreciate it. Thank you and belated Happy Chinese New Year to everyone.

I vote to ban raisins now.

I vote to ban raisins now.

In America, raisins are from

In America, raisins are from California. They can sing and even play tiny musical instruments.

Yea I can add those people

Yea I can add those people as responses in training the bot. But I don't think the Ninbot forum has an rss feed (which is how I am parsing the CL rants & raves), however I might be able to somehow just scrape the pages. Yet I certainly don't wish to burden the Ninbot web server in any real way etc.

L Ron Hubbard? Now that

L Ron Hubbard? Now that would be scary...

Can you have the bot quote

Can you have the bot quote Mr Rogers, Mary Poppins and L Ron Hubbard?

cool. You could feed "it"

cool. You could feed "it" with the ninbot forum too? lot's of material for a hungry bot!

I've updated the bot now so

I've updated the bot now so that after it insults you, it randomly spews hateful stuff from Craigslist rants & raves until everyone leaves.

Good thing you got it

Good thing you got it working, mutant.

Talks s*** and can't play

Talks s*** and can't play guitar?

Man, it's like a lot of Ninjammers!

Thanks pl, feeling inspired

Thanks pl, feeling inspired again :)

@unfretted Welcome back :)

@unfretted Welcome back :)

Ironically the bot is much

Ironically the bot is much like most real people using NINJAM, except it doesn't play guitar.

@ mutant, lol, automatic

@ mutant, lol, automatic insult in chat

I finally got my NINJAM

I finally got my NINJAM server to generate MP3's now. The link to the public archive page is listed in the topic, you should be able to either just listen or click each icon to download them. I currently have the server set to create logs every hour, so you might have to wait for the the MP3 to appear, but they are all at 320kbps.

I also modified Tea's script to create an AI chatbot. I've begun training it using responses by GG Allin and Charles Manson, it also asks random questions and insults each persons musical ability. I hope to maybe add more stuff to it eventually and see what develops.

Andy, I believe the

Andy, I believe the connected user names appear in the Icecast stream title directly via NinjamCast. Also the old Jam Farm code displays connected users on a web page doesn't it? But if you need any help let me know.

I've started messing around with fluent a ffmpeg API node.js module, but my script is throwing out a bunch of errors. So unless somebody would maybe be willing to take a look at it, again I'll have to hack my way through it.

But essentially I'm trying to continually check the live Icecast stream to see if it exceeds a decibel level for a period of time and the stream title also contains at least two names. If both conditions are met, then ffmpeg starts encoding and only stops and saves a sequentially numbered, time, date and name stamped MP3 once the volume goes below that same decibel level for the same time period or the stream title has less than two names.

One thing i never been able

One thing i never been able to get working though, which I did once but maybe older icecast server, is icecast needs mount points and ninjamcast has no option to give like a user name on connection.
So always had probs getting ninjamcast sending to upto date icecast server. Any info you can send back this way would be nice to know Mutant.

When i got it working on one place via icecast I don't think it passed through the server info either.

I'm sure you can set filters

I'm sure you can set filters and conditions with one of the rippers, might be stream ripper can't rememebr now. But the it would only rip if say jambot=jambot+jammer. Also i thought one of them did not record when no audio. Plus I'm sure it can pull info from the server, or rather ninjam cast throws some out with the stream about ninjam server info.

Also have you tried one of the frontends for steamripper?

Station Ripper is a front end version of streamripper and that allows for entering silence info and splitting the file.
ninbot i tested it with and that doesn't forward any server info but I'm sure ninjamcast does and the shoutcast server will pass that info on. Might need some stuff setting in the shoutcast ini file but should do it. I'd suggest if possible looking to encode to ogg or acc as mp3 is big file sizes and not as good quality. So you coudl reduce file size and get better quality using ogg or acc.

Also you could use online webspace, a few offer 50 to 100gigs free and auto sunc the dir maybe limiting the upload bandwidth of the sync software as not to effect the ninjam server. You can also send the tracks to, but u'd have to ask damned or tom or justin.

Thanks again anyways

Thanks again anyways pljones. I emailed Fabian the other day to ask about how it works, but all he said was that he thinks Ninbot uses Lame. So I guess I will have to try to hopefully figure this out by myself. Ninjam is the best video game in the world!

I think it might be possible

I think it might be possible to rig this up on a stream but it would take some thinking about. Of course, the output would still be to a file, rather than another stream - you can't remove time in real time. The idea is you're saving only the part of the stream where there is no silence.

The ninbot jam saver also checks that the non-silence is there when more than one connection exists to the room. It then names the file after every connection it saw during the saved period of non-silence.

If you're saving separate files per connection, you could refine this so you only save jams where more than one connection is non-silent.

How you rig this up and what tools you use depends on many factors.

OK, thank you much pljones

OK, thank you much pljones for this tip. I am unfamiliar with using ffmpeg, but basically would I run a command on the Icecast stream itself or rather somehow the output of the "NinjamCast" bot or even the Ninjam Server port directly? Also how could this be done automatically so that everybody would be ensured to get a MP3 of their favorite jam etc? Or would I just run this over all the MP3's already created by StreamRipper?

You can use the ffmpeg

You can use the ffmpeg silencedetect filter on an audio stream to get a list of silences. You should then be able to feed that information back to ffmpeg to split the stream up, discarding the silence chunks.

Or you could also use the ffmpeg silenceremove filter just to remove them but leave the "trimmed" audio still in the one stream.

Never tried either...

    © 2013 All rights reserved