Solved Is Kodi supposed to render Closed Captions embedded in .mp4 files?
#1
Hey it's me again... The PITA that keeps pointing out bugs for things used by 12 people out of millions...

Anyway,

I download a ton of shows directly from Discovery+ cause my wife and i are reality TV junkies (don't judge!) and the resulting MP4 contains Closed Captions muxed into the video track.

For the shows i will keep for posterity, i extract the CC to a .srt and remux everything into a .mkv file.

For shows i am not sure about yet, i keep them as the original .mp4 and watch the 1st episode with my wife and we decide if we like the show or not.

My wife's first language is not English so she wants subtitles for EVERYTHING we watch. When playing a .mp4 file with embedded closed captions, they do not show in Kodi.

Yes, i have enabled: Settings | Player | Videos | Activate Teletext and also Settings | Player | Language | Enable parsing for closed captions

While the video plays, Pressing V says Teletext Not Available and pressing T says Subtitles Not Available. Is there some other way to activate the CC i don't know about? Or is CC only supported for Live TV?

If i try the same file in VLC, i can enable/disable Closed Captions and it works just fine.

Here is the structure of a typical episode:

Code:

General
Complete name                            : C:\Users\Jack\Videos\YTDLP\DiscoveryPlus\Naked and Afraid.1x01.The Jungle Curse.1080p WEB-DL.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 1.53 GiB
Duration                                 : 42 min 34 s
Overall bit rate                         : 5 160 kb/s
Collection                               : Naked and Afraid
Season                                   : 1
Part                                     : 1
Track name                               : The Jungle Curse
Performer                                : Discovery
Description                              : Survivalists face life-threatening challenges in Costa Rica's rain forest.
Recorded date                            : 20210625
Writing application                      : Lavf58.76.100
Comment                                  : https://www.discoveryplus.com/video/nake...ngle-curse
LongDescription                          : Survivalists face life-threatening challenges in Costa Rica's rain forest.
Part_ID                                  : Episode 1

Video
ID                                       : 2
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : CABAC / 2 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 2 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 42 min 34 s
Source duration                          : 42 min 34 s
Bit rate                                 : 5 027 kb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 29.970 (29970/1000) FPS
Minimum frame rate                       : 9.989 FPS
Maximum frame rate                       : 2 727.273 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.081
Stream size                              : 1.50 GiB (97%)
Source stream size                       : 1.50 GiB (97%)
Writing library                          : x264 core 148 r2579M 73ae2d1
Encoding settings                        : cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=1 / lookahead_threads=1 / sliced_threads=0 / nr=250 / decimate=1 / interlaced=0 / bluray_compat=0 / stitchable=1 / constrained_intra=0 / bframes=0 / weightp=1 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=2pass / mbtree=1 / bitrate=5000 / ratetol=1.0 / qcomp=0.60 / qpmin=5 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=10000 / vbv_bufsize=5000 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
mdhd_Duration                            : 2554852
Codec configuration box                  : avcC

Audio
ID                                       : 1
Format                                   : AAC LC SBR
Format/Info                              : Advanced Audio Codec Low Complexity with Spectral Band Replication
Commercial name                          : HE-AAC
Format settings                          : Implicit
Codec ID                                 : mp4a-40-2
Duration                                 : 42 min 34 s
Bit rate mode                            : Constant
Bit rate                                 : 127 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 23.438 FPS (2048 SPF)
Compression mode                         : Lossy
Stream size                              : 38.6 MiB (2%)
Default                                  : Yes
Alternate group                          : 1

Text
ID                                       : 2-CC1
Format                                   : EIA-608
Muxing mode                              : SCTE 128 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 42 min 34 s
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)
CaptionServiceName                       : CC1



I don't want to distribute copyrighted content but there is no DRM for Discovery+ paid content so if a dev wants to get an episode to test/implement the feature, you can do a trial subscription and use any of the FOSS that will let you download episodes. If you can't figure it out then just PM me and i'll send you instructions.

Thanks
[4 Kodi Clients + 4 Norco RPC-4224 Media Servers w/376 TB HDD Space]
Reply
#2
I've never found a DirectShow filter that could display those (I know Kodi doesn't use DirectShow, I simply mean that I've always found them problematic, no matter the platform in use). The fact that "stream size" is reported at 0 bytes is suspicious too.
For troubleshooting and bug reporting please make sure you read this first (usually it's enough to follow instructions in the second post).
Reply
#3
(2022-05-15, 23:17)ashlar Wrote: I've never found a DirectShow filter that could display those (I know Kodi doesn't use DirectShow, I simply mean that I've always found them problematic, no matter the platform in use). The fact that "stream size" is reported at 0 bytes is suspicious too.

VLC plays them no problem. 

What i do is i extract them from the MP4 to .srt with CCExtractor and them mux the .mp4 and the .srt to a .mkv.

I would just love it if i didn't have to do these steps for shows i am not sure i will even keep...
[4 Kodi Clients + 4 Norco RPC-4224 Media Servers w/376 TB HDD Space]
Reply
#4
I suppose this is in Kodi matrix right? Can you give a go with a Nexus nightly build (make sure to backup your userdata folder first)? You can get them from https://mirrors.kodi.tv/nightlies/windows/win64/master/

If that doesn't work I think you'll have to provide a sample. The full episode is not needed but a 1/2 minute snippet would help tracking and fixing the issue.
Reply
#5
Ok so i tried with the 20220515 build and it doesn't work.

Here are the 1st 5 minutes of a show with Closed Captions

Don't get confused by the burnt-in subtitles as these are just part of the video for when a person with accent may be hard to understand.

If you use VLC and enable the Closed Captions subs, you will see the CCs in a completely different font/color/background
[4 Kodi Clients + 4 Norco RPC-4224 Media Servers w/376 TB HDD Space]
Reply
#6
The work-around using VLC as an External Players (wiki) with-in Kodi I was able to play the CC without issue.
Reply
#7
@Pr.Sinister thanks for the sample, really helpful to understand what's going on. I've issued https://github.com/xbmc/xbmc/pull/21410 as a possible fix.

test-build: https://mirrors.kodi.tv/test-builds/wind...ux-x64.exe

Please let me know if you still have this issue with your files.
Reply
#8
(2022-05-16, 18:35)enen92 Wrote: @Pr.Sinister thanks for the sample, really helpful to understand what's going on. I've issued https://github.com/xbmc/xbmc/pull/21410 as a possible fix.

test-build: https://mirrors.kodi.tv/test-builds/wind...ux-x64.exe

Please let me know if you still have this issue with your files.

Image

Great success!

Thanks for the amazing expediency!
[4 Kodi Clients + 4 Norco RPC-4224 Media Servers w/376 TB HDD Space]
Reply
#9
Thread marked solved.
Reply
#10
Thanks for confirming the fix.
Fix PR has been merged into master (and will be in Alpha2). Was also backported to Matrix so hopefully will be in v19.5 as well.
Reply

Logout Mark Read Team Forum Stats Members Help
Is Kodi supposed to render Closed Captions embedded in .mp4 files?0