Forums > Jitter

[bugreport] inserting audio track in jit.qt.movie

December 6, 2007 | 12:43 pm

Hi all,

Here is a clear and reproduceable bug that started happening about two months ago, possibly after a quicktime update.

Description:
Inserting a new audio track into jit.qt.movie will only add the first 500 ms if it is uncompressed (i.e. quicktime says ‘Integer (Little Endian)’). This bug does not occur when the audio codec is ‘Apple Lossless’.

Expected result:
The complete audiotrack should be added.

Steps to reproduce:
See patch below. Here is the patch in a zip, together with two sample movies that you could use to test:
http://www.smadsteck.nl/movieinsertsoundproblem.zip (1.9 MB)

It would be great if someone could confirm.

Best,
Mattijs

The patch:

#P comment 18 309 228 196617 3) open the saved movie in quicktime and play it. Only the first 500 ms of the audio is present , the rest is gone.;
#P window linecount 1;
#P comment 112 231 72 196617 2) save movie;
#P newex 128 140 18 196617 t i;
#P newex 109 119 29 196617 t i 1;
#P newex 18 119 29 196617 t i 2;
#N vpatcher 465 560 749 886;
#P window setfont "Sans Serif" 9.;
#P newex 67 127 29 196617 t l 0;
#P newex 103 195 32 196617 sel 1;
#P newex 175 195 32 196617 sel 1;
#P newex 175 215 21 196617 t 2;
#P newex 103 215 21 196617 t 1;
#P newex 175 172 64 196617 zl sub sound;
#P newex 103 172 63 196617 zl sub video;
#P newex 86 239 47 196617 gate 2 1;
#P newex 14 67 49 196617 append 0;
#P newex 14 47 103 196617 prepend gettrackinfo;
#P newex 67 147 83 196617 unpack 0 s s 0 0;
#P newex 67 107 78 196617 route trackinfo;
#P newex 14 87 63 196617 jit.qt.movie;
#N comlet path;
#P inlet 14 27 15 0;
#N comlet video track nr;
#P outlet 86 261 15 0;
#N comlet audio track nr;
#P outlet 123 261 15 0;
#P connect 2 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 3 0;
#P connect 3 1 4 0;
#P connect 4 0 15 0;
#P connect 15 0 5 0;
#P connect 11 0 8 0;
#P connect 12 0 8 0;
#P connect 15 1 8 0;
#P connect 8 0 1 0;
#P connect 5 2 9 0;
#P connect 9 1 14 0;
#P connect 14 0 11 0;
#P connect 5 0 8 1;
#P connect 8 1 0 0;
#P connect 5 2 10 0;
#P connect 10 1 13 0;
#P connect 13 0 12 0;
#P pop;
#P newobj 18 99 101 196617 p getMovieTrackNrs;
#B color 5;
#P newex 18 199 75 196617 prepend insert;
#P newex 18 139 27 196617 t b i;
#P newex 62 179 187 196617 sprintf set track %i 0 1000 track %i 0;
#P newex 18 179 40 196617 append;
#P newex 18 73 40 196617 t l l b;
#P newex 18 159 36 196617 zl reg;
#P message 40 231 68 196617 savemovieas;
#P message 315 178 124 196617 newmovie 360 288 1000;
#P message 287 142 66 196617 trackvol 1 1;
#P newex 273 103 53 196617 t b b b b;
#P message 301 160 77 196617 addtrack sound;
#P message 273 124 76 196617 addtrack video;
#P button 18 35 15 0;
#P newex 18 53 56 196617 opendialog;
#P newex 18 254 102 196617 jit.qt.movie @rate 0;
#P comment 35 35 198 196617 1) add movie with audio codec ‘integer’;
#P connect 6 3 8 0;
#P connect 6 2 5 0;
#P connect 6 1 7 0;
#P connect 6 0 4 0;
#P fasten 11 2 6 0 53 95 278 95;
#P connect 19 0 13 1;
#P connect 17 1 19 0;
#P connect 18 1 19 0;
#P connect 16 1 18 0;
#P connect 14 1 13 0;
#P connect 11 1 10 1;
#P connect 15 0 1 0;
#P connect 9 0 1 0;
#P fasten 8 0 1 0 320 220 23 220;
#P fasten 5 0 1 0 306 220 23 220;
#P fasten 7 0 1 0 292 220 23 220;
#P fasten 4 0 1 0 278 220 23 220;
#P connect 12 0 15 0;
#P connect 10 0 12 0;
#P connect 13 0 12 0;
#P connect 14 0 10 0;
#P connect 17 0 14 0;
#P connect 18 0 14 0;
#P connect 16 0 17 0;
#P connect 11 0 16 0;
#P connect 2 0 11 0;
#P connect 3 0 2 0;


