Hi, There are problems with this fix. Although with 30000:1001 its watchable, the audio is off from the start.
If my origional problem is caused by a frame rate change later in the mpg are there tools that can sort this out ? Are there timecodes on the frames in the mjpeg file that would allow this to happen ? Any ideas ? Thanks, Stuart On Thursday 29 May 2003 20:52, Stuart Hodges wrote: > Hi, > > Here is the output requested and some extra for 30000:1001 and 60000:1001. > > head -n1 stream.yuv > YUV4MPEG2 W320 H240 F59939998:1000000 Ip A0:0 > > cat stream.yuv | yuvfps -v2 -r 30:1 | head -n1 > INFO: [yuvfps] yuv2fps (version 0.1) is a general frame resampling > utility for yuv streams > INFO: [yuvfps] (C) 2002 Alfonso Garcia-Patino Barbolani > <[EMAIL PROTECTED]> > INFO: [yuvfps] yuv2fps -h for help, or man yuv2fps > INFO: [yuvfps] Converting from 29969999:500000 to 30:1 > YUV4MPEG2 W320 H240 F30:1 Ip A0:0 > > cat stream.yuv | yuvfps -v2 -r 30000:1001 | head -n1 > INFO: [yuvfps] yuv2fps (version 0.1) is a general frame resampling > utility for yuv streams > INFO: [yuvfps] (C) 2002 Alfonso Garcia-Patino Barbolani > <[EMAIL PROTECTED]> > INFO: [yuvfps] yuv2fps -h for help, or man yuv2fps > INFO: [yuvfps] Converting from 29969999:500000 to 30000:1001 > YUV4MPEG2 W320 H240 F30000:1001 Ip A0:0 > > cat stream.yuv | yuvfps -v2 -r 60000:1001 | head -n1 > INFO: [yuvfps] yuv2fps (version 0.1) is a general frame resampling > utility for yuv streams > INFO: [yuvfps] (C) 2002 Alfonso Garcia-Patino Barbolani > <[EMAIL PROTECTED]> > INFO: [yuvfps] yuv2fps -h for help, or man yuv2fps > INFO: [yuvfps] Converting from 29969999:500000 to 60000:1001 > YUV4MPEG2 W320 H240 F60000:1001 Ip A0:0 > > I added some printf's to yuvfps, thus: > srcInc = src_frame_rate.n * frame_rate.d ; > dstInc = frame_rate.n * src_frame_rate.d ; > > fprintf (stderr,"srcInc %d\n",srcInc); > fprintf (stderr,"dstInc %d\n",dstInc); > > write_error_code = Y4M_OK ; > > The output when given 30000:1001 is: > > cat stream.yuv | /home/schodge/dvd/cvsmjpegtools/mjpeg_play/lavtools/yuvfps > -v2 -r 30000:1001 | head -n1 > INFO: [yuvfps] yuv2fps (version 0.1) is a general frame resampling > utility for yuv streams > INFO: [yuvfps] (C) 2002 Alfonso Garcia-Patino Barbolani > <[EMAIL PROTECTED]> > INFO: [yuvfps] yuv2fps -h for help, or man yuv2fps > INFO: [yuvfps] Converting from 29969999:500000 to 30000:1001 > srcInc -64802073 > dstInc 2115098112 > YUV4MPEG2 W320 H240 F30000:1001 Ip A0:0 > > I changed srcInc and dstInc to unsigned longs and things look good. I will > run a test through and try to sync the audio. > > Thanks, > > Stuart > > On Thursday 29 May 2003 10:23, Matto Marjanovic wrote: > > Hiya, > > > > > yuvfps reports: > > >cat stream.yuv | yuvfps -v2 > debout > > > INFO: [yuvfps] yuv2fps (version 0.1) is a general frame resampling > > > utility for yuv streams > > > INFO: [yuvfps] (C) 2002 Alfonso Garcia-Patino Barbolani > > ><[EMAIL PROTECTED]> > > > INFO: [yuvfps] yuv2fps -h for help, or man yuv2fps > > > INFO: [yuvfps] Converting from 29969999:500000 to 29969999:500000 > > > > "stream.yuv" is the stream captured by "GATOS", right? > > > > Could you send us the output of > > "head -n1 stream.yuv", > > and the output of > > "cat stream.yuv | yuvfps -v2 -r 30:1 | head -n1" > > > > > > The problem is most probably due to a bug in yuvfps's resample() > > function, due to the logic of this code: > > > > srcInc = src_frame_rate.n * frame_rate.d ; > > dstInc = frame_rate.n * src_frame_rate.d ; > > ... > > while( Y4M_ERR_EOF != read_error_code && write_error_code == Y4M_OK > > ) { ... > > currCount += srcInc ; > > while( currCount >= dstInc && Y4M_ERR_EOF != read_error_code ) { > > currCount -= dstInc ; > > ++src_frame_counter ; > > ... > > } > > } > > > > The multiplications in the assignments of "srcInc" and "dstInc" have > > certainly overflowed. They should be made into big, fat 64-bit int's, > > and/or some check for overflow should be made. > > > > Also, GATOS, or whatever produced the stream, should be fixed. I'm > > guessing that the headers will show that it is specifying > > "59939998:1000000" as the framerate, which is dumb --- that should be > > "60000:1001", if anything. > > > > -matt m. > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: eBay > > Get office equipment for less on eBay! > > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > > _______________________________________________ > > Mjpeg-users mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/mjpeg-users ------------------------------------------------------- ------------------------------------------------------- This SF.net email is sponsored by: eBay Get office equipment for less on eBay! http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 _______________________________________________ Mjpeg-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mjpeg-users