[x264-devel] Single frame encoding

Takashi Mochizuki mochi at da2.so-net.ne.jp
Fri Nov 20 11:36:41 CET 2009


Hi,

I have tried latest git-1342 library with my x264Encoder (QuickTime  
Component for MacOS X).

Mostly works well, but I have found an intermittent hang on threaded  
lookahead.
It could happen only when "encoding single frame" repeatedly (e.g.  
updating preview images).

//

My component uses libx264 via patched libavcodec, and it could stop
- when tried to take out delayed output frame from libx264 (passing  
NULL buffer) -
Code snippet like:

         glob->frame_size = avcodec_encode_video(glob->codecCont,
             glob->encode_buffer, glob->encode_buffer_size, NULL);

Tried to dump stacks, and found that, there is x264_lookahead_thread()  
remaining inside stack trace.

   Thread id:      5872ba0
   User stack:
     586 _thread_start + 34 (in libSystem.B.dylib) [0x94b9a012]
       586 _x264_lookahead_thread + 169 (in x264Encoder) [0x15bb7e89]
         586 _semaphore_wait_signal_trap + 10 (in libSystem.B.dylib)  
[0x94b692ce]

Disassemble in debugger, and found it is waiting at pthread_cond_wait.

encoder/lookahead.c
  88: static void x264_lookahead_thread( x264_t *h )
:
104:            while( !h->lookahead->ifbuf.i_size && !h->lookahead- 
 >b_exit_thread )
105:                x264_pthread_cond_wait( &h->lookahead- 
 >ifbuf.cv_fill, &h->lookahead->ifbuf.mutex );

Do you have any idea about what is happening?

//

Takashi Mochizuki

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x264-devel/attachments/20091120/3679223e/attachment.htm>


More information about the x264-devel mailing list