forked from wang-bin/QtAV
-
Notifications
You must be signed in to change notification settings - Fork 0
FFmpeg dict opt in QtAV
WangBin edited this page May 18, 2014
·
5 revisions
FFmpeg/Libav has functions like av_opt_set_xxx
, av_dict_set
. In QtAV, the you can use
void AVPlayer::setOptionsForFormat(const QVariantHash& dict); //avformat
void AVPlayer::setOptionsForAudioCodec(const QVariantHash& dict); //avcodec
void AVPlayer::setOptionsForVideoCodec(const QVariantHash& dict); //avcodec
You can add a wrapper for the options. i.e. add a key and make the options as it"s value. The key is avformat
for AVPlayer::setOptionsForFormat
and avcodec
for AVPlayer::setOptionsForAudioCodec
and AVPlayer::setOptionsForVideoCodec
.
Example: the following options are equal
QVariantHash opt;
opt["probesize"] = 4096;
player->setOptionsForFormat(opt);
and
QVariantHash avfmt_opt;
avfmt_opt["probesize"] = 4096;
QVariantHash opt;
opt["avformat"] = avfmt_opt;
player->setOptionsForFormat(opt);
The option above can change the stream latency. See https://trac.ffmpeg.org/wiki/StreamingGuide#Latency
####TODO
command line options and gui in player example