Login | Register 

multi-purpose moviePlayer

Share your components here. First one to 100 wins!

multi-purpose moviePlayer

Postby greg » Tue Sep 12, 2017 4:33 am

moviePlayer is a standalone TouchDesigner component for playing and exploring movie files, setting cue points and presenting sections of movies. Movie playback can be externally controlled with ramps and python commands.

To start playing around with it, start the .tox, go into Perform mode and drag-drop a movie file from a file browser onto the panel UI.

On the user interface, you can press the Par+ button to bring up the parameters. You can alternately choose a movie with the File parameter on the Settings 1 page of the component.

It's a mix of features like in QuickTime or VLC Media Player, with features for making and playing cues and sub-clips, It's useful for playing live or when giving presentations in TouchDesigner networks (an alternate to using PowerPoint or Keynote) because of the ease of jumping around long movies. It works well with a touch screen.

moviePlayer.4.jpg (43.98 KiB) Viewed 1718 times

moviePlayer can be driven with external CHOP timing ramps and via python trigger commands to position/play at specific times or cues.

Play and Position Controls

The precise shuttle controls and frame increment buttons, speed control and audio level are described here. The || and > button plays and pauses.

Scrub-and-pause/play: When dragging on the scrub bar, when you release it, if you have dragged up off the bar, it will play the movie from the scrub point. If you have dragged down off the bar, it will pause the movie.

For precise positioning, the - and + buttons let you step forward backward one frame. If you hold these buttons down, it will increment/decrement 1 frames every 1/6 second, and if you drag right/left off the + and - buttons, it will increment/decrement faster the farther you drag off the buttons.

The <> button lets you inspect around the current frame: If you click <> and drag left/right off the button, it will go and pause at nearby frames, and if you continue to hold down and bring the cursor back to <>, it will return to the initial frame.

Roll over the time counter to get the movie length.

Look and Movie Settings

The "Par+" button brings up the custom parameters for the UI, the movie that is playing and its cues:

Parameters on the Settings 1 and Settings 2 pages configure and pre-process the movie.

On Setup, Force Resolution internally scales the movie to your desired resolution when it is read.

All UI looks and controls are tied to parameters on the Setup page.

On Setup -> Action on Select, you can play the movie when you click on the moviePlayer1 node in a TouchDesigner network. Also it can pause the movie when you click on another node. etc. You can play a certain cue when you select the movie. This is useful when demoing movies in a TD network.

You can control opacity of the UI's overlay panels, and whether you want them displayed only when you roll over the panels or always.


moviePlayer optionally plays audio out the default audio device (Internal Audio Player on the Setup page). Its Volume parameter is mirrored in the UI as the Audio slider. Also the second output of the component is the audio of the movie, which can be routed to a mixer/output.

Creating Cues

You can set up cues (a point or sub-section of a movie), each with a "beauty" frame, a "start" time, an optional "end" time and a end-start crossfade time.

To set up, pause the movie somewhere. Move your cursor to the top part of the player. The cue grid comes up (mostly empty at first).

Click Add Cue. It will add a 5 second cue at the current frame. Go and pause to some other frame after the current frame. Press the E= button to set the End time. Now you have a cue segment. Press the grey Cue 1 button at the bottom. It will turn green and play/loop the cue.

If you click in the top row of boxes labelled "B", it goes to the respective Cue's Beauty frame and pauses. If you click in the middle row of boxes labelled "S", it goes go to a cue's Start point and plays (hold Shift to pause). If you click in the third row of boxes labelled "E", it goes to a cue's End point and pauses. These provide quick-access jump points.

There are 4 ways to set the beauty, start and end points (some are better for touch screens):

Pause the movie where you want set a start, beauty or end point.

(1) Press the S= or E= buttons in the cue grid. S= sets both the beauty and start frames.

(2) Press Ctrl-click on the B, S or E boxes.

(3) Use the Set> menus in the cue grid.

(4) Right-click on an existing cue in the timeline and use the same Set> menu.

Thereafter, when you left-click on the B, S and E boxes, it will go to those times in the movie.

Using Cues

In the bottom row of the timeline (row 1), if you click on an icon image it goes to the beauty frame for that cue and pauses. If you press Shift-click on the icon, it will go to the cue's start and play forward to the end of the movie. You can also play from the start time if you click on an icon and drag off the icon to the right (convenient for touch screen).

In row 2, click the grey cue boxes to play only the cue's segment from start to end, and depending on the Cue's Next Behavior setting, loop the cue. The box turns green indicating it will only play the cue start-end range. Press Shift-click to pause at a cue's start time, or press the cue and drag down off the button. Press > to continue, keeping the cue selected (green). The first click on an unselected cue sets it to the cue start, the next click on that cue scrubs the cue.

End-to-start crossfade times are set per-cue: Set the the Crossfade parameter of the individual cue's parameter dialog via Par+ or via Set> Cue Parameters. (The Crossfade of the full movie (cue 0) is set in the movie's Settings 1 page.)

