Bitmap subs with different positions

Anything and everything to do with DCP-o-matic.
Carsten
Posts: 2665
Joined: Tue Apr 15, 2014 9:11 pm
Location: Germany

Bitmap subs with different positions

Post by Carsten »

Today I showed a Bluray. I usually do not convert to DCP for single showings. This Bluray was Scope with some subtitles at the end. Unfortunately, I did not go through the whole disc before to check this, so with the subs being positioned half on screen, half within the letterbox black bars, I ended up with some of the sub lines being cut off around the end, as we have a scope screen and showed the movie in scope format.
Well, these were translations of epilogue lines being visible on screen in english language as well, so, not such a big deal for the audience, but:.
On this movie I noticed for the first time that the subs at the end actually alternated between being below the image and being above the image. As these are within a single subtitle stream, I would have had no chance to correct this even IF I had chosen to convert the disc to DCP and shifted up the subs at the end. The only 'benefit' from this operation would have been that the below-the-image subs had been visible completely, and the above-the-image subs would have vanished completely. Or vice versa.

I have a feeling that there is no good or easy way to fix a problem like this within DCP-o-matic alone?

- Carsten
scorpio81
Posts: 116
Joined: Mon May 09, 2016 7:19 am

Re: Bitmap subs with different positions

Post by scorpio81 »

Carsten, I guess the only way to fix such a problem would be OCR the subtitles with some subtitle editing software (SubtitleEdit is very good) and then make XML subtitles for DCP (SubtitleEdit can make XML subtitles).
liloneum
Posts: 7
Joined: Fri Apr 14, 2017 9:00 am

Re: Bitmap subs with different positions

Post by liloneum »

Carsten,

To fix this kind of issue, you can demux the sup file with tsMuxeR, open it with BDSup2Sub, change the position of some/all the subtitles, export it to sup and remux it with tsMuxer.

Is it what you are trying to do?
Carsten
Posts: 2665
Joined: Tue Apr 15, 2014 9:11 pm
Location: Germany

Re: Bitmap subs with different positions

Post by Carsten »

Thanks,

I knew there were things like this that could solve the issue, I just always try to squeeze out as much as possible from DCP-o-matic.

Showing Scope from Bluray always has a risc of such things happening. There are some Bluray Players which offer to shift Subs while playing, the same way as DCP-o-matic offers it - however, they wouldn't be able to solve this issue, because, as DCP-o-matic, they only offer a global shift parameter.
The only 'quick' options would be to create a new format with 'some' letterboxing to show the subs above and below. I hate showing scope movies in flat on our screen just because some subs may show up in the letterboxing.
Another question is, how do I find out in advance about such issues. These showings usually do not allow to watch through the whole movie in advance, and in fast-forward, our player does not show subs at all.

- Carsten
carl
Site Admin
Posts: 2362
Joined: Thu Nov 14, 2013 2:53 pm

Re: Bitmap subs with different positions

Post by carl »

Without having thought about this too deeply, couldn't we check for out-of-frame subs and nudge them back into the frame? Would that be useful?
liloneum
Posts: 7
Joined: Fri Apr 14, 2017 9:00 am

Re: Bitmap subs with different positions

Post by liloneum »

Yes, there is a risk to have subtitles out of the image, as BD has HD definition and is supposed to be displayed on HD screens.
When you demux the sup file from m2ts stream, you get PNG files and a XML BDN file referencing In/Out time codes, PNG files and there position on screen.
You can easily detect with a script witch images are below 940 pix in the case of non full screen PNG files (the most common).
Carsten
Posts: 2665
Joined: Tue Apr 15, 2014 9:11 pm
Location: Germany

Re: Bitmap subs with different positions

Post by Carsten »

carl wrote: Tue May 02, 2017 10:19 pm Without having thought about this too deeply, couldn't we check for out-of-frame subs and nudge them back into the frame? Would that be useful?
Hmm, how would you do that? You would need to have a 'letterbox/pillarbox' detector. It would probably be helpful for AR/scaling as well. I remember we brought up letterbox detection in earlier discussions. Once you know the content is letterboxed or pillarboxed, it is probably easy to detect subs outside/inside. But then how to deal with them globally instead of individually? Sounds like a lot of effort for potentially some few features with variable sub positioning. But maybe the mechanism could be helpful for other issues as well. Talking about subtitle editor ;-)

