Open Johndirr opened 4 years ago
Hey @Johndirr , sorry for the delay. Can you provide a link to the audio files?
Ah! Unable to download the files. I'd suggest you extract the fingerprints for both the files and send them over to me.
You can get fpcalc
static binaries from here: chromaprint
It's easy, just run:
fpcalc -raw -json -overlap /path/to/audio/file
I'll look into what's causing the program to stop.
Dumped the output into these files. Hope this will help. lowres.txt highres.txt
I can also upload the wav files to a different hoster if you suggest me one.
Hey!
What I can tell after running the code for the two files is that these two files are almost the same.
The case that resync
currently handles is that of two files with changed timings commonly due to the presence of extra portions (mainly commercials). As far as I can see the current files are the same maybe with different frame rates.
Maybe I can try something but for that, I'll need the files(media and subtitle).
The google drive links seem to be broken.
Hi, you are right. The two files are the same with a different framerate. Uploaded the wavs to another site: https://filebin.net/bz6ihecdnhp1v1gs/files.zip?t=mswa7vao But I don't care that much about the difference for these files in particular. I just want to get the program to work :)
Reuploaded files
Ok, I gave this another try. This time it ended in a Segmentation fault
./resync -o original.wav -m new.wav -s orignalsub.srt Subtitle-Resync 0.00, CCExtractor Development.
[05-11 11:20:18][Debug] Extracting audio fingerprints from: original.wav [05-11 11:20:18][Debug] Begin reading WAV file [05-11 11:20:18][Debug] Opening mode chosen: readFile, proceeding [05-11 11:20:18][Debug] Trying to read from file : original.wav [05-11 11:20:18][Debug] Reading file data [05-11 11:20:25][Debug] File data read and stored in buffer [05-11 11:20:25][Debug] Processing data and extracting samples [05-11 11:20:25][Debug] Checking chunkID, should be RIFF [05-11 11:20:25][Debug] Wave File chunkID verification successful [05-11 11:20:25][Debug] Begin decoding wave file [05-11 11:20:25][Debug] File format is identified as WAV [05-11 11:20:25][Debug] Finding FMT and DATA subchunks [05-11 11:20:25][Debug] FMT index : 12 , DATA index : 70 [05-11 11:20:25][Debug] PCM : True [05-11 11:20:25][Debug] MONO : True [05-11 11:20:25][Debug] Sample Rate 16KHz : True [05-11 11:20:25][Debug] BitRate 16 bits/sec : True [05-11 11:20:25][Debug] Number of samples : 105009152 [05-11 11:20:25][Debug] Reading samples [05-11 11:20:27][Debug] Successfully decoded [05-11 11:20:27][Debug] File decoded successfully [05-11 11:20:39][Debug] The audio is 6563.07 seconds in length. [05-11 11:20:39][Debug] Audio fingerprints successfully generated.
[05-11 11:20:39][Debug] Extracting audio fingerprints from: new.wav [05-11 11:20:39][Debug] Begin reading WAV file [05-11 11:20:39][Debug] Opening mode chosen: readFile, proceeding [05-11 11:20:39][Debug] Trying to read from file : new.wav [05-11 11:20:39][Debug] Reading file data [05-11 11:20:45][Debug] File data read and stored in buffer [05-11 11:20:45][Debug] Processing data and extracting samples [05-11 11:20:45][Debug] Checking chunkID, should be RIFF [05-11 11:20:45][Debug] Wave File chunkID verification successful [05-11 11:20:45][Debug] Begin decoding wave file [05-11 11:20:45][Debug] File format is identified as WAV [05-11 11:20:45][Debug] Finding FMT and DATA subchunks [05-11 11:20:45][Debug] FMT index : 12 , DATA index : 70 [05-11 11:20:45][Debug] PCM : True [05-11 11:20:45][Debug] MONO : True [05-11 11:20:45][Debug] Sample Rate 16KHz : True [05-11 11:20:45][Debug] BitRate 16 bits/sec : True [05-11 11:20:45][Debug] Number of samples : 85014528 [05-11 11:20:45][Debug] Reading samples [05-11 11:20:47][Debug] Successfully decoded [05-11 11:20:47][Debug] File decoded successfully [05-11 11:20:56][Debug] The audio is 5313.41 seconds in length. [05-11 11:20:56][Debug] Audio fingerprints successfully generated.
[05-11 11:20:56][Debug] Finding the different segments...
Segmentation fault
@sypai If you would be so kind to have a look at this. I uploaded the files to mega: https://mega.nz/folder/KUgjmCpB#ailTQWAXfl_bpCBu-LnP5g If you can't download from there please tell me a host and I'll reupload.
Hello, @Johndirr Apologies for the delay.
mega doesn't seem to work :( Can we try G Drive once more?
Here you go: https://drive.google.com/open?id=15EwO6LTaSWBm8HLtt6CwhoDvB3WkCxiz EDIT: Accidentally closed the issue...
I tried resync and have the same segmentation fault.
The problem is somewhere in slice function https://github.com/CCExtractor/Subtitle-Resync/blob/82e7673c4452056598d9edd46db685a17ea1b9cd/src/utils/align_fingerprints.cpp#L321 According to backtrace, there are calls: main -> Tool::sync -> AlignFP::brum_brum -> AlignFP::segment_it -> AlignFP::next and after it AlignFP::slice have been recursively called like ~70k times until the program died. UPD: That's funny, but it seems like every recurrent call of function slice is called with the same arguments of ub ("upper bound") and lb ("lower bound"). lb=-20, ub=24883. Is it legal for lb be negative, because otherwise it's wrong lb to be compared with type of size_t here: https://github.com/CCExtractor/Subtitle-Resync/blob/82e7673c4452056598d9edd46db685a17ea1b9cd/src/utils/align_fingerprints.cpp#L327 I think because of this wrong type comparison we have segmentation fault here. Forcing with negative values infinity recursive calls.
Same thing here. Different audios tried, different subtitles, same result. Shame because I haven't found any other tool that does exactly this.
Running
I get the following output. But it won't go past this state and never finishes resynchronizing.
Any idea whats wrong? The audio files were created as stated in the docs.