The Cue List

You can change the display of the top area to display cues as a time-ordered list. On the Setup page, change the Upper Display Area menu to Cue List on Rollover.

Cue Internals

Note that every cue is a Base component in moviePlayer1/cues, each with a few custom parameters.

In Par+ you can see the Cues' parameters via the top row of buttons. Or in the Set> menu, select Cue Parameters to bring up the parameters of a cue.

Here you see where the start, end and beauty times are held. You can name the cue. The Enable parameter undisplays the cue in the timeline, and is useful when it gets too cluttered. The Next Behavior menu allows you to stop or loop when reaching the end of a cue. You can set it to go black (0 0 0 1) or zero (0 0 0 0) at the end of the cue. You can safely delete or re-order cue1, cue2... components in the cues network, or via the Set> menu.

Movie Adjustments

The moviePlayer component has more parameters on the Settings 1 and 2 pages to prepare the movie: Crop, Black Level / Luminance / Gamma adjust, audio-adjust etc.

External Control of moviePlayer

To the first input of the moviePlayer component, you can attach a CHOP with one channel with values in the 0-1 range, such as a ramp from a LFO CHOP. This will take over the timeline until you disconnect the CHOP.

If you want to control using seconds instead of a 0-1 value, you can use values in the third output of the CHOP which contains 3 constant channels: length (how many seconds long in moviePlayer is the currently selected cue (cue 0 is the full movie)), duration (this is the length divided by the Speed parameter - the movie takes longer to play if you set the Speed lower than 1)) and the movie's rate (images per second).

On the "Cues" page of the component's parameters, you can select a cue number and press Go to Cue and Play, for example. You can drive this with python or by exporting to the parameters.

You can alternately set a time and press Go to Time and Play.

The python extension of the component has the functions GoToCue(cuenum, cuepoint, play) and GoToTime(seconds, play). Example to go to 50 sec and play:



movie and audio go out the first two outputs. Other movie info goes out 3 and 4.

moviePlayer contains about 40 nodes initially without cues - your GPU memory may become the limiting factor as you add many moviePlayers. But its default behavior is to pause moviePlayer when it is un-selected, to avoid using GPU and CPU time.

Multi-moviePlayers or Multi-Movie Specs

To manage multiple movies, duplicate moviePlayer in the network and alter the duplicates. This will let you play several movies at one time. Changing the file name will delete all its cues and reinitialize all the parameters.

