On 28/06/2012 07:43, Luca Barbato wrote:
On 06/27/2012 01:15 PM, Mark Kenna wrote:
Furthermore, I've found that the interrupt_callback works for
rtsp_transport UDP but not HTTP or TCP (which are the ones I am
interested in).
Do you have a code snippet? avconv does work in those situations?
lu
Sure:
This only gets executed during the avformat_open_input and
av_find_stream_info
static int callback_func(void *ctx)
{
return 0;
}
This executes the callback_func
//Open the url
AVDictionary* inputOptions = NULL;
av_dict_set(&inputOptions, "rtsp_transport", "http", 0);
AVFormatContext *context = avformat_alloc_context();
context->interrupt_callback.callback = callback_func;
int err = avformat_open_input(&context, "rtsp://x.x.x.x:80/live",
NULL, &inputOptions);
These calls never execute callback_func
AVPacket packet;
while (reading)
{
//Read a frame from the source. This will block until there is
a new frame available or if there are no more frames available
int err = av_read_frame(formatContext, &packet);
...
...
Thanks,
Mark.
_______________________________________________
libav-api mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-api