[FFmpeg-trac] #8078(ffmpeg:new): Closed captions removed when decoding with NVDEC
FFmpeg
trac at avcodec.org
Mon Aug 12 18:47:37 EEST 2019
#8078: Closed captions removed when decoding with NVDEC
-------------------------------------+-------------------------------------
Reporter: Canta | Type: defect
Status: new | Priority: normal
Component: ffmpeg | Version: git-
Keywords: nvidia, | master
nvdec, cc | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
NVDEC seems to remove CEA-608/708 captions from stream.
Related:
https://devtalk.nvidia.com/default/topic/1025092/video-codec-and-optical-
flow-sdk/nvenc-with-ffmpeg-for-transcoding-closed-caption-text-display-
order-issue-while-using-quot-bf-2-quot-/
http://trac.ffmpeg.org/ticket/6802
http://trac.ffmpeg.org/ticket/6726
Please note the difference between NVDEC (decoding) and NVENC (encoding).
This ticket is about the DEcoding system, while the other tickets are
ENcoding related.
How to reproduce:
{{{
root at cdn1:/# nvidia-smi
Fri Aug 9 21:18:57 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.40 Driver Version: 430.40 CUDA Version: 10.1
|
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr.
ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute
M. |
|===============================+======================+======================|
| 0 Quadro M4000 Off | 00000000:05:00.0 Off |
N/A |
| 55% 65C P0 49W / 120W | 2640MiB / 8126MiB | 48%
Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU
Memory |
| GPU PID Type Process name Usage
|
|=============================================================================|
+-----------------------------------------------------------------------------+
root at cdn1:/# wget "http://samples.ffmpeg.org/MPEG-
VOB/ClosedCaptions/Starship_Troopers.vob"
--2019-08-09 21:19:40-- http://samples.ffmpeg.org/MPEG-
VOB/ClosedCaptions/Starship_Troopers.vob
Resolving samples.ffmpeg.org (samples.ffmpeg.org)... 79.124.17.100
Connecting to samples.ffmpeg.org (samples.ffmpeg.org)|79.124.17.100|:80...
connected.
HTTP request sent, awaiting response... 200 OK
Length: 29618176 (28M)
Saving to: 'Starship_Troopers.vob'
Starship_Troopers.vob
100%[=====================================================================================================>]
28.25M 7.24MB/s in 3.9s
2019-08-09 21:19:45 (7.24 MB/s) - 'Starship_Troopers.vob' saved
[29618176/29618176]
root at cdn1:/# ffprobe Starship_Troopers.vob
ffprobe version N-94476-gf12e662 Copyright (c) 2007-2019 the FFmpeg
developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix=./ --disable-shared --extra-
cflags=-I/usr/local/include --extra-
cflags=-I/usr/local/cuda-8.0/targets/x86_64-linux/include --extra-
cflags=-I../nvidia/cudautils --extra-
ldflags=-L/usr/local/cuda-8.0/targets/x86_64-linux/lib --extra-
ldflags=-L../nvidia/cudautils --enable-nonfree --enable-gpl --enable-
version3 --enable-avresample --enable-avisynth --enable-openal --enable-
opencl --enable-opengl --enable-libnpp --enable-nvenc --enable-libxvid
--enable-libxml2 --enable-cuda --enable-cuda-sdk --enable-vaapi --enable-
vdpau --enable-libx264 --enable-libx265 --enable-libass --enable-
libwavpack --enable-libsoxr --enable-libfdk-aac --enable-libfreetype
--enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-librtmp --enable-libssh --enable-openssl
--enable-omx-rpi --enable-omx --enable-libsrt
libavutil 56. 33.100 / 56. 33.100
libavcodec 58. 55.100 / 58. 55.100
libavformat 58. 30.100 / 58. 30.100
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.100 / 7. 58.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mpeg, from 'Starship_Troopers.vob':
Duration: 00:00:51.30, start: 1986.626100, bitrate: 4618 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first),
720x480 [SAR 32:27 DAR 16:9], Closed Captions, 29.97 fps, 59.94 tbr, 90k
tbn, 59.94 tbc
Stream #0:1[0x83]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:2[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:4[0x81]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream #0:5[0x20]: Subtitle: dvd_subtitle
Stream #0:6[0x22]: Subtitle: dvd_subtitle
root at cdn1:/# ffmpeg -y -i Starship_Troopers.vob -map 'i:0x1e0' -c:v
h264_nvenc -f mpegts out1.mp4
ffmpeg version N-94476-gf12e662 Copyright (c) 2000-2019 the FFmpeg
developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix=./ --disable-shared --extra-
cflags=-I/usr/local/include --extra-
cflags=-I/usr/local/cuda-8.0/targets/x86_64-linux/include --extra-
cflags=-I../nvidia/cudautils --extra-
ldflags=-L/usr/local/cuda-8.0/targets/x86_64-linux/lib --extra-
ldflags=-L../nvidia/cudautils --enable-nonfree --enable-gpl --enable-
version3 --enable-avresample --enable-avisynth --enable-openal --enable-
opencl --enable-opengl --enable-libnpp --enable-nvenc --enable-libxvid
--enable-libxml2 --enable-cuda --enable-cuda-sdk --enable-vaapi --enable-
vdpau --enable-libx264 --enable-libx265 --enable-libass --enable-
libwavpack --enable-libsoxr --enable-libfdk-aac --enable-libfreetype
--enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-librtmp --enable-libssh --enable-openssl
--enable-omx-rpi --enable-omx --enable-libsrt
libavutil 56. 33.100 / 56. 33.100
libavcodec 58. 55.100 / 58. 55.100
libavformat 58. 30.100 / 58. 30.100
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.100 / 7. 58.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mpeg, from 'Starship_Troopers.vob':
Duration: 00:00:51.30, start: 1986.626100, bitrate: 4618 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first),
720x480 [SAR 32:27 DAR 16:9], Closed Captions, 29.97 fps, 59.94 tbr, 90k
tbn, 59.94 tbc
Stream #0:1[0x83]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:2[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:4[0x81]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream #0:5[0x20]: Subtitle: dvd_subtitle
Stream #0:6[0x22]: Subtitle: dvd_subtitle
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_nvenc))
Press [q] to stop, [?] for help
Output #0, mpegts, to 'out1.mp4':
Metadata:
encoder : Lavf58.30.100
Stream #0:0: Video: h264 (h264_nvenc) (Main), yuv420p, 720x480 [SAR
32:27 DAR 16:9], q=-1--1, 2000 kb/s, 29.97 fps, 90k tbn, 29.97 tbc
Metadata:
encoder : Lavc58.55.100 h264_nvenc
Side data:
cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000
vbv_delay: -1
[mpeg @ 0x5580626fca00] New subtitle stream 0:7 at pos:8497166 and
DTS:1999.51s/s speed=17.9x
[mpeg2video @ 0x55806273b080] ac-tex damaged at 3 270:47.48
bitrate=1678.4kbits/s speed=23.7x
[mpeg2video @ 0x55806273b080] Warning MVs not available
[mpeg2video @ 0x55806273b080] concealing 135 DC, 135 AC, 135 MV errors in
I frame
Starship_Troopers.vob: corrupt decoded frame in stream 0
frame= 1229 fps=575 q=23.0 Lsize= 10725kB time=00:00:51.28
bitrate=1713.2kbits/s speed= 24x
video:9811kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 9.312987%
root at cdn1:/# ffprobe out1.mp4
ffprobe version N-94476-gf12e662 Copyright (c) 2007-2019 the FFmpeg
developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix=./ --disable-shared --extra-
cflags=-I/usr/local/include --extra-
cflags=-I/usr/local/cuda-8.0/targets/x86_64-linux/include --extra-
cflags=-I../nvidia/cudautils --extra-
ldflags=-L/usr/local/cuda-8.0/targets/x86_64-linux/lib --extra-
ldflags=-L../nvidia/cudautils --enable-nonfree --enable-gpl --enable-
version3 --enable-avresample --enable-avisynth --enable-openal --enable-
opencl --enable-opengl --enable-libnpp --enable-nvenc --enable-libxvid
--enable-libxml2 --enable-cuda --enable-cuda-sdk --enable-vaapi --enable-
vdpau --enable-libx264 --enable-libx265 --enable-libass --enable-
libwavpack --enable-libsoxr --enable-libfdk-aac --enable-libfreetype
--enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-librtmp --enable-libssh --enable-openssl
--enable-omx-rpi --enable-omx --enable-libsrt
libavutil 56. 33.100 / 56. 33.100
libavcodec 58. 55.100 / 58. 55.100
libavformat 58. 30.100 / 58. 30.100
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.100 / 7. 58.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mpegts, from 'out1.mp4':
Duration: 00:00:51.32, start: 1.400000, bitrate: 1712 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 720x480 [SAR 32:27 DAR 16:9], Closed Captions, 29.97
fps, 29.97 tbr, 90k tbn, 59.94 tbc
root at cdn1:/# ffmpeg -y -c:v mpeg2_cuvid -i Starship_Troopers.vob -map
'i:0x1e0' -c:v h264_nvenc -f mpegts out2.mp4
ffmpeg version N-94476-gf12e662 Copyright (c) 2000-2019 the FFmpeg
developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix=./ --disable-shared --extra-
cflags=-I/usr/local/include --extra-
cflags=-I/usr/local/cuda-8.0/targets/x86_64-linux/include --extra-
cflags=-I../nvidia/cudautils --extra-
ldflags=-L/usr/local/cuda-8.0/targets/x86_64-linux/lib --extra-
ldflags=-L../nvidia/cudautils --enable-nonfree --enable-gpl --enable-
version3 --enable-avresample --enable-avisynth --enable-openal --enable-
opencl --enable-opengl --enable-libnpp --enable-nvenc --enable-libxvid
--enable-libxml2 --enable-cuda --enable-cuda-sdk --enable-vaapi --enable-
vdpau --enable-libx264 --enable-libx265 --enable-libass --enable-
libwavpack --enable-libsoxr --enable-libfdk-aac --enable-libfreetype
--enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-librtmp --enable-libssh --enable-openssl
--enable-omx-rpi --enable-omx --enable-libsrt
libavutil 56. 33.100 / 56. 33.100
libavcodec 58. 55.100 / 58. 55.100
libavformat 58. 30.100 / 58. 30.100
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.100 / 7. 58.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mpeg, from 'Starship_Troopers.vob':
Duration: 00:00:51.30, start: 1986.626100, bitrate: 4618 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first),
720x480 [SAR 32:27 DAR 16:9], Closed Captions, 29.97 fps, 59.94 tbr, 90k
tbn, 59.94 tbc
Stream #0:1[0x83]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:2[0x82]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:4[0x81]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream #0:5[0x20]: Subtitle: dvd_subtitle
Stream #0:6[0x22]: Subtitle: dvd_subtitle
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video (mpeg2_cuvid) -> h264 (h264_nvenc))
Press [q] to stop, [?] for help
Output #0, mpegts, to 'out2.mp4':
Metadata:
encoder : Lavf58.30.100
Stream #0:0: Video: h264 (h264_nvenc) (Main), nv12, 720x480 [SAR 32:27
DAR 16:9], q=-1--1, 2000 kb/s, 29.97 fps, 90k tbn, 29.97 tbc
Metadata:
encoder : Lavc58.55.100 h264_nvenc
Side data:
cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000
vbv_delay: -1
[mpeg @ 0x55621a00fa40] New subtitle stream 0:7 at pos:8497166 and
DTS:1999.51s/s speed=10.4x
frame= 1229 fps=371 q=23.0 Lsize= 10718kB time=00:00:51.35
bitrate=1709.8kbits/s speed=15.5x
video:9806kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 9.301291%
root at cdn1:/# ffprobe out2.mp4
ffprobe version N-94476-gf12e662 Copyright (c) 2007-2019 the FFmpeg
developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix=./ --disable-shared --extra-
cflags=-I/usr/local/include --extra-
cflags=-I/usr/local/cuda-8.0/targets/x86_64-linux/include --extra-
cflags=-I../nvidia/cudautils --extra-
ldflags=-L/usr/local/cuda-8.0/targets/x86_64-linux/lib --extra-
ldflags=-L../nvidia/cudautils --enable-nonfree --enable-gpl --enable-
version3 --enable-avresample --enable-avisynth --enable-openal --enable-
opencl --enable-opengl --enable-libnpp --enable-nvenc --enable-libxvid
--enable-libxml2 --enable-cuda --enable-cuda-sdk --enable-vaapi --enable-
vdpau --enable-libx264 --enable-libx265 --enable-libass --enable-
libwavpack --enable-libsoxr --enable-libfdk-aac --enable-libfreetype
--enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-librtmp --enable-libssh --enable-openssl
--enable-omx-rpi --enable-omx --enable-libsrt
libavutil 56. 33.100 / 56. 33.100
libavcodec 58. 55.100 / 58. 55.100
libavformat 58. 30.100 / 58. 30.100
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.100 / 7. 58.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mpegts, from 'out2.mp4':
Duration: 00:00:51.38, start: 1.400000, bitrate: 1708 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 720x480 [SAR 32:27 DAR 16:9], 29.97 fps, 29.97 tbr,
90k tbn, 59.94 tbc
root at cdn1:/# ffmpeg -y -c:v h264_cuvid -i out1.mp4 -map 'i:0x100' -c:v
h264_nvenc -f mpegts out3.mp4
ffmpeg version N-94476-gf12e662 Copyright (c) 2000-2019 the FFmpeg
developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix=./ --disable-shared --extra-
cflags=-I/usr/local/include --extra-
cflags=-I/usr/local/cuda-8.0/targets/x86_64-linux/include --extra-
cflags=-I../nvidia/cudautils --extra-
ldflags=-L/usr/local/cuda-8.0/targets/x86_64-linux/lib --extra-
ldflags=-L../nvidia/cudautils --enable-nonfree --enable-gpl --enable-
version3 --enable-avresample --enable-avisynth --enable-openal --enable-
opencl --enable-opengl --enable-libnpp --enable-nvenc --enable-libxvid
--enable-libxml2 --enable-cuda --enable-cuda-sdk --enable-vaapi --enable-
vdpau --enable-libx264 --enable-libx265 --enable-libass --enable-
libwavpack --enable-libsoxr --enable-libfdk-aac --enable-libfreetype
--enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-librtmp --enable-libssh --enable-openssl
--enable-omx-rpi --enable-omx --enable-libsrt
libavutil 56. 33.100 / 56. 33.100
libavcodec 58. 55.100 / 58. 55.100
libavformat 58. 30.100 / 58. 30.100
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.100 / 7. 58.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mpegts, from 'out1.mp4':
Duration: 00:00:51.32, start: 1.400000, bitrate: 1712 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 720x480 [SAR 32:27 DAR 16:9], Closed Captions, 29.97
fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream mapping:
Stream #0:0 -> #0:0 (h264 (h264_cuvid) -> h264 (h264_nvenc))
Press [q] to stop, [?] for help
Output #0, mpegts, to 'out3.mp4':
Metadata:
encoder : Lavf58.30.100
Stream #0:0: Video: h264 (h264_nvenc) (Main), nv12, 720x480 [SAR 32:27
DAR 16:9], q=-1--1, 2000 kb/s, 29.97 fps, 90k tbn, 29.97 tbc
Metadata:
encoder : Lavc58.55.100 h264_nvenc
Side data:
cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000
vbv_delay: -1
frame= 1229 fps=427 q=21.0 Lsize= 10752kB time=00:00:51.41
bitrate=1713.0kbits/s speed=17.9x
video:9834kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 9.330894%
root at cdn1:/# ffprobe out3.mp4
ffprobe version N-94476-gf12e662 Copyright (c) 2007-2019 the FFmpeg
developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix=./ --disable-shared --extra-
cflags=-I/usr/local/include --extra-
cflags=-I/usr/local/cuda-8.0/targets/x86_64-linux/include --extra-
cflags=-I../nvidia/cudautils --extra-
ldflags=-L/usr/local/cuda-8.0/targets/x86_64-linux/lib --extra-
ldflags=-L../nvidia/cudautils --enable-nonfree --enable-gpl --enable-
version3 --enable-avresample --enable-avisynth --enable-openal --enable-
opencl --enable-opengl --enable-libnpp --enable-nvenc --enable-libxvid
--enable-libxml2 --enable-cuda --enable-cuda-sdk --enable-vaapi --enable-
vdpau --enable-libx264 --enable-libx265 --enable-libass --enable-
libwavpack --enable-libsoxr --enable-libfdk-aac --enable-libfreetype
--enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-librtmp --enable-libssh --enable-openssl
--enable-omx-rpi --enable-omx --enable-libsrt
libavutil 56. 33.100 / 56. 33.100
libavcodec 58. 55.100 / 58. 55.100
libavformat 58. 30.100 / 58. 30.100
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.100 / 7. 58.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mpegts, from 'out3.mp4':
Duration: 00:00:51.45, start: 1.400000, bitrate: 1711 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 720x480 [SAR 32:27 DAR 16:9], 29.97 fps, 29.97 tbr,
90k tbn, 59.94 tbc
}}}
Those steps should be reproducible on a machine with nvidia card by just
copying and pasting the commands. Please note the ffprobe output after
each test: with software DEcoding, even when using hardware ENcoding, the
stream deails say "Closed Captions". With hardware DEcoding, closed
captions are never detected again, no matter the input stream codec (in
the example, I've tested mpeg2 and h264).
I believe this was fixed in another (now closed) issue, but only for
ENcoding.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8078>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list