If you have more that 10 movies, you can have a multitude of Movie Spec components (movieplayer1/mvspec1 is the template) and drag-drop them onto any movie player (you are setting the Movie Spec parameter to point to the movie spec components.

The Movie Spec components are very lightweight. Inside are 4 passive nodes plus one empty component per cue.

To use this, copy movieplayer1/mvspec1 anywhere outside moviePlayer1, make multi-copies of it. Then for each you edit it by assigning it to Movie Spec of a moviePlayer component and editing / adding cues etc as you normally would. All edits are saved in mvspec. mvspec2, ...

WHen using mvspec with a moviePlayer component, the latter's Settings parameters are unused.

Every time you assign a new mvspec to the moviePlayer1's Movie SPec parameter, it will take some number of frames to uload the prior movie, open the new movie and load the number of pre-read frames into the GPU. (It uses the Timer CHOP for this.) So one moviePlayer can never have a perfect cut between movies. For this reason you need two moviePlayer components and switch between them. You get the second moviePlayer to pre-load the next movie before making a cut or corssfade.

moviePlayer.10.tox uploaded Dec 5 with improvements described in a post below.

moviePlayer.11.tox uploaded Dec 9 switches movies faster and by not deleting/creating cue components.

NOTE: The moviePlayer.8.tox is in the Palette, moviePlayer.11.tox will be in the December Experimental palette.
(90.21 KiB) Downloaded 7 times
User avatar
Posts: 487
Joined: Tue Nov 13, 2007 1:08 am

Re: multi-purpose moviePlayer

Postby barakooda » Tue Sep 12, 2017 12:21 pm

works smooth.
User avatar
Posts: 405
Joined: Fri Nov 27, 2009 5:08 pm

Re: multi-purpose moviePlayer

Postby greg » Sun Sep 24, 2017 11:56 pm

Numerous improvements including ability to make loops with end-start crossfades, and driving the movie with ramps or python. Works with latest Official.

The .tox is at the end of the first post of this thread. Doc is updated in the first post.

Updated again on Oct 2 and again Oct 8.
User avatar
Posts: 487
Joined: Tue Nov 13, 2007 1:08 am

Re: multi-purpose moviePlayer

Postby Timesquid » Mon Oct 09, 2017 1:09 pm

This is amazing greg thank you, Ive got a show coming up that needs very organic and flexible movie playbacks, and this will help immensely.

Although some things I found myself wanting right away were :

1. A filter on the scrubber, that disables itself (which I added)
2. crossfade to a cue? I would not know how to best add this myself.
3. Is that filter chop "filtercontrolson" just there to fade the ui on? seems like disabling it cuts alot of ui cooking out.
Posts: 110
Joined: Wed Jan 04, 2012 8:08 pm

Re: multi-purpose moviePlayer

Postby greg » Thu Oct 12, 2017 1:12 am

Re: 1. A filter on the scrubber, that disables itself

You mean a Filter CHOP on the scrubber value to smooth index?

Re: 2. crossfade to a cue? I would not know how to best add this myself.

Yes, this component isn't designed for that as it needs two Movie File In TOPs to do a cross-fade. It really depends what UI you need around that, like is your application fully automated, or improvised? In the Palette, movieBlender and moviePlaylist do that, with differing capabilities. In OP Snippets for Timer CHOP, example22 has automated overlapping movies with a fixed crossfade time.

Or you have 2 moviePlayers and a small python script to start a crossfade and start the movie at the same time.


3. Is that filter chop "filtercontrolson" just there to fade the ui on? seems like disabling it cuts alot of ui cooking out.

ugh yes, the Filter CHOP keeps cooking. If you follow it with a Null CHOP set to Selective, it stops propagating when the value hits a constant 0. Or just bypass it to make it instant 0n/off.
User avatar
Posts: 487
Joined: Tue Nov 13, 2007 1:08 am

Re: multi-purpose moviePlayer

Postby Timesquid » Mon Oct 16, 2017 1:31 pm

Thanks Greg!

Im going to use it per longer movie file and export my content in longer sections. Then use a separate transitions system for when I change moviefiles.

I don't know if I will need to optimize it just yet but will find out as the system gets flushed out.

Thanks again!
Posts: 110
Joined: Wed Jan 04, 2012 8:08 pm

Re: multi-purpose moviePlayer

Postby greg » Mon Oct 23, 2017 1:58 am

lots of small improvements in moviePlayer.8.tox. among them:

  • You can force the movie resolution and aspect ratio to any specific width/height.
  • You can change the moviePlayer component panel width/height to anything and the buttons/text scale appropriately.
  • rollover the time code to get the movie length.
  • If in Perform mode, press space bar and arrow keys to pause/play and step.
  • UI is simpler when you start up.
  • new ui for scrub bar (drag up to play, drag down to pause)
  • cues are temporally ordered.
  • There is a simple cue list mode where you can see your cue comments and play cues, via Setup -> Upper Display Area.
  • new Help.
Download and doc are in the first post of this thread.
User avatar
Posts: 487
Joined: Tue Nov 13, 2007 1:08 am

Re: multi-purpose moviePlayer

Postby vertexshining » Sun Nov 26, 2017 10:46 am

about Mult-moviePlayers:

To manage multiple movies, duplicate moviePlayer in the network and alter the duplicates. This will preserve all the cues and settings you make for a movie.

is this the best approach or it is possible to save the cue playlist for every movie on a DAT and recall along with the nominated file?

It would be less heavy than duplicate the moviePlayer, let's say, 10 times within a single project?
Posts: 36
Joined: Fri Mar 24, 2017 7:17 am

Re: multi-purpose moviePlayer

Postby greg » Mon Nov 27, 2017 12:52 pm

You could save the cues separately in another component by copying the "cues" component, or as you suggest, you could save the cue parameters in an DAT (more work, less size).

Actually DATs is how cues and settings were originally stored in Mixxa and other things I've made in the past. To specify cues now, I'm using one empty Base COMP with custom parameters per cue, since parameters are typed and DAT cells are simply strings.

It may be better to keep all the cues and Settings in one place. Working on this. It's the ability for one moviePlayer to support switching between multi-Mv settings/cues components. Likely you'll see it over the next month.
User avatar
Posts: 487
Joined: Tue Nov 13, 2007 1:08 am

Re: multi-purpose moviePlayer

Postby greg » Mon Dec 04, 2017 2:45 pm

In the attached .toe, for each movie you have, you can define your settings in a very lightweight mvspec component, then assign it to the moviePlayer via its Movie Spec parameter. This allows you to have 1 or 2 players and a multitude of movie specs, each mvspec can have cues, special movie-adjustment settings and metadata.

If Movie Spec is blank, it will continue to use its built-in spec, and you can drag-drop files onto moviePlayer or set its File parameter.

This works with the current Experimental 099, not Official. This version 10 of moviePlayer will soon replace version 8 in the palette.

Dec 9: Now version 11 avoids the deletion and creation of components when you load choose Movie Spec components or choose new movie files. Before it would rebuild the replicator of 4 components per cue. It now creates new replicants when a Movie Spec has more cues that any previous Movie Spec. It resets it to 0 cues on startup or cop/paste of a moviePlayer component.
(195.13 KiB) Downloaded 2 times
User avatar
Posts: 487
Joined: Tue Nov 13, 2007 1:08 am

Return to Shared .tox Components

Who is online

Users browsing this forum: No registered users and 3 guests