Opened 5 years ago

Last modified 5 years ago

#7566 new enhancement

Request: support auto proper pixel format in hwdownload

Reported by: ponpon Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

ffmpeg -v 99 -init_hw_device opencl=ocl:0.1 -filter_hw_device ocl -f lavfi -i nullsrc -vf "hwupload,unsharp_opencl,hwdownload" -f null -
ffmpeg version N-92458-gfc94e9704e Copyright (c) 2000-2018 the FFmpeg developers
  built with clang version 5.0.2 (tags/RELEASE_502/final)
  configuration: --prefix=/sw --cc=clang-mp-5.0 --cxx=clang++-mp-5.0 --disable-shared --enable-static --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --optflags=-Ofast --extra-cflags='-I/sw/include -I/opt/local/include ' --extra-ldflags=' -L/sw/lib -L/opt/local/lib -fopenmp' --extra-ldsoflags='-L/sw/lib -L/opt/local/lib -static--target-os=darwin' --arch=x86_64 --cpu=kabylake --enable-avresample --enable-libfdk-aac --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid --enable-libfreetype --enable-gcrypt --enable-gmp --enable-openssl --enable-librtmp --enable-libass --enable-fontconfig --enable-libfribidi --enable-libbluray --enable-libdc1394 --enable-libmodplug --enable-lzma --enable-libx264 --enable-libx265 --enable-libzimg --enable-libvidstab --enable-libsoxr --enable-libsmbclient --enable-libcdio --enable-opengl --enable-opencl --pkg-config-flags=' --libs --static'
  libavutil      56. 23.101 / 56. 23.101
  libavcodec     58. 39.100 / 58. 39.100
  libavformat    58. 22.100 / 58. 22.100
  libavdevice    58.  6.100 / 58.  6.100
  libavfilter     7. 44.100 /  7. 44.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '99'.
Reading option '-init_hw_device' ... matched as option 'init_hw_device' (initialise hardware device) with argument 'opencl=ocl:0.1'.
Reading option '-filter_hw_device' ... matched as option 'filter_hw_device' (set hardware device used when filtering) with argument 'ocl'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'lavfi'.
Reading option '-i' ... matched as input url with argument 'nullsrc'.
Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'hwupload,unsharp_opencl,hwdownload'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'null'.
Reading option '-' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 99.
Applying option init_hw_device (initialise hardware device) with argument opencl=ocl:0.1.
[AVHWDeviceContext @ 0x7f80e65002c0] 1 OpenCL platforms found.
[AVHWDeviceContext @ 0x7f80e65002c0] 3 OpenCL devices found on platform "Apple".
[AVHWDeviceContext @ 0x7f80e65002c0] 0.1: Apple / Intel(R) HD Graphics 630
Applying option filter_hw_device (set hardware device used when filtering) with argument ocl.
Successfully parsed a group of options.
Parsing a group of options: input url nullsrc.
Applying option f (force format) with argument lavfi.
Successfully parsed a group of options.
Opening an input file: nullsrc.
detected 8 logical cores
[Parsed_nullsrc_0 @ 0x7f80e6425680] size:320x240 rate:25/1 duration:-1.000000 sar:1/1
[AVFilterGraph @ 0x7f80e651f640] query_formats: 2 queried, 1 merged, 0 already done, 0 delayed
[lavfi @ 0x7f80e71bfc00] All info found
[lavfi @ 0x7f80e71bfc00] stream 0: start_time: 0.000 duration: -368934881474191040.000
[lavfi @ 0x7f80e71bfc00] format: start_time: 0.000 duration: -9223372036854.775 bitrate=0 kb/s
Input #0, lavfi, from 'nullsrc':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0, 1, 1/25: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 0/1, 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output url -.
Applying option vf (set video filters) with argument hwupload,unsharp_opencl,hwdownload.
Applying option f (force format) with argument null.
Successfully parsed a group of options.
Opening an output file: -.
Successfully opened the file.
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[rawvideo @ 0x7f80e9002200] PACKET SIZE: 115200, STRIDE: 480
[graph 0 input from stream 0:0 @ 0x7f80e651ff80] Setting 'video_size' to value '320x240'
[graph 0 input from stream 0:0 @ 0x7f80e651ff80] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x7f80e651ff80] Setting 'time_base' to value '1/25'
[graph 0 input from stream 0:0 @ 0x7f80e651ff80] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x7f80e651ff80] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x7f80e651ff80] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x7f80e651ff80] w:320 h:240 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[AVHWDeviceContext @ 0x7f80e65002c0] Maximum supported image size 16384x16384.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuv420p supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuv422p supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuv444p supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuv410p supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuv411p supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format gray supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuvj420p supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuvj422p supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuvj444p supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format nv12 supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format nv21 supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format argb supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format rgba supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format abgr supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format bgra supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format gray16le supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuv440p supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuvj440p supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuva420p supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuv420p16le supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuv422p16le supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuv444p16le supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format ya8 supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format gbrp supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format gbrp16le supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuva422p supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuva444p supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuva420p16le supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuva422p16le supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuva444p16le supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format nv16 supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format rgba64le supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format bgra64le supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format ya16le supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format gbrap supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format gbrap16le supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format yuvj411p supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format ayuv64le supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format p010le supported.
[AVHWDeviceContext @ 0x7f80e65002c0] Format p016le supported.
[AVFilterGraph @ 0x7f80e810cf40] query_formats: 5 queried, 4 merged, 0 already done, 0 delayed
[Parsed_hwdownload_2 @ 0x7f80e651fa40] picking monow out of 172 ref:opencl alpha:1
[hwupload @ 0x7f80e6500200] Surface format is yuv420p.
[hwdownload @ 0x7f80e651f6c0] Invalid output format monow for hwframe download.
[Parsed_hwdownload_2 @ 0x7f80e651fa40] Failed to configure output pad on Parsed_hwdownload_2
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!

Change History (3)

comment:1 by jkqxz, 5 years ago

"format=FOO,hwupload,unsharp_opencl,hwdownload,format=FOO", same FOO in both cases.

The filter format negotiation doesn't have the information to see what format it needs to pick as the output of hwdownload, because it doesn't know what the thing before it will produce yet.

in reply to:  1 comment:2 by ponpon, 5 years ago

Replying to jkqxz:
Thank you for your help.

I change this ticket from a bug to a request if technically possible.
If impossible, please close this ticket.

comment:3 by ponpon, 5 years ago

Summary: hwdownload error in using openclRequest: support auto proper pixel format in hwdownload
Type: defectenhancement
Note: See TracTickets for help on using tickets.