[FFmpeg-trac] #8849(undetermined:new): sub2video does not work with overlay_cuda
FFmpeg
trac at avcodec.org
Fri Sep 4 23:58:58 EEST 2020
#8849: sub2video does not work with overlay_cuda
-------------------------------------+-------------------------------------
Reporter: Znuff | Owner:
Type: defect | Status: new
Priority: normal | Component:
| undetermined
Version: unspecified | Resolution:
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by Znuff):
Follow up on this:
I'm not sure that '''sub2video''' is actually the main culprit here.
I copied the subtitle stream to an external file:
{{{
ffmpeg -i input.ts -vn -an -scodec copy subs.ts
}}}
And I re-tried using cuda_overlay:
{{{
./ffmpeg -v verbose -nostats -vsync 0 -hwaccel nvdec
-hwaccel_output_format cuda -fix_sub_duration -i input.ts -i subs.ts
-init_hw_device cuda=cuda:0 -filter_hw_device cuda -filter_complex "[1:s]
hwupload=derive_device=cuda [sub]; [0:v] scale_npp=format=yuv420p [video];
[video][sub] overlay_cuda [v]" -map "[v]" -map 0:a -c:v h264_nvenc -acodec
copy -copy_unknown -f mpegts -y out.ts
ffmpeg version N-98994-g939f4b35b8 Copyright (c) 2000-2020 the FFmpeg
developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --pkg-config-flags=--static --disable-libxcb --disable-
debug --enable-cuda-llvm --enable-cuvid --enable-nvenc --enable-libnpp
--extra-cflags=-I/usr/local/cuda/include --extra-
ldflags=-L/usr/local/cuda/lib64 --enable-static --disable-shared --enable-
nonfree --enable-libfdk-aac --enable-vulkan --enable-libglslang
libavutil 56. 58.100 / 56. 58.100
libavcodec 58.105.100 / 58.105.100
libavformat 58. 53.100 / 58. 53.100
libavdevice 58. 11.101 / 58. 11.101
libavfilter 7. 87.100 / 7. 87.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
[h264 @ 0x559ea6e14e80] Reinit context to 1920x1088, pix_fmt: yuv420p
[h264 @ 0x559ea6e14e80] Increasing reorder buffer to 2
[mpegts @ 0x559ea6e0e380] max_analyze_duration 5000000 reached at 5016000
microseconds st:1
Input #0, mpegts, from 'input.ts':
Duration: 00:00:15.93, start: 1.400000, bitrate: 8561 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High), 1 reference frame
([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first, left), 1920x1080
(1920x1088) [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x101](rum): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
stereo, fltp, 256 kb/s
Stream #0:2[0x102](qaa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000
Hz, 5.1(side), fltp, 640 kb/s
Stream #0:3[0x103](rum): Subtitle: dvb_subtitle ([6][0][0][0] /
0x0006)
Input #1, mpegts, from 'subs.ts':
Duration: 00:00:11.06, start: 1.400000, bitrate: 22 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #1:0[0x100](rum): Subtitle: dvb_subtitle ([6][0][0][0] /
0x0006)
Stream mapping:
Stream #0:0 (h264) -> scale_npp
Stream #1:0 (dvbsub) -> hwupload
overlay_cuda -> Stream #0:0 (h264_nvenc)
Stream #0:1 -> #0:1 (copy)
Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
[h264 @ 0x559ea6eff680] NVDEC capabilities:
[h264 @ 0x559ea6eff680] format supported: yes, max_mb_count: 65536
[h264 @ 0x559ea6eff680] min_width: 48, max_width: 4096
[h264 @ 0x559ea6eff680] min_height: 16, max_height: 4096
[h264 @ 0x559ea6eff680] Reinit context to 1920x1088, pix_fmt: cuda
[mpegts @ 0x559ea6f1a340] sub2video: using 720x576 canvas
[graph 0 input from stream 1:0 @ 0x559ea8c7c600] w:720 h:576 pixfmt:bgra
tb:1/90000 fr:0/1 sar:0/1
[graph 0 input from stream 0:0 @ 0x559ea6eedb40] w:1920 h:1080 pixfmt:cuda
tb:1/90000 fr:25/1 sar:1/1
[auto_scaler_0 @ 0x559ea74b7280] w:iw h:ih flags:'bilinear' interl:0
[Parsed_hwupload_0 @ 0x559ea8b8fe80] auto-inserting filter 'auto_scaler_0'
between the filter 'graph 0 input from stream 1:0' and the filter
'Parsed_hwupload_0'
[Parsed_scale_npp_1 @ 0x559ea6fe9a00] w:1920 h:1080 -> w:1920 h:1080
[auto_scaler_0 @ 0x559ea74b7280] w:720 h:576 fmt:bgra sar:0/1 -> w:720
h:576 fmt:yuva420p sar:0/1 flags:0x2
[Parsed_overlay_cuda_2 @ 0x559ea8b250c0] [framesync @ 0x559ea6f18fb8] Sync
level 2
[h264_nvenc @ 0x559ea6f32b80] Using input frames context (format cuda)
with h264_nvenc encoder.
[h264_nvenc @ 0x559ea6f32b80] Loaded Nvenc version 10.0
[h264_nvenc @ 0x559ea6f32b80] Nvenc initialized successfully
[mpegts @ 0x559ea6f12900] service 1 using PCR in pid=256, pcr_period=80ms
[mpegts @ 0x559ea6f12900] muxrate VBR, sdt every 500 ms, pat/pmt every 100
ms
Output #0, mpegts, to 'out.ts':
Metadata:
encoder : Lavf58.53.100
Stream #0:0: Video: h264 (h264_nvenc) (Main), 1 reference frame, cuda,
1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 2000 kb/s, 25 fps, 90k tbn, 25 tbc
(default)
Metadata:
encoder : Lavc58.105.100 h264_nvenc
Side data:
cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000
vbv_delay: N/A
Stream #0:1(rum): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
stereo, fltp, 256 kb/s
Stream #0:2(qaa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz,
5.1(side), fltp, 640 kb/s
[Parsed_overlay_cuda_2 @ 0x559ea8b250c0] [framesync @ 0x559ea6f18fb8] Sync
level 1
[Parsed_overlay_cuda_2 @ 0x559ea8b250c0] [framesync @ 0x559ea6f18fb8] Sync
level 0
No more output streams to write to, finishing.
frame= 355 fps=244 q=21.0 Lsize= 4561kB time=00:01:11.04 bitrate=
526.0kbits/s speed=48.8x
video:2717kB audio:1628kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 4.979304%
Input file #0 (input.ts):
Input stream #0:0 (video): 714 packets read (14014289 bytes); 354 frames
decoded;
Input stream #0:1 (audio): 620 packets read (476160 bytes);
Input stream #0:2 (audio): 465 packets read (1190400 bytes);
Input stream #0:3 (subtitle): 0 packets read (0 bytes);
Total: 1799 packets (15680849 bytes) demuxed
Input file #1 (subs.ts):
Input stream #1:0 (subtitle): 6 packets read (28670 bytes); 3 frames
decoded;
Total: 6 packets (28670 bytes) demuxed
Output file #0 (out.ts):
Output stream #0:0 (video): 355 frames encoded; 355 packets muxed
(2782576 bytes);
Output stream #0:1 (audio): 620 packets muxed (476160 bytes);
Output stream #0:2 (audio): 465 packets muxed (1190400 bytes);
Total: 1440 packets (4449136 bytes) muxed
[AVIOContext @ 0x559ea6ef5100] Statistics: 0 seeks, 18 writeouts
[h264_nvenc @ 0x559ea6f32b80] Nvenc unloaded
[AVIOContext @ 0x559ea6e17280] Statistics: 21886488 bytes read, 2 seeks
[AVIOContext @ 0x559ea6ee7f40] Statistics: 31396 bytes read, 0 seeks
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8849#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list