Forums > Jitter

Capture DV stream to disk (unprocessed)

May 29, 2006 | 10:36 pm

Hi,
we are working on a project where we capture live video from a DV
camcorder to a buffer.
From this buffer we play back the frames with some not-too-
complicated proccesing.
We intend to go from DV to 720p or 1080p, budget permitting.
Playback starts before capturing has ended. So it is read-while-write.

The delay between capture and playback is 4 to 10 minutes.
So the buffer has to be disk based, not RAM based.
We chop the footage up into one minute segments, to deal with
simultaneous reading
and writing, and to deal with variable delay times.
No problem here.

We want to store the frames on disk in compressed form, to reduce
disk I/O.
Ideally we capture a DV compressed frame from FireWire and store it
as-is on disk.
This we managed to do with WinDV. http://windv.mourek.cz/
In fact this is what most capture apps do, like the one you have in
iMovie or FCP.
The special thing about WinDV is that it does the chopping for us,
every N frames.

We did not manage to do this with [jit.dx.grab]. It is possible to
capture frames to disk
without decompressing and recompressing this way, but it is not
possible to chop up
the incoming stream. if we try to change the file captured to, by
first closing the current file,
and opening a new file, all within one frame as not to drop any, we get
"jit.qt.grab error -9402 setting bottlenecks"

The problem with the WinDV solution is that it is not possible to
encapsulate it
into one idiot-proof max standalone.
Right now we have a very arcane solution to control WinDV from max,
which is easily broken.

Does anyone here have a solution to capture and chop a DV stream to
disk under max control?
aTdHvAaNnKcSe
-jennek


May 30, 2006 | 3:41 pm

Hi,

Have you considered appending every newly grabbed movie to your currently playing movie with [jit.qt.movie]‘s insert command? This way you construct your currently playing movie with a series of quicktime references, saving disk space.

For the frame dropping i’d say route your [jit.qt.grab] through a gate to two alternating [jit.qt.record]s.

Cheers,
Mattijs


May 30, 2006 | 6:57 pm

> On 30 May 2006, at 17:41, Mattijs Kneppers wrote:

> Have you considered appending every newly grabbed movie to your
> currently playing movie with [jit.qt.movie]‘s insert command? This
> way you construct your currently playing movie with a series of
> quicktime references, saving disk space.

no we have not considered it.
While I understand what reference movies are, I fail to see what
benefit it would bring
in this situation

> For the frame dropping i’d say route your [jit.qt.grab] through a
> gate to two alternating [jit.qt.record]s.
this will work for the file splitting, but it wil decompress and
recompress every frame, which is a waste of CPU
that we cannot afford.

Thanks for your reaction
-jennek


May 31, 2006 | 12:23 pm

> no we have not considered it.
> While I understand what reference movies are, I fail to see what
> benefit it would bring
> in this situation

I was wondering how you would bring the chopped captures back into the patch. Appearantly you have already found another nice solution for that.

> this will work for the file splitting, but it wil decompress and
> recompress every frame, which is a waste of CPU
> that we cannot afford.

