Open simoninns opened 5 years ago
There is also a 'sliced' format: https://linuxtv.org/downloads/v4l-dvb-apis/uapi/v4l/dev-sliced-vbi.html
This is probably best implemented as part of the new ld-discmap tool as that 'preps' the TBC for final output
Sounds like a job for ld-export-metadata.
Working from the JSON metadata won't output any unimplemented VBI lines though (like teletext for example). I think the linuxtv format requires the actual video lines rather than decoded LD-specific VBI data points.
Ah, that's true.
I'm uncertain if ld-discmap is the right place for it either, though. At least until it can at minimum pass-through weird ntsc pull-down tbcs if not fully support them. I believe Cinderella PILA-1124 might be one such case, but I'd have to check.
ld-discmap isn't the right place for it - I think a separate tool would be required to pull the lines from the .tbc and output them in the right format for linuxtv.
I've been experimenting with libzvbi, which includes both a decoder that extracts various kinds of ("sliced") VBI data from raw images, and pretty complete Teletext and CC renderers.
At present I have the zvbi decoder hooked up in ld-process-vbi, alongside Simon's existing CC decoder, and it seems to extract both PAL Teletext and NTSC CC frames successfully. The next step would be to make it store the "sliced" results in the JSON (as with CC already), then have ld-export-metadata extract it again, feed it into the renderer, and write the result out as subtitle files (or just dump the sliced data out if you want to render the whole magazine with an external tool).
(That's not to say that this is necessarily the right way to do it in the long run, but I want to see if it works at all before figuring out the right way to do it!)
If you are happy to code it, you'll get no complaints from me :) Feel free to experiment - it's better for us to discuss results rather than potential results!
Work in progress on the zvbi branch - ld-export-metadata can now write out Teletext lines in formats that ZVBI's tools and vhs-teletext's tools can work with:
I'm pretty convinced now that going via the JSON is not the right way to handle Teletext, though - it works, but it produces very big JSON files (which JsonWax doesn't handle well), and getting it into and out of the metadata is half the effort...
Edit: It's not nearly as bad (in efficiency or complexity) if you encode the VBI data as a Base64 string rather than an array.
Worth noting that there's some variation between discs in which lines are used. Using ld-analyse's line numbering system, British Garden Birds and Touch of Evil have Teletext on lines 39-42 (two lines per field), but Glenn Gould's Greatest Hits has Teletext on lines 27-30 and 39-42 (four lines per field).
vhs-teletext can now read .tbc files, so I don't know if this is still needed...
See: https://linuxtv.org/downloads/v4l-dvb-apis/uapi/v4l/dev-raw-vbi.html#raw-vbi
Unless anyone knows of a more suitable output format for external tools?