Burkhard Plaum | 1 Jul 10:46
Picon
Favicon
Gravatar

Re: Scheduler:

Hi,

Christian Thaeter wrote:
> Anton Yakovlev wrote:
>> Hi, guys!
>>
>> Two simple questions:
>> 1) How to interpret job's gavl_time_t value from scheduler's point of
>> view? I mean, how can I understand, that it's time to fire up some job?
> 
> The job's time should be copied into the schedulers table, that needs
> more memory space, but far less pointer dereferencings (i saied that
> already). Then the heap algorithm can just do (64bit type) comparsions
> (less than) to sort it. Note that the scheduler runs on real/absolute
> time. Gavl has no much provisions for this (Burkhard, shall we do our
> own stuff here or do you want to include some simple time functions
> which in the gavltime api?). 

There is a simple timer already (gavl_timer_t), which works perfectly
for me. The flaw is, that it's based on gettimeofday(), the
most portable solution. I would like to implement it with
clock_gettime(CLOCK_MONOTONIC, ...), but that must be optional
since I'm sure that MinGW (where gavl was ported to) doesn't have
clock_gettime().

If you can live with the current gavl_timer_t API, you can use it.
If you think you need more (or different) functionality, it would
better to do your own stuff.

Burkhard
(Continue reading)

Juan Pablo Bouza | 3 Jul 15:31
Picon

Re: Audio editing

Hey!!
 
Well, about the Script that connects Blender with Ardour through Jack, I found out that it didn´t support frame rates with fractions, such as 23.976.............But, I wrote to the author of the script and he was kind enough to make a patch to enable this kind of frame rate!!
 
Here is the link to the new script
 
 
 
I didn´t mention that this script also needs a patched PyJack, which can be downloaded here:
 
 
Well, I hope this helps!!
 
 
 
 
 
 
 
 
#!BPY """ Name: 'BPyJack' Blender: 249 Group: 'Animation' Tooltip: 'makes jack and blender synced' """ # Depends from PyJack-0.1: # ( http://sourceforge.net/projects/py-jack/ ) # patched with my patch: # http://sourceforge.net/tracker/index.php?func=detail&aid=1871688&group_id=207557&atid=1002156 ## # Author: IL'dar AKHmetgaleev aka AkhIL # e-mail: akhilman at gmail dot com # web: http://akhilman.blogspot.com # # This code is licensed under # Creative Commons Attribution 3.0 Unported License # http://creativecommons.org/licenses/by/3.0/ ## # latest update at 2009-07-02 05:00 import time from Blender import * import jack play_button = Draw.Create(False) BEV_PLAY = 1 BEV_EXIT = 2 nontick = 0 jackframe = 0 blenframe = 0 def tick(): global nontick global jackframe global blenframe # getting current values cblenframe = Get("curframe") cjackframe = jack.get_current_transport_frame() fps = Scene.GetCurrent().getRenderingContext().fps fpsBase = Scene.GetCurrent().getRenderingContext().fpsBase rate = jack.get_sample_rate() factor = int(rate/(fps/fpsBase)) # checking is blender curent time chenged # if yes setting jack's time to same if cblenframe != blenframe: jackframe = cblenframe*factor jack.transport_locate(jackframe) while jack.get_current_transport_frame() != jackframe: time.sleep(0.01) # waiting till jack applyed transport blenframe = cblenframe # checking jack's time and setting blender's if chenged elif cjackframe != jackframe: blenframe = cjackframe/factor Set("curframe",blenframe) Window.RedrawAll() jackframe = cjackframe # putting event for next tick id = Window.GetAreaID() Window.QAdd(id, Draw.TIMER3, 0, 1) nontick = 0 # redraw gui if transport state is chenged if (jack.get_transport_state == jack.TransportStopped \ and play_button.val) \ or (jack.get_transport_state != jack.TransportStopped \ and not play_button.val): Draw.Redraw() def event (evt,val): global nontick nontick = 0 if evt == Draw.TIMER3 or nontick > 1: tick() # doing tick nontick += 1 def button_event (evt): global play_button #print "button event: %s" % evt if evt == BEV_PLAY: if play_button.val == 1: jack.transport_start() else: jack.transport_stop() elif evt == BEV_EXIT: jack.detach() Draw.Exit() def gui (): global play_button BGL.glClearColor(*map(lambda x: x/255.0, Window.Theme.Get()[0].get('buts').back)) BGL.glClear(BGL.GL_COLOR_BUFFER_BIT) area_size = Window.GetAreaSize() Draw.BeginAlign() if jack.get_transport_state() == jack.TransportStopped: play_button.val = 0 else: play_button.val = 1 play_button = Draw.Toggle(">", BEV_PLAY, 1, 1, area_size[0]-20,area_size[1]-2, \ play_button.val,"toggle play") Draw.PushButton("X", BEV_EXIT, area_size[0]-20, 1, 18, area_size[1]-2, \ "Exit from BPyJack") Draw.EndAlign() Draw.Register(gui, event, button_event) try: jack.attach("/var/run/jack") except jack.UsageError: pass # continue using exist jack if scirpt crashed but jack still online blenframe = Get("curframe") jackframe = jack.get_current_transport_frame() jack.transport_stop() tick()
_______________________________________________
Lumiera mailing list
Lumiera@...
http://lists.lumiera.org/cgi-bin/mailman/listinfo/lumiera
Christian Thaeter | 4 Jul 19:48

