transcoding. Use @option{-noaccurate_seek} to disable it, which may be useful
e.g. when copying some streams and transcoding the others.
+@item -thread_message_queue @var{size} (@emph{input})
+This option sets the maximum number of queued packets when reading from the
+file or device. With low latency / high rate live streams, packets may be
+discarded if they are not read in a timely manner; raising this value can
+avoid it.
+
@item -override_ffserver (@emph{global})
Overrides the input specifications from @command{ffserver}. Using this
option you can map any input stream to @command{ffserver} and control
strcmp(f->ctx->iformat->name, "lavfi"))
f->non_blocking = 1;
ret = av_thread_message_queue_alloc(&f->in_thread_queue,
- 8, sizeof(AVPacket));
+ f->thread_queue_size, sizeof(AVPacket));
if (ret < 0)
return ret;
int64_t input_ts_offset;
int rate_emu;
int accurate_seek;
+ int thread_queue_size;
SpecifierOpt *ts_scale;
int nb_ts_scale;
pthread_t thread; /* thread reading from this file */
int non_blocking; /* reading packets from the thread should not block */
int joined; /* the thread has been joined */
+ int thread_queue_size; /* maximum number of queued packets */
#endif
} InputFile;
f->nb_streams = ic->nb_streams;
f->rate_emu = o->rate_emu;
f->accurate_seek = o->accurate_seek;
+#if HAVE_PTHREADS
+ f->thread_queue_size = o->thread_queue_size > 0 ? o->thread_queue_size : 8;
+#endif
/* check if all codec options have been used */
unused_opts = strip_specifiers(o->g->codec_opts);
{ "disposition", OPT_STRING | HAS_ARG | OPT_SPEC |
OPT_OUTPUT, { .off = OFFSET(disposition) },
"disposition", "" },
+ { "thread_queue_size", HAS_ARG | OPT_INT | OPT_OFFSET | OPT_EXPERT | OPT_INPUT,
+ { .off = OFFSET(thread_queue_size) },
+ "set the maximum number of queued packets from the demuxer" },
/* video options */
{ "vframes", OPT_VIDEO | HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_video_frames },