mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-17 13:27:46 -04:00
fixes, set tune to lowlatency
This commit is contained in:
@@ -271,7 +271,6 @@ void zm_dump_stream_format(AVFormatContext *ic, int i, int index, int is_output)
|
||||
AVStream *st = ic->streams[i];
|
||||
AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
|
||||
|
||||
avcodec_string(buf, sizeof(buf), st->codec, is_output);
|
||||
Debug(1, " Stream #%d:%d", index, i);
|
||||
|
||||
/* the pid is an important information, so we display it */
|
||||
@@ -281,6 +280,7 @@ void zm_dump_stream_format(AVFormatContext *ic, int i, int index, int is_output)
|
||||
if (lang)
|
||||
Debug(1, "(%s)", lang->value);
|
||||
Debug(1, ", frames:%d, timebase: %d/%d", st->codec_info_nb_frames, st->time_base.num, st->time_base.den);
|
||||
avcodec_string(buf, sizeof(buf), st->codec, is_output);
|
||||
Debug(1, ": %s", buf);
|
||||
|
||||
if (st->sample_aspect_ratio.num && // default
|
||||
|
||||
@@ -128,7 +128,6 @@ Debug(2,"About to copy aparames");
|
||||
Error("Could not allocate in frame");
|
||||
return;
|
||||
}
|
||||
video_out_ctx = avcodec_alloc_context3( video_out_codec );
|
||||
// Don't have an input stream, so need to tell it what we are sending it, or are transcoding
|
||||
video_out_ctx->width = monitor->Width();
|
||||
video_out_ctx->height = monitor->Height();
|
||||
@@ -184,6 +183,10 @@ Debug(2,"About to copy aparames");
|
||||
Debug(2,"Setting preset to ultrafast");
|
||||
av_dict_set( &opts, "preset", "ultrafast", 0 );
|
||||
}
|
||||
if ( ! av_dict_get( opts, "tune", NULL, 0 ) ) {
|
||||
Debug(2,"Setting tune to lowlatency");
|
||||
av_dict_set( &opts, "tune", "lowlatency", 0 );
|
||||
}
|
||||
|
||||
if ( (ret = avcodec_open2(video_out_ctx, video_out_codec, &opts)) < 0 ) {
|
||||
Warning("Can't open video codec (%s)! %s, trying h264",
|
||||
|
||||
Reference in New Issue
Block a user