xmixahlx / pbp-tools

pinebook pro tools: tools for system management, hardware acceleration, and wayland environment for the pinebook pro.
GNU General Public License v3.0
46 stars 8 forks source link

error compiling ffmpeg on a T4 #3

Closed ghost closed 4 years ago

ghost commented 4 years ago

HI! It seems to me than on my kernel 5.7.2 I have all the requirements meet to enable the VPU acceleration.

pi@arm-64:/media/pi/DATOS/pbp-tools$ vainfo libva info: VA-API version 1.8.0 libva info: User environment variable requested driver 'v4l2_request' libva info: Trying to open /usr/local/lib/aarch64-linux-gnu/dri/v4l2_request_drv_video.so libva info: Found init function __vaDriverInit_1_8 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.8 (libva 2.8.0.1) vainfo: Driver version: v4l2-request vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointVLD VAProfileH264High : VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264MultiviewHigh : VAEntrypointVLD VAProfileH264StereoHigh : VAEntrypointVLD

but I fail on compiling ffmpeg

In function ‘strncpy’,
    inlined from ‘ff_v4l2_m2m_codec_init’ at libavcodec/v4l2_m2m.c:362:9:
/usr/include/aarch64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin___strncpy_chk’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavcodec/v4l2_m2m.c: In function ‘ff_v4l2_m2m_codec_init’:
libavcodec/v4l2_m2m.c:362:35: note: length computed here
  362 |         strncpy(s->devname, node, strlen(node) + 1);
      |                                   ^~~~~~~~~~~~
CC  libavcodec/v4l2_m2m_enc.o
CC  libavcodec/v4l2_request.o
CC  libavcodec/v4l2_request_h264.o
libavcodec/v4l2_request.c: In function ‘v4l2_request_queue_decode’:
libavcodec/v4l2_request.c:294:90: error: ‘V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF’ undeclared (first use in this function)
  294 |     ret = v4l2_request_queue_buffer(ctx, req->request_fd, &req->output, last_slice ? 0 : V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF);
      |                                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavcodec/v4l2_request.c:294:90: note: each undeclared identifier is reported only once for each function it appears in
CC  libavcodec/v4l2_request_hevc.o
libavcodec/v4l2_request.c: In function ‘ff_v4l2_request_decode_slice’:
libavcodec/v4l2_request.c:378:37: error: ‘V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF’ undeclared (first use in this function)
  378 |     if ((req->output.capabilities & V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF) != V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF)
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavcodec/v4l2_request.c: In function ‘ff_v4l2_request_output_frame’:
libavcodec/v4l2_request.c:391:25: warning: unused variable ‘ctx’ [-Wunused-variable]
  391 |     V4L2RequestContext *ctx = avctx->internal->hwaccel_priv_data;
      |                         ^~~
make: *** [ffbuild/common.mak:59: libavcodec/v4l2_request.o] Error 1
make: *** Se espera a que terminen otras tareas....

hope you can help me here.

xmixahlx commented 4 years ago

you build 5.7.2 with hwaccel support? the linux kernel with hwaccel patch is required to build ffmpeg with v4l2request support. also, vaapi is NOT required to build ffmpeg.

ghost commented 4 years ago

Okay!! Gotcha! So the patch it's unofficial and will not be merged on mainline?

xmixahlx commented 4 years ago

it is currently WIP, which is why the hwaccel patch is needed.