1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
From 3cb4f580565b307457f6e645f34bf113c2be54a4 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Fri, 20 Apr 2018 14:28:13 +0200
Subject: [PATCH] ffmpeg 3.5 fixes
---
src/muxer/muxer_libav.c | 2 +-
src/plumbing/transcoding.c | 24 ++++++++++++------------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/muxer/muxer_libav.c b/src/muxer/muxer_libav.c
index a3ed82199..e5ff6d0e7 100644
--- a/src/muxer/muxer_libav.c
+++ b/src/muxer/muxer_libav.c
@@ -174,7 +174,7 @@ lav_muxer_add_stream(lav_muxer_t *lm,
}
if(lm->lm_oc->oformat->flags & AVFMT_GLOBALHEADER)
- c->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
return 0;
}
diff --git a/src/plumbing/transcoding.c b/src/plumbing/transcoding.c
index d86970b81..f587df772 100644
--- a/src/plumbing/transcoding.c
+++ b/src/plumbing/transcoding.c
@@ -19,7 +19,7 @@
#include <unistd.h>
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
-#include <libavfilter/avfiltergraph.h>
+#include <libavfilter/avfilter.h>
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
#include <libavutil/opt.h>
@@ -574,7 +574,7 @@ transcoder_stream_audio(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
octx->channels = as->aud_channels ? as->aud_channels : ictx->channels;
octx->channel_layout = transcode_get_channel_layout(&octx->channels, ocodec);
octx->bit_rate = as->aud_bitrate ? as->aud_bitrate : 0;
- octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ octx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
if (!octx->sample_rate) {
tvherror(LS_TRANSCODE, "%04X: audio encoder has no suitable sample rate!", shortid(t));
@@ -619,7 +619,7 @@ transcoder_stream_audio(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
break;
case SCT_AAC:
- octx->flags |= CODEC_FLAG_BITEXACT;
+ octx->flags |= AV_CODEC_FLAG_BITEXACT;
// use 64 kbit per channel as default
if (octx->bit_rate == 0) {
octx->bit_rate = octx->channels * 64000;
@@ -630,10 +630,10 @@ transcoder_stream_audio(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
// use vbr with quality setting as default
// and also use a user specified bitrate < 16 kbit as quality setting
if (octx->bit_rate == 0) {
- octx->flags |= CODEC_FLAG_QSCALE;
+ octx->flags |= AV_CODEC_FLAG_QSCALE;
octx->global_quality = 4 * FF_QP2LAMBDA;
} else if (t->t_props.tp_abitrate < 16) {
- octx->flags |= CODEC_FLAG_QSCALE;
+ octx->flags |= AV_CODEC_FLAG_QSCALE;
octx->global_quality = t->t_props.tp_abitrate * FF_QP2LAMBDA;
octx->bit_rate = 0;
}
@@ -1048,7 +1048,7 @@ create_video_filter(video_stream_t *vs, transcoder_t *t,
AVCodecContext *ictx, AVCodecContext *octx)
{
AVFilterInOut *flt_inputs, *flt_outputs;
- AVFilter *flt_bufsrc, *flt_bufsink;
+ const AVFilter *flt_bufsrc, *flt_bufsink;
enum AVPixelFormat pix_fmts[] = { 0, AV_PIX_FMT_NONE };
char opt[128];
int err;
@@ -1289,12 +1289,12 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
else
octx->pix_fmt = AV_PIX_FMT_YUV420P;
- octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ octx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
if (t->t_props.tp_vbitrate < 64) {
// encode with specified quality and optimize for low latency
// valid values for quality are 2-31, smaller means better quality, use 5 as default
- octx->flags |= CODEC_FLAG_QSCALE;
+ octx->flags |= AV_CODEC_FLAG_QSCALE;
octx->global_quality = FF_QP2LAMBDA *
(t->t_props.tp_vbitrate == 0 ? 5 : MINMAX(t->t_props.tp_vbitrate, 2, 31));
} else {
@@ -1340,7 +1340,7 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
else
octx->pix_fmt = AV_PIX_FMT_YUV420P;
- octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ octx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
// Default = "medium". We gain more encoding speed compared to the loss of quality when lowering it _slightly_.
// select preset according to system performance and codec type
@@ -1371,7 +1371,7 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
case SCT_HEVC:
octx->pix_fmt = AV_PIX_FMT_YUV420P;
- octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ octx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
// on all hardware ultrafast (or maybe superfast) should be safe
// select preset according to system performance
@@ -2177,7 +2177,7 @@ transcoder_get_capabilities(int experimental)
if (!WORKING_ENCODER(p->id))
continue;
- if (((p->capabilities & CODEC_CAP_EXPERIMENTAL) && !experimental) ||
+ if (((p->capabilities & AV_CODEC_CAP_EXPERIMENTAL) && !experimental) ||
(p->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)) {
continue;
}
@@ -2192,7 +2192,7 @@ transcoder_get_capabilities(int experimental)
htsmsg_add_str(m, "name", p->name);
snprintf(buf, sizeof(buf), "%s%s",
p->long_name ?: "",
- (p->capabilities & CODEC_CAP_EXPERIMENTAL) ?
+ (p->capabilities & AV_CODEC_CAP_EXPERIMENTAL) ?
" (Experimental)" : "");
if (buf[0] != '\0')
htsmsg_add_str(m, "long_name", buf);
--
2.17.0
|