Youtube mixer

Oct 14, 2009 at 11:16pm

Youtube mixer

I’m looking to make a video mixer that can crossfade between two youtube videos. Do you know of a way to do this in Jitter? I’ve got as far as trying to take the linked swf file and putting it into jweb but it does not seem to play.

Can anyone point me in the right direction?


Oct 25, 2009 at 7:13pm

I expect this might be more easily done in Flash.

Oct 31, 2009 at 1:02pm

I’m sure youtube won’t like this, but since it’s caturday:

– Pasted Max Patch, click to expand. –
Oct 31, 2009 at 6:07pm

Woh! Xellent!

Would you comment a little bit what are you doing with these regular expression?

I tryed to set a different youtube link, but I get only the tags.

– Pasted Max Patch, click to expand. –
Nov 1, 2009 at 1:45pm

It very much depends on the network, since will try to asyncread directly from the url.
Banging ‘p make_download_url’ might reload the video.

I just tried your link, it works here(love the part with just two hands in the frame btw).


Nov 2, 2009 at 2:49pm

Tried running the first patch and got the error - error -2048 reading URL

Subsequent mucking around returned error 503. Hmmm. Is the patch still working for others?

Nov 5, 2009 at 6:57pm

The same with me.
I tried nesa’s code and I got the same error:
error -2048 reading url

Nov 6, 2009 at 3:42pm


this is a hack, there’s no guarantee that it’s gonna work on your system.

error 2048 might mean that you’re missing codec that can play flash videos, try installing perian.

error 503 is general ‘service unavailable’ error, this probably happens if you try to load the video too often and youtube suspects your doing something you shouldn’t (i.e. this).

good luck!

Nov 6, 2009 at 4:02pm

Hey perfect!
Once I installed perian everything works smoothly
thnx a lot!

Dec 3, 2009 at 8:58pm

Nesa, that is brilliant. There is some complex things going on there. Could you explain how you went about building it?

I now want use this patch in a project in college were I’m building an on line editing system using mobile phones for input. I want to use a live video sharing website called Qik ( to upload content then stream it into max. The developers of the Qik have given me permission to use their API if it helps me in my project.

I am wondering Nesa were do I change your code to work with Qik videos?

Dec 3, 2009 at 9:22pm

unfortunately perian workaround doesn’t work for PC ;(. Anybody got a pc solution?

Dec 15, 2009 at 10:47am

this is great! Is it possible to recieve the sound as well?

Dec 15, 2009 at 10:06pm

awesome hack! looks like the audio plays as well (provided you can get the flv’s to play in quicktime with something like perian). in the qtm patcher you can change the volume level of the object.

i’ve got two instances running smooth. a crossfader and render window wouldn’t be hard to add from there!

Dec 15, 2009 at 10:09pm

oh but you may need spigot~ to get audio to crossfade in msp. common question for quicktime mov’s. not sure spigot is completely solid in max 5 yet tho i’ve read threads saying they’re revising it for jitter 2. it works okay for me sometimes. i’m gonna try and build this up when i’m not at work i’ll holler with what comes up!

Dec 16, 2009 at 9:53pm
Dec 16, 2009 at 10:18pm

To get the volume to work just change the @vol attrib in jit.qt.move from 0 to 1.

Feb 2, 2010 at 2:46am

to those who can’t play flv due to quicktime bollocks on windows:

change the [combine] arguments in make_download_url patcher to:

combine vid &t= t &fmt=18 @triggers 3

added &fmt=18 gets the url of an mp4 not flv if possible ;>

hope this helps…

edit: video plays only for few seconds, don’t know why is that?

Apr 13, 2010 at 5:26pm

Here’s a desktop application that does just that! Check it out…

Apr 14, 2010 at 4:44am

MOJO, your project sounds really interesting, I’m a New Media student at the University of Maine, USA and I am intrigued by your project. What do you mean by online editing system? my sense is that anyone will be able to edit uploaded content virally? Love to hear more.

Jan 6, 2011 at 1:38am

i’m getting a 404 error when it is looking for the youtube url…I assume this is because youtube has once again changed the format of their urls in order to prevent users from download .flv files. has anyone had any luck with this patch recently? or any updates to correctly parse the new youtube url format? i saw a library for Processing that does this sort of thing

Jan 6, 2011 at 1:40am

i’ve also looked into jweb a lot but there’s currently no way to get jweb to output to jitter matrices…

Jul 28, 2011 at 9:49pm

Any news about nesa patch?
Regular expression is really a hard way to go …
Anyone in this forum to share something that would work with youtube new format?

Jul 30, 2011 at 2:00am
Jul 30, 2011 at 5:42pm

Same issue: crash with
Any chance to have a look at your java patch?

Aug 1, 2011 at 11:37pm

sure. basically the crucial bit is here, where it extracts the links from the page source:
private HashMap getVideoLink() throws Exception{
String pageSource = getPageSource("" + videoID);
// System.out.println(videoID);

Matcher matcher = Pattern.compile(""t":\s*"([^"]*)"").matcher(pageSource);
String videoTicket =;
videoTicket = videoTicket.replace(""t": "", "").replace(""", "");
// System.out.println(videoTicket);

matcher = Pattern.compile(""fmt_url_map":\s*"([^"]*)"").matcher(pageSource);
String videoFormats =;
videoFormats = videoFormats.replace(""fmt_url_map": "", "").replace(""", "");

// parse fmt_url_map
HashMap videoURLs = new HashMap();
String sep1 = "%2C", sep2 = "%7C";
if (videoFormats.indexOf(",") > -1) { // new UI
sep1 = ",";
sep2 = "\|";
String[] videoFormatsGroup = videoFormats.split(sep1);

for (int i = 0; i < videoFormatsGroup.length; i++) {
String[] videoFormatsElem = videoFormatsGroup[i].split(sep2);
videoURLs.put(Integer.parseInt(videoFormatsElem[0]), URLDecoder.decode(videoFormatsElem[1]).replace("\", "").replace("u0026", "&") + "&title=video");

return videoURLs;


You must be logged in to reply to this topic.