<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.6000.17063" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> <A
title=ofer.fly@gmail.com href="mailto:ofer.fly@gmail.com">עופר בר</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=libav-user@ffmpeg.org
href="mailto:libav-user@ffmpeg.org">This list is about using libavcodec,
libavformat, libavutil,libavdevice and libavfilter.</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, December 31, 2013 6:32
AM</DIV>
<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>>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> </DIV>
<DIV>Possibly ffmpeg multi-thread decoding would help some, but I am leary about
that. More things to go wrong and more for me to figue out what went wrong :)
Also I may have numerous threads open since there may be more than 10 av files
open and playing at same time so try to be careful about being too thread
heavy.</DIV>
<DIV> </DIV>
<DIV>Conceptually it's a pretty easy thing to implement an interrupt callback
for AVCodecContext. It may take awhile though for it to filter thru everywhere,
hitting the problem areas first and ignored by others while waiting.</DIV>
<DIV> </DIV>
<DIV>Mostly its not too bad but depends on machine and video of course. I don;t
think most will have much interest but timeline apps and editing apps could
benefit the most.</DIV>
<DIV> </DIV>
<DIV>You also have to ask why an intense process like decoding is not
interruptible.</DIV></DIV></FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=ofer.fly@gmail.com href="mailto:ofer.fly@gmail.com">עופר בר</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=libav-user@ffmpeg.org
href="mailto:libav-user@ffmpeg.org">This list is about using libavcodec,
libavformat, libavutil,libavdevice and libavfilter.</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, December 31, 2013 6:32
AM</DIV>
<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>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="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><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>
<P>
<HR>
<P></P>_______________________________________________<BR>Libav-user mailing
list<BR>Libav-user@ffmpeg.org<BR>http://ffmpeg.org/mailman/listinfo/libav-user<BR></BLOCKQUOTE></BODY></HTML>