[FFmpeg-trac] #11174(ffmpeg:new): scale_npp can't parse ref_* like ref_w or ref_h
FFmpeg
trac at avcodec.org
Thu Sep 5 13:25:16 EEST 2024
#11174: scale_npp can't parse ref_* like ref_w or ref_h
---------------------------------+--------------------------------------
Reporter: mytseng | Type: task
Status: new | Priority: normal
Component: ffmpeg | Version: git-master
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
---------------------------------+--------------------------------------
Summary of the bug:
because #10795 scale2ref is deprecated, scale2ref_npp also can't use, I
change use scale_npp to replace scale2ref_npp , but scale2ref_npp can't
parse any ref_* like ref_w or ref_h
How to reproduce:
{{{
ffmpeg -y -init_hw_device cuda=cuda -filter_hw_device cuda -hwaccel cuvid
-i /home/mytseng/nginx_conf/20240903.mp4 -i
/home/mytseng/nginx_conf/TWM.png -filter_complex
"[1:v]format=yuva420p,hwupload[o];[v:0]scale_npp=format=yuv420p[m];[o][m]scale_npp=w=rw/5:h=ow/dar[foreg];[m][foreg]overlay_cuda=x=20:y=20"
-c:v h264_nvenc -b:v 5M /home/mytseng/nginx_conf/testfile666.mp4
ffmpeg version N-116752-g507c2a5774 Copyright (c) 2000-2024 the FFmpeg
developers
built with gcc 12 (Ubuntu 12.2.0-3ubuntu1)
configuration: --enable-nonfree --enable-cuda-nvcc --enable-libnpp
--extra-cflags=-I/usr/local/cuda/include --extra-
ldflags=-L/usr/local/cuda/lib64 --disable-static --enable-shared --enable-
openssl --enable-nvenc --enable-cuvid --enable-cuda --enable-decoder=png
--enable-encoder=png --enable-libx264 --enable-libfdk-aac --enable-gpl
libavutil 59. 34.100 / 59. 34.100
libavcodec 61. 11.100 / 61. 11.100
libavformat 61. 5.101 / 61. 5.101
libavdevice 61. 2.100 / 61. 2.100
libavfilter 10. 2.102 / 10. 2.102
libswscale 8. 2.100 / 8. 2.100
libswresample 5. 2.100 / 5. 2.100
libpostproc 58. 2.100 / 58. 2.100
Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files)
with argument '1'.
Reading option '-init_hw_device' ... matched as option 'init_hw_device'
(initialise hardware device) with argument 'cuda=cuda'.
Reading option '-filter_hw_device' ... matched as option
'filter_hw_device' (set hardware device used when filtering) with argument
'cuda'.
Reading option '-hwaccel' ... matched as option 'hwaccel' (use HW
accelerated decoding) with argument 'cuvid'.
Reading option '-i' ... matched as input url with argument
'/home/mytseng/nginx_conf/20240903.mp4'.
Reading option '-i' ... matched as input url with argument
'/home/mytseng/nginx_conf/TWM.png'.
Reading option '-filter_complex' ... matched as option 'filter_complex'
(create a complex filtergraph) with argument
'[1:v]format=yuva420p,hwupload[o];[v:0]scale_npp=format=yuv420p[m];[o][m]scale_npp=w=rw:h=ow/dar[foreg];[m][foreg]overlay_cuda=x=20:y=20'.
Reading option '-c:v' ... matched as option 'c' (select encoder/decoder
('copy' to copy stream without reencoding)) with argument 'h264_nvenc'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use
-b:v)) with argument '5M'.
Reading option '/home/mytseng/nginx_conf/testfile666.mp4' ... matched as
output url.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging
level) with argument 'debug'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option init_hw_device (initialise hardware device) with argument
cuda=cuda.
[AVHWDeviceContext @ 0x5633fc616540] Loaded lib: libcuda.so.1
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuInit
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDriverGetVersion
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDeviceGetCount
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDeviceGet
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDeviceGetAttribute
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDeviceGetName
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDeviceComputeCapability
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuCtxCreate_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuCtxGetCurrent
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuCtxSetLimit
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuCtxPushCurrent_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuCtxPopCurrent_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuCtxDestroy_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemAlloc_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemAllocPitch_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemAllocManaged
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemsetD8Async
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemFree_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemcpy
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemcpyAsync
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemcpy2D_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemcpy2DAsync_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemcpyHtoD_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemcpyHtoDAsync_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemcpyDtoH_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemcpyDtoHAsync_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemcpyDtoD_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMemcpyDtoDAsync_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuGetErrorName
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuGetErrorString
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuCtxGetDevice
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDevicePrimaryCtxRetain
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDevicePrimaryCtxRelease
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuDevicePrimaryCtxSetFlags
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuDevicePrimaryCtxGetState
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDevicePrimaryCtxReset
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuStreamCreate
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuStreamQuery
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuStreamSynchronize
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuStreamDestroy_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuStreamAddCallback
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuStreamWaitEvent
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuEventCreate
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuEventDestroy_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuEventSynchronize
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuEventQuery
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuEventRecord
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuLaunchKernel
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuLinkCreate
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuLinkAddData
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuLinkComplete
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuLinkDestroy
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuModuleLoadData
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuModuleUnload
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuModuleGetFunction
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuModuleGetGlobal
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuTexObjectCreate
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuTexObjectDestroy
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuGLGetDevices_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuGraphicsGLRegisterImage
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuGraphicsUnregisterResource
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuGraphicsMapResources
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuGraphicsUnmapResources
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuGraphicsSubResourceGetMappedArray
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuGraphicsResourceGetMappedPointer_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDeviceGetUuid
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDeviceGetUuid_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDeviceGetLuid
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDeviceGetByPCIBusId
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDeviceGetPCIBusId
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuImportExternalMemory
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuDestroyExternalMemory
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuExternalMemoryGetMappedBuffer
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuExternalMemoryGetMappedMipmappedArray
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMipmappedArrayGetLevel
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuMipmappedArrayDestroy
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuImportExternalSemaphore
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuDestroyExternalSemaphore
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuSignalExternalSemaphoresAsync
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuWaitExternalSemaphoresAsync
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuArrayCreate_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuArray3DCreate_v2
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym: cuArrayDestroy
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuEGLStreamProducerConnect
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuEGLStreamProducerDisconnect
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuEGLStreamConsumerDisconnect
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuEGLStreamProducerPresentFrame
[AVHWDeviceContext @ 0x5633fc616540] Loaded sym:
cuEGLStreamProducerReturnFrame
Applying option filter_hw_device (set hardware device used when filtering)
with argument cuda.
Applying option filter_complex (create a complex filtergraph) with
argument
[1:v]format=yuva420p,hwupload[o];[v:0]scale_npp=format=yuv420p[m];[o][m]scale_npp=w=rw:h=ow/dar[foreg];[m][foreg]overlay_cuda=x=20:y=20.
[AVFilterGraph @ 0x5633fcf31780] Setting 'pix_fmts' to value 'yuva420p'
[AVFilterGraph @ 0x5633fcf31780] Setting 'format' to value 'yuv420p'
[AVFilterGraph @ 0x5633fcf31780] Setting 'w' to value 'rw'
[AVFilterGraph @ 0x5633fcf31780] Setting 'h' to value 'ow/dar'
[AVFilterGraph @ 0x5633fcf31780] Setting 'x' to value '20'
[AVFilterGraph @ 0x5633fcf31780] Setting 'y' to value '20'
[Parsed_scale_npp_3 @ 0x5633fcf34bc0] [Eval @ 0x7ffea76f16f0] Undefined
constant or missing '(' in 'rw'
[Parsed_scale_npp_3 @ 0x5633fcf34bc0] Cannot parse expression for width:
'rw'
[AVFilterGraph @ 0x5633fcf31780] Error initializing filters
Failed to set value
'[1:v]format=yuva420p,hwupload[o];[v:0]scale_npp=format=yuv420p[m];[o][m]scale_npp=w=rw:h=ow/dar[foreg];[m][foreg]overlay_cuda=x=20:y=20'
for option 'filter_complex': Invalid argument
Error parsing global options: Invalid argument
}}}
Patches should be submitted to the ffmpeg-devel mailing list and not this
bug tracker.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11174>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list