December 7, 2007 | 9:25 pm

confirmed. tried playing with timescale and your edit points, which acted fishy.

Christopher O


December 7, 2007 | 9:51 pm

Quote: Christopher Overstreet wrote on Fri, 07 December 2007 22:25
—————————————————-
> confirmed. tried playing with timescale and your edit points, which acted fishy.
>
> Christopher O
—————————————————-

Thanks Christopher!



jln
December 8, 2007 | 12:19 am


December 8, 2007 | 10:22 am

Quote: jln wrote on Sat, 08 December 2007 01:19
—————————————————-

> I got the same result with last Max, Mac OS 10.5.1, Quicktime 7.3 if
> that helps.
>
> Best,
> Julien.
>
—————————————————-

Ah, thanks Julien.

I see I forgot to add my application versions. Here they are: Mac OS 10.4.11, Max 4.6.3, Jitter 1.6.3, Quicktime 7.3.0

Mattijs


December 8, 2007 | 12:28 pm

This happens in windows as well, max 463&jit163 – but I don’t know
exactly what quicktime version, probably the latest(I can check if
needed).

In osx, this happens with&without experimental jitter framework.

hth,
nesa


December 17, 2007 | 3:59 pm

This appears to be a QuickTime bug wrt timescale and audio tracks.
There’s an ugly workaround, which is to set the timescale of the
tracks to match that of the source tracks.

The best thing to do would be to use the magic track number -1 for the
first insert operation on each track to create a new track with
identical properties as the source data. Then you can avoid the whole
problem.

I’ve modified your patch to hard-code the necessary timescales for the
movies you sent to support. Jitter for Max 5 will support creating new
tracks with the track’s timescale (which can be different from the
movie timescale) as an optional argument.

jb

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 361 142 77 196617 tracktimescale;
#P window linecount 3;
#P comment 18 309 228 196617 3) open the saved movie in quicktime and
play it. Only the first 500 ms of the audio is present , the rest is
gone.;
#P window linecount 1;
#P comment 112 231 72 196617 2) save movie;
#P newex 128 140 18 196617 t i;
#P newex 109 119 29 196617 t i 1;
#P newex 18 119 29 196617 t i 2;
#N vpatcher 465 560 1023 895;
#P origin -120 0;
#P window setfont "Sans Serif" 9.;
#P newex 223 140 29 196617 t l 0;
#P newex 259 208 32 196617 sel 1;
#P newex 331 208 32 196617 sel 1;
#P newex 331 228 21 196617 t 2;
#P newex 259 228 21 196617 t 1;
#P newex 331 185 64 196617 zl sub sound;
#P newex 259 185 63 196617 zl sub video;
#P newex 242 252 47 196617 gate 2 1;
#P newex 170 80 49 196617 append 0;
#P newex 170 60 103 196617 prepend gettrackinfo;
#P newex 223 160 83 196617 unpack 0 s s 0 0;
#P newex 223 120 148 196617 route trackinfo tracktimescale;
#P newex 170 100 63 196617 jit.qt.movie;
#N comlet path;
#P inlet 170 40 15 0;
#N comlet video track nr;
#P outlet 242 274 15 0;
#N comlet audio track nr;
#P outlet 279 274 15 0;
#P connect 2 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 3 0;
#P connect 3 1 4 0;
#P connect 4 0 15 0;
#P connect 15 0 5 0;
#P connect 15 1 8 0;
#P connect 11 0 8 0;
#P connect 12 0 8 0;
#P connect 8 0 1 0;
#P connect 5 2 9 0;
#P connect 9 1 14 0;
#P connect 14 0 11 0;
#P connect 5 0 8 1;
#P connect 8 1 0 0;
#P connect 5 2 10 0;
#P connect 10 1 13 0;
#P connect 13 0 12 0;
#P pop;
#P newobj 18 99 101 196617 p getMovieTrackNrs;
#B color 5;
#P newex 18 199 75 196617 prepend insert;
#P newex 18 139 27 196617 t b i;
#P newex 62 179 187 196617 sprintf set track %i 0 1000 track %i 0;
#P newex 18 179 40 196617 append;
#P newex 18 73 40 196617 t l l b;
#P newex 18 159 36 196617 zl reg;
#P message 40 231 68 196617 savemovieas;
#P message 315 178 124 196617 newmovie 360 288 1000;
#P message 287 142 66 196617 trackvol 1 1;
#P newex 273 103 53 196617 t b b b b;
#P message 301 160 193 196617 addtrack sound , tracktimescale 1 44100;
#P message 273 124 174 196617 addtrack video , tracktimescale 2 25;
#P button 18 35 15 0;
#P newex 18 53 56 196617 opendialog;
#P newex 18 254 102 196617 jit.qt.movie @rate 0;
#P comment 35 35 198 196617 1) add movie with audio codec ‘integer’;
#P connect 6 3 8 0;
#P connect 6 2 5 0;
#P connect 6 1 7 0;
#P connect 6 0 4 0;
#P fasten 11 2 6 0 53 95 278 95;
#P connect 19 0 13 1;
#P connect 18 1 19 0;
#P connect 17 1 19 0;
#P connect 16 1 18 0;
#P connect 14 1 13 0;
#P connect 11 1 10 1;
#P fasten 4 0 1 0 278 220 23 220;
#P fasten 7 0 1 0 292 220 23 220;
#P fasten 5 0 1 0 306 220 23 220;
#P fasten 8 0 1 0 320 220 23 220;
#P connect 9 0 1 0;
#P connect 15 0 1 0;
#P connect 12 0 15 0;
#P connect 10 0 12 0;
#P connect 13 0 12 0;
#P connect 14 0 10 0;
#P connect 18 0 14 0;
#P connect 17 0 14 0;
#P connect 16 0 17 0;
#P connect 11 0 16 0;
#P connect 2 0 11 0;
#P connect 3 0 2 0;
#P window clipboard copycount 23;

