[FFmpeg-user] [Parsed_overlay_opencl_5 @ 0x4f22e80] Failed to finish command queue:
Mark Thompson
sw at jkqxz.net
Thu Jan 11 00:57:08 EET 2018
On 10/01/18 02:54, 郭浩 wrote:
> Thank you for your reply!
> I try the command not udp and nvenc, it's not work,can you tell me you ffmpeg version?
git master in the last day. I've tried on Intel graphics (both Beignet and Windows), AMD (Windows) and ARM/Mali and not seen anything like this problem.
So, maybe this is some bad interaction with the Nvidia implementation? Google suggests that there are some problems where clFinish() can unhelpfully return -36 (CL_INVALID_COMMAND_QUEUE) on a valid command queue, which sounds like what you've got here. The driver source code isn't available code and I don't have any hardware to hand to debug further, though, so I'm not sure what to suggest.
- Mark
> ffmpeg version:
> ffmpeg version N-89748-g2050464 Copyright (c) 2000-2018 the FFmpeg developers
>
>
> ffmpeg cmd:
> ./ffmpeg -loglevel debug -init_hw_device opencl=cl:0.0 -filter_hw_device cl -i /opt/Film18/afanda/afanda.ts -filter_complex "color=c=black at 1:s=1280x720,hwupload[bg];[0:v]setpts=PTS-STARTPTS,scale=w=426:h=240,hwupload[v0];[bg][v0]overlay_opencl=x=0:y=0 ,hwdownload,format=yuv420p" -c:v libx264 -b:v 4M -r 25 -g 25 -f mpegts -y out.ts
>
>
> debug log:
> Splitting the commandline.
> Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
> Reading option '-init_hw_device' ... matched as option 'init_hw_device' (initialise hardware device) with argument 'opencl=cl:0.0'.
> Reading option '-filter_hw_device' ... matched as option 'filter_hw_device' (set hardware device used when filtering) with argument 'cl'.
> Reading option '-i' ... matched as input url with argument '/opt/Film18/afanda/afanda.ts'.
> Reading option '-filter_complex' ... matched as option 'filter_complex' (create a complex filtergraph) with argument 'color=c=black at 1:s=1280x720,hwupload[bg];[0:v]setpts=PTS-STARTPTS,scale=w=426:h=240,hwupload[v0];[bg][v0]overlay_opencl=x=0:y=0 ,hwdownload,format=yuv420p'.
> Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.
> Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '4M'.
> Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '25'.
> Reading option '-g' ... matched as AVOption 'g' with argument '25'.
> Reading option '-f' ... matched as option 'f' (force format) with argument 'mpegts'.
> Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
> Reading option 'out.ts' ... matched as output url.
> Finished splitting the commandline.
> Parsing a group of options: global .
> Applying option loglevel (set logging level) with argument debug.
> Applying option init_hw_device (initialise hardware device) with argument opencl=cl:0.0.
> [AVHWDeviceContext @ 0x48a22c0] 1 OpenCL platforms found.
> [AVHWDeviceContext @ 0x48a22c0] 1 OpenCL devices found on platform "NVIDIA CUDA".
> [AVHWDeviceContext @ 0x48a22c0] 0.0: NVIDIA CUDA / Quadro M4000
> Applying option filter_hw_device (set hardware device used when filtering) with argument cl.
> Applying option filter_complex (create a complex filtergraph) with argument color=c=black at 1:s=1280x720,hwupload[bg];[0:v]setpts=PTS-STARTPTS,scale=w=426:h=240,hwupload[v0];[bg][v0]overlay_opencl=x=0:y=0 ,hwdownload,format=yuv420p.
> Applying option y (overwrite output files) with argument 1.
> Successfully parsed a group of options.
> Parsing a group of options: input url /opt/Film18/afanda/afanda.ts.
> Successfully parsed a group of options.
> Opening an input file: /opt/Film18/afanda/afanda.ts.
> [NULL @ 0x5321bc0] Opening '/opt/Film18/afanda/afanda.ts' for reading
> [file @ 0x5322240] Setting default whitelist 'file,crypto'
> [mpegts @ 0x5321bc0] Format mpegts probed with size=2048 and score=50
> [mpegts @ 0x5321bc0] stream=0 stream_type=2 pid=200 prog_reg_desc=
> [mpegts @ 0x5321bc0] stream=1 stream_type=3 pid=201 prog_reg_desc=
> [mpegts @ 0x5321bc0] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0 nb_streams:2
> [mpeg2video @ 0x4d6a880] Format yuv420p chosen by get_format().
> [mpegts @ 0x5321bc0] Probe buffer size limit of 5000000 bytes reached
> [mpegts @ 0x5321bc0] After avformat_find_stream_info() pos: 0 bytes read:6148240 seeks:2 frames:180
> Input #0, mpegts, from '/opt/Film18/afanda/afanda.ts':
> Duration: 00:25:48.76, start: 0.173789, bitrate: 17028 kb/s
> Program 1
> Stream #0:0[0x200], 66, 1/90000: Video: mpeg2video (Main), 1 reference frame ([2][0][0][0] / 0x0002), yuv420p(tv, bt470bg, bottom first, left), 1920x1080 [SAR 1:1 DAR 16:9], 0/1, 15000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
> Stream #0:1[0x201], 114, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s
> Successfully opened the file.
> [Parsed_color_0 @ 0x4d6c600] Setting 'c' to value 'black at 1'
> [Parsed_color_0 @ 0x4d6c600] Setting 's' to value '1280x720'
> [Parsed_color_0 @ 0x4d6c600] size:1280x720 rate:25/1 duration:-1.000000 sar:1/1
> [Parsed_setpts_2 @ 0x4d6d980] Setting 'expr' to value 'PTS-STARTPTS'
> [Parsed_scale_3 @ 0x537e080] Setting 'w' to value '426'
> [Parsed_scale_3 @ 0x537e080] Setting 'h' to value '240'
> [Parsed_scale_3 @ 0x537e080] w:426 h:240 flags:'bilinear' interl:0
> [Parsed_overlay_opencl_5 @ 0x537f6c0] Setting 'x' to value '0'
> [Parsed_overlay_opencl_5 @ 0x537f6c0] Setting 'y' to value '0'
> [Parsed_format_7 @ 0x5381540] Setting 'pix_fmts' to value 'yuv420p'
> Parsing a group of options: output url out.ts.
> Applying option c:v (codec name) with argument libx264.
> Applying option b:v (video bitrate (please use -b:v)) with argument 4M.
> Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 25.
> Applying option f (force format) with argument mpegts.
> Successfully parsed a group of options.
> Opening an output file: out.ts.
> [file @ 0x537e800] Setting default whitelist 'file,crypto'
> Successfully opened the file.
> detected 16 logical cores
> Stream mapping:
> Stream #0:0 (mpeg2video) -> setpts (graph 0)
> format (graph 0) -> Stream #0:0 (libx264)
> Stream #0:1 -> #0:1 (mp2 (native) -> mp2 (native))
> Press [q] to stop, [?] for help
> cur_dts is invalid (this is harmless if it occurs once at the start per stream)
> [graph_1_in_0_1 @ 0x53f1200] Setting 'time_base' to value '1/48000'
> [graph_1_in_0_1 @ 0x53f1200] Setting 'sample_rate' to value '48000'
> [graph_1_in_0_1 @ 0x53f1200] Setting 'sample_fmt' to value 's16p'
> [graph_1_in_0_1 @ 0x53f1200] Setting 'channel_layout' to value '0x3'
> [graph_1_in_0_1 @ 0x53f1200] tb:1/48000 samplefmt:s16p samplerate:48000 chlayout:0x3
> [format_out_0_1 @ 0x53f1e80] Setting 'sample_fmts' to value 's16'
> [format_out_0_1 @ 0x53f1e80] Setting 'sample_rates' to value '44100|48000|32000|22050|24000|16000'
> [format_out_0_1 @ 0x53f1e80] Setting 'channel_layouts' to value '0x4|0x3'
> [format_out_0_1 @ 0x53f1e80] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1'
> [AVFilterGraph @ 0x537f7c0] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
> [auto_resampler_0 @ 0x53f45c0] [SWR @ 0x53f4ac0] Using s16p internally between filters
> [auto_resampler_0 @ 0x53f45c0] ch:2 chl:stereo fmt:s16p r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
> cur_dts is invalid (this is harmless if it occurs once at the start per stream)
> [mpeg2video @ 0x4d6e580] Format yuv420p chosen by get_format().
> cur_dts is invalid (this is harmless if it occurs once at the start per stream)
> Last message repeated 1 times
> [Parsed_color_0 @ 0x5412400] Setting 'c' to value 'black at 1'
> [Parsed_color_0 @ 0x5412400] Setting 's' to value '1280x720'
> [Parsed_color_0 @ 0x5412400] size:1280x720 rate:25/1 duration:-1.000000 sar:1/1
> [Parsed_setpts_2 @ 0x5413640] Setting 'expr' to value 'PTS-STARTPTS'
> [Parsed_scale_3 @ 0x5414180] Setting 'w' to value '426'
> [Parsed_scale_3 @ 0x5414180] Setting 'h' to value '240'
> [Parsed_scale_3 @ 0x5414180] w:426 h:240 flags:'bilinear' interl:0
> [Parsed_overlay_opencl_5 @ 0x5415580] Setting 'x' to value '0'
> [Parsed_overlay_opencl_5 @ 0x5415580] Setting 'y' to value '0'
> [Parsed_format_7 @ 0x5466500] Setting 'pix_fmts' to value 'yuv420p'
> [graph 0 input from stream 0:0 @ 0x5467340] Setting 'video_size' to value '1920x1080'
> [graph 0 input from stream 0:0 @ 0x5467340] Setting 'pix_fmt' to value '0'
> [graph 0 input from stream 0:0 @ 0x5467340] Setting 'time_base' to value '1/90000'
> [graph 0 input from stream 0:0 @ 0x5467340] Setting 'pixel_aspect' to value '1/1'
> [graph 0 input from stream 0:0 @ 0x5467340] Setting 'sws_param' to value 'flags=2'
> [graph 0 input from stream 0:0 @ 0x5467340] Setting 'frame_rate' to value '25/1'
> [graph 0 input from stream 0:0 @ 0x5467340] w:1920 h:1080 pixfmt:yuv420p tb:1/90000 fr:25/1 sar:1/1 sws_param:flags=2
> [format @ 0x5414b40] Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16'
> [AVHWDeviceContext @ 0x48a22c0] Maximum supported image size 16384x16384.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv420p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv422p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv444p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv410p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv411p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format gray supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuvj420p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuvj422p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuvj444p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format nv12 supported.
> [AVHWDeviceContext @ 0x48a22c0] Format nv21 supported.
> [AVHWDeviceContext @ 0x48a22c0] Format argb supported.
> [AVHWDeviceContext @ 0x48a22c0] Format rgba supported.
> [AVHWDeviceContext @ 0x48a22c0] Format abgr supported.
> [AVHWDeviceContext @ 0x48a22c0] Format bgra supported.
> [AVHWDeviceContext @ 0x48a22c0] Format gray16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv440p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuvj440p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuva420p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv420p16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv422p16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv444p16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format ya8 supported.
> [AVHWDeviceContext @ 0x48a22c0] Format gbrp supported.
> [AVHWDeviceContext @ 0x48a22c0] Format gbrp16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuva422p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuva444p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuva420p16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuva422p16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuva444p16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format nv16 supported.
> [AVHWDeviceContext @ 0x48a22c0] Format rgba64le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format bgra64le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format ya16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format gbrap supported.
> [AVHWDeviceContext @ 0x48a22c0] Format gbrap16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuvj411p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format ayuv64le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format p010le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format p016le supported.
> [AVHWDeviceContext @ 0x48a22c0] Maximum supported image size 16384x16384.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv420p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv422p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv444p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv410p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv411p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format gray supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuvj420p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuvj422p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuvj444p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format nv12 supported.
> [AVHWDeviceContext @ 0x48a22c0] Format nv21 supported.
> [AVHWDeviceContext @ 0x48a22c0] Format argb supported.
> [AVHWDeviceContext @ 0x48a22c0] Format rgba supported.
> [AVHWDeviceContext @ 0x48a22c0] Format abgr supported.
> [AVHWDeviceContext @ 0x48a22c0] Format bgra supported.
> [AVHWDeviceContext @ 0x48a22c0] Format gray16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv440p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuvj440p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuva420p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv420p16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv422p16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuv444p16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format ya8 supported.
> [AVHWDeviceContext @ 0x48a22c0] Format gbrp supported.
> [AVHWDeviceContext @ 0x48a22c0] Format gbrp16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuva422p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuva444p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuva420p16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuva422p16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuva444p16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format nv16 supported.
> [AVHWDeviceContext @ 0x48a22c0] Format rgba64le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format bgra64le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format ya16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format gbrap supported.
> [AVHWDeviceContext @ 0x48a22c0] Format gbrap16le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format yuvj411p supported.
> [AVHWDeviceContext @ 0x48a22c0] Format ayuv64le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format p010le supported.
> [AVHWDeviceContext @ 0x48a22c0] Format p016le supported.
> [AVFilterGraph @ 0x5410580] query_formats: 11 queried, 10 merged, 0 already done, 0 delayed
> [hwupload @ 0x5455780] Surface format is yuv420p.
> [graph 0 input from stream 0:0 @ 0x5467340] TB:0.000011 FRAME_RATE:25.000000 SAMPLE_RATE:nan
> [Parsed_scale_3 @ 0x5414180] w:1920 h:1080 fmt:yuv420p sar:1/1 -> w:426 h:240 fmt:yuv420p sar:640/639 flags:0x2
> [hwupload @ 0x54102c0] Surface format is yuv420p.
> [Parsed_overlay_opencl_5 @ 0x5415580] [framesync @ 0x54156d0] Selected 1/90000 time base
> [Parsed_overlay_opencl_5 @ 0x5415580] [framesync @ 0x54156d0] Sync level 2
> [Parsed_overlay_opencl_5 @ 0x5415580] Using kernel overlay_no_alpha.
> [Parsed_overlay_opencl_5 @ 0x5415580] Failed to finish command queue: -36.
> Error while filtering: Input/output error
> Failed to inject frame into filter network: Input/output error
> Error while processing the decoded data for stream #0:0
> [AVIOContext @ 0x537f680] Statistics: 0 seeks, 0 writeouts
> [AVIOContext @ 0x5324100] Statistics: 6377616 bytes read, 2 seeks
> Conversion failed!
>
>
>
>
>
>
>
>
> MARK**********************************************************************************************************
>
>
>
>
>
>
> At 2018-01-09 21:02:43, "Mark Thompson" <sw at jkqxz.net> wrote:
>> On 09/01/18 06:01, 郭浩 wrote:
>>> i want to use overlay_opencl, and i build the ffmpeg with opencl success! but i run the command , it alway report "[Parsed_overlay_opencl_5 @ 0x4f22e80] Failed to finish command queue:",i am not sure my command is correct , can someone tell me how this should be corrected? Thanks
>>>
>>>
>>> this is my cmd:
>>> cmd:
>>> -----------------
>>> ./ffmpeg -init_hw_device opencl=cl:0.0 -filter_hw_device cl -i "udp://230.0.0.100:53007?overrun_nonfatal=1" -filter_complex "color=c=black at 1:s=1280x720,hwupload[bg];[0:v]setpts=PTS-STARTPTS,scale=w=426:h=240,hwupload[v0];[bg][v0]overlay_opencl=x=0:y=0 ,hwdownload " -c:v hevc_nvenc -b:v 4M -r 25 -g 25 -f mpegts "udp://230.0.0.240:53001?pkt_size=1316&localaddr=192.168.172.115&overrun_nonfatal=1&fifo_size=286720&ttl=64&bitrate=4096000"
>>> -----------------
>>
>> Does it work if you remove all of the other external stuff (replace the udp with normal files and nvenc with a software encoder)?
>>
>> I don't have that other stuff available for testing, but the following command without them does work for me (using Beignet):
>>
>> ./ffmpeg_g -init_hw_device opencl=cl:0.0 -filter_hw_device cl -i input_1080p.mp4 -filter_complex "color=c=black at 1:s=1280x720,hwupload[bg];[0:v]setpts=PTS-STARTPTS,scale=w=426:h=240,hwupload[v0];[bg][v0]overlay_opencl=x=0:y=0 ,hwdownload " -c:v libx264 -b:v 4M -r 25 -g 25 -f mpegts out.ts
>>
>> A few other thoughts:
>> * overlay_opencl in isolation isn't necessarily faster or even using less CPU than normal overlay when you take into account the extra upload/download steps needed (it's more intended for cases when you have interop and can keep things on the GPU).
>> * Format selection is kindof tricky, because the negotiation can't see through properly to the underlying hardware formats. You could try adding "format=yuv420p" (or another choice, maybe nv12) before the hwupload instances, though I'm not sure why your setup would give a different answer to mine there.
>> * A log with "-v debug" will have a bit more information about the OpenCL device and setup - please post that if you still can't get it to work.
>>
>> - Mark
>>
>>> report:
>>> ---------------
>>> --enable-doc --enable-postproc --enable-bzlib --enable-zlib --enable-parsers --enable-libx264 --enable-libx265 --enable-libmp3lame --enable-libfdk-aac --enable-libspeex --enable-pthreads --extra-libs=-lpthread --enable-decoders --enable-encoders --enable-avfilter --enable-muxers --enable-demuxers --enable-nvenc --enable-cuvid --enable-cuda --enable-libnpp --enable-opencl --enable-decoders
>>> libavutil 56. 7.100 / 56. 7.100
>>> libavcodec 58. 9.100 / 58. 9.100
>>> libavformat 58. 3.100 / 58. 3.100
>>> libavdevice 58. 0.100 / 58. 0.100
>>> libavfilter 7. 11.101 / 7. 11.101
>>> libswscale 5. 0.101 / 5. 0.101
>>> libswresample 3. 0.101 / 3. 0.101
>>> libpostproc 55. 0.100 / 55. 0.100
>>> Input #0, mpegts, from 'udp://230.0.0.100:53007?overrun_nonfatal=1':
>>> Duration: N/A, start: 2197.197333, bitrate: N/A
>>> Program 1
>>> Metadata:
>>> service_name : ffmpeg
>>> service_provider: ffmpeg
>>> Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 428x240 [SAR 320:321 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
>>> Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 58 kb/s
>>> Stream mapping:
>>> Stream #0:0 (h264) -> setpts (graph 0)
>>> hwdownload (graph 0) -> Stream #0:0 (hevc_nvenc)
>>> Stream #0:1 -> #0:1 (aac (native) -> mp2 (native))
>>> Press [q] to stop, [?] for help
>>> [Parsed_overlay_opencl_5 @ 0x4f22e80] Failed to finish command queue: -36.
>>> Error while filtering: Input/output error
>>> Failed to inject frame into filter network: Input/output error
>>> Error while processing the decoded data for stream #0:0
>>> Conversion failed!
>>> --------------
More information about the ffmpeg-user
mailing list