On 21. 10. 2017 00:35, James Girotti wrote: >> When I add hw acceleration for decoding I stops. Any ideas what can I try? >> >> > Not exactly sure how it works with filter_complex, but with regular filter > you would do something like: > > "hwdownload,format=nv12,YOUR_FILTERS_HERE,format=yuv420p,hwupload_cuda" > > This will grab the decoded frames from GPU memory, convert to nv12 (from > cuda format), then apply whatever filter you need, change the format to > something reasonable (my example uses yuv420p, then upload frames back to > GPU memory > > Hope that helps, > -J
Shouldn't I be using hwupload_cuda, to upload frames to the CUDA engine, then apply overlay filter and after that download it back? At least I understood it that way. Or you are suggesting to download it from CUDA run on CPU and after that upload it back. I am trying something like this, but I don't exactly know where to upload it: ffmpeg -hwaccel cuvid -c:v h264_cuvid -i udp://239.255.6.2:1234 -filter_complex "[i:0x4b1]scale_npp=w=1920:h=1080,hwdownload,format=nv12 [base]; [base][i:0x4ba]overlay[v]" -map [v] -map i:0x4b2 -c:a libfdk_aac -profile:a aac_he -ac 2 -b:a 64k -ar 48000 -c:v h264_nvenc -preset llhq -rc vbr_hq -qmin:v 19 -qmax:v 21 -b:v 2500k -maxrate:v 5000k -profile:v high -f flv rtmp://127.0.0.1/live/test It works, but I don't see any acceleration probably because it is not in CUDA anymore and the manual is not really helpful here. Anybody with more experience? ffmpeg version N-87875-gf685bbc Copyright (c) 2000-2017 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.5) 20160609 configuration: --prefix=/home/mitja/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/mitja/ffmpeg_build/include --extra-ldflags=-L/home/mitja/ffmpeg_build/lib --extra-libs=-lpthread --bindir=/home/mitja/bin --enable-cuda --enable-cuvid --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libspeex --enable-nonfree --enable-nvenc libavutil 55. 79.100 / 55. 79.100 libavcodec 57.108.100 / 57.108.100 libavformat 57. 84.100 / 57. 84.100 libavdevice 57. 11.100 / 57. 11.100 libavfilter 6.108.100 / 6.108.100 libswscale 4. 9.100 / 4. 9.100 libswresample 2. 10.100 / 2. 10.100 libpostproc 54. 8.100 / 54. 8.100 [h264 @ 0x2c76d80] SPS unavailable in decode_picture_timing [h264 @ 0x2c76d80] non-existing PPS 0 referenced [h264 @ 0x2c76d80] SPS unavailable in decode_picture_timing [h264 @ 0x2c76d80] non-existing PPS 0 referenced [h264 @ 0x2c76d80] decode_slice_header error [h264 @ 0x2c76d80] no frame! [h264 @ 0x2c76d80] SPS unavailable in decode_picture_timing [h264 @ 0x2c76d80] non-existing PPS 0 referenced [h264 @ 0x2c76d80] SPS unavailable in decode_picture_timing [h264 @ 0x2c76d80] non-existing PPS 0 referenced [h264 @ 0x2c76d80] decode_slice_header error [h264 @ 0x2c76d80] no frame! [h264 @ 0x2c76d80] SPS unavailable in decode_picture_timing [h264 @ 0x2c76d80] non-existing PPS 0 referenced [h264 @ 0x2c76d80] SPS unavailable in decode_picture_timing [h264 @ 0x2c76d80] non-existing PPS 0 referenced [h264 @ 0x2c76d80] decode_slice_header error [h264 @ 0x2c76d80] no frame! Input #0, mpegts, from 'udp://239.255.6.2:1234': Duration: N/A, start: 44444.615722, bitrate: N/A Program 13002 Stream #0:0[0x4b1]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:1[0x4b2](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s Stream #0:2[0x4ba](slv): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) Stream mapping: Stream #0:0 (h264_cuvid) -> scale_npp (graph 0) Stream #0:2 (dvbsub) -> overlay:overlay (graph 0) overlay (graph 0) -> Stream #0:0 (h264_nvenc) Stream #0:1 -> #0:1 (mp2 (native) -> aac (libfdk_aac)) Press [q] to stop, [?] for help [mpegts @ 0x2c51e00] sub2video: using 1920x1080 canvas Output #0, flv, to 'rtmp://127.0.0.1/live/test': Metadata: encoder : Lavf57.84.100 Stream #0:0: Video: h264 (h264_nvenc) (High) ([7][0][0][0] / 0x0007), nv12, 1920x1080 [SAR 1:1 DAR 16:9], q=19-21, 2500 kb/s, 25 fps, 1k tbn, 25 tbc (default) Metadata: encoder : Lavc57.108.100 h264_nvenc Side data: cpb: bitrate max/min/avg: 5000000/0/2500000 buffer size: 5000000 vbv_delay: -1 Stream #0:1(eng): Audio: aac (libfdk_aac) (HE-AAC) ([10][0][0][0] / 0x000A), 48000 Hz, stereo, s16, 64 kb/s Metadata: encoder : Lavc57.108.100 libfdk_aac [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. Last message repeated 11 times [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. Last message repeated 5 times [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. Last message repeated 1 times [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. Last message repeated 6 times [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. Last message repeated 4 times [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. Last message repeated 1 times [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. Last message repeated 2 times [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. Last message repeated 5 times [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. Last message repeated 2 times [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. Last message repeated 3 times [graph 0 input from stream 0:2 @ 0x2ce5c80] Changing frame properties on the fly is not supported by all filters. Last message repeated 1 times _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".