Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
4th November 2021, 22:53 | #1 | Link |
Registered User
Join Date: Mar 2021
Location: Germany
Posts: 11
|
DVD EIA-608 Closed Captions timing source
Hello everyone,
i am currently working on a tool to extract EIA-608 closed captions from MPEG2 streams demuxed from VOB files. Mainly as a learning excercise but also because ffmpeg's extractor doesn't work properly for me and neither does CCExtractor. The decoding of the text itself works fine, but from the information i could find (EIA-608 Wikipedia article, VLC source code, ffmpeg source code, mencoder source code) it is not really clear to me where the timestamps for when to display the captions come from, when i use the PTS of the packet containing the "Display Buffer" control command the captions are delayed by a factor of about 12 (i.e. they run 12 times slower than they should). VLC displays the caption without issue and with proper timing. i hope someone can point me in the right direction. (the end goal is to wrap this and some other tooling i wrote up in a script as a headless (maybe i'll add a GUI when everything works), cross-platform alternative to MakeMKV that's aimed at preparing DVDs for filtering using Vapoursynth or AVISynth) Best regards, Earthnuker
__________________
Hack the planet! Last edited by Earthnuker; 4th November 2021 at 23:25. |
4th November 2021, 23:36 | #2 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
|
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..." Last edited by Emulgator; 5th November 2021 at 00:17. |
5th November 2021, 00:51 | #3 | Link | |
Registered User
Join Date: Mar 2021
Location: Germany
Posts: 11
|
Quote:
sadly the tools linked on the SCC Tools website are windows only, which defeats the purpose of my endeavor and closed source which allows no easy introspection into how they work. The datasheet for the Zilog Z86229 NTSC Line 21 CCD Decoder chip, while very interesting, also does not fit my use case, as i am not trying to extract captions from an NTSC broadcast transmitted over the air but from an MPEG2 elementary stream demuxed from a VOB file which was retrieved from a DVD. Best regards, Earthnuker
__________________
Hack the planet! |
|
5th November 2021, 01:09 | #4 | Link |
Registered User
Join Date: Mar 2021
Location: Germany
Posts: 11
|
I should probably give a quick overview of how my closed-captions extractor works to make sure I'm not missing anything obvious:
- use ffprobe -f lavfi -i movie=foo.m2v[out+subcc] -show_packets to retrieve the position and timestamp of subtitle packets within the mpeg stream - seek to the corresponding position+42 in the file, make sure there is a 000001B24343 marker - retrieve caption blocks, process commands and update the state of the caption-rendering state machine accordingly - if a "Display Buffer" command is received, retrieve all non-empty lines from the current screen buffer and print them to the console, along with the PTS of the MPEG2 packet that contained the "Display Buffer" command my code is here: https://pastebin.com/DGPFa2Mm it's a bit messy because i hacked it together in two days Best regards, Earthnuker
__________________
Hack the planet! |
Tags |
captions, dvd, eia-608 |
|
|