View Full Version : H.264 + closed captioning
echo14612
February 20th, 2010, 11:24 AM
My short investigation into H.254 indicates that it supports embedded closed captions. In the past I've done QSF on wtv recordings and got a dvr-ms recording which preserves the captions. When I use QSF to H.254 format or transcode from dvr-ms to H.254, however, the closed captions don't show up.
What am I missing (or not doing right)?
DanR
February 20th, 2010, 02:02 PM
Are you NTSC? If so, then the MPEG2 EIA 608/708 CC's are not being carried over to H.264. Do you know what format you might want them in? As far as I know there isn't an over-the-air broadcast standard for embedded CCs in NTSC.
echo14612
February 20th, 2010, 02:31 PM
Are you NTSC? If so, then the MPEG2 EIA 608/708 CC's are not being carried over to H.264. Do you know what format you might want them in? As far as I know there isn't an over-the-air broadcast standard for embedded CCs in NTSC.
Well, I can say I'm NTSC but I don't know how to answer the rest of your question. I don't know anything about closed caption formats. What I DO know is that when I use WMC to record over-the air programing, the captions show up beautifully in wtv and in dvr-ms after processing with VRD. If you can point me to a resource that could educate me on this, I'd be grateful.
Right now the recordings I'm going to watch in the next week or so I'm leaving in the dvr-ms format. For the others I extract the captions to srt files using ccextractor, convert the dvr-ms to mpg, then use VideoDubMod to resize, crop and transcode to avi.
It would be wonderful if in only one or two steps I could go from the raw wtv to a cropped and resized H.264 - with captions intact.
I can also say that WMC can identify whether or not captions are present in digital cable recordings (from a set top box), but the resulting wtv recording DOES NOT display in WMC. I've asked about this here before, but I didn't follow through with sending you a sample file since I really think Time-Warner cable is to blame for this - and it probably is in no way a VRD issue. (When you're not busy fixing bugs on a new product, I'll be happy to send you a sample if you think you can tell me why I don't see subtitles in digital cable broadcasts.)
Thanks for your response and any help you can give.
DanR
February 20th, 2010, 05:27 PM
The problem is that I don't know how NTSC CC's should be stored in an .TS or .wtv file when you have H.264 video. In MPEG2, the CCs are stored in the video stream as user data, but there isn't an equivalent standard, as far as I know, for H264.
echo14612
February 21st, 2010, 07:44 AM
I tried looking this up with Google. I don't know enough to know how to approach your question! Are you asking about US standards? Are any of these snippets in the ballpark?:
"Closed Caption data can be embedded in H.264 Elementary Streams with support for EIA-608, EIA-708 and SCC. ..."
"In the United States, the official NTSC Closed Caption standard requires that all TVs larger than 13 inches include circuitry to decode and display caption information stored on line 21 of the video signal. ..."
"...The closed caption data supported conforms to the HD ATSC A/53 Digital Television Specification, the CEA-608 NTSC captioning, and the CEA-708-B Digital Television (DTV) Closed Captioning Consumer Electronics Association recommendations. ..."
DanR
February 21st, 2010, 08:11 AM
I think I found the document that is needed. Does anyone have any H264 streams with CC data in it that we can use to test with?
echo14612
February 22nd, 2010, 11:56 AM
On Usenet I found some files using x264 in matroska containers. It's not totally clear from the descriptions that they have embedded CCs, but I think they might. The "subtitles" are described as:
Text
ID : 3
Format : UTF-8
Codec ID : S_TEXT/UTF8
Codec ID/Info : UTF-8 Plain Text
Language : English
If I download them and confirm they have CCs embedded, I can cut out a small file or two to send you. Will that help?
txporter
February 22nd, 2010, 03:55 PM
What you are talking about is a closed caption stream saved as a .srt file and mux'd into the mkv container as a subtitle. There are a few programs that can mux the subtitle files into the container for you (mp4box, mp4creator, tsmuxer, etc). I am not sure of one that will do it for dvr-ms or wtv container though (not that there isn't one, I am just not aware of one).
echo14612
February 22nd, 2010, 04:25 PM
What you are talking about is a closed caption stream saved as a .srt file and mux'd into the mkv container as a subtitle. There are a few programs that can mux the subtitle files into the container for you (mp4box, mp4creator, tsmuxer, etc). I am not sure of one that will do it for dvr-ms or wtv container though (not that there isn't one, I am just not aware of one).
I don't think that's what I'm talking about. When I was looking for a file to send to DanR, I saw many that specified that the subtitles were in the form of .srt and I didn't choose them. I looked specifically for files that listed the CCs as a separate track (or stream or whatever the lingo is). It's possible you're right that the posters extracted the ccs from the .ts source file and then incorporated the resulting text file into the matrosky container. How can I tell? MediaInfo lists the CCs as a separate "track" and describes it as a UTF-8 Text Codec".
That leads me to more questions
1. If a text file (.srt) is inserted into the mkv, does it act like hard-coded subtitles or can you turn it on or off with the player's options?
2. h.264 files are supposed to be able to handle ccs. Would they be "inserted" the same way into whatever container they're in? Or is there another way for them to carry subtitles as part of the file?
3. I'm not trying to insert ccs into dvr-ms or wtv containers. The ccs are there already (if the recorded the files off the air - with digital cable I haven't been so fortunate). I want to convert them to (smaller) h294 and have the CCs go along for the ride. I know I can't do that with xvid files, so I've been extracting the ccs and making (separate) srt files that pair with the video. Sure, I can do that for h294 files, too, BUT I READ THAT THEY CAN CARRY CCs - no extra files required. That's what I want to do.
DanR
February 22nd, 2010, 06:15 PM
MediaInfo lists the CCs as a separate "track" and describes it as a UTF-8 Text Codec".Those aren't the CCs I'm looking for. They would be embedded as part fo the video stream. MKV files has some capabilities to embed text-based subs, but I think that's particular to the MKV format and isn't an industry standard.
I'll ask some of my friends on the broadcast side if they know of any H.264 sources with CC embedded.
txporter
February 23rd, 2010, 10:52 AM
I don't think that's what I'm talking about. When I was looking for a file to send to DanR, I saw many that specified that the subtitles were in the form of .srt and I didn't choose them. I looked specifically for files that listed the CCs as a separate track (or stream or whatever the lingo is). It's possible you're right that the posters extracted the ccs from the .ts source file and then incorporated the resulting text file into the matrosky container. How can I tell? MediaInfo lists the CCs as a separate "track" and describes it as a UTF-8 Text Codec".
That leads me to more questions
1. If a text file (.srt) is inserted into the mkv, does it act like hard-coded subtitles or can you turn it on or off with the player's options?
2. h.264 files are supposed to be able to handle ccs. Would they be "inserted" the same way into whatever container they're in? Or is there another way for them to carry subtitles as part of the file?
3. I'm not trying to insert ccs into dvr-ms or wtv containers. The ccs are there already (if the recorded the files off the air - with digital cable I haven't been so fortunate). I want to convert them to (smaller) h294 and have the CCs go along for the ride. I know I can't do that with xvid files, so I've been extracting the ccs and making (separate) srt files that pair with the video. Sure, I can do that for h294 files, too, BUT I READ THAT THEY CAN CARRY CCs - no extra files required. That's what I want to do.
If you build a video file with h.264 video and aac/ac3/etc audio and then come along with tsmuxer or mp4box or mp4creator or some other piece of software and add your srt as an additional stream to the container, it will be what is called a soft subtitled. It will be switchable on/off and not hard coded. Not all players are actually capable of displaying the subtitles, so you will need to verify that though. Software players on windows like MPC-HC and kmplayer can (as well as others). From what little research I did on this, there are a number of ways to add text based subtitles to mp4 files (as separate stream and as private data). All mention that I have seen of h.264 video with embedded closed captions has been in ts containers. I did see this post (http://forum.doom9.org/showthread.php?t=132018) on doom9 that was specifically talking about closed captions with h.264 video. He referenced ATSC Document A/72 Part 1 for more information. That is all that I know.
DanR
February 23rd, 2010, 11:45 AM
A friend of mine that works at a video distribution company has transcoded an MPEG2 with CCs to and H.264 file with CCs using a hardware encoder. We can now use this as a reference to assist in support H.264 NTSC CCs.
echo14612
February 23rd, 2010, 01:58 PM
A friend of mine that works at a video distribution company has transcoded an MPEG2 with CCs to and H.264 file with CCs using a hardware encoder. We can now use this as a reference to assist in support H.264 NTSC CCs.
I'm hopeful! Thank you so much for looking into this.
echo14612
February 23rd, 2010, 02:03 PM
I did see this post (http://forum.doom9.org/showthread.php?t=132018) on doom9 that was specifically talking about closed captions with h.264 video. He referenced ATSC Document A/72 Part 1 for more information. That is all that I know.
That's funny! Your research took you to the reply to a message I made under a different ID (patlange). I never knew I'd gotten a response so thanks for posting that!
Rev1979
August 6th, 2011, 09:13 PM
Any progress here? I would really like to be able to preserve the MPEG Closed Captions when those files are then converted to H.264
andrewp
August 9th, 2011, 05:57 AM
Hello Each
From a UK broadcaster.
We use H264 and this can have teletext type data as well as subtitle data. The UK does not use "closed captioning" this is a N. American system.
However, if VideoReDo need some content with Teletext and or sub titles this can be arranged for testing purposes. We always use different PID's for teletext and sub titles but there are some special circumstances where both can be applied in the same PID but using a different descriptor for each page.
In SD transport streams we will only use teletext data on page 888 typically.
regards
Andrewp:)
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.