Am 06.12.2007 um 13:43 schrieb Mattijs Kneppers:

>
> Hi all,
>
> Here is a clear and reproduceable bug that started happening about
> two months ago, possibly after a quicktime update.
>
> Description:
> Inserting a new audio track into jit.qt.movie will only add the
> first 500 ms if it is uncompressed (i.e. quicktime says ‘Integer
> (Little Endian)’). This bug does not occur when the audio codec is
> ‘Apple Lossless’.
>
> Expected result:
> The complete audiotrack should be added.
>
> Steps to reproduce:
> See patch below. Here is the patch in a zip, together with two
> sample movies that you could use to test:
> http://www.smadsteck.nl/movieinsertsoundproblem.zip (1.9 MB)
>
> It would be great if someone could confirm.
>
> Best,
> Mattijs
>
>
> The patch:
>
> #P comment 18 309 228 196617 3) open the saved movie in quicktime
> and play it. Only the first 500 ms of the audio is present , the
> rest is gone.;
> #P window linecount 1;
> #P comment 112 231 72 196617 2) save movie;
> #P newex 128 140 18 196617 t i;
> #P newex 109 119 29 196617 t i 1;
> #P newex 18 119 29 196617 t i 2;
> #N vpatcher 465 560 749 886;
> #P window setfont "Sans Serif" 9.;
> #P newex 67 127 29 196617 t l 0;
> #P newex 103 195 32 196617 sel 1;
> #P newex 175 195 32 196617 sel 1;
> #P newex 175 215 21 196617 t 2;
> #P newex 103 215 21 196617 t 1;
> #P newex 175 172 64 196617 zl sub sound;
> #P newex 103 172 63 196617 zl sub video;
> #P newex 86 239 47 196617 gate 2 1;
> #P newex 14 67 49 196617 append 0;
> #P newex 14 47 103 196617 prepend gettrackinfo;
> #P newex 67 147 83 196617 unpack 0 s s 0 0;
> #P newex 67 107 78 196617 route trackinfo;
> #P newex 14 87 63 196617 jit.qt.movie;
> #N comlet path;
> #P inlet 14 27 15 0;
> #N comlet video track nr;
> #P outlet 86 261 15 0;
> #N comlet audio track nr;
> #P outlet 123 261 15 0;
> #P connect 2 0 6 0;
> #P connect 6 0 7 0;
> #P connect 7 0 3 0;
> #P connect 3 1 4 0;
> #P connect 4 0 15 0;
> #P connect 15 0 5 0;
> #P connect 11 0 8 0;
> #P connect 12 0 8 0;
> #P connect 15 1 8 0;
> #P connect 8 0 1 0;
> #P connect 5 2 9 0;
> #P connect 9 1 14 0;
> #P connect 14 0 11 0;
> #P connect 5 0 8 1;
> #P connect 8 1 0 0;
> #P connect 5 2 10 0;
> #P connect 10 1 13 0;
> #P connect 13 0 12 0;
> #P pop;
> #P newobj 18 99 101 196617 p getMovieTrackNrs;
> #B color 5;
> #P newex 18 199 75 196617 prepend insert;
> #P newex 18 139 27 196617 t b i;
> #P newex 62 179 187 196617 sprintf set track %i 0 1000 track %i 0;
> #P newex 18 179 40 196617 append;
> #P newex 18 73 40 196617 t l l b;
> #P newex 18 159 36 196617 zl reg;
> #P message 40 231 68 196617 savemovieas;
> #P message 315 178 124 196617 newmovie 360 288 1000;
> #P message 287 142 66 196617 trackvol 1 1;
> #P newex 273 103 53 196617 t b b b b;
> #P message 301 160 77 196617 addtrack sound;
> #P message 273 124 76 196617 addtrack video;
> #P button 18 35 15 0;
> #P newex 18 53 56 196617 opendialog;
> #P newex 18 254 102 196617 jit.qt.movie @rate 0;
> #P comment 35 35 198 196617 1) add movie with audio codec ‘integer’;
> #P connect 6 3 8 0;
> #P connect 6 2 5 0;
> #P connect 6 1 7 0;
> #P connect 6 0 4 0;
> #P fasten 11 2 6 0 53 95 278 95;
> #P connect 19 0 13 1;
> #P connect 17 1 19 0;
> #P connect 18 1 19 0;
> #P connect 16 1 18 0;
> #P connect 14 1 13 0;
> #P connect 11 1 10 1;
> #P connect 15 0 1 0;
> #P connect 9 0 1 0;
> #P fasten 8 0 1 0 320 220 23 220;
> #P fasten 5 0 1 0 306 220 23 220;
> #P fasten 7 0 1 0 292 220 23 220;
> #P fasten 4 0 1 0 278 220 23 220;
> #P connect 12 0 15 0;
> #P connect 10 0 12 0;
> #P connect 13 0 12 0;
> #P connect 14 0 10 0;
> #P connect 17 0 14 0;
> #P connect 18 0 14 0;
> #P connect 16 0 17 0;
> #P connect 11 0 16 0;
> #P connect 2 0 11 0;
> #P connect 3 0 2 0;
>
>
>
>
> –
> SmadSteck – http://www.smadsteck.nl
> Hard- and software for interactive audiovisual sampling