I can imagine. I can not think of another solution though. I tried two alternating jit.qt.grabs in the patch below. It works, there are no (troublesome) errors but it misses frames.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 663 452 30 196617 t b b;
#P message 683 471 29 196617 stop;
#P message 663 489 33 196617 close;
#P comment 67 35 51 196617 2) record;
#N vpatcher 20 74 659 390;
#P button 47 31 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 64 31 65 196617 populate lists;
#P window linecount 0;
#P newex 413 146 60 196617 loadmess 1;
#P toggle 499 189 15 0;
#P window linecount 1;
#P message 499 207 75 196617 write_audio $1;
#P toggle 413 189 15 0;
#P message 413 207 78 196617 write_video $1;
#P window linecount 0;
#P newex 96 140 25 196617 iter;
#P newex 191 161 38 196617 t clear;
#P newex 329 161 38 196617 t clear;
#P message 251 206 45 196617 input $1;
#P user ubumenu 251 185 145 196617 0 1 1 0;
#X add ADVC-100;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P newex 251 161 75 196617 prepend append;
#P newex 251 140 25 196617 iter;
#P message 96 206 58 196617 vdevice $1;
#P user ubumenu 96 185 145 196617 0 1 1 0;
#X add "DV Video";
#X add "IIDC FireWire Video";
#X add "USB Video Class Video";
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 96 161 75 196617 prepend append;
#P newex 96 110 112 196617 route vdevlist inputlist;
#P newex 50 86 56 196617 jit.qt.grab;
#P message 61 68 59 196617 getinputlist;
#P message 61 50 59 196617 getvdevlist;
#P outlet 96 226 15 0;
#P connect 1 0 3 0;
#P connect 2 0 3 0;
#P connect 21 0 1 0;
#P connect 21 0 2 0;
#P connect 3 1 4 0;
#P connect 4 0 14 0;
#P connect 14 0 5 0;
#P connect 5 0 6 0;
#P fasten 13 0 6 0 196 181 101 181;
#P connect 6 0 7 0;
#P connect 17 0 0 0;
#P connect 15 0 0 0;
#P connect 7 0 0 0;
#P connect 11 0 0 0;
#P fasten 4 0 13 0 101 137 196 137;
#P fasten 4 1 8 0 152 134 256 134;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P fasten 12 0 10 0 334 180 256 180;
#P connect 10 0 11 0;
#P fasten 4 1 12 0 152 134 334 134;
#P connect 19 0 16 0;
#P connect 16 0 15 0;
#P connect 19 0 18 0;
#P connect 18 0 17 0;
#P pop;
#P newobj 330 517 54 196617 p settings;
#B color 5;
#P message 66 138 33 196617 set 0;
#P newex 65 96 21 196617 t 0;
#P newex 65 73 41 196617 sel 1 0;
#P newex 50 53 40 196617 t i i b;
#P toggle 50 35 15 0;
#P newex 50 117 64 196617 metro 5000;
#P toggle 255 517 15 0;
#P toggle 171 517 15 0;
#P newex 29 156 27 196617 !- 1;
#P number 525 208 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N counter;
#X flags 0 0;
#P newobj 525 189 66 196617 counter;
#P newex 63 156 27 196617 t i b;
#P newex 525 225 27 196617 t b i;
#P message 474 292 29 196617 stop;
#P message 432 352 357 196617 write "Macintosh HD:/Users/jeroenhofs/Desktop/12.mov" 30. jpeg normal;
#P message 446 329 30 196617 open;
#P message 460 311 33 196617 close;
#P newex 432 272 53 196617 t b b b b;
#P message 105 292 29 196617 stop;
#P button 331 208 15 0;
#P newex 331 226 76 196617 opendialog fold;
#P newex 331 245 221 196617 sprintf set write "%s%i.mov" 30. jpeg normal;
#P message 63 352 357 196617 write "Macintosh HD:/Users/jeroenhofs/Desktop/12.mov" 30. jpeg normal;
#P message 77 329 30 196617 open;
#P message 91 311 33 196617 close;
#P toggle 50 139 15 0;
#P newex 63 272 53 196617 t b b b b;
#P newex 63 251 41 196617 sel 1 0;
#P newex 271 517 56 196617 jit.qt.grab;
#P newex 187 517 56 196617 jit.qt.grab;
#P comment 347 208 100 196617 1) select record dir;
#P connect 5 0 22 0;
#P connect 26 0 27 0;
#P connect 27 0 25 0;
#P connect 25 0 5 0;
#P connect 30 0 5 0;
#P connect 5 0 19 0;
#P connect 19 0 3 0;
#P connect 3 0 4 0;
#P fasten 9 0 8 0 336 346 68 346;
#P connect 4 0 8 0;
#P connect 27 1 28 0;
#P connect 28 0 29 0;
#P connect 27 2 30 0;
#P connect 4 1 7 0;
#P connect 4 2 6 0;
#P connect 4 3 12 0;
#P fasten 5 0 23 0 55 487 176 487;
#P lcolor 13;
#P fasten 34 0 1 0 688 513 192 513;
#P fasten 33 0 1 0 668 513 192 513;
#P hidden connect 31 0 1 0;
#P lcolor 1;
#P fasten 7 0 1 0 82 487 192 487;
#P lcolor 13;
#P fasten 8 0 1 0 68 487 192 487;
#P lcolor 13;
#P fasten 17 0 1 0 479 487 192 487;
#P lcolor 13;
#P fasten 14 0 1 0 465 487 192 487;
#P lcolor 13;
#P fasten 22 0 24 0 34 495 260 495;
#P lcolor 14;
#P fasten 34 0 2 0 688 513 276 513;
#P fasten 33 0 2 0 668 513 276 513;
#P hidden connect 31 0 2 0;
#P lcolor 1;
#P fasten 6 0 2 0 96 495 276 495;
#P lcolor 14;
#P fasten 12 0 2 0 110 495 276 495;
#P lcolor 14;
#P fasten 15 0 2 0 451 495 276 495;
#P lcolor 14;
#P fasten 16 0 2 0 437 495 276 495;
#P lcolor 14;
#P connect 11 0 10 0;
#P connect 10 0 9 0;
#P connect 18 0 9 0;
#P connect 3 1 13 0;
#P fasten 9 0 16 0 336 346 437 346;
#P connect 13 0 16 0;
#P connect 13 1 15 0;
#P connect 13 2 14 0;
#P connect 13 3 17 0;
#P connect 19 1 20 0;
#P connect 20 0 21 0;
#P connect 21 0 18 0;
#P connect 18 1 9 1;
#P fasten 29 0 20 2 70 114 558 114;
#P fasten 28 1 35 0 85 93 668 93;
#P connect 35 0 33 0;
#P connect 35 1 34 0;
#P window clipboard copycount 36;



amy
July 12, 2006 | 2:12 pm

HI,

I have a similar problem. The difference is I am using a webcam to get stream video. I tried mattijs’s patch and I got an error with Jit.qt.grab: no grabber component is currently open.

The whole patch looked like working well. the two toggles on the left of two jit.qt.grab objects were turning on/off alternatively. But there’s no record in the directed folder.

Could you explain it for me? I’m an anxious student and Max beginner. Looking forward to your response! Thanks!

amy


July 12, 2006 | 5:43 pm

On Jul 12, 2006, at 9:13 AM, Xinmei wrote:

>
> HI,
>
> I have a similar problem. The difference is I am using a webcam to
> get stream video. I tried mattijs’s patch and I got an error with
> Jit.qt.grab: no grabber component is currently open.
>
> The whole patch looked like working well. the two toggles on the
> left of two jit.qt.grab objects were turning on/off alternatively.
> But there’s no record in the directed folder.
>
> Could you explain it for me? I’m an anxious student and Max
> beginner. Looking forward to your response! Thanks!

Jitter Tutorial 21 should answer all your questions -
even the ones you haven’t thought of asking yet.


Viewing 6 posts - 1 through 6 (of 6 total)