Re: Audio editing

Juan Pablo Bouza wrote:
> Hey!!
>  
> Well, about the Script that connects Blender with Ardour through Jack, I
> found out that it didn´t support frame rates with fractions, such as
> 23.976.............But, I wrote to the author of the script and he was
> kind enough to make a patch to enable this kind of frame rate!!

Just a note: using floating point for framerates is almost always a bad
idea. Rational numbers (numerator/demominator) are much better because
the underlying math is 'exact' while floating point types are 'inexact'
(the internal representation in the computer is only a approximation),
thus floats would add some drift and rounding errors over time.

	Christian
Ichthyostega | 5 Jul 16:36
Picon

Re: Audio editing


> Juan Pablo Bouza wrote:
>> ...that it didn´t support frame rates with fractions, such as 23.976....

Christian Thaeter schrieb:
> Just a note: using floating point for framerates is almost always a bad idea.
> Rational numbers (numerator/demominator) are much better...

And additionally, could you please enlighten me what would be the prospective
use of such a fractional frame rate for audio? For everything I am aware off,
the frame rate was fixed to a limited set of values dictated by hardware,
eg. 8000, 44100, 48000, 96000, 192000, etc.

But maybe I'm overlooking an interesting use case here?

Cheers,
Hermann

Juan Pablo Bouza | 5 Jul 17:05
Picon

Re: Audio editing

The FPS thing is to synchronize the time of the application with jack, in this case tha application is blender. Blender manages time with fps values.
So the script tries to synchronize the fps values of blender with jack, so that the cursors or playheads of all the applications are in sync.
When you move the playhead in blender, the playhead in Ardour also moves and viceversa. That way you can edit with both apps as one.

So, an audio applications doesn't work with fps, but a video editing application does, so this is a way synchronizing both applications.  





>
> And additionally, could you please enlighten me what would be the prospective
> use of such a fractional frame rate for audio? For everything I am aware off,
> the frame rate was fixed to a limited set of values dictated by hardware,
> eg. 8000, 44100, 48000, 96000, 192000, etc.
>
> But maybe I'm overlooking an interesting use case here?
>
> Cheers,
> Hermann
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkpQumYACgkQZbZrB6HelLJ7WwCgpXx1ublG1JuZM2/k1tQ/TPyy
> 4loAn3r5iYGz8BQ9nlLL1jS5SHRl3ZOe
> =e5eQ
> -----END PGP SIGNATURE-----
> _______________________________________________
> Lumiera mailing list
> Lumiera-aLEFhgZF4x639dL7tAm8iNi2O/JbrIOy@public.gmane.org
> http://lists.lumiera.org/cgi-bin/mailman/listinfo/lumiera

Tus elecciones hablan por vos. ¡Conocé quién sos realmente!
_______________________________________________
Lumiera mailing list
Lumiera@...
http://lists.lumiera.org/cgi-bin/mailman/listinfo/lumiera
Christian Thaeter | 5 Jul 17:15

Re: Audio editing

