ercanserteli / condenser

Condenser allows you to extract speech audio from video files, based on subtitle timings. By omitting the audio outside of speech, it increases the language per second that you are getting exposed to.
https://ercanserteli.com/condenser
GNU General Public License v3.0
33 stars 7 forks source link

Condenser crashes on certain .mkv videos for some unknown reason. #19

Open AdriGrana opened 2 weeks ago

AdriGrana commented 2 weeks ago

So I wanted to condense the anime suzumiya haruhi no yuuutsu, but no matter which torrent I get it crashes. (all that I tried are .mkv) There is no info in the console since it closes immediately. Also, other anime I have on my system work perfectly without any issues (and most of them are .mkv as well).

The console output from the condenser is only this:

Checking videos in folder: D:\Torrent_Downloads\Suzumiya Haruhi no Yuuutsu Found 14 videos out of 14 files Streams are consistent Condensing video 1 And this is were it crashes immediately

Here are the the video files I was talking about (all of which caused it to crash): https://nyaa.si/view/1068840 https://nyaa.si/view/1338132 https://nyaa.si/view/1094353

To reproduce it I would suggest running the same files as me.

welpo commented 2 weeks ago

This is most likely failing because the subtitles are PGS format*. These are bitmapt subtitles: a bunch of pictures that are overlaid upon the video. It's not possible/easy to extract timings from this (you'd need OCR, for starters).

Try with external .srt subs that match your files, and it should work!

*: checked with ffprobe:

  Stream #0:4(eng): Subtitle: hdmv_pgs_subtitle (pgssub), 1920x1080
      Metadata:
        title           : Full English
        BPS             : 17242
        BPS-eng         : 17242
        DURATION        : 00:24:35.641000000
        DURATION-eng    : 00:24:35.641000000
        NUMBER_OF_FRAMES: 862
        NUMBER_OF_FRAMES-eng: 862
        NUMBER_OF_BYTES : 3180558
        NUMBER_OF_BYTES-eng: 3180558
        _STATISTICS_WRITING_APP: mkvmerge v10.0.0 ('To Drown In You') 64bit
        _STATISTICS_WRITING_APP-eng: mkvmerge v10.0.0 ('To Drown In You') 64bit
        _STATISTICS_WRITING_DATE_UTC: 2017-06-26 10:50:00
        _STATISTICS_WRITING_DATE_UTC-eng: 2017-06-26 10:50:00
        _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
AdriGrana commented 2 weeks ago

Oh I see. Thanks for the fast reply, yes that's it, it worked flawlessly now with external srt subs. My understanding of bitmaps is not that great when it comes to subs but I kinda assumed getting the timing from them wouldn't be to hard given they remain static until a new subs comes a long.

Only anoying thing now is that .srt files usually aren't synced, which is not an issue if I am watching anime as I will just sync it msyself. I think there is no way yet to tell the condenser software the timing of the subs (by how much to shift) right? (I know I can permanently just shift the subs myself and then use the condenser, but I think it would be a cool feature for the future).

Anyways, thanks a lot for the help, it works perfectly now!!!

welpo commented 2 weeks ago

My understanding of bitmaps is not that great when it comes to subs but I kinda assumed getting the timing from them wouldn't be to hard given they remain static until a new subs comes a long

Think of these kinds of subtitles as videos. You essentially have the main video (anime or film or whatever) and another video (not text!) overlaid on top.

To extract timing from this second video you'd need to at least be able to detect empty "video" (subs) for that stream. I'm not sure how easy or feasible that is, though.

I think there is no way yet to tell the condenser software the timing of the subs (by how much to shift) right?

As far as I see in the options, nope.