Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

most working but some give errors #12

Open
huuub opened this issue Apr 19, 2019 · 7 comments
Open

most working but some give errors #12

huuub opened this issue Apr 19, 2019 · 7 comments
Labels
bug Something isn't working

Comments

@huuub
Copy link

huuub commented Apr 19, 2019

any help?

Traceback (most recent call last):
File "/home/jeroen/.local/bin/subsync", line 4, in
subsync.run()
File "/home/jeroen/.local/lib/python3.6/site-packages/subsync/main.py", line 42, in run
m.mfcc(duration=args.duration, seek=not args.start)
File "/home/jeroen/.local/lib/python3.6/site-packages/subsync/media.py", line 83, in mfcc
transcode = Transcode(self.filepath, duration=duration, seek=seek)
File "/home/jeroen/.local/lib/python3.6/site-packages/subsync/ffmpeg.py", line 28, in init
self.length = self.__length()
File "/home/jeroen/.local/lib/python3.6/site-packages/subsync/ffmpeg.py", line 57, in __length
match = re.search(r'(\d\d):(\d\d):(\d\d).(\d\d)', duration[0])
IndexError: list index out of range

@tympanix
Copy link
Owner

We are invoking ffprobe to find the length of the video file here:

cmd = subprocess.Popen(['ffprobe', self.input], stdout=PIPE, stderr=STDOUT)
duration = [x.decode("utf-8") for x in cmd.stdout.readlines() if b"Duration" in x]
match = re.search(r'(\d\d):(\d\d):(\d\d)\.(\d\d)', duration[0])
code = cmd.wait()
if not match or code != 0:
raise RuntimeError('Could not call ffprobe:', self.input)

Apparently the output of the ffprobe command is something unexpected and therefore it does not match the regex. If you may, try to run the command on the same file in a terminal and paste it here. Then we might know why it does not match the expected output.

@tympanix tympanix added the bug Something isn't working label Apr 20, 2019
@tympanix
Copy link
Owner

Maybe we can make the ffprobe invokation more robust with some tricks mentioned in the documentation

@huuub
Copy link
Author

huuub commented Apr 23, 2019

The output is empty for that one. For a normal one it is something like
[' Duration: 01:42:33.38, start: 0.000000, bitrate: 11643 kb/s\n']

@tympanix
Copy link
Owner

Ok, that is a problem. Do you get a non-zero exit code? Maybe the video file is unsupported by ffmpeg or it is corrupt in some way 🤔

@huuub
Copy link
Author

huuub commented Apr 23, 2019

I don't think so, the code goes further.
However I have 2 types of error which I get a lot more. I will make 2 other issues for them.

@huuub
Copy link
Author

huuub commented Apr 23, 2019

Contact me at huuubAThuuubDOTcom and I give you an FTP user where you can download the problem videos? That is maybe easier...

@huuub
Copy link
Author

huuub commented May 10, 2019

I think you can close/remove this one.
I really want to thank you for this one. Great tool!!!
The out of sync subtitles were a real pain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants