Project

General

Profile

Bug #3146

CC error compiling tvheadend-git with dynamically loaded ffmpeg-git

Added by Thomas Ziegler about 9 years ago. Updated about 9 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
General
Target version:
-
Start date:
2015-10-10
Due date:
% Done:

100%

Estimated time:
Found in version:
current git
Affected Versions:

Description

Trying to compile the current git version of tvheadend against the current git version of ffmpeg yields compilation errors for some weeks now:

CC src/plumbing/transcoding.o
src/plumbing/transcoding.c:27:36: fatal error: libavutil/audioconvert.h: No such file or directory
#include <libavutil/audioconvert.h>
^
compilation terminated.

Maybe they did make it happen? "This interface is deprecated and will be dropped in a future version. "


Files

tvh-ffmpeg9999-dbgtypes.patch (1.47 KB) tvh-ffmpeg9999-dbgtypes.patch Manuel Lauss, 2015-11-04 21:11

History

#1

Updated by Jaroslav Kysela about 9 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset commit:tvheadend|ea02889c149e3d2b80dcaed3d9ad976145bb92b0.

#2

Updated by Thomas Ziegler about 9 years ago

Sorry, ist me again, removing the include does lead to more Errors:

CC src/plumbing/transcoding.o
src/plumbing/transcoding.c: In function ‘transcoder_stream_audio’:
src/plumbing/transcoding.c:681:7: error: format ‘%d’ expects argument of type ‘int’, but argument 11 has type ‘int64_t’ [-Werror=format=]
tvhdebug("transcode", "%04X: IN : channel_layout=%s, rate=%d, fmt=%s, bitrate=%d",
^
src/plumbing/transcoding.c:686:7: error: format ‘%d’ expects argument of type ‘int’, but argument 11 has type ‘int64_t’ [-Werror=format=]
tvhdebug("transcode", "%04X: OUT: channel_layout=%s, rate=%d, fmt=%s, bitrate=%d",
^
src/plumbing/transcoding.c: In function ‘transcoder_stream_video’:
src/plumbing/transcoding.c:1132:30: error: ‘PIX_FMT_YUV420P’ undeclared (first use in this function)
octx->pix_fmt = PIX_FMT_YUV420P;
^
src/plumbing/transcoding.c:1132:30: note: each undeclared identifier is reported only once for each function it appears in
src/plumbing/transcoding.c:1270:3: error: implicit declaration of function ‘avpicture_deinterlace’ [-Werror=implicit-function-declaration]
if (avpicture_deinterlace(&deint_pic,
^
src/plumbing/transcoding.c: In function ‘transcoder_init_video’:
src/plumbing/transcoding.c:1682:3: error: implicit declaration of function ‘avcodec_alloc_frame’ [-Werror=implicit-function-declaration]
vs->vid_dec_frame = avcodec_alloc_frame();
^
src/plumbing/transcoding.c:1682:21: error: assignment makes pointer from integer without a cast [-Werror]
vs->vid_dec_frame = avcodec_alloc_frame();
^
src/plumbing/transcoding.c:1683:21: error: assignment makes pointer from integer without a cast [-Werror]
vs->vid_enc_frame = avcodec_alloc_frame();
^
src/plumbing/transcoding.c:1685:3: error: implicit declaration of function ‘avcodec_get_frame_defaults’ [-Werror=implicit-function-declaration]
avcodec_get_frame_defaults(vs->vid_dec_frame);
^
cc1: all warnings being treated as errors

#3

Updated by Jaroslav Kysela about 9 years ago

  • Status changed from Fixed to New
#4

Updated by Thomas Ziegler about 9 years ago

The easy part: Rename a flag und two functions and adapt a change from int to int64:

diff --git a/src/plumbing/transcoding.c b/src/plumbing/transcoding.c
index d6c7838..a7a399a 100644
--- a/src/plumbing/transcoding.c
+++ b/src/plumbing/transcoding.c
@@ -678,12 +678,12 @@ transcoder_stream_audio(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
       tvhdebug("transcode", "%04X: starting audio resampling", shortid(t));

       av_get_channel_layout_string(layout_buf, sizeof (layout_buf), ictx->channels, ictx->channel_layout);
-      tvhdebug("transcode", "%04X: IN : channel_layout=%s, rate=%d, fmt=%s, bitrate=%d",
+      tvhdebug("transcode", "%04X: IN : channel_layout=%s, rate=%d, fmt=%s, bitrate=%ld",
                shortid(t), layout_buf, ictx->sample_rate,
                av_get_sample_fmt_name(ictx->sample_fmt), ictx->bit_rate);

       av_get_channel_layout_string(layout_buf, sizeof (layout_buf), octx->channels, octx->channel_layout);
-      tvhdebug("transcode", "%04X: OUT: channel_layout=%s, rate=%d, fmt=%s, bitrate=%d",
+      tvhdebug("transcode", "%04X: OUT: channel_layout=%s, rate=%d, fmt=%s, bitrate=%ld",
                shortid(t), layout_buf, octx->sample_rate,
                av_get_sample_fmt_name(octx->sample_fmt), octx->bit_rate);

@@ -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
@@ -1679,11 +1679,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);
#5

Updated by Thomas Ziegler about 9 years ago

The hard part:

avpicture_deinterlace
got removed and the only option is to use avfilter or reimplement the function on your own.

#6

Updated by Thomas Ziegler about 9 years ago

https://tvheadend.org/projects/tvheadend/repository/revisions/be3bb7c7aa89c623b68026f1929e44504f6b726a
fixes this issue mostly.

Only two minor errors remain (which I fixed locally, I am yet not quite comfortable with git und going push):

src/plumbing/transcoding.c: In function ‘transcoder_stream_audio’:
src/plumbing/transcoding.c:687:7: error: format ‘%d’ expects argument of type ‘int’, but argument 11 has type ‘int64_t’ [-Werror=format=]
tvhdebug("transcode", "%04X: IN : channel_layout=%s, rate=%d, fmt=%s, bitrate=%d",
^
src/plumbing/transcoding.c:692:7: error: format ‘%d’ expects argument of type ‘int’, but argument 11 has type ‘int64_t’ [-Werror=format=]
tvhdebug("transcode", "%04X: OUT: channel_layout=%s, rate=%d, fmt=%s, bitrate=%d",
^
cc1: all warnings being treated as errors

#7

Updated by Manuel Lauss about 9 years ago

Give latest tvh git a try please.

#8

Updated by Thomas Ziegler about 9 years ago

Manuel Lauss wrote:

Give latest tvh git a try please.

This error is with latest git.

#9

Updated by Manuel Lauss about 9 years ago

Oh I see it now, it's due to ffmpeg.git changing some types.

#10

Updated by Manuel Lauss about 9 years ago

Please try this patch. I've tested it against ffmpeg.git and ffmpeg-2.8, but only on 64bit systems.

#11

Updated by Jaroslav Kysela about 9 years ago

Manuel J. Garcia Egido: use PRId64 for int64_t ..

#12

Updated by Manuel Lauss about 9 years ago

@Jaroslav: Done, I sent you pull request #753. It passes my compile tests on x64 with ffmpeg-2.8 and ffmpeg git head.

#13

Updated by Jaroslav Kysela about 9 years ago

  • Status changed from New to Fixed

Applied. Marking as fixed.

Also available in: Atom PDF