Ichthyostega wrote:
>> Juan Pablo Bouza wrote:
>>> ...that it didn´t support frame rates with fractions, such as 23.976....
> 
> Christian Thaeter schrieb:
>> Just a note: using floating point for framerates is almost always a bad idea.
>> Rational numbers (numerator/demominator) are much better...
> 
> And additionally, could you please enlighten me what would be the prospective
> use of such a fractional frame rate for audio? For everything I am aware off,
> the frame rate was fixed to a limited set of values dictated by hardware,
> eg. 8000, 44100, 48000, 96000, 192000, etc.
> 
> But maybe I'm overlooking an interesting use case here?

That are sample rates, dunno if one wants to call single audio samples a
frame :)...

Anyway, video frame rates coming into play when one wants to sync audio
with video which was the case here. Even worse, a lot of (consumer)
cameras clock drift depending on temperature, moon-phase and mood, the
audio sample rate is not exactly 48kHz but some Hz more or less (i'd
guess frame rates may drift too). Some people told me that this gives
noticeable audio desyncs depending if the camera was warm or cold. We'll
face endless fun with such things :). I think some automation for
frame/sample rate fine adjustment controling some noise gate
(extend/compact silent phases) or frame drop (or doubling) might be a
forseeable tool to correct that.

	Christian

_______________________________________________
Lumiera mailing list
Lumiera <at> lists.lumiera.org
http://lists.lumiera.org/cgi-bin/mailman/listinfo/lumiera
hendrik | 5 Jul 21:45

Re: Audio editing

On Sun, Jul 05, 2009 at 05:15:38PM +0200, Christian Thaeter wrote:
> Ichthyostega wrote:
> >> Juan Pablo Bouza wrote:
> >>> ...that it didn´t support frame rates with fractions, such as 23.976....
> > 
> > Christian Thaeter schrieb:
> >> Just a note: using floating point for framerates is almost always a bad idea.
> >> Rational numbers (numerator/demominator) are much better...
> > 
> > And additionally, could you please enlighten me what would be the prospective
> > use of such a fractional frame rate for audio? For everything I am aware off,
> > the frame rate was fixed to a limited set of values dictated by hardware,
> > eg. 8000, 44100, 48000, 96000, 192000, etc.

Then you might want exact numbers like 78334/48000.

> > 
> > But maybe I'm overlooking an interesting use case here?
> 
> That are sample rates, dunno if one wants to call single audio samples a
> frame :)...
> 
> Anyway, video frame rates coming into play when one wants to sync audio
> with video which was the case here. Even worse, a lot of (consumer)
> cameras clock drift depending on temperature, moon-phase and mood, the
> audio sample rate is not exactly 48kHz but some Hz more or less (i'd
> guess frame rates may drift too). Some people told me that this gives
> noticeable audio desyncs depending if the camera was warm or cold. We'll
> face endless fun with such things :). I think some automation for
> frame/sample rate fine adjustment controling some noise gate
> (extend/compact silent phases) or frame drop (or doubling) might be a
> forseeable tool to correct that.

So the audio sample rate and the video frame rate need to be driven by 
the same timer.  If this is'nt done in a videw camera, the camera is 
designed broken.  It we're talking about synching independently 
recorded audi and video (like comparing different people's recordings 
of the Kennedy assassination), it takes real work in the editor.  But 
using floating point for anything but compatibility with another 
application's floating point just introduces additional errors.

-- hendrik
Ichthyostega | 5 Jul 22:30
Picon

Re: Audio editing

hendrik@... schrieb:
> On Sun, Jul 05, 2009 at 05:15:38PM +0200, Christian Thaeter wrote:
>> Ichthyostega wrote:
>>> ... For everything I am aware off, the frame rate was fixed to a limited
>>> set of values dictated by hardware, eg. 8000, 44100, 48000, 96000,
>>> 192000, etc.

>>> Christian Thaeter schrieb:
>> That are sample rates, dunno if one wants to call single audio samples a 
>> frame :)...

yes, "audio sample frame" is a common term. Which seemed to have confused
me ;-)  because Juan probably referred to the NTSC video framerate (23.976)
-- thanks for pointing that out!

I think, for the most common video framerates, we should provide fixed
identifiers on the API/GUI (and internally represent them as rational numbers).

