Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2519 closed defect (fixed)

ffmpeg master opencl boken

Reported by: telperion Owned by:
Priority: important Component: build system
Version: git-master Keywords: regression opencl
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

% ffmpeg -i '.test.mkv' -vf "deshake=opencl=1" -b:v 1600k out.avi
ffmpeg version N-52151-g30926a1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Apr 28 2013 22:59:02 with gcc 4.7 (Debian 4.7.2-5)
  configuration: --extra-cflags='-Wall -g -O3 -march=core2 -mtune=core2' --prefix=/usr --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-libvpx --enable-librtmp --enable-avfilter --enable-frei0r --enable-libopencv --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --enable-libdc1394 --disable-altivec --disable-armv5te --disable-armv6 --disable-vis --enable-filter=delogo --enable-filter=boxblur --enable-filter=frei0r --enable-filter=drawtext --enable-filter=gradfun --disable-ffserver --disable-shared --enable-static --enable-vdpau --enable-libfdk-aac --enable-libass --enable-opencl
  libavutil      52. 26.100 / 52. 26.100
  libavcodec     55.  2.100 / 55.  2.100
  libavformat    55.  2.100 / 55.  2.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 56.101 /  3. 56.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, matroska,webm, from 'test.mkv':
  Duration: 00:22:08.09, start: 0.000000, bitrate: 995 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 576x432 [SAR 1:1 DAR 4:3], 29.97 fps, 29.97 tbr, 1k tbn, 180k tbc (default)
    Stream #0:1: Audio: aac, 48000 Hz, mono, fltp (default)
File 'out.avi' already exists. Overwrite ? [y/N] y
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf55.2.100
    Stream #0:0(eng): Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 576x432 [SAR 1:1 DAR 4:3], q=2-31, 1600 kb/s, 29.97 tbn, 29.97 tbc (default)
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, mono, fltp (default)
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
  Stream #0:1 -> #0:1 (aac -> libmp3lame)
Press [q] to stop, [?] for help
frame=  344 fps= 51 q=6.7 Lsize=    2586kB time=00:00:11.66 bitrate=1816.1kbits/s    
video:2465kB audio:91kB subtitle:0 global headers:0kB muxing overhead 1.149812%


after this commit

http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=df9117921ac3fea7552a20c66b1cfd5967a9f345

-enable-opencl don't build

CC      libavfilter/deshake_opencl.o
In file included from libavfilter/deshake.h:29:0,
                 from libavfilter/deshake_opencl.h:24,
                 from libavfilter/deshake_opencl.c:29:
./libavutil/opencl.h:38:23: fatal error: OpenCL/cl.h: File o directory non esistente
compilation terminated.
CC      libavfilter/drawutils.o
CC      libavfilter/f_ebur128.o
make: *** [libavfilter/deshake_opencl.o] Error 1
make: *** Waiting for unfinished jobs....


but

% ls /usr/include/CL
cl_d3d10.h  cl_dx9_media_sharing.h  cl_gl_ext.h  cl.h    cl_platform.h
cl_d3d11.h  cl_ext.h                cl_gl.h      cl.hpp  opencl.h
% grep -R HAVE_CL_CL_H
config.h:#define HAVE_CL_CL_H 0
config.mak:!HAVE_CL_CL_H=yes
libavutil/opencl.h:#if HAVE_CL_CL_H
config.asm:%define HAVE_CL_CL_H 0

reversing in libavutil/opencl.h

-#include <CL/cl.h>
 #include "config.h"
+#if HAVE_CL_CL_H
+#include <CL/cl.h>
+#else
+#include <OpenCL/cl.h>
+#endif

ffmpeg build again, but segfault if i use opencl=1 in deshake or unsharp

