1129 |
1129 |
|
1130 |
1130 |
switch (ts->ts_type) {
|
1131 |
1131 |
case SCT_MPEG2VIDEO:
|
1132 |
|
octx->pix_fmt = PIX_FMT_YUV420P;
|
|
1132 |
octx->pix_fmt = AV_PIX_FMT_YUV420P;
|
1133 |
1133 |
octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
1134 |
1134 |
|
1135 |
1135 |
if (t->t_props.tp_vbitrate < 64) {
|
... | ... | |
1152 |
1152 |
break;
|
1153 |
1153 |
|
1154 |
1154 |
case SCT_VP8:
|
1155 |
|
octx->pix_fmt = PIX_FMT_YUV420P;
|
|
1155 |
octx->pix_fmt = AV_PIX_FMT_YUV420P;
|
1156 |
1156 |
|
1157 |
1157 |
// setting quality to realtime will use as much CPU for transcoding as possible,
|
1158 |
1158 |
// while still encoding in realtime
|
... | ... | |
1176 |
1176 |
break;
|
1177 |
1177 |
|
1178 |
1178 |
case SCT_H264:
|
1179 |
|
octx->pix_fmt = PIX_FMT_YUV420P;
|
|
1179 |
octx->pix_fmt = AV_PIX_FMT_YUV420P;
|
1180 |
1180 |
octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
1181 |
1181 |
|
1182 |
1182 |
// Default = "medium". We gain more encoding speed compared to the loss of quality when lowering it _slightly_.
|
... | ... | |
1205 |
1205 |
break;
|
1206 |
1206 |
|
1207 |
1207 |
case SCT_HEVC:
|
1208 |
|
octx->pix_fmt = PIX_FMT_YUV420P;
|
|
1208 |
octx->pix_fmt = AV_PIX_FMT_YUV420P;
|
1209 |
1209 |
octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
1210 |
1210 |
|
1211 |
1211 |
// on all hardware ultrafast (or maybe superfast) should be safe
|
... | ... | |
1267 |
1267 |
ictx->width,
|
1268 |
1268 |
ictx->height);
|
1269 |
1269 |
|
1270 |
|
if (avpicture_deinterlace(&deint_pic,
|
1271 |
|
(AVPicture *)vs->vid_dec_frame,
|
1272 |
|
ictx->pix_fmt,
|
1273 |
|
ictx->width,
|
1274 |
|
ictx->height) < 0) {
|
1275 |
|
tvherror("transcode", "%04X: Cannot deinterlace frame", shortid(t));
|
1276 |
|
transcoder_stream_invalidate(ts);
|
1277 |
|
goto cleanup;
|
1278 |
|
}
|
1279 |
|
|
1280 |
1270 |
len = avpicture_get_size(octx->pix_fmt, octx->width, octx->height);
|
1281 |
1271 |
buf = av_malloc(len + FF_INPUT_BUFFER_PADDING_SIZE);
|
1282 |
1272 |
memset(buf, 0, len);
|
... | ... | |
1679 |
1669 |
if (t->t_props.tp_nrprocessors)
|
1680 |
1670 |
vs->vid_octx->thread_count = t->t_props.tp_nrprocessors;
|
1681 |
1671 |
|
1682 |
|
vs->vid_dec_frame = avcodec_alloc_frame();
|
1683 |
|
vs->vid_enc_frame = avcodec_alloc_frame();
|
|
1672 |
vs->vid_dec_frame = av_frame_alloc();
|
|
1673 |
vs->vid_enc_frame = av_frame_alloc();
|
1684 |
1674 |
|
1685 |
|
avcodec_get_frame_defaults(vs->vid_dec_frame);
|
1686 |
|
avcodec_get_frame_defaults(vs->vid_enc_frame);
|
|
1675 |
av_frame_unref(vs->vid_dec_frame);
|
|
1676 |
av_frame_unref(vs->vid_enc_frame);
|
1687 |
1677 |
|
1688 |
1678 |
LIST_INSERT_HEAD(&t->t_stream_list, (transcoder_stream_t*)vs, ts_link);
|
1689 |
1679 |
|