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.

 

Go Back   Doom9's Forum > General > Subtitles

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th April 2025, 16:31   #2001  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,761
Hi,
I'm quite confused with a pattern to replace, I can't target 3 suspension points following a new line and followed by another character.
I want to add a space after these 3 points, thus only when they begin the line (I have another reg ex when they are preceeded by a space).

For instance, I'd like this ;
Code:
1
00:02:37,309 --> 00:02:39,516
Hello...

2
00:02:39,687 --> 00:02:42,641
...hi ...you.
to become ;
Code:
1
00:02:37,309 --> 00:02:39,516
Hello...

2
00:02:39,687 --> 00:02:42,641
... hi ...you.
I believed this could work but no ;
Code:
(\n)(\.{3})(\w)
replace by ;
Code:
$1$2 $3
Music Fan is offline   Reply With Quote
Old 10th April 2025, 16:42   #2002  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly, Silicon Valley in California)
Posts: 427
Quote:
Originally Posted by Music Fan View Post
Hi,
Code:
(\n)(\.{3})(\w)
Slow down my friend. You're telling regexp to find a word boundary.

Try this instead:

Code:
(\n)(\.{3})([^\s])
Also try this:

Code:
(\n)(\.{3})([\S])
Also try this:

Code:
^(\.{3})([\S])

Last edited by markfilipak; 10th April 2025 at 16:50.
markfilipak is offline   Reply With Quote
Old 10th April 2025, 16:50   #2003  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,761
Thanks but neither of these 2 detects the pattern.
Music Fan is offline   Reply With Quote
Old 10th April 2025, 16:54   #2004  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly, Silicon Valley in California)
Posts: 427
Quote:
Originally Posted by Music Fan View Post
Thanks but neither of these 2 detects the pattern.
Then try these:
Code:
(\n)(\.\.\.)([\S])
(\n)(\.\.\.)([^ ])
^(\.\.\.)([^ ])
markfilipak is offline   Reply With Quote
Old 10th April 2025, 17:02   #2005  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,761
Great, this works ;
Code:
^(\.{3})([^ ])
equals ;
Code:
^(\.\.\.)([^ ])
replace by ;
Code:
$1 $2


Do you know why \n is not taken into account ?
Music Fan is offline   Reply With Quote
Old 10th April 2025, 17:13   #2006  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly, Silicon Valley in California)
Posts: 427
Quote:
Originally Posted by Music Fan View Post
Great, this works ;
Do you know why \n is not taken into account ?
Nope. Every regexp processor I've used has bugs. SE can't seem to make up its mind regarding how to handle line-endings between subs versus line-endings within subs.
markfilipak is offline   Reply With Quote
Old 10th April 2025, 17:23   #2007  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,761
Ok, good to know.
Music Fan is offline   Reply With Quote
Old 10th April 2025, 20:38   #2008  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly, Silicon Valley in California)
Posts: 427
Quote:
Originally Posted by Music Fan View Post
Do you know why \n is not taken into account ?
If
- your subs are text (e.g., SRT), and
- you have a text editor for UTF-8, and
- your text editor does regexp.
I'd recommend you use your text editor rather than SE.
markfilipak is offline   Reply With Quote
Old 10th April 2025, 23:26   #2009  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly, Silicon Valley in California)
Posts: 427
Waveshapes in waveforms are lagging

"The Ghost and Mrs. Muir" [1947] DVD, UPC 024543071426 (2023)

I've written about this in the past two days.
As it turns out, the real problem is that the audio is out of sync. The movie's running time is 102 minutes. By the 30 minute mark, the audio lags by about 200ms and placing subtitle cues begins to get difficult. By the end, the audio lags by about 600ms.

The fault is not with SE. The fault is with Mill Creek Entertainment, the folks who made the DVD. Perhaps my experience, documented here, will help other SE users.

