[brainstorm] Digital clapper board

Started by Roman, September 26, 2012, 10:16:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

1%


msleep(100);
int current_iso = FRAME_ISO;
    int switched_iso = 104;
FRAME_ISO = switched_iso | (switched_iso << 8);
generate_beep_tone(buf1,1000);
FRAME_ISO = current_iso | (current_iso << 8);
    msleep(100);
FRAME_ISO = switched_iso | (switched_iso << 8);
generate_beep_tone(buf1,1000);
FRAME_ISO = current_iso | (current_iso << 8);
msleep(100);
FRAME_ISO = switched_iso | (switched_iso << 8);
generate_beep_tone(buf1,1000);
FRAME_ISO = current_iso | (current_iso << 8);


This should be working but it is not. lens_info.raw_iso did not work either.


msleep(100);
int r = lens_info.iso_equiv_raw ? lens_info.iso_equiv_raw : lens_info.raw_iso_auto;
    int raw_iso0 = (r + 3) & ~3;
    NotifyBox(1000,"StartBlanking");

    lens_set_rawiso(raw_iso0+8);
generate_beep_tone(buf1,1000);
lens_set_rawiso(raw_iso0);
    msleep(100);
lens_set_rawiso(raw_iso0+8);
generate_beep_tone(buf1,1000);
lens_set_rawiso(raw_iso0);
    msleep(100);
lens_set_rawiso(raw_iso0+8);
generate_beep_tone(buf1,1000);
lens_set_rawiso(raw_iso0);
memset(YUV422_HD_BUFFER_1, 0xf, 1920*1080*2);
    memset(YUV422_HD_BUFFER_2, 0xf, 1920*1080*2);
struct vram_info *hd_vram = get_yuv422_hd_vram();
memset(hd_vram->vram, 0xf, 1920*1080*2);
memset(YUV422_HD_BUFFER_DMA_ADDR, 0xf, 1920*1080*2);

NotifyBox(1000,"DoneBlanking!");


I don't get to see the notify boxes.

Figured it out... it was code cache...

Sync frames are dropping in, will have to see how well they actually sync.

Dropped them around the beeps.

a1ex


1%

It didn't work tho, iso doesn't change... or I need to pick a different number. I'm able to inject white or black frames but I have to get the timing right. I'll crib  a little from HDR doing odd/even and see if that works.

If you override the buffer too long, LV freezes and eventually get an assertion. If you get the timing wrong the frame doesn't show up or is spread out.

a1ex

Yea, timing is the big issue here.

ISO override works best from the same place as HDR video (or smooth ISO transitions). Maybe it helps.

1%


msleep(6*video_mode_fps);
static int odd_frame = 0;
    static int frame=0;
int count=0;

while (count <= video_mode_fps/6 && recording)
{

frame = MVR_FRAME_NUMBER;
odd_frame = frame % 2;
// bmp_printf(FONT_MED, 10,120, "Frame: %d", frame);
    if (odd_frame==1)
{ memset(YUV422_HD_BUFFER_1, 0, 1920*1080*2);
generate_beep_tone(buf1, (1000/video_mode_fps));
// NotifyBox(1000,"Sync!");
//bmp_printf(FONT_MED, 10,120, "Odd Frame: %d", odd_frame);
       msleep(wtf goes here);
count++;
}   



This is "working* but timing is inconsistent from the audio peaks and looking at the frames (not evenly spaced). I hit some frames at the top, some at the bottom, some at top half, some at bottom half. Gets better further in but that wastes too much "film".

*I can't get that msleep right, either too soon or too late. Was also interfering with rec picture style until changed.

Got ISO changing working but its too slow... need to try digic or ML gain, should be easier.

1%

Had some luck last night. I managed to align a clip via beeps and iso however a few problems remain.

*Loop goes around ~6 times. There are 6 beeps, they aren't all evenly spaced. There are only 2 or 3 strings of iso raised frames so ISO changing is too slow.
*Changing iso alters it for 6 frames which is odd. Should be just 1.
*Sync frames at start interfere with Rec picture style (found msleep # for this though)
*too many injected 1920x1080 "0" frames crash playback (in cam) or rec start. Timing is difficult too. What frame did it really go into. Supposed to be at 3 but you get 1/2 of a black frame on 4 or 7 or 8, etc. Also drifts further as loop runs.
*smooth iso interferes with iso altered frames
*iso altered frames are difficult to see in all conditions.

Any ideas on what else to try? Maybe a better way of writing something on the HD buffer?

Iso altering doesn't seem to cut it. Need an accurate way to inject a black square (or any mark) right on the frame I want. The beeps are fast enough, if only this part was we'd have something.

Found some more things:
* No delay between external/internal if there is one then its 1 delay for everything.
* Smaller black frames are writen quicker. Still hard to tell which sync mark goes with what.

Got another idea:

Instead of marking the video, we could just generate a beep on odd frames and then you line it up based on people talking, etc. A rough alignment is easy, its the finer one that screws everything up. Unfortunately I'm having a problem getting the beeps to show up consistently and exactly "on" the frames. If I can do that sync can be achieved down to the frame level and from dicking with it, that is probably enough as it gives you a reference point between the video/audio.

tin2tin

A really simple idea, if the beep is precise enough, could be to place it on the very first frame of the video rrcording, but the duration would have to be 1 frame.

Roman

Hey 1% I noticed in another thread you mentioned that taking a pic while in video mode ends up cutting out 3 frames from the video.

Any way of perhaps taking a dummy picture or activating the shutter or something?

Although, increasing shutter count would probably not be a very popular solution.

1%

Problem is that isn't consistent and damages the video. I'm getting beeps to land on a single frame but the duration is only how long it took to write that frame which in 24p is like ~41ms. The first beep *is* landing consistently in the same spot no matter the video mode.  Don't know how it will do with actual interleaved canon audio but sync is less of a problem there.

A bigger problem I'm having is that at high bit rates I get some distortion/tearing in the audio like a few MS is missing. The wave forms are offset. Don't know what will help there, I've tried uint16 and uint32 buffers but I don't think that made it better, maybe even worse. It does seem to sound better with 16 though, more like a real recorder. Should also let other cameras besides 600D record stereo wav. If this is fixed, that is a change that could go into the ML tree. With a way to sync it this beats canon audio hands down.

Roman

Hey I just had a random thought about the synch issue today.

I know with the Canon 600D at least, in the 'play' menu there is an edit function.

With 'cut start' and 'cut end' and one or two other integrated functions for trimming the video.

(I'd say most people have never used this, as it sucks)

Any chance of hijacking these perhaps, to help try cut the WAV and/or .MOV to sync with each other?

If the audio lagged by xzy amount each time, you could cut the start of the clip to match it.

Although, sounds like its unpredictable at the moment.

1%

I have to get wav audio to stop speeding up/slowing down. I can try injecting into canon audio buffer and see what happens there. Saw some stuff in FW on 600D about stoppiing MVR related to audio so I should investigate there too maybe its sync related and not just bandwith/cpu/overhead.

Still some more work on this.

tin2tin

Have you reached a dead end on this? What about a camera beep, when the record button is hit. Is that possible? (so the external audio recording of the beep can be aligned with the first frame of the video)

nanomad

There's a lag between the rec button is pressed event and the actual start of recording (at least on my camera)
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

Camera beep when you press record is already done, not sure how precise is for sync though.

1%

Given up for now because audio speeds up/slows down. I was injecting beeps directly into the buffer.

QuoteThere's a lag between the rec button is pressed event and the actual start of recording (at least on my camera)

Might explain audio being shorter or longer than the actual video clip.