commit 5ea78f4205b75d2dc8e67f582bdae8d39b20f3d9 Author: Manuel Lauss Date: Fri Oct 30 18:43:16 2015 +0100 Fix up ffmpeg - ffmpeg dropped the deprecated deinterlacer module, remove it - update to new APIs Tested against ffmpeg-2.8 and ffmpeg-git head. diff --git a/src/plumbing/transcoding.c b/src/plumbing/transcoding.c index d6c7838..8a9a9a2 100644 --- a/src/plumbing/transcoding.c +++ b/src/plumbing/transcoding.c @@ -1129,7 +1129,7 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt) switch (ts->ts_type) { case SCT_MPEG2VIDEO: - octx->pix_fmt = PIX_FMT_YUV420P; + octx->pix_fmt = AV_PIX_FMT_YUV420P; octx->flags |= CODEC_FLAG_GLOBAL_HEADER; if (t->t_props.tp_vbitrate < 64) { @@ -1152,7 +1152,7 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt) break; case SCT_VP8: - octx->pix_fmt = PIX_FMT_YUV420P; + octx->pix_fmt = AV_PIX_FMT_YUV420P; // setting quality to realtime will use as much CPU for transcoding as possible, // while still encoding in realtime @@ -1176,7 +1176,7 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt) break; case SCT_H264: - octx->pix_fmt = PIX_FMT_YUV420P; + octx->pix_fmt = AV_PIX_FMT_YUV420P; octx->flags |= CODEC_FLAG_GLOBAL_HEADER; // Default = "medium". We gain more encoding speed compared to the loss of quality when lowering it _slightly_. @@ -1205,7 +1205,7 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt) break; case SCT_HEVC: - octx->pix_fmt = PIX_FMT_YUV420P; + octx->pix_fmt = AV_PIX_FMT_YUV420P; octx->flags |= CODEC_FLAG_GLOBAL_HEADER; // on all hardware ultrafast (or maybe superfast) should be safe @@ -1267,16 +1267,6 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt) ictx->width, ictx->height); - if (avpicture_deinterlace(&deint_pic, - (AVPicture *)vs->vid_dec_frame, - ictx->pix_fmt, - ictx->width, - ictx->height) < 0) { - tvherror("transcode", "%04X: Cannot deinterlace frame", shortid(t)); - transcoder_stream_invalidate(ts); - goto cleanup; - } - len = avpicture_get_size(octx->pix_fmt, octx->width, octx->height); buf = av_malloc(len + FF_INPUT_BUFFER_PADDING_SIZE); memset(buf, 0, len); @@ -1679,11 +1669,11 @@ transcoder_init_video(transcoder_t *t, streaming_start_component_t *ssc) if (t->t_props.tp_nrprocessors) vs->vid_octx->thread_count = t->t_props.tp_nrprocessors; - vs->vid_dec_frame = avcodec_alloc_frame(); - vs->vid_enc_frame = avcodec_alloc_frame(); + vs->vid_dec_frame = av_frame_alloc(); + vs->vid_enc_frame = av_frame_alloc(); - avcodec_get_frame_defaults(vs->vid_dec_frame); - avcodec_get_frame_defaults(vs->vid_enc_frame); + av_frame_unref(vs->vid_dec_frame); + av_frame_unref(vs->vid_enc_frame); LIST_INSERT_HEAD(&t->t_stream_list, (transcoder_stream_t*)vs, ts_link);