Until one month ago, I was successfully using lavrec with Mandrake 9.2
(DC10plus, 2.4 kernel) and the PICVideo codec with WindowsXP.  I captured
video files using lavrec and edited them in WindowsXP with programs such as
VirtualDub, AviSynth, and Studio 9.  After upgrading to Mandrake 10.0
Official (2.6 kernel), parts of this flow stop working correctly for video
files that I captured with a decimation of one (-d 1).

  $ lavrec -i N -d 1 -a 0 -t 1 video.avi

After spending several evenings using a hex editor examining both "good" and
"bad" AVI files, I discover the problem.  lavrec is not writing the APP0
marker segment to its AVI files correctly.  I have been using the following
link as a reference for how things should work (the end of the 37th page of
this PDF document is the most relevant):

  http://www.matrox.com/video/press/papers/odmlff2.pdf

When I capture video using the lavrec command describe above, I never see
the code which fixes the APP0 marker segment get executed (line 437-441 in
lav_io.c).  From my understanding of the APP0 marker segment, its length is
supposed to be greater than or equal to 16 bytes (>= 16), but this is not
the case.  If you examine an AVI file captured using lavrec (DC10plus, 2.6
kernel), then I suspect that you will see this as well.

Here is a partial hex dump of a "bad" AVI file that I captured:

000007f0: 0000 0000 4c49 5354 80d1 4500 6d6f 7669  ....LIST..E.movi
00000800: 3030 6462 5049 0200 ffd8 ffe0 0007 2041  00dbPI........ A
00000810: 5649 31ff fe00 0620 434f 4dff db00 8400  VI1.... COM.....

In this case, the APP0 segment (starting at offset 0x80a) is only 7 bytes in
length.  It also starts with a space character (' ') and not an 'A' as it
should.

Commenting out the if-statement on line 435 in lav_io.c fixes my problem.
However, I suspect that the real cause may be somewhere in zr36060.c.

Here is a partial hex dump of an AVI file after my code change to lav_io.c:

000007f0: 0000 0000 4c49 5354 80d1 4500 6d6f 7669  ....LIST..E.movi
00000800: 3030 6462 5049 0200 ffd8 ffe0 0007 4156  00dbPI........AV
00000810: 4931 01ff fe00 0620 434f 4dff db00 8400  I1..... COM.....

The APP0 segment is still smaller then it should be, but the field/polarity
information is now written after the AVI1 identifier tag.
 
If you have any other questions, then please let me know.  I've been very
pleased with the mjpegtools in the past and I hope that an appropriate bug
fix can be made (either in the 2.6 kernel module or user space code) so that
future releases of lavrec won't suffer from this problem.

Regards,
Wesley

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bernhard
Praschinger
Sent: Sunday, May 23, 2004 1:06 PM
To: Wesley Dungan
Cc: [EMAIL PROTECTED]
Subject: Re: [Mjpeg-users] PICVideo Codec Problem Solved (lav_io.c Bug...)

Hallo

> I have discovered a bug in lav_io.c which has been causing video that I
> captured (with decimation == 1) from playing back correctly using the
> PICVideo codec under WindowsXP.
Could you describe the problem a bit more ?

Have you tried playing the movie back with a other progam/codec in
Windows ?
Like VLC (www.videolan.org) the version 0.7.1 and later can playback
mjpeg encoded AVIs.

> Around line 436 in lav_io.c there is the following code:
> 
>   if(get_int2(jpgdata+jpeg_app0_offset+2) < 16 ) continue;
> 
> I'm not sure what the original intent of this test was, but it always
seems
> to be true.  This prevents the section of code which follows it from
> properly inserting the polarity after the "AVI1" tag.  I noticed that the
> APP0 marker, as created in zr36060.c, has a space before the "AVI1" tag.
> With the bug I've described above, this incorrectly formatted APP0 marker
> gets written out to file.
BTW: There are 2 different mjpeg File formats. 

auf hoffentlich bald,

Berni the Chaos of Woodquarter

Email: [EMAIL PROTECTED]
www: http://www.lysator.liu.se/~gz/bernhard



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to