>> .... Even worse, a lot of (consumer) cameras clock drift depending on
>> temperature, moon-phase and mood, the audio sample rate is not exactly
>> 48kHz but some Hz more or less (i'd guess frame rates may drift too). Some
>> people told me that this gives noticeable audio desyncs depending if the
>> camera was warm or cold. We'll face endless fun with such things :).
Yes, can confirm that. Both image and sound framerate can drift on consumer
cameras, which gives you endless headaches esp. when filming a musical event
with several such cameras....

>> I think some automation for frame/sample rate fine adjustment controling
>> some noise gate (extend/compact silent phases) or frame drop (or doubling)
>> might be a forseeable tool to correct that.

we could try to find a solution here; but I'm rather sceptical with regards to
getting sound automatically synched to the image. Maybe a semi-automatic tool
could work. But even a tool of the sort "pin this (mouse click in waveform)
sound elm. to that video frame and stretch sound if necessary" would be a great
help for this tedious task...

	Hermann
Christian Thaeter | 5 Jul 22:59

Re: Audio editing

Ichthyostega wrote:
> hendrik@... schrieb:
>> On Sun, Jul 05, 2009 at 05:15:38PM +0200, Christian Thaeter wrote:
>>> Ichthyostega wrote:
>>>> ... For everything I am aware off, the frame rate was fixed to a limited
>>>> set of values dictated by hardware, eg. 8000, 44100, 48000, 96000,
>>>> 192000, etc.
> 
>>>> Christian Thaeter schrieb:
>>> That are sample rates, dunno if one wants to call single audio samples a 
>>> frame :)...
> 
> yes, "audio sample frame" is a common term. Which seemed to have confused
> me ;-)  because Juan probably referred to the NTSC video framerate (23.976)
> -- thanks for pointing that out!
> 
> I think, for the most common video framerates, we should provide fixed
> identifiers on the API/GUI (and internally represent them as rational numbers).
> 
>>> .... Even worse, a lot of (consumer) cameras clock drift depending on
>>> temperature, moon-phase and mood, the audio sample rate is not exactly
>>> 48kHz but some Hz more or less (i'd guess frame rates may drift too). Some
>>> people told me that this gives noticeable audio desyncs depending if the
>>> camera was warm or cold. We'll face endless fun with such things :).
> Yes, can confirm that. Both image and sound framerate can drift on consumer
> cameras, which gives you endless headaches esp. when filming a musical event
> with several such cameras....
> 
>>> I think some automation for frame/sample rate fine adjustment controling
>>> some noise gate (extend/compact silent phases) or frame drop (or doubling)
>>> might be a forseeable tool to correct that.
> 
> we could try to find a solution here; but I'm rather sceptical with regards to
> getting sound automatically synched to the image. Maybe a semi-automatic tool
> could work. But even a tool of the sort "pin this (mouse click in waveform)
> sound elm. to that video frame and stretch sound if necessary" would be a great
> help for this tedious task...

I intend to do this semi-automatically, that is, the user has to pin the
time points and events, but with some automation curves and other tools
lumiera will be able to find the the best position where to
stretch/compress the footage, kindof latex for video :). Events you want
to sync (visible and audible hints, like someone strumming a guitar or
banging a drum) are also the points in time where distortion would be
most noticeable, so let the software figure out where to do the syncing
at best (with some manual assistance) independently from this sync
points. That should be much better than completely manually fiddeling.

I am thinking about some kind of automation curve which acts like a
kindof frequency modulation where one can increase/decrease the
frame/sample rate slightly (or even more). Sidenote: We might want such
independently for the timecode too, long time syncronization of footage
done with different cameras needs reliable (corrected) timecodes which
need to be brought into sync.

Cavat for the 'workflow' thinkers: does this need some special
preparation/gui mode? or just loading all footage from different cameras
basically timecode aligned below each other and then do some semi-manual
preprocessing to correct timecode offsets and modulations for all clips
before doing anything else?

	Christain

> 
> 	Hermann
> 
> _______________________________________________
> Lumiera mailing list
> Lumiera@...
> http://lists.lumiera.org/cgi-bin/mailman/listinfo/lumiera
Christian Thaeter | 5 Jul 23:21

Next Developer Meeting

Last time we forgot to acknowledge the date for the next meeting. I just
talked with ichthyo on irc about it and we concluded that we want a time
where Anton can attend too. Wednesday won't work earlier for ichthyo.
The idea for now is to meet at Thursday 9. Jul at 16:00 UTC. Joel, Anton
does that work for you? if not, please suggest alternatives. Preferably
same day, maybe later (or earlier?).

	Christian

Gmane