<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hi, all,</div><div>I am trying to decode h264 video using FFmpeg h264 decoder and got some problem:</div><div>Although the number of threads was the same as I set, the decoder seems to fail to utilize these threads.</div><div>----------<span style="line-height: 23.8px;">----------</span><span style="line-height: 23.8px;">----------</span><span style="line-height: 23.8px;">----------</span><span style="line-height: 23.8px;">----------</span><span style="line-height: 23.8px;">----------</span><span style="line-height: 23.8px;">----------</span><span style="line-height: 23.8px;">----------</span></div><div><span style="line-height: 23.8px;">THE PROBLEM:</span></div><div>    I traced the program by GDB and found that when executing ff_h264_execute_decode_slices()</div><div>    in libavcodec/h264_slice.c, the context_count is always 1, so it failed to execute the branch that</div><div>    invokes avctx->execute() (which seems to be the correct multithread version).</div><div><br></div><div>THE PROGRAM: </div><div>    the program I used was the example program demuxing_decoding.c under ffmpeg/doc/examples/,</div><div>    and I inserted dec_ctx->thread_count = thread_count; dec_ctx->thread_type = thread_type; before</div><div>    line 179 which executing avcodec_open2()</div><div>    the version of FFmpeg I used was: ffmpeg version git-2015-09-24-7179add</div><div><br></div><div>THE SAMPLE VIDEO:</div><div>    the video I used was big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 under </div><div>    <a href="http://download.openbricks.org/sample/H264/" _src="http://download.openbricks.org/sample/H264/">http://download.openbricks.org/sample/H264/</a></div><div><br></div><div>    One more thing, some videos trigger warning like:</div><div>    [h264 @ 0x17ac3e0] Cannot parallelize slice decoding with deblocking filter type 1, decoding such frames in sequential order</div><div>    but this video is fine.</div><div><span style="line-height: 23.8px;">----------</span><span style="line-height: 23.8px;">----------</span><span style="line-height: 23.8px;">----------</span><span style="line-height: 23.8px;">----------</span><span style="line-height: 23.8px;">----------</span><span style="line-height: 23.8px;">----------</span><span style="line-height: 23.8px;">----------</span><span style="line-height: 23.8px;">----------</span></div><div>    How can I make use of slice based multithread decoding?</div><div>    Thanks for your help.</div><div><br></div><div>    zheng</div><div><br></div><div><br></div></div><br><br><span title="neteasefooter"><p> </p></span>