ccextractor icon indicating copy to clipboard operation
ccextractor copied to clipboard

[QUESTION] How do you save DVD closed captions with position data?

Open cgarz opened this issue 4 years ago • 6 comments

OS: Linux (Archlinux) Version: 0.88 (git bc3d729e30a751feb9b854a54c085f0e81a99134)

When extracting closed captions (EIA-608) from a DVD everything works fine but they do not display in the correct positions like they do when played from the DVD.

I have tried with ASS and SSA which should have the ability to position the subtitles but they are just placed at the bottom like SRT.

Does anyone know how to accomplish this?

cgarz avatar Sep 18 '19 03:09 cgarz

The format g608 accurately shows the screen positioning. May or may not be useful to you though.

cfsmp3 avatar Sep 18 '19 13:09 cfsmp3

Thanks I've tried that now and looking at it in a text editor it definitely works to preserve the position data. However I am unable to use it as a subtitle in mpv. I am also unable to find any information about it via Google. Let alone a player or tool that can read or convert it.

Is there any way to convert this to SSA or some other position capable format?

cgarz avatar Sep 18 '19 19:09 cgarz

You could create a quick converter - text file to text file is quite easy. This is a format we invented for a specific user that needed to have access to the 608 grid, which is what g608 gives you, but definitely unsupported by any other tool or player, so if it contains what you need it's up to you to take it to the next step I'm afraid.

On Wed, Sep 18, 2019 at 12:43 PM cgarz [email protected] wrote:

Thanks I've tried that now and looking at it in a text editor it definietly works to preserve the position data. However I am unable to use it as a subtitle in mpv. I am also unable to find any information about it via Google. Let alone a player or tool that can read or convert it.

Is there any way to convert this to SSA or some other position capable format?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

cfsmp3 avatar Sep 21 '19 03:09 cfsmp3

I was considering writing a quick python script but after a lot of searching I was able to find a solution with ffmpeg. Looking at the ASS file it spits out It would have taken me quite a while to get it working nicely.

If anyone is interested the command was as follows: [...] | ffmpeg -f lavfi -i 'movie=pipe\\:0[out0+subcc]' -map s subs.ass stdin is from dvd_copy. For a file instead of a pipe you can change pipe\\:0 to the filename.

My only problem then was I couldn't work out how to change the style of ffmpegs output and didn't want to use a GUI editor so I found pysubs2 and used it like so: python -c "import pysubs2; s=pysubs2.load('input.ass'); s.styles['Default'].borderstyle=1; s.styles['Default'].outline=2; s.save('output.ass')"

This solves my issue but it would still be great to have ccextractor support something playable with position data.

cgarz avatar Sep 21 '19 21:09 cgarz

couldn't work out how to change the style of ffmpegs output

You can't. That is this bug. https://trac.ffmpeg.org/ticket/5851

But since raw cc format is now supported: https://trac.ffmpeg.org/ticket/4767 you can try to use that, but CCextractor does not have support yet. That is bug #1293.

ValZapod avatar May 15 '21 13:05 ValZapod

I've had a chance to try that now. Playback of scc in mpv works and matches the embedded CC's style exactly which is fantastic! Many thanks! Also thanks for linking up all these related issues, they were an interesting read.

cgarz avatar May 19 '21 05:05 cgarz