Google did not turn up a problem similar to mine, so I'm posting to this list.
I had downloaded mjpegtools from cvs on Oct 10, 2003. I also downloaded libquicktime 
from cvs on
the same date.
Both had built fine, and mjpegtools was built with quicktime support.
I only noticed the problem today because I ran the following command today.
When I ran the following command:
yuv2lav -f q -q 100 -b 1024 -o output.mov < raw.yuv 
I got a segfault. There was no such problem if I used '-f a'. After recompiling with 
'-g' and
tracing the yuv2lav program with kdbg, I found the segfault was occurring in the file
lavtools/lav_io.c in the function lav_open_output_file(), specifically at the line 
that says
'lav_fd->qt_fd = quicktime_open(filename, 1, 1)'.
Looking in the file src/lqt_quicktime.c in the libquicktime directory I found the 
problem. In the
function quicktime_open(char *filename, int rd, int wr), it seems that when the output 
file does
not exist and the 'rd' parameter is set to 1, the line 'quicktime_read_info(new_file)' 
returns a
non-zero value and the in the resulting if-block the value of 'new_file' is set to 
zero.
'new_file' is a pointer. Because the 'wr' parameter is also 1, the line
quicktime_atom_write_header64(new_file, &new_file->mdat.atom,  "mdat") gets executed. 
In the
quicktime_atom_write_header64 function the line 'atom->start = 
quicktime_position(file)'.
quicktime_postion simply does a 'return file->file_position;'

Anyway, I worked around this issue by modifying lav_io.c as follows:
----------------------------------------------------------------------------------------------------------------
--- untars/videorelated/cvsmjpeg/mjpeg_play/lavtools/lav_io.c~  2003-09-07 
12:31:08.000000000
+0300
+++ untars/videorelated/cvsmjpeg/mjpeg_play/lavtools/lav_io.c   2003-11-17 
15:13:35.000000000
+0200
@@ -346,7 +346,7 @@
 
          remove(filename);
 
-         lav_fd->qt_fd = quicktime_open(filename, 1, 1);
+         lav_fd->qt_fd = quicktime_open(filename, 0, 1);
          if(!lav_fd->qt_fd) { free(lav_fd); return 0; }
          quicktime_set_video(lav_fd->qt_fd, 1, width, height, fps,
                              (interlaced ? QUICKTIME_MJPA : QUICKTIME_JPEG));

----------------------------------------------------------------------------------------------------------------

I figured that in lav_open_output_file(), there is no need to open the file 'filename' 
for
reading. Anyway, this solved my problem, and now I can create quicktime files with 
yav2lav.

Is this a known issue that I have managed to rediscover. Is it recommended to use a 
particular
version of libquicktime ? Or should it not be used and only quicktime4linux should be 
used.
FYI, using sourceforge's viewcvs for both mjpegtools and libquicktime, the issue still 
remains. I
have also looked at the latest quicktime4linux code, and the same thing will happen 
there.

Sorry if I have posted to the wrong list or reposted an older problem.

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree


-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to