Always wondered wether there is a way to separate and split streams? That way I could split the subtitle stream into separate parts and assign individual shift parameters. I know I could do this manually (adding the same content multiple times, and trimming, but doing that frame-accurate to cater for precise video transitions is no fun...). It would be easier for the subtitle stream alone. Maybe a generic function to extract/separate individual streams from interleaved files. But only per metadata, the source media should stay intact.

- Carsten
carl
Site Admin
Posts: 2362
Joined: Thu Nov 14, 2013 2:53 pm

Re: Bitmap subs with different positions

Post by carl »

Hmm, how would you do that? You would need to have a 'letterbox/pillarbox' detector. It would probably be helpful for AR/scaling as well. I remember we brought up letterbox detection in earlier discussions. Once you know the content is letterboxed or pillarboxed, it is probably easy to detect subs outside/inside. But then how to deal with them globally instead of individually? Sounds like a lot of effort for potentially some few features with variable sub positioning.
I'd assume we've already cut off the letterbox/pillarbox manually with trim, so we just keep the subs inside the container...
Always wondered wether there is a way to separate and split streams? That way I could split the subtitle stream into separate parts and assign individual shift parameters. I know I could do this manually (adding the same content multiple times, and trimming, but doing that frame-accurate to cater for precise video transitions is no fun...). It would be easier for the subtitle stream alone. Maybe a generic function to extract/separate individual streams from interleaved files. But only per metadata, the source media should stay intact.
You mean apply different settings to different parts of a subtitle stream?
Carsten
Posts: 2665
Joined: Tue Apr 15, 2014 9:11 pm
Location: Germany

Re: Bitmap subs with different positions

Post by Carsten »

Yes. I guess it would be no big problem to split content on a metadata basis, just like there is repeat. You would get the current playhead position, right click 'split', and you would repeat the content once, and adjust in/out accordingly to make the seam invisible.

Ah , yes, maybe it would be easy to detect subs that are outside the set content frame and force them back in...

The trouble is, they would (in this case) still alternate between top and bottom without a way to adjust their placement individually. You would need to make a calculation about the before/after vertical displacement ratio. But, still better than nothing, even if you can't adjust top/bottom individually.

- Carsten
Carsten
Posts: 2665
Joined: Tue Apr 15, 2014 9:11 pm
Location: Germany

Re: Bitmap subs with different positions

Post by Carsten »

Funny, I have been asked to show that same Bluray again, and my intuition tells me this will not be the last time. So, I am again thinking to convert it to DCP, and fix the issue with (bitmap) subs appearing both above and below the active image area (in the scope letter boxes).

Now, I don't think this can be fixed quickly, but I will create a mantis entry for this - always force subtitles into the active image area (after cropping).

Now, consider a 1920/1080 video that carries a letterboxed scope movie, and the subs flipping between the bottom and the top black bar. How would you calculate the right spacing between the two? Just breakdown the original position that are based on the 1080p vertical dimension down to the active image vertical dinension?

How are these bitmap subs positions referenced - lowest subtitle pixel from bottom? In that case, one would also need to consider the height of the subtitles in order to move them low enough so the top part of the sub comes down enough below the first line of the active image area? I know this is a very special case, but the idea of automatically moving all subs into the visible image area seems to be a good idea. Can we still move them into intentional letterbox areas manually if we want to, using the shift controls? Because that was something I did to great effect on another project, shifting a scope movie to the lower part of a flat container, and shifting the subtitles into the black space above the scope active area.

I am very explicitly not after 'special functions' to accomplish all that. Just a way to accomplish this in an intuitive way with the existing controls. Placing subs at an initial 'useful' position within the active image area, but still allowing to shift them outside that area should be possible?

- Carsten