50D - Is the framerate stable when I set the 24p recording?

Issue #934 resolved
Zak84 created an issue

First of all I want to congratulate with you and all the community of the magic lantern for the huge work made available for free. This release is awesome. I have just a little (?) problem with my 50D. When I start recording at 24fps, in postproduction I'm not able to obtain the audio synchronization even after the conformation of the clip at 23,976fps, or at 24fps or at 23,98 fps (since the header of the file is saved by the camera at 30fps, as described in the guide). I've made the conformation either with after effect and twixtor, either with Dumpster changing the timescale value in the header of the file. Is the framerate stable when I set the 24p recording? Which fps value have I to set in order to have the audio synchronization?

Merry Christmas to all! :-)

Comments (30)

  1. Zak84 reporter
    • changed status to open

    Hi, I've made some tests and I can't get proper audio sync, yet.

    Shooting at 25fps, after about 6 mins the audio was 5 frames out of sync. In a test made yesterday I noticed that after about 13 mins and 30 secs the audio was 13 frames out of sync.

    There is almost the same problem with the other fps values. This time I've not checked in Premiere the correct fps value to achieve the sync.

    Another thing that I've noticed is that after I enable the fps override in the ML menu, even if the ML menu says that the shutter speed is fixed at 1/fps value,

    I can change it by the small wheel on the shoulder of the camera.

    I've checked that the shutter speed really change, both watching on the camera lcd and the histogram on it. As a further evidence I've shot a CRT monitor and varying the shutter speed value I can see an effective change in speed drawing of the vertical refresh of the monitor.

    I'm not really sure the shutter speed that I set on camera is the effective one. Though the ML menu says that the shutter speed is fixed at 1/fps but I can change it anyway, if this fact can cause some problems, maybe, if there is a way to lock the function of the small wheel on the shoulder of the camera, it may be a solution.

    On the other hand, if the shutter speed that I can change with the small wheel is correct, why can't we use this function, and why does the shutter speed have to be locked at 1/fps?

    Anyway, I've made tests even without changing the shutter speed using the small wheel. Any time I turned off the camera and removed the batteries. At the next power on, after I set the shutter speed override I didn't change anymore the shutter speed using the small wheel.

    I hope that this information is useful for your work.

  2. Alex

    Hm... that's bad news. If my calculations are right, the closest approximations for 25p and 24p are 24.996 and 23.996.

    Check these:

    • 30fps with fps override enabled -> ML should display 30.000 and audio sync should be the same as with fps override off.
    • 25 and 24fps -> ML should display the numbers above.
  3. Zak84 reporter

    If I set fps override to 30fps ML displays 30.000, but if I set to 25 ML displays 25.042 and if I set to 24 ML displays 24.010, instead of the values that you reported above. I didn't try yet to sync the audio with a clip shot at 25 or 24 fps with this new version of the autoexec.bin.

  4. Alex

    It's OK, ML used a different approximation than I did with pen and paper. The audio sync test will tell the truth.

  5. Alex

    After revising the computations, found out that I have to subtract 1 from the timer register value.

    This results in 30.000, 25.000 and 24.000 fps, according to computations.

    To double-check, hit "don't click me" while recording, and it should display 563. Try doing this in both PAL and NTSC modes. This 563 (which is 0x563) is clock_frequency / fps / 1000 - 1. I need to find out clock_frequency (current guess: 41400000 Hz). Just in case you want to double-check my math.

  6. Zak84 reporter

    So... With the camera set both to PAL and NTSC mode by the Canon menu (I haven't seen this setting in any ML menus), when I set fps override at 25 fps, if I click on "Dont't click me" ML displays 677, instead if I set fps override at 24 fps ML displays 6bc.

  7. Zak84 reporter

    Another thing... when I set fps override at 24 fps ML says 24.013 and when I set fps override at 25 ML says 25.015.

  8. Zak84 reporter

    Ops... I didn't understand. Without fps override ML displays 563 both to PAL and to NTSC mode.

  9. Zak84 reporter

    Alex, I shot a clip at 25fps and I was able to achieve the sync at 24.988fps. Setting the speed in Premiere at 25fps I had 11 frames of delay after about 15 mins and 50 secs. I didn't try yet at other fps values.

  10. Alex

    Can't get 24.988 from my computations. So, this autoexec reprograms the FPS at the next step above (that is, instead of 0x677, it programs it at 0x676).

    If 24.998 is accurate, I expect this autoexec to sync at 25.003.

    Usage:

    • turn OFF fps override.
    • hit "don't click me" -> this will set the next step above 24.988 (which I believe to be 25.003).

    Another test that I'd like you to do. Check if FPS override set at 30 fps is really 30.000 fps (with this autoexec).

  11. Zak84 reporter

    With fps override disabled, I've turned on Live View, hit "don't click me" and started recording. With these settings I can sync the audio at 29.988 fps. Maybe there is something wrong in this autoexec. With fps override set at 30 fps ML displays 30.000.

    In the message above you reported just one time 24.998 fps instead of 24.988 fps. I'm sure that it is just a type error, anyway I thought it was appropriate to let you notice.

  12. Alex

    Yes, I wanted to say "24.988".

    To make sure the autoexec was correct, does it say something about 0x676 when you hit "don't click me"?

    With FPS override set at 30, what fps you need to achieve correct audio sync?

  13. Zak84 reporter

    Excuse me but I was very busy in the past days.

    I made the test just now and I can't tell you nothing about the value 676 because when I hit "don't click me" ML doesn't display anything both with fps override enabled and fps override disabled.

    Subsequently I've shot a clip at 30 fps with fps override enabled and I've been able to sync the audio with a good precision, setting in Premiere 29.9868 fps.

    However don't consider these values of fps extremely accurate. These are the values that allow me to achieve the audio sync with about 15 mins of recording.

    If it was possible recording for a longer time, maybe the fps value to set would be a little different, because Premiere timeline is at 30 fps and to reproduce a clip at 29.9868 fps has to do a kind of pulldown.

  14. Alex

    I repeat.

    """

    Usage:

    • turn OFF fps override.
    • hit "don't click me" -> this will set the next step above 24.988 (which I believe to be 25.003).

    """

    ML won't display it. Tell me at which value you can sync the audio.

  15. Zak84 reporter

    As I told you in message number 19, I've already made this test because you asked me for it in message number 18. With fps override disabled, I've turned on Live View, hit "don't click me" and started recording. With these settings I can sync the audio at 29.988 fps. That's why I thought that may there be something wrong in the function "dont click me" of the latest autoexec.bin. To be sure I repeated the test and this time I was able to sync at 29.985. I think this little differences of values derive from a kind of pull down operated by Premiere to conform the fps of the clip to the fps of the timeline, and maybe they are unavoidable until the fps of the clip will be a standard value (e.g. 25 - 30 - 29,97, ecc...) adopted by the editing softwares, and until they can be adapted to the timeline fps values by a standard pulldown (e.g. 3:2).

    Subsequently (in message number 20), you asked me to tell you at which fps value I can achieve the sync with FPS override set at 30 and I answered you that I can achieve the sync at 29.9868 fps.

  16. Zak84 reporter

    Hi, Alex.

    I was able to make some tests only this afternoon.

    For now I could test only at 30fps without fps override, at 30 fps with fps override and at 25fps with fps override. All in PAL mode.

    These are the results of the tests:

    • 30 without fps override: 29.986
    • 30 with fps override: 29.964
    • 25 with fps override: 24.973

    By these results I think that the most important information derives from the 30 fps without fps override result. I wasn't able to achieve a precise sync neither at 30fps without fps override.

    I've made also some more tests with the old versions of magic lantern where there were still no fps override functions. The result at 30fps was almost the same. I can sync at 29.985 fps instead of 29.986 fps of the latest autoexec, but I think that this is an irrilevant error.

    I'm always willing to do more tests.

  17. Alex

    Very interesting. So, after re-doing the computations with these numbers, I've got:

    • clock frequency: somewhere between 41349315 and 41350694 -> rounded to 41350000
    • 30fps is actually 29.985
    • 30fps with ML override is 29.963 -> I'll change it to 29.985
    • another possible approximation for 30fps is 30.007
    • 25.000 fps is possible (41350000 / 1654 = 25000, 41350000 / 25 = 1654)

    This autoexec (#27) should display the proper values for syncing. It might use different approximations according to PAL/NTSC setting (in NTSC it will try to choose 29.970 and 24.976, in PAL it will try 25.000 and 24.000, but in all cases, the number displayed should be OK for syncing).

  18. Zak84 reporter

    I've tested at 25 fps in PAL mode and I can sync at 25.034 instead of 25.030 as ML says.

    This is the only test that I've made for now.

  19. Alex

    With clock frequency = 41380585 I can confirm 29.986, 29.964, 24.973 and 25.034.

    The exact value is difficult to find, because, unlike in other cameras, Canon did not use standard values for FPS (so I'm just doing some kind of "best fit" which explains all frequencies you are able to sync at).

    ----------

    Technical: I've used this function to compute a best fit:

    def fps_fit(clock_freq, sync_freqs):
        E = []
        for s in sync_freqs:
            timer_value = round(clock_freq / (s * 1000))
            e = clock_freq / timer_value / 1000 - s
            E.append(e)
        E = array(E)
        return norm(E)
    
    def fps_opt(lo, hi, sync_freqs):
        E = []
        R = range(lo, hi)
        for i in R:
            e = fps_fit(i, sync_freqs)
            E.append(e)
        plot(E), show()
        print R[argmin(E)], E[argmin(E)]
    
    fps_opt(41370000, 41390000, [29.986, 29.964, 24.973, 25.034])
    41380585 0.000479376551128
    

    If you can provide data for more FPS values (even for non-standard fps values.. for example 27fps, whatever you may think of), I can compute a better approximation.

  20. Log in to comment