Open bearcatjamboree opened 2 years ago
By the way, this is what is produced by the subprocess call:
subprocess.call(['ffmpeg', '-y', '-f', 'wav', '-i', '/var/folders/fh/6zywpfcj2w71vq7z8fjf81240000gn/T/tmpdvgbzvv_/tmp00140.wav', '-acodec', 'pcm_s16le', '-vn', '-f', 'wav', '-'])
Is the problem the fact that -f wav is passed twice? When I issue this command, it seems to work:
ffmpeg -i tmp00001.wav -acodec pcm_s16le -vn -y -f wav -
If I change the code in audio_segement.py starting at line 698 as follows:
conversion_command = [cls.converter]
#conversion_command = [cls.converter,
# '-y', # always overwrite existing files
# ]
# If format is not defined
# ffmpeg/avconv will detect it automatically
if format:
pass
#conversion_command += ["-f", format]
And add the '-y' to the last statement (line 760):
conversion_command += ["-y", "-"]
I don't getting the error any more. I'm not sure if that would be universal to ffmpeg and libav but the way ffmpeg is called does appear to be an issue here.
Steps to reproduce
Expected behavior
File should be readable by AudioSegment so the frame can be padded to a specific length so SRT and WAV are the same length and align with video frames.
Actual behavior
Decoding failed. ffmpeg returned error code: 1
Your System configuration
Is there an audio file you can include to help us reproduce?
Yes I have provided two zip files: the original and one I was able to manually decode without errors using the following ffmpeg command:
ffmpeg -i "tmp00001.wav" -f wav -bitexact -acodec pcm_s16le -ar 22050 -ac 1 "ffmpeg00001.wav"
tmp00001.wav.zip
ffmpeg00001.wav.zip