Closed audiofilter closed 8 years ago
Do you have ffmpeg and ffprobe installed? In program's folder there is a file 'log.txt' (it automatically rewrites itself after closing the program). Can you copy it here. Maybe it can help to find the problem.
This is log file.
Video file: /vagrant/BridgeOfSpies.mp4 Audio id: 0 English subtitles: /vagrant/Bridge.of.Spies.2015.HDRip.XviD.AC3-EVO.srt Russian subtitles: /vagrant/Bridge.of.Spies.2015.HDRip.XviD.AC3.2.0-EVO SDH.srt English subtitles output: /vagrant/BridgeOfSpies.out.en.srt Russian subtitles output: /vagrant/BridgeOfSpies.out.ru.srt Write output subtitles: False Ignore SDH subtitles: True Output Directory: /vagrant Video width: 480 Video height: 320 Pad start: 0.25 Pad end: 0.25 Gap between phrases: 1.75 Split Long Phrases: False Max length phrases: 60 Mode: Phrases
Loading English subtitles... Traceback (most recent call last): File "/vagrant/movies2anki.py", line 948, in start self.model.create_subtitles() File "/vagrant/movies2anki.py", line 527, in create_subtitles en_subs = self.load_subtitle(self.en_srt, self.is_ignore_sdh_subtitle) File "/vagrant/movies2anki.py", line 445, in load_subtitle return read_subtitles(file_content, is_ignore_SDH) File "/vagrant/movies2anki.py", line 128, in read_subtitles sub_start = srt_time_to_seconds(sub_timecode[0].strip()) File "/vagrant/movies2anki.py", line 81, in srt_time_to_seconds major, minor = (split_time[0].split(':'), split_time[1])
Video file: /vagrant/BridgeOfSpies.mp4 Audio id: 0 English subtitles: /vagrant/Bridge.of.Spi
Thanks. Can you upload 'Bridge.of.Spies.2015.HDRip.XviD.AC3-EVO.srt' here or somewhere?
Ah, yes. If I just use 2 english srt files, it appears to work. I think the problem is parsing a unicode srt file of format like below
This file processes OK with python package pysubs2
subtitle.txt is correct. On windows there is no problem.
Try this: Add before line 81: "major, minor = (split_time[0].split(':'), split_time[1])" this line: "print "Time: %s" % repr(time)"
Then open program, add subs, click on "Preview", close program. Copy new log.txt here.
Sorry, had to re-attach
Perhaps, because my video file is shorter than sub-title file is suggesting?
Log file suddenly ends without error. After last line "Time: u'02:10:51,846" there must be a quote (') and maybe error message. But there is nothing. Strange.
No, i don't think that video length is a problem.
What about these subtitles? Friends.S05E04.The.One.Where.Phoebe.Hates.PBS_track5_eng.txt Just add it as English subtitles, then click on Preview. Is dialog with information about subtitles appeared?
With only English subtitles (Friends), I get a pop up box: English subtitles : 344,... from log Time: u'00:22:00,235' Time: u'00:22:02,528' Encoding: utf-8 English subtitles: 344 English sentences: 342 English phrases: 54 Loading Russian subtitles... Encoding: utf-8 Russian subtitles: 0 Syncing Russian subtitles with English phrases... Adding Pad Timings between English phrases... Adding Pad Timings between Russian phrases...
In comment https://github.com/kelciour/movies2anki/issues/1#issuecomment-186682353 you added file newlog.txt. It appears to be correct. And before
Ah, yes. If I just use 2 english srt files, it appears to work.
What do you mean? tsv file and folder with media files was successful created? So movies2anki is working or not?
No, just preview worked. Now I add the other subtitle file and this is the log.txt. I think before I didn't exit the program and so log.txt was incomplete
Time: u'00:22:00,235' Time: u'00:22:02,528' Encoding: utf-8 English subtitles: 344 English sentences: 342 English phrases: 54 Loading Russian subtitles... Time: '\x00' Traceback (most recent call last): File "/vagrant/movies2anki.py", line 924, in preview self.model.create_subtitles() File "/vagrant/movies2anki.py", line 542, in create_subtitles ru_subs = self.load_subtitle(self.ru_srt, self.is_ignore_sdh_subtitle) File "/vagrant/movies2anki.py", line 446, in load_subtitle return read_subtitles(file_content, is_ignore_SDH) File "/vagrant/movies2anki.py", line 129, in read_subtitles sub_start = srt_time_to_seconds(sub_timecode[0].strip()) File "/vagrant/movies2anki.py", line 82, in srt_time_to_seconds major, minor = (split_time[0].split(':'), split_time[1]) IndexError: list index out of range
Ok. Try open this subtitle file in AegiSub and save it with utf-8 encoding (File->Export) as srt file (just print output name with srt extension).
Sorry, previous comment was wrong. With 2 English only subtitles, the tsv file & media directory seemed to work & it was progressing through the encoding (i.e with progress dialog). I cancelled before it finished
Thanks.
Please, add another line before line 129: "sub_start = srt_time_to_seconds(sub_timecode[0].strip())"
print "Subtitle: %s" % repr(sub)
And upload new log with problem srt file.
I don't have AegiSub, but I just noticed that the file was utf-16 and when I try
iconv -t UTF-8 Bridge.of.Spies.2015.HDRip.XviD.AC3-EVO.srt >bridge.fa.srt I get iconv: illegal input sequence at position 0
So i guess the file is messed up somehow
Yeah, try to change srt encoding to utf-8 because movies2anki support srt files only with encoding utf-8 and cp1251.
Ah, I just done "dos2unix" on the srt files and now preview is working (and encoding). Thanks for the help. Perhaps pysub2 is more forgiving.
Great!
On Mac itself, I have some QT incompatibilities and can't even get the GUI up.
Maybe I can help? What is the problem? I don't have Mac but maybe somehow i can help =)
Thanks. I have parts of both QT4 & QT5 I think. I will try in a virtual python env. However, now that I have a .tsv file + media directory, how do I convert that to anki cards? Thanks Tony
On Feb 20, 2016, at 1:54 PM, Nickolay notifications@github.com wrote:
On Mac itself, I have some QT incompatibilities and can't even get the GUI up.
Maybe I can help? What is the problem? I don't have Mac but maybe somehow i can help =)
— Reply to this email directly or view it on GitHub https://github.com/kelciour/movies2anki/issues/1#issuecomment-186688396.
Or check this video -> https://www.youtube.com/watch?v=Uu9oT5z08Is
Maybe this instruction can be helpful to install Qt and PySide -> http://pyside.readthedocs.org/en/latest/installing/macosx.html
Using a vagrant linux on a Mac, I'm able to get GUI up and set parameters, but when I hit Go or Preview nothing happens. On Mac itself, I have some QT incompatibilities and can't even get the GUI up. Is there a simple command line way I can use this without QT ? Or how would I modify this to do that?