readbeyond / aeneas

aeneas is a Python/C library and a set of tools to automagically synchronize audio and text (aka forced alignment)
http://www.readbeyond.it/aeneas/
GNU Affero General Public License v3.0
2.49k stars 228 forks source link

extract MFCC real wave FAILURE #188

Closed nbuton closed 6 years ago

nbuton commented 7 years ago

hi, i have install aeneas with the exe file on windows 10 64bit. i ran this command : python -m aeneas.tools.execute_task "pathTo\movie.mp3" "pathTo\movie.srt" "task_language=fr|is_text_type=subtitles|os_task_file_format=srt" out.srt -v The audio file is neerly 3 hours but i have 8Gb of ram. The cmd return at the end : [DEBU] AudioFile: Converting audio file to mono... done [CRIT] ExecuteTask: STEP 1 (extract MFCC real wave) FAILURE [CRIT] ExecuteTask: Unexpected error while executing task [CRIT] ExecuteTask: [ERRO] CLI: An unexpected error occurred while executing the task: [ERRO] An unexpected error occurred while executing the task: [ERRO] CLI: Unexpected error while executing task : [ERRO] Unexpected error while executing task : [DEBU] CLI: Execution completed with code 1

ps: i also test with pip install and with python 3 but same thing sorry for my bad english.

pettarin commented 7 years ago

Hi,

does running the built-in example work? E.g.

$ python -m aeneas.tools.execute_task --example-srt

?

Also, is the input file "movie.srt" in "subtitles" format, in the sense of aeneas? Or is it a "real" SRT file (which is not valid as input for aeneas)? See: https://www.readbeyond.it/aeneas/docs/clitutorial.html#input-text-formats

From the information you provided, it might or might not be an issue with the length of the audio file. You can try splitting it in half, and see if you can process the two halves. But I suspect something else is going on, but I have not enough information to tell exactly.

HTH,

AP

On 09/23/2017 11:37 PM, rootNico wrote:

hi, i have install aeneas with the exe file on windows 10 64bit. i ran this command : python -m aeneas.tools.execute_task "pathTo\movie.mp3" "pathTo\movie.srt" "task_language=fr|is_text_type=subtitles|os_task_file_format=srt" out.srt -v The audio file is neerly 3 hours but i have 8Gb of ram. The cmd return at the end : [DEBU] AudioFile: Converting audio file to mono... done [CRIT] ExecuteTask: STEP 1 (extract MFCC real wave) FAILURE [CRIT] ExecuteTask: Unexpected error while executing task [CRIT] ExecuteTask: [ERRO] CLI: An unexpected error occurred while executing the task: [ERRO] An unexpected error occurred while executing the task: [ERRO] CLI: Unexpected error while executing task : [ERRO] Unexpected error while executing task : [DEBU] CLI: Execution completed with code 1

ps: i also test with pip install and with python 3 but same thing sorry for my bad english.

nbuton commented 7 years ago

Hi, First thanks to answers me. the command : python -m aeneas.tools.execute_task --example-srt work on my computer but say some warning : [WARN] The default input encoding is not UTF-8. [WARN] You might want to set 'PYTHONIOENCODING=UTF-8' in your shell. [WARN] The default output encoding is not UTF-8. [WARN] You might want to set 'PYTHONIOENCODING=UTF-8' in your shell. (i try to do windows+r and launch cmd with utf8 : cmd /K chcp 65001 ,but this didn't work : LookupError: unknown encoding: cp65001)

In fact you are right my srt file was not in the right format but i write little python script to convert it and now it's like this : "Mon pere etait cultivateur.

Comme tout le monde, alors.

Bien sur, il n'etait pas cela au depart.

Selon l'ordi, vous decrochez.

Non, j'assure.

Traversee du detroit.

The mp3 file was extract with the command : ffmpeg -i input.avi -vn -acodec copy audiot.mp3

readbeyond commented 7 years ago

On 09/30/2017 11:34 AM, rootNico wrote:

Hi, First thanks to answers me. the command : python -m aeneas.tools.execute_task --example-srt work on my computer but say some warning : [WARN] The default input encoding is not UTF-8. [WARN] You might want to set 'PYTHONIOENCODING=UTF-8' in your shell. [WARN] The default output encoding is not UTF-8. [WARN] You might want to set 'PYTHONIOENCODING=UTF-8' in your shell. (i try to do windows+r and launch cmd with utf8 : cmd /K chcp 65001 ,but this didn't work : LookupError: unknown encoding: cp65001)

OK, you might want to set the PYTHONIOENCODING env var instead. However, I strongly doubt this solves your issue, which occurs before aeneas processes the text. It seems something related to either the length of the audio file or its format or some failure in the intermediate conversion of the MP3 into WAVE before extracting the MFCCs.

But this didn't solve the problem.
After i try to split the file in chunk of 90 minutes but same result.

The mp3 file was extract with the command : ffmpeg -i input.avi -vn -acodec copy audiot.mp3

Usually the output of (a recent version of) ffmpeg is fine.

Please run the following commands and report if some errors/warnings/no output appear:

$ python -m aeneas.diagnostics

$ python -m aeneas.tools.read_audio path/to/your/audiot.mp3

$ python -m aeneas.tools.extract_mfcc path/to/your/audiot.mp3 some/output/path/file.txt

You might want to add -v to the last two, to get a verbose output, if something goes wrong.

HTH,

AP

nbuton commented 7 years ago

The command : python -m aeneas.diagnostics just say warning on the shell encoding The command python -m aeneas.tools.read_audio path/to/your/audiot.mp3 output that : "File path: C:\path\testAudiocut.mp3 File format: None File size (bytes): 86400488 Audio length (s): 5400.0 Audio format: mp3 Audio sample rate: 48000 Audio channels: 2 Samples capacity: 0 Samples length: 0" The command python -m aeneas.tools.extract_mfcc path/to/your/audiot.mp3 some/output/path/file.txt do this : "Traceback (most recent call last): File "C:\Python27\lib\runpy.py", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "C:\Python27\lib\runpy.py", line 72, in _run_code exec code in run_globals File "C:\Python27\lib\site-packages\aeneas\tools\extract_mfcc.py", line 143, in main() File "C:\Python27\lib\site-packages\aeneas\tools\extract_mfcc.py", line 140, in main ExtractMFCCCLI().run(arguments=sys.argv) File "C:\Python27\lib\site-packages\aeneas\tools\abstract_cli_program.py", line 375, in run exit_code = self.perform_command() File "C:\Python27\lib\site-packages\aeneas\tools\extract_mfcc.py", line 97, in perform_command mfccs = AudioFileMFCC(input_file_path, rconf=self.rconf, logger=self.logger).all_mfcc File "C:\Python27\lib\site-packages\aeneas\audiofilemfcc.py", line 141, in init self.audio_file.audio_samples File "C:\Python27\lib\site-packages\aeneas\audiofile.py", line 324, in audio_samples self.read_samples_from_file() File "C:\Python27\lib\site-packages\aeneas\audiofile.py", line 444, in read_samples_from_file self.samples = self.samples.astype("float64") / 32768"

So I finally cut the audio file in again little chunk and this work without error, but it was for match the subtitle of a movie but this didn't work corectly the subtitle was not at the right time.

readbeyond commented 7 years ago

If I understand correctly, you are saying that the problem seems to be related to the size (length) of the original audio file, because if you just try to run the MFCC extractor with a shorter audio file, it succeeds.

However, it is very strange that on a 64-bit OS with 8 GB of RAM you are not able to extract the MFCCs of an audio file of length 5400 seconds. For example, the (linux amd64) machine running aeneasweb.org has only 4 GB of RAM, but can compute 5400s files.

I suspect there is something else going on.

Have you tried extracting the audio from your video into another format? For example, WAVE mono 44100 Hz, and using the resulting file as input for aeneas?

Also, what's your

$ ffmpeg -version

?

HTH,

AP

On 09/30/2017 10:27 PM, rootNico wrote:

The command : python -m aeneas.diagnostics just say warning on the shell encoding The command python -m aeneas.tools.read_audio path/to/your/audiot.mp3 output that : "File path: C:\path\testAudiocut.mp3 File format: None File size (bytes): 86400488 Audio length (s): 5400.0 Audio format: mp3 Audio sample rate: 48000 Audio channels: 2 Samples capacity: 0 Samples length: 0" The command python -m aeneas.tools.extract_mfcc path/to/your/audiot.mp3 some/output/path/file.txt do this : "Traceback (most recent call last): File "C:\Python27\lib\runpy.py", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "C:\Python27\lib\runpy.py", line 72, in _run_code exec code in run_globals File "C:\Python27\lib\site-packages\aeneas\tools\extract_mfcc.py", line 143, in main() File "C:\Python27\lib\site-packages\aeneas\tools\extract_mfcc.py", line 140, in main ExtractMFCCCLI().run(arguments=sys.argv) File "C:\Python27\lib\site-packages\aeneas\tools\abstract_cli_program.py", line 375, in run exit_code = self.perform_command() File "C:\Python27\lib\site-packages\aeneas\tools\extract_mfcc.py", line 97, in perform_command mfccs = AudioFileMFCC(input_file_path, rconf=self.rconf, logger=self.logger).all_mfcc File "C:\Python27\lib\site-packages\aeneas\audiofilemfcc.py", line 141, in init self.audio_file.audio_samples File "C:\Python27\lib\site-packages\aeneas\audiofile.py", line 324, in audio_samples self.read_samples_from_file() File "C:\Python27\lib\site-packages\aeneas\audiofile.py", line 444, in read_samples_from_file self.samples = self.samples.astype("float64") / 32768"

So I finally cut the audio file in again little chunk and this work without error, but it was for match the subtitle of a movie but this didn't work corectly the subtitle was not at the right time.

nbuton commented 7 years ago

I find that the one file installer, install python 32bit, i don't know if this can be why it doesn't work. I try to install manually each component but that say an error on espeak(i try to change the permission of the espeak-data folder but again the same error). But when i use litle chunk i finally have a better result but i don't know if it's because i extract audio into WAVE mono 44100 Hz, or because i give the subtitle only on the part of the movie i cut and not all the movie subtitle.

readbeyond commented 7 years ago

Python 32 bit explains the error, and there is no way to get around it.

Directions to manually install all the dependencies --- of course, now you want a 64 bit version of Python --- are here: https://github.com/readbeyond/aeneas/blob/master/wiki/INSTALL.md#manual-procedure-2

If you are not able to complete the native installation, the alternative suggested way is using the VirtualBox+Vagrant route: https://github.com/readbeyond/aeneas-vagrant

HTH,

AP

On 10/01/2017 12:17 PM, rootNico wrote:

I find that the one file installer, install python 32bit, i don't know if this can be why it doesn't work. I try to install manually each component but that say an error on espeak(i try to change the permission of the espeak-data folder but again the same error). But when i use litle chunk i finally have a better result but i don't if it's because i extract audio into WAVE mono 44100 Hz, or because i give the subtitle only on the part of the movie i cut and not all the movie subtitle.

nbuton commented 7 years ago

I will try this, thanks for all !