Cross posting from reddit, hope to get help here.
I'd like to add the ability to detect and remove closed captions embedded in video streams to my PlexCleaner project.
When I run ffprobe in JSON output mode, it is not setting the closed_captions attribute.
When I run ffprobe in default output mode, it does correctly identify closed captions in video streams and prints Closed Captions in the stream descriptor.
The ffmpeg code to print "Closed Captions" is here.
The ffmpeg code to create the JSON attribute is here.
All code referencing FF_CODEC_PROPERTY_CLOSED_CAPTIONS is here.
Please help: I am not sure if I am using ffprobe incorrectly in JSON output mode, maybe a missing show attribute, or if there is a bug in ffprobe's JSON output code.
Following is an example of a H264 media file that contains embedded closed caption titles.
Default ffprobe output identifies CC in video stream, JSON does not identify CC, remove CC from video, JSON output looks the same with or without CC.
Tested using ffmpeg 5.0 on Windows and Ubuntu.
Default output, file has Closed Captions, video stream reports Closed Captions:
JSON output, file has Closed Captions, closed_captions tag is 0:Code:PS C:\Users\piete\source\repos\ptr727\PlexCleaner\PlexCleaner\bin\Debug\net6.0\Tools\FfMpeg\bin> ./ffprobe.exe D:\Temp\CC.mkv ffprobe version 5.0-full_build-www.gyan.dev Copyright (c) 2007-2022 the FFmpeg developers built with gcc 11.2.0 (Rev5, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint libavutil 57. 17.100 / 57. 17.100 libavcodec 59. 18.100 / 59. 18.100 libavformat 59. 16.100 / 59. 16.100 libavdevice 59. 4.100 / 59. 4.100 libavfilter 8. 24.100 / 8. 24.100 libswscale 6. 4.100 / 6. 4.100 libswresample 4. 3.100 / 4. 3.100 libpostproc 56. 3.100 / 56. 3.100 Input #0, matroska,webm, from 'D:\Temp\CC.mkv': Metadata: encoder : libebml v1.4.2 + libmatroska v1.6.4 creation_time : 2022-03-10T12:55:01.000000Z Duration: 00:42:30.68, start: 0.000000, bitrate: 5098 kb/s Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080, Closed Captions, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 1k tbn (default) Metadata: BPS : 4969575 DURATION : 00:42:30.648000000 NUMBER_OF_FRAMES: 76434 NUMBER_OF_BYTES : 1584454580 _STATISTICS_WRITING_APP: mkvmerge v61.0.0 ('So') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-03-10 12:55:01 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:1(eng): Audio: aac (HE-AAC), 48000 Hz, stereo, fltp (default) Metadata: BPS : 126804 DURATION : 00:42:30.656000000 NUMBER_OF_FRAMES: 59781 NUMBER_OF_BYTES : 40429361 _STATISTICS_WRITING_APP: mkvmerge v61.0.0 ('So') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-03-10 12:55:01 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:2(eng): Subtitle: subrip Metadata: BPS : 116 DURATION : 00:42:29.779000000 NUMBER_OF_FRAMES: 911 NUMBER_OF_BYTES : 37125 _STATISTICS_WRITING_APP: mkvmerge v61.0.0 ('So') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-03-10 12:55:01 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Remove Closed Captions from video stream:Code:PS C:\Users\piete\source\repos\ptr727\PlexCleaner\PlexCleaner\bin\Debug\net6.0\Tools\FfMpeg\bin> ./ffprobe.exe -loglevel quiet -print_format json -show_streams -show_format D:\Temp\CC.mkv { "streams": [ { "index": 0, "codec_name": "h264", "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", "profile": "High", "codec_type": "video", "codec_tag_string": "[0][0][0][0]", "codec_tag": "0x0000", "width": 1920, "height": 1080, "coded_width": 1920, "coded_height": 1080, "closed_captions": 0, "film_grain": 0, "has_b_frames": 0, "sample_aspect_ratio": "1:1", "display_aspect_ratio": "16:9", "pix_fmt": "yuv420p", "level": 40, "color_range": "tv", "color_space": "bt709", "color_transfer": "bt709", "color_primaries": "bt709", "chroma_location": "center", "field_order": "progressive", "refs": 1, "is_avc": "true", "nal_length_size": "4", "r_frame_rate": "30000/1001", "avg_frame_rate": "30000/1001", "time_base": "1/1000", "start_pts": 33, "start_time": "0.033000", "bits_per_raw_sample": "8", "extradata_size": 44, "disposition": { "default": 1, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "language": "eng", "BPS": "4969575", "DURATION": "00:42:30.648000000", "NUMBER_OF_FRAMES": "76434", "NUMBER_OF_BYTES": "1584454580", "_STATISTICS_WRITING_APP": "mkvmerge v61.0.0 ('So') 64-bit", "_STATISTICS_WRITING_DATE_UTC": "2022-03-10 12:55:01", "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES" } }, { "index": 1, "codec_name": "aac", "codec_long_name": "AAC (Advanced Audio Coding)", "profile": "HE-AAC", "codec_type": "audio", "codec_tag_string": "[0][0][0][0]", "codec_tag": "0x0000", "sample_fmt": "fltp", "sample_rate": "48000", "channels": 2, "channel_layout": "stereo", "bits_per_sample": 0, "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/1000", "start_pts": 0, "start_time": "0.000000", "extradata_size": 2, "disposition": { "default": 1, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "language": "eng", "BPS": "126804", "DURATION": "00:42:30.656000000", "NUMBER_OF_FRAMES": "59781", "NUMBER_OF_BYTES": "40429361", "_STATISTICS_WRITING_APP": "mkvmerge v61.0.0 ('So') 64-bit", "_STATISTICS_WRITING_DATE_UTC": "2022-03-10 12:55:01", "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES" } }, { "index": 2, "codec_name": "subrip", "codec_long_name": "SubRip subtitle", "codec_type": "subtitle", "codec_tag_string": "[0][0][0][0]", "codec_tag": "0x0000", "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/1000", "start_pts": 0, "start_time": "0.000000", "duration_ts": 2550681, "duration": "2550.681000", "disposition": { "default": 0, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "language": "eng", "BPS": "116", "DURATION": "00:42:29.779000000", "NUMBER_OF_FRAMES": "911", "NUMBER_OF_BYTES": "37125", "_STATISTICS_WRITING_APP": "mkvmerge v61.0.0 ('So') 64-bit", "_STATISTICS_WRITING_DATE_UTC": "2022-03-10 12:55:01", "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES" } } ], "format": { "filename": "D:\\Temp\\CC.mkv", "nb_streams": 3, "nb_programs": 0, "format_name": "matroska,webm", "format_long_name": "Matroska / WebM", "start_time": "0.000000", "duration": "2550.681000", "size": "1625733258", "bit_rate": "5098977", "probe_score": 100, "tags": { "encoder": "libebml v1.4.2 + libmatroska v1.6.4", "creation_time": "2022-03-10T12:55:01.000000Z" } } }
Default output, file does not have Closed Captions:Code:PS C:\Users\piete\source\repos\ptr727\PlexCleaner\PlexCleaner\bin\Debug\net6.0\Tools\FfMpeg\bin> ./ffmpeg.exe -i D:\Temp\CC.mkv -abort_on empty_output -map 0 -c copy -bsf:v "filter_units=remove_types=6" -f matroska D:\Temp\NoCC.mkv ffmpeg version 5.0-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers built with gcc 11.2.0 (Rev5, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint libavutil 57. 17.100 / 57. 17.100 libavcodec 59. 18.100 / 59. 18.100 libavformat 59. 16.100 / 59. 16.100 libavdevice 59. 4.100 / 59. 4.100 libavfilter 8. 24.100 / 8. 24.100 libswscale 6. 4.100 / 6. 4.100 libswresample 4. 3.100 / 4. 3.100 libpostproc 56. 3.100 / 56. 3.100 Input #0, matroska,webm, from 'D:\Temp\CC.mkv': Metadata: encoder : libebml v1.4.2 + libmatroska v1.6.4 creation_time : 2022-03-10T12:55:01.000000Z Duration: 00:42:30.68, start: 0.000000, bitrate: 5098 kb/s Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080, Closed Captions, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 1k tbn (default) Metadata: BPS : 4969575 DURATION : 00:42:30.648000000 NUMBER_OF_FRAMES: 76434 NUMBER_OF_BYTES : 1584454580 _STATISTICS_WRITING_APP: mkvmerge v61.0.0 ('So') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-03-10 12:55:01 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:1(eng): Audio: aac (HE-AAC), 48000 Hz, stereo, fltp (default) Metadata: BPS : 126804 DURATION : 00:42:30.656000000 NUMBER_OF_FRAMES: 59781 NUMBER_OF_BYTES : 40429361 _STATISTICS_WRITING_APP: mkvmerge v61.0.0 ('So') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-03-10 12:55:01 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:2(eng): Subtitle: subrip Metadata: BPS : 116 DURATION : 00:42:29.779000000 NUMBER_OF_FRAMES: 911 NUMBER_OF_BYTES : 37125 _STATISTICS_WRITING_APP: mkvmerge v61.0.0 ('So') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-03-10 12:55:01 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Output #0, matroska, to 'D:\Temp\NoCC.mkv': Metadata: encoder : Lavf59.16.100 Stream #0:0(eng): Video: h264 (High) (H264 / 0x34363248), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 1k tbn (default) Metadata: BPS : 4969575 DURATION : 00:42:30.648000000 NUMBER_OF_FRAMES: 76434 NUMBER_OF_BYTES : 1584454580 _STATISTICS_WRITING_APP: mkvmerge v61.0.0 ('So') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-03-10 12:55:01 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:1(eng): Audio: aac (HE-AAC) ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, fltp (default) Metadata: BPS : 126804 DURATION : 00:42:30.656000000 NUMBER_OF_FRAMES: 59781 NUMBER_OF_BYTES : 40429361 _STATISTICS_WRITING_APP: mkvmerge v61.0.0 ('So') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-03-10 12:55:01 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:2(eng): Subtitle: subrip Metadata: BPS : 116 DURATION : 00:42:29.779000000 NUMBER_OF_FRAMES: 911 NUMBER_OF_BYTES : 37125 _STATISTICS_WRITING_APP: mkvmerge v61.0.0 ('So') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-03-10 12:55:01 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Stream #0:2 -> #0:2 (copy) Press [q] to stop, [?] for help frame=76434 fps=13184 q=-1.0 Lsize= 1586912kB time=00:42:30.65 bitrate=5096.7kbits/s speed= 440x video:1546324kB audio:39482kB subtitle:36kB other streams:0kB global headers:0kB muxing overhead: 0.067418%
JSON output, file does not have Closed Captions, closed_captions still not set:Code:PS C:\Users\piete\source\repos\ptr727\PlexCleaner\PlexCleaner\bin\Debug\net6.0\Tools\FfMpeg\bin> ./ffprobe.exe D:\Temp\NoCC.mkv ffprobe version 5.0-full_build-www.gyan.dev Copyright (c) 2007-2022 the FFmpeg developers built with gcc 11.2.0 (Rev5, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint libavutil 57. 17.100 / 57. 17.100 libavcodec 59. 18.100 / 59. 18.100 libavformat 59. 16.100 / 59. 16.100 libavdevice 59. 4.100 / 59. 4.100 libavfilter 8. 24.100 / 8. 24.100 libswscale 6. 4.100 / 6. 4.100 libswresample 4. 3.100 / 4. 3.100 libpostproc 56. 3.100 / 56. 3.100 Input #0, matroska,webm, from 'D:\Temp\NoCC.mkv': Metadata: ENCODER : Lavf59.16.100 Duration: 00:42:30.68, start: 0.000000, bitrate: 5096 kb/s Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 1k tbn (default) Metadata: BPS : 4969575 NUMBER_OF_FRAMES: 76434 NUMBER_OF_BYTES : 1584454580 _STATISTICS_WRITING_APP: mkvmerge v61.0.0 ('So') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-03-10 12:55:01 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES DURATION : 00:42:30.681000000 Stream #0:1(eng): Audio: aac (HE-AAC), 48000 Hz, stereo, fltp (default) Metadata: BPS : 126804 NUMBER_OF_FRAMES: 59781 NUMBER_OF_BYTES : 40429361 _STATISTICS_WRITING_APP: mkvmerge v61.0.0 ('So') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-03-10 12:55:01 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES DURATION : 00:42:30.655000000 Stream #0:2(eng): Subtitle: subrip Metadata: BPS : 116 NUMBER_OF_FRAMES: 911 NUMBER_OF_BYTES : 37125 _STATISTICS_WRITING_APP: mkvmerge v61.0.0 ('So') 64-bit _STATISTICS_WRITING_DATE_UTC: 2022-03-10 12:55:01 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES DURATION : 00:42:30.113000000
Code:PS C:\Users\piete\source\repos\ptr727\PlexCleaner\PlexCleaner\bin\Debug\net6.0\Tools\FfMpeg\bin> ./ffprobe.exe -loglevel quiet -print_format json -show_streams -show_format D:\Temp\NoCC.mkv { "streams": [ { "index": 0, "codec_name": "h264", "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", "profile": "High", "codec_type": "video", "codec_tag_string": "[0][0][0][0]", "codec_tag": "0x0000", "width": 1920, "height": 1080, "coded_width": 1920, "coded_height": 1080, "closed_captions": 0, "film_grain": 0, "has_b_frames": 0, "sample_aspect_ratio": "1:1", "display_aspect_ratio": "16:9", "pix_fmt": "yuv420p", "level": 40, "color_range": "tv", "color_space": "bt709", "color_transfer": "bt709", "color_primaries": "bt709", "chroma_location": "center", "field_order": "progressive", "refs": 1, "is_avc": "true", "nal_length_size": "4", "r_frame_rate": "30000/1001", "avg_frame_rate": "30000/1001", "time_base": "1/1000", "start_pts": 33, "start_time": "0.033000", "bits_per_raw_sample": "8", "extradata_size": 48, "disposition": { "default": 1, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "language": "eng", "BPS": "4969575", "NUMBER_OF_FRAMES": "76434", "NUMBER_OF_BYTES": "1584454580", "_STATISTICS_WRITING_APP": "mkvmerge v61.0.0 ('So') 64-bit", "_STATISTICS_WRITING_DATE_UTC": "2022-03-10 12:55:01", "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", "DURATION": "00:42:30.681000000" } }, { "index": 1, "codec_name": "aac", "codec_long_name": "AAC (Advanced Audio Coding)", "profile": "HE-AAC", "codec_type": "audio", "codec_tag_string": "[0][0][0][0]", "codec_tag": "0x0000", "sample_fmt": "fltp", "sample_rate": "48000", "channels": 2, "channel_layout": "stereo", "bits_per_sample": 0, "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/1000", "start_pts": 0, "start_time": "0.000000", "extradata_size": 2, "disposition": { "default": 1, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "language": "eng", "BPS": "126804", "NUMBER_OF_FRAMES": "59781", "NUMBER_OF_BYTES": "40429361", "_STATISTICS_WRITING_APP": "mkvmerge v61.0.0 ('So') 64-bit", "_STATISTICS_WRITING_DATE_UTC": "2022-03-10 12:55:01", "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", "DURATION": "00:42:30.655000000" } }, { "index": 2, "codec_name": "subrip", "codec_long_name": "SubRip subtitle", "codec_type": "subtitle", "codec_tag_string": "[0][0][0][0]", "codec_tag": "0x0000", "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/1000", "start_pts": 0, "start_time": "0.000000", "duration_ts": 2550681, "duration": "2550.681000", "disposition": { "default": 0, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "language": "eng", "BPS": "116", "NUMBER_OF_FRAMES": "911", "NUMBER_OF_BYTES": "37125", "_STATISTICS_WRITING_APP": "mkvmerge v61.0.0 ('So') 64-bit", "_STATISTICS_WRITING_DATE_UTC": "2022-03-10 12:55:01", "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", "DURATION": "00:42:30.113000000" } } ], "format": { "filename": "D:\\Temp\\NoCC.mkv", "nb_streams": 3, "nb_programs": 0, "format_name": "matroska,webm", "format_long_name": "Matroska / WebM", "start_time": "0.000000", "duration": "2550.681000", "size": "1624997558", "bit_rate": "5096670", "probe_score": 100, "tags": { "ENCODER": "Lavf59.16.100" } } }
+ Reply to Thread
Results 1 to 2 of 2
-
-
I found a patch and discussion for exactly this issue, i.e. stream print says "Closed Captions" JSON output says closed_captions=0.
It seems the patch was abandoned due to disagreement on correctness of expectation?
See:
https://patchwork.ffmpeg.org/project/ffmpeg/patch/MN2PR04MB59815313285AA685E37D09AEBAB...d.outlook.com/
https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=&submitter=&state=*&q=closed_...both&delegate=
https://www.mail-archive.com/ffmpeg-devel@ffmpeg.org/msg126211.html
In the absence of the patch, how then do I get closed_captions set in JSON output?Last edited by ptr727; 15th Mar 2022 at 17:12.
Similar Threads
-
ffprobe : Unsupported codec with id 0 for input stream 0
By jean202 in forum Capturing and VCRReplies: 2Last Post: 28th Jul 2021, 07:32 -
Cast streaming video to smart TV/dongle for more legible closed-captions?
By rawilson100 in forum Newbie / General discussionsReplies: 0Last Post: 25th Jul 2020, 14:02 -
Encode closed captions embedded into MPEG2 video?
By Tanz76 in forum SubtitleReplies: 5Last Post: 19th Apr 2020, 15:24 -
Staxrip and Closed Captions
By kalemvar1 in forum SubtitleReplies: 1Last Post: 20th Feb 2018, 12:09 -
How to extract closed captions from youtube video
By pirgah in forum Video Streaming DownloadingReplies: 5Last Post: 5th Feb 2018, 05:55