New controller script for video sync using XJadeo

RELATED
PRODUCTS

Post

I just wrote a controller script for synced video playback:
https://github.com/Trinitou/xjadeo_vide ... g/releases

It uses the OSC remote control capabilities of xJadeo. And for now it's tested and developped on Windows only.

I think it's an easy but useful solution because...
  • You just have to start xJadeo with OSC enabled and with the correct port number (but there is a script for that included in the .zip)
  • Then you can specify a video file path per Bitwig project which is automatically loaded to the xJadeo window together with the project (when opening the project, switching to the project tab etc.).
  • Also the script reacts to Bitwig Studio's current play position (on playback, setting the playhead manually) and will set the video window to the correct frame.
Last edited by u-u-u on Tue Feb 21, 2023 7:07 am, edited 1 time in total.

Post

This seems to work great in a first quick test, although my video was a smooth animation and not something to check frame accuracy with. But an exactly 4 minutes long video ended after 4 minutes perfectly at 30fps with the realtime ruler visible, so it looks very good to me.

Very cool and very nicely implemented with the IO panel path per project!
Also nice that xjadeo can show timecode.

Thank you so much, I will give it some more workout in coming projects! :-)
But I think I like this solution much more than vidplay VST, since it's not bound to a single track (I show plugin windows only if the track they are on is selected).

:tu: :tu: :tu: :tu: :tu: :tu: :tu:

Gamechanger for Video in Bitwig :party: :hug: :tu: :clap: :D

Cheers,

Tom
Last edited by ThomasHelzle on Tue Feb 14, 2023 5:52 pm, edited 1 time in total.
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi
UrbanFlow.art · Instagram · YouTube

Post

Thank you for the positive feedback! :) Also if you have suggestions, feel free to propose stuff here or over on github :tu:

I also did the test with dropping the same .mpeg video file into Bitwig arranger at position 1.1.1.00 set to 'Raw' stretching mode -> audio was perfectly in sync with the video.

But probably they will add official video support with the next major release now that we have figured this workaround :D

Concerning suggestions: Maybe you find something in this list which you think might be nice to have as a setting for the controller script (or maybe even per project if that makes sense):
https://xjadeo.sourceforge.net/osc.html

Post

Now that is fresh!! Great idea.
----------------------------------------------------------------------
/CTRL → http://slashctrl.io
Music & mixes → http://soundcloud.com/kirkwoodwest

Post

u-u-u wrote: Tue Feb 14, 2023 5:04 pm Concerning suggestions: Maybe you find something in this list which you think might be nice to have as a setting for the controller script (or maybe even per project if that makes sense):
https://xjadeo.sourceforge.net/osc.html
Actually yes - I was just reluctant to instantly bother you ... :-)

For me it would be:
- Show Timecode was the first thing I set in XJADEO itself :-)
I'd probably make that into a global preference to be active by default here, but I created some scripts in the past that had both global and local preferences for the same value where the global one set the default and then you were able to change it per project if needed.

- Show Frames could also be nice in case somebody is working in a 3D software and going framewise. Bitwig can't show that AFAIK.

- Offset could actually be quite important in cases where you do not load the whole animation but only part of it, like a scene in a longer movie.
Per project.

- Loop (we are sometimes working on looping animations where we have like a 10-30 second loop and then just play to it, not knowing yet how long we'll make it in the end for youtube).
Per Project.

Could all be done in XJADEO or the .bat file, but of course would be nicer in the GUI :-)

Cheers!

Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi
UrbanFlow.art · Instagram · YouTube

Post

Oh, if that is possible (not on the list though): Could also be nice to have the view scale as a per project setting.
By default it's quite small. I tend towards 50% or 100% in most cases.

Cheers,

Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi
UrbanFlow.art · Instagram · YouTube

Post

ThomasHelzle wrote: Tue Feb 14, 2023 5:51 pm
u-u-u wrote: Tue Feb 14, 2023 5:04 pm Concerning suggestions: Maybe you find something in this list which you think might be nice to have as a setting for the controller script (or maybe even per project if that makes sense):
https://xjadeo.sourceforge.net/osc.html
Actually yes - I was just reluctant to instantly bother you ... :-)

For me it would be:
...
Thank you for the input! So I created the first issues for them over on github:
https://github.com/Trinitou/xjadeo_vide ... wig/issues

Post

Version 0.2 is out.

For the changelog, look here. :wink:

Post

Very cool, works great in a quick test here on Windows 11 Home. :-)
Can't wait to try it on a real project :-)

Cheers,

Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi
UrbanFlow.art · Instagram · YouTube

Post

Hey u-u-u,

today I tried my first real project with your tool and Xjadeo and run into a snag:
It is a short video of about 8 seconds that I want to play in a loop in Bitwig, jam over to find out how long I want it to be in the end and later put the soundtrack under the looped video in Resolve.
Now it seems that Xjadeo shows something like a 1 frame gap at the loop point, the "no video" cross flashes quickly - and that is a bit distracting.

When I play the video in Mediaplayer Classic, I get a smooth loop.
I have set the framerate correctly and set the sync-rate in Bitwigs preferences to 25 too, just in case.
I also tried different BPM but didn't find any setting that would prevent the flash.

Do you have any idea what I could do to get a smooth loop?
Or is that a limitation of the setup?
In that case I would probably create a longer video with several loops so that the flash isn't happening so often.

Cheers,

Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi
UrbanFlow.art · Instagram · YouTube

Post

Hi Tom,
I think we found a bug in XJadeo. I could reproduce it with a random video of mine. Maybe you can try out these things to confirm? ...
  1. In the script uncomment the following line:

    Code: Select all

    // host.println("Sent frame: " + lastFrame);
  2. Save the script and have a look into the Bitwig console script console: should print the sent frames now.
  3. Load your video with loop activated and move the Bitwig transport to the first position to where the missing frame happens.
  4. Look into the windows console where you started XJadeo: it should show the 'total frames' of the loaded video
  5. The 'sent frame' in the controller script console and the 'total frames' of the video should match exactly... which means XJadeo loops around the wrong number of frames!
Edit: created a pull request for XJadeo (see https://github.com/x42/xjadeo/pull/53)

Post

Cool, okay I will try that!
Thanks a lot.

Cheers,

Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi
UrbanFlow.art · Instagram · YouTube

Post

For the time being or if they take too long with adopting the pull request, we could workaround the issue by looping manually in the script:
  • Inside init(), add this to create a frame count setting:

    Code: Select all

    frameCountSetting = docState.getNumberSetting("Frame count", "File", 1, 10000, 1, "", 1);
    frameCountSetting .markInterested();
  • Inside flush()
    • replace the following line

      Code: Select all

      // updateFrame(Math.ceil(pos.get() * frameRateSetting.getRaw()));
      var frame = Math.ceil(pos.get() * frameRateSetting.getRaw());
      let frameCount = frameCountSetting.getRaw();
      if(loopSetting.get() === "On") {
         frame %= frameCount;
         if(frame < 0)
            frame += frameCount;
      }
      updateFrame(frame);
    • comment out the following line:

      Code: Select all

      // updateLoop(loopSetting.get() === "On"); // workaround: enum setting
Haven't tried out but hopefully this works ;)

Post

Currently in our cottage in the woods, but will try it out early next week when I'm back at the studio.
Thanks!
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi
UrbanFlow.art · Instagram · YouTube

Post

Is there something obvious that would prevent this javascript from working in Linux, once the batch file is adapted to reflect a Linux path ?

Post Reply

Return to “Controller Scripting”