% ffmpeg -i 'test.mkv' -vf "deshake=opencl=1" -b:v 1600k out.avi
ffmpeg version N-52587-g53efb2f Copyright (c) 2000-2013 the FFmpeg developers
  built on Apr 30 2013 19:59:40 with gcc 4.7 (Debian 4.7.2-5)
  configuration: --extra-cflags='-Wall -g -O3 -march=core2 -mtune=core2' --prefix=/usr --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-libvpx --enable-librtmp --enable-avfilter --enable-frei0r --enable-libopencv --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --enable-libdc1394 --disable-altivec --disable-armv5te --disable-armv6 --disable-vis --enable-filter=delogo --enable-filter=boxblur --enable-filter=frei0r --enable-filter=drawtext --enable-filter=gradfun --disable-ffserver --disable-shared --enable-static --enable-vdpau --enable-opencl --enable-libfdk-aac --enable-libass -  libavutil      52. 27.101 / 52. 27.101
  libavcodec     55.  6.100 / 55.  6.100
  libavformat    55.  3.100 / 55.  3.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 61.101 /  3. 61.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, matroska,webm, from 'test.mkv':
  Duration: 00:22:08.09, start: 0.000000, bitrate: 995 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 576x432 [SAR 1:1 DAR 4:3], 29.97 fps, 29.97 tbr, 1k tbn, 180k tbc (default)
    Stream #0:1: Audio: aac, 48000 Hz, mono, fltp (default)
Segmentation fault

Build on debian sid 64
Nvidia 440GT

Change History (8)

comment:1 by Carl Eugen Hoyos, 11 years ago

Component: FFmpegbuild system
Keywords: regression added
Priority: normalimportant
Status: newopen
Version: unspecifiedgit-master

in reply to:  description comment:2 by Carl Eugen Hoyos, 11 years ago

Replying to telperion:

ffmpeg build again, but segfault if i use opencl=1 in deshake or unsharp

This sounds like an unrelated issue, please open a separate ticket.

comment:3 by telperion, 11 years ago

ok open another ticket for segfault.

for build sistem after

./configure --extra-cflags='-Wall -g -O3 -march=core2 -mtune=core2'  --prefix=/usr --enable-libmp3lame --enable-gpl --enable-nonfree  --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-libvpx --enable-librtmp --enable-avfilter --enable-frei0r --enable-libopencv --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --enable-libdc1394 --disable-altivec --disable-armv5te --disable-armv6 --disable-vis --enable-filter=delogo --enable-filter=boxblur --enable-filter=frei0r --enable-filter=drawtext --enable-filter=gradfun --disable-ffserver  --disable-shared --enable-static --enable-vdpau --enable-libfdk-aac --enable-libass --enable-libvidstab --enable-opencl

i found:

grep -R HAVE_CL_CL_H

config.h:#define HAVE_CL_CL_H 0
config.mak:!HAVE_CL_CL_H=yes
libavutil/opencl.h:#if HAVE_CL_CL_H
config.asm:%define HAVE_CL_CL_H 0

manual edit files config.h config.mak config.asm
then

grep -R HAVE_CL_CL_H

config.h:#define HAVE_CL_CL_H 1
config.mak:HAVE_CL_CL_H=yes
libavutil/opencl.h:#if HAVE_CL_CL_H
config.asm:%define HAVE_CL_CL_H 1

and ffmpeg build.

comment:4 by telperion, 11 years ago

this could be:

--- a/configure   2013-04-29 12:11:07.000000000 +0200
+++ b/configure   2013-05-03 00:49:44.473017236 +0200
@@ -1408,7 +1408,7 @@
     attribute_packed
     cdio_paranoia_h
     cdio_paranoia_paranoia_h
-    cl_cl_h
+    CL_cl_h
     clock_gettime
     closesocket
     cmov

after configure:

%grep -R HAVE_CL_CL_H
config.h:#define HAVE_CL_CL_H 1
config.mak:HAVE_CL_CL_H=yes
libavutil/opencl.h:#if HAVE_CL_CL_H
config.asm:%define HAVE_CL_CL_H 1

comment:5 by Carl Eugen Hoyos, 11 years ago

Could you send a patch to ffmpeg-devel?

comment:6 by Carl Eugen Hoyos, 11 years ago

Resolution: fixed
Status: openclosed

I suspect this is fixed in git head.

comment:7 by Carl Eugen Hoyos, 11 years ago

Keywords: opencl added
Note: See TracTickets for help on using tickets.