[Libav-user] any way to interrupt avcodec_decode_video2 ?

עופר בר ofer.fly at gmail.com
Tue Dec 31 12:32:39 CET 2013


I think it's also possible to multi-thread decoding by changing some
parameters codec context structure like thread_count and thread_type.
You do need a multi-threaded ffmpeg build for that I believe.
Maybe in this way you can reduce the decoding time, assuming you have few
cores.



On Mon, Dec 16, 2013 at 8:17 AM, Don Moir <donmoir at comcast.net> wrote:

>   *From:* עופר בר <ofer.fly at gmail.com>
> *To:* This list is about using libavcodec, libavformat,
> libavutil,libavdevice and libavfilter. <libav-user at ffmpeg.org>
> *Sent:* Tuesday, December 31, 2013 5:24 AM
> *Subject:* Re: [Libav-user] any way to interrupt avcodec_decode_video2 ?
>
> >What do you mean by "waiting"?
> >If you're calling this api on a different thread, why can't you terminate
> the thread?
> >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.
>
> >Best of luck!
>
> 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.
>
> Another thread waits on it normally waiting to seek or exit.
>
> Best thing would be interrupt callback.
>
> ---- Original Message -----
>
> *From:* עופר בר <ofer.fly at gmail.com>
> *To:* This list is about using libavcodec, libavformat,
> libavutil,libavdevice and libavfilter. <libav-user at ffmpeg.org>
> *Sent:* Tuesday, December 31, 2013 5:24 AM
> *Subject:* Re: [Libav-user] any way to interrupt avcodec_decode_video2 ?
>
> What do you mean by "waiting"?
> If you're calling this api on a different thread, why can't you terminate
> the thread?
> 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.
>
> Best of luck!
>
>
> On Mon, Dec 16, 2013 at 8:48 AM, Don Moir <donmoir at comcast.net> wrote:
>
>>
>> ----- Original Message ----- From: "Carl Eugen Hoyos" <cehoyos at ag.or.at>
>> To: <libav-user at ffmpeg.org>
>> Sent: Tuesday, December 31, 2013 4:08 AM
>>
>> Subject: Re: [Libav-user]any way to interrupt avcodec_decode_video2 ?
>>
>>
>>  Don Moir <donmoir at ...> writes:
>>>
>>> Since app is timeline oriented, trying to keep seek time
>>>> down to minimum and if avcodec_decode_video2 has been
>>>> called, seems there is no way out until its finished
>>>> and this decoding time can delay a new seek attempt.
>>>>
>>>
>>> Are you looking for CODEC_FLAG2_SHOW_ALL?
>>>
>>> Carl Eugen
>>>
>>
>> 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.
>>
>> 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.
>>
>>
>> _______________________________________________
>> Libav-user mailing list
>> Libav-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/libav-user
>>
>
>  ------------------------------
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20131231/f2842c94/attachment.html>


More information about the Libav-user mailing list