-
I just discovered that series like My Hero Academia have 2 video streams (identical runtime according to Potplayer) but the English stream has ~2.5s Toho Animation intro screen that the Japanese version does not. The result is an mkv with 2 video stream and 2 audio streams which is fine if I was watching from Potplayer or VLC on my PC then I could simply select the appropriate streams. But Plex doesn't allow you to do this, it only plays the first stream(Japanese typically I think). I had the idea to try to us mkvtoolnix to manually delay the Japanese video and audio streams by the ~2.5s the Toho intro plays but it's ugly, I can't get the exact millisecond offset so I can still perceive a difference. I haven't gone through very many series so I've only noticed it on My Hero Academia but I imagine this could affect other shows. Hopefully I don't have to scrap everything. 😭 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
You can use ffmpeg to SSIM the two video streams to find differences. Alternatively, You can use ffmpeg filters to find the difference between the two video steams, negate that, then check for black screen (e.g. that there are major differences between the two.) you would programmatically trim frames until you find a minimum amount of black frames/the videos are above a threshold for SSIM. However, in my experience, there is usually a video segment that is changed in the middle of the dubbed video stream which makes the whole ordeal useless since the dubbed audio won't match what's happening in the video (it also takes a good while to run all the filters on the videos, though that can probably be changed by only checking key frames). Are you sure that the videos after the intro are exactly the same? |
Beta Was this translation helpful? Give feedback.
-
v3.4.0 introduced the Edit: Beginning with v3.6.0, |
Beta Was this translation helpful? Give feedback.
v3.4.0 introduced the
--sync-start
flag (documentation). The flag tries to find and cut away offsets some video streams have, as you described your problem, so that only one video track for multiple audio tracks is stored.The flag isn't 100% reliable tho, the current implementation is the best I could do in the limited time I have, so it might fail (in this case the download continues normally and just stores multiple video tracks, as it did before) or not everything is cut away and the audio is a bit off, so manually validation is highly recommended.
Edit: Beginning with v3.6.0,
--sync-start
was replaced with a new merge behavior, namelyaudio
(full flag is--merge sync
). This flag uses…