FOLLOW-UP: Below is how I fixed the movie MP4. I
- sped up the dialog audio (-map "[a]") by a factor of 1.00005 (found by trail and error) and
- mixed in the sped up dialog (-c:a:0 ac3) and
- added the two audio comment streams (-map 0:a:4 -map 0:a:5, -c:a:1 copy -c:a:2 copy) and
- deleted closed captions
using the following script:
Code:
set      _SOURCE_="c:\The Ghost and Mrs. Muir\copy_b.mp4"
: copy_b is the concatenated VOBs made via copy /b then transcoded to AVC using my special sauce
set    _CHAPTERS_="c:\The Ghost and Mrs. Muir\chapters.txt"
set      _TARGET_="c:\The Ghost and Mrs. Muir [1947].mp4"
set _STRETCH_AUDIO_=-filter_complex "[0:a]atempo=1.00005[a]"
set _DELETE_CC_=-bsf:v "filter_units=remove_types=6"
ffmpeg^
 -i %_SOURCE_%^
 -i %_CHAPTERS_%^
 %_STRETCH_AUDIO_%^
 -map 0:v -map "[a]" -map 0:a:4 -map 0:a:5 -map_metadata 1^
 %_DELETE_CC_%^
 -c:v copy -c:a:0 ac3 -c:a:1 copy -c:a:2 copy^
 -dn^
 %_TARGET_%
I will now fix the SRT subs that I made in a previous step, which should be much easier now, and mix them in at the end.

Last edited by markfilipak; 11th April 2025 at 17:09.
markfilipak is offline   Reply With Quote
Old 11th April 2025, 08:54   #2010  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,761
Quote:
Originally Posted by markfilipak View Post
If
- your subs are text (e.g., SRT), and
- you have a text editor for UTF-8, and
- your text editor does regexp.
I'd recommend you use your text editor rather than SE.
Ok, I believe I can do that with PowerShell (I don't know other methods).
Music Fan is offline   Reply With Quote
Old 11th April 2025, 12:22   #2011  |  Link
TR-7970X
Registered User
 
TR-7970X's Avatar
 
Join Date: Jan 2025
Posts: 54
Quote:
Originally Posted by markfilipak View Post
"The Ghost and Mrs. Muir" [1947] DVD, UPC 024543071426 (2023)

I've written about this in the past two days.

The fault is not with SE.

I will now fix the SRT subs that I made in a previous step, which should be much easier now, and mix them in at the end.
I just had to say that you've gone to a huge effort to "fix" this, and it's still DVD resolution (unless you're going to upscale in the future).

And progressive sync problems are a real pain.

The copy I got is 720p, with sub's, and it's all good, despite it being B&W, and a little grainy, it's good.
__________________
Main Systems:-
Threadripper 7970X on Asus Pro WS TRX50-Sage WiFi
Ryzen 9 9950X3D on MSI Carbon X670E
Ryzen 9 7950X on Gigabyte Aorus Elite B650
Intel 13900KF on MSI Tomahawk B660
TR-7970X is offline   Reply With Quote
Old 11th April 2025, 17:07   #2012  |  Link
markfilipak
Registered User
 
markfilipak's Avatar
 
Join Date: Jul 2016
Location: Mansfield, Ohio (formerly, Silicon Valley in California)
Posts: 427
What waveforms shows doesn't make sense

This should be useful for anyone experiencing audio out of sync.
Quote:
Originally Posted by TR-7970X View Post
I just had to say that you've gone to a huge effort to "fix" this, and it's still DVD resolution (unless you're going to upscale in the future).
Every problem holds a serpent in one hand and a laurel wreath in the other. Wisdom comes through struggle. (Note: I'm puzzled by "upscale". Why would anyone ever do that?)

Quote:
And progressive sync problems are a real pain.
The audio is slightly early and needed to be stretched.
Code:
From ffprobe -show_streams
   Before stretching: duration=6265.248021 seconds = 1:44:25.248021
    After stretching: duration=6265.595708 seconds = 1:44:25.595708
Amount of stretching: 6265.595708/6265.248021 ==> atempo=1.00005
What waveforms shows doesn't make sense:
In the case of the DVD above, audio was early relative to video. Don't let that confuse the issue. Regardless how well audio syncs with video, sound and a picture of the sound should always be identical. If a sound is early, then a picture of the sound should also be early. When SE waveforms draws pictures of sounds (audio), it must be using improper methods, methods derived from video timing.

Last edited by markfilipak; 11th April 2025 at 19:14.
markfilipak is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:23.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.