pipe入力だとx264で--seekが使えません。で、パッチ。巻き戻しで呼び出されるとNGだけど、通常は大丈夫なハズ。
% diff -cEbw muxers.org.c muxers.c
*** muxers.org.c Sun May 7 18:46:06 2006
--- muxers.c Sun May 7 18:59:23 2006
***************
*** 265,275 ****
--- 265,279 ----
if( i_frame != h->next_frame )
{
+ if(i_frame < h->next_frame){
if (fseek(h->fh, (uint64_t)i_frame*(3*(h->width*h->height)/2+h->frame_header_len)
+ h->seq_header_len, SEEK_SET))
return -1;
+ h->next_frame = i_frame;
+ }
}
+ do{
/* Read frame header - without terminating '\n' */
if (fread(header, 1, slen, h->fh) != slen)
return -1;
***************
*** 297,303 ****
|| fread(p_pic->img.plane[2], 1, h->width * h->height / 4, h->fh) <= 0)
return -1;
! h->next_frame = i_frame+1;
return 0;
}
--- 301,308 ----
|| fread(p_pic->img.plane[2], 1, h->width * h->height / 4, h->fh) <= 0)
return -1;
! h->next_frame++;
! } while(h->next_frame != i_frame+1);
return 0;
}
Visitors: -