December 17, 2007 | 5:02 pm

Hi Jeremy, thanks for your efforts!

The workaround you suggest works pretty well for us. The aim of the patch is to easily combine multiple movies into one movie buffer. Ideally this should work independently of the source movies timescales, codecs, etc.

But our main problem is solved, i.e. some of the movies are generated by jit.qt.grab, which can’t write audio as apple lossless.

> The best thing to do would be to use the magic track number -1 for the
> first insert operation on each track to create a new track with
> identical properties as the source data. Then you can avoid the whole
> problem.

Yeah, I tried that first. But we import the movie sound into a buffer~ and unfortunately there is still a bug in buffer~’s import function that prevents working with the technique you propose:

http://www.cycling74.com/forums/index.php?t=msg&goto=110259&rid=3579&S=8571fb4f8b5563b1f66ccd0db740af33

Thanks again!

Mattijs


December 17, 2007 | 5:58 pm

This will be fixed in Max 5 as well. The track length will now be
correctly identified as 22s, in the example you posted, and will have
8s of silence at the top. You’ll be able to use the offset argument to
the import message to move beyond the silence, if desired.

jb

Am 17.12.2007 um 18:02 schrieb Mattijs Kneppers:

> http://www.cycling74.com/forums/index.php?t=msg&goto=110259&rid=3579&S=8571fb4f8b5563b1f66ccd0db740af33


December 17, 2007 | 9:26 pm

Quote: Jeremy Bernstein wrote on Mon, 17 December 2007 18:58
—————————————————-
> This will be fixed in Max 5 as well. The track length will now be
> correctly identified as 22s, in the example you posted, and will have
> 8s of silence at the top. You’ll be able to use the offset argument to
> the import message to move beyond the silence, if desired.

That’s great news! It will make things a whole lot simpler.

Mattijs


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