<div dir="ltr">I think it's also possible to multi-thread decoding by changing some parameters codec context structure like thread_count and thread_type.<div>You do need a multi-threaded ffmpeg build for that I believe.</div>
<div>Maybe in this way you can reduce the decoding time, assuming you have few cores.</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 16, 2013 at 8:17 AM, Don Moir <span dir="ltr"><<a href="mailto:donmoir@comcast.net" target="_blank">donmoir@comcast.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div bgcolor="#ffffff">
<div><font face="Arial">
<div style="BACKGROUND:#e4e4e4;FONT:10pt arial"><b>From:</b> <a title="ofer.fly@gmail.com" href="mailto:ofer.fly@gmail.com" target="_blank">עופר בר</a> </div><div class="im">
<div style="FONT:10pt arial"><b>To:</b> <a title="libav-user@ffmpeg.org" href="mailto:libav-user@ffmpeg.org" target="_blank">This list is about using libavcodec,
libavformat, libavutil,libavdevice and libavfilter.</a> </div>
</div><div style="FONT:10pt arial"><b>Sent:</b> Tuesday, December 31, 2013 5:24
AM</div><div class="im">
<div style="FONT:10pt arial"><b>Subject:</b> Re: [Libav-user] any way to
interrupt avcodec_decode_video2 ?</div>
<div><br></div>
</div><div dir="ltr"><div class="im">>What do you mean by "waiting"?
<div>>If you're calling this api on a different thread, why can't you
terminate the thread?</div>
<div>>If you're calling it from your main thread, there's nothing your app
can do until the function returns, unless they implement some callbacks in the
middle of the execution.</div>
<div><br></div>
<div>>Best of luck!</div>
<div> </div>
</div><div>I allow for proper cleanup and no telling what state ffmpeg would be in if
I just up and terminated the thread. It's in the mist of decoding and waiting
for return allows me to free packet its decoding etc.</div>
<div> </div>
<div>Another thread waits on it normally waiting to seek or exit.</div>
<div> </div>
<div>Best thing would be interrupt callback.</div>
<div> </div>
<div></div></div></font>---- Original Message ----- </div></div>
<blockquote style="PADDING-RIGHT:0px;PADDING-LEFT:5px;MARGIN-LEFT:5px;BORDER-LEFT:#000000 2px solid;MARGIN-RIGHT:0px">
<div style="BACKGROUND:#e4e4e4;FONT:10pt arial"><b>From:</b>
<a title="ofer.fly@gmail.com" href="mailto:ofer.fly@gmail.com" target="_blank">עופר בר</a>
</div><div class="im">
<div style="FONT:10pt arial"><b>To:</b> <a title="libav-user@ffmpeg.org" href="mailto:libav-user@ffmpeg.org" target="_blank">This list is about using libavcodec,
libavformat, libavutil,libavdevice and libavfilter.</a> </div>
</div><div style="FONT:10pt arial"><b>Sent:</b> Tuesday, December 31, 2013 5:24
AM</div><div class="im">
<div style="FONT:10pt arial"><b>Subject:</b> Re: [Libav-user] any way to
interrupt avcodec_decode_video2 ?</div>
<div><br></div>
<div dir="ltr">What do you mean by "waiting"?
<div>If you're calling this api on a different thread, why can't you terminate
the thread?</div>
<div>If you're calling it from your main thread, there's nothing your app can
do until the function returns, unless they implement some callbacks in the
middle of the execution.</div>
<div><br></div>
<div>Best of luck!</div></div>
<div class="gmail_extra"><br><br>
<div class="gmail_quote">On Mon, Dec 16, 2013 at 8:48 AM, Don Moir <span dir="ltr"><<a href="mailto:donmoir@comcast.net" target="_blank">donmoir@comcast.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT:1ex;MARGIN:0px 0px 0px 0.8ex;BORDER-LEFT:#ccc 1px solid"><br>-----
Original Message ----- From: "Carl Eugen Hoyos" <<a href="mailto:cehoyos@ag.or.at" target="_blank">cehoyos@ag.or.at</a>><br>To:
<<a href="mailto:libav-user@ffmpeg.org" target="_blank">libav-user@ffmpeg.org</a>><br>Sent: Tuesday, December 31,
2013 4:08 AM
<div><br>Subject: Re: [Libav-user]any way to interrupt
avcodec_decode_video2 ?<br><br><br></div>
<div>
<blockquote class="gmail_quote" style="PADDING-LEFT:1ex;MARGIN:0px 0px 0px 0.8ex;BORDER-LEFT:#ccc 1px solid">Don
Moir <donmoir@...> writes:<br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT:1ex;MARGIN:0px 0px 0px 0.8ex;BORDER-LEFT:#ccc 1px solid">Since
app is timeline oriented, trying to keep seek time<br>down to minimum
and if avcodec_decode_video2 has been<br>called, seems there is no way
out until its finished<br>and this decoding time can delay a new seek
attempt.<br></blockquote><br>Are you looking for
CODEC_FLAG2_SHOW_ALL?<br><br>Carl Eugen<br></blockquote><br></div>No. I can
easily check between calls to avcodec_decode_video2 but once its called you
are stuck until it returns. Would be nice to be able to interrupt it for
quicker seeking and to end 'the' video more quickly. Doesn't matter too much
for a simple player app, but I have things on timelines and also video
coming and going quicky. Things are time corrected to a timeline but the
more I can reduce impact from things like this the better off we
are.<br><br>A simple seek to zero is quick, but if I have to wait on
avcodec_decode_video2 to return, then its slower and can be quite slow. I
don't mean finish as in the flag (gotframe) to avcodec_decode_video2, but
just waiting on it to return period.
<div>
<div><br><br>______________________________<u></u>_________________<br>Libav-user
mailing list<br><a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br><a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/<u></u>listinfo/libav-user</a><br>
</div></div></blockquote></div><br></div>
</div><p>
</p><hr><div class="im">
<p></p>_______________________________________________<br>Libav-user mailing
list<br><a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br><a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br></div>
<p></p></blockquote>
<br>_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br></blockquote></div><br></div>