<DIV>x264 can't read large file if the file size is greater than 2^31 (2 gbyte), </DIV>
<DIV>I modifed the source code enable to read large files.</DIV>
<DIV> </DIV>
<DIV>==> Current code</DIV>
<DIV>static int get_frame_total_yuv( hnd_t handle, int i_width, int i_height )<BR>{<BR> FILE *f = (FILE *)handle;<BR> int i_frame_total = 0;</DIV>
<DIV> if( !fseek( f, 0, SEEK_END ) )<BR> {<BR> int64_t i_size = ftell( f );<BR> fseek( f, 0, SEEK_SET );<BR> i_frame_total = (int)(i_size / ( i_width * i_height * 3 / 2 ));<BR> }</DIV>
<DIV> return i_frame_total;<BR>}</DIV>
<DIV> </DIV>
<DIV>==> modified code</DIV>
<DIV> </DIV>
<DIV>char gnp08FileName[1024];</DIV>
<DIV>/* raw 420 yuv file operation */<BR>static int open_file_yuv( char *psz_filename, hnd_t *p_handle, x264_param_t *p_param )<BR>{<BR> if ((*p_handle = fopen(psz_filename, "rb")) == NULL)<BR> return -1;<BR> <BR> strcpy(gnp08FileName, psz_filename);</DIV>
<DIV> return 0;<BR>}</DIV>
<DIV> </DIV>
<DIV>static int get_frame_total_yuv( hnd_t handle, int i_width, int i_height )<BR>{<BR> int i_frame_total = 0;<BR> int fh;<BR> int64_t n64Size, n64Pos;</DIV>
<DIV> if( (fh = _open(gnp08FileName, _O_RDONLY )) != -1 )<BR> {<BR> n64Pos = _lseeki64 ( fh, 0L, SEEK_END );<BR> if( n64Pos == -1L )<BR> perror( "_lseek to end failed" );</DIV>
<DIV> n64Size = _telli64( fh );<BR> i_frame_total = (int)(n64Size / ( i_width * i_height * 3 / 2 ));</DIV>
<DIV> _close( fh );<BR> }</DIV>
<DIV> return i_frame_total;<BR>}</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Best regards</DIV>
<DIV> </DIV>
<DIV>Bae</DIV>
<DIV> </DIV><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com