excitoon / video-remove-silence

Tool for removing silence from video files
MIT License
109 stars 23 forks source link

AttributeError: 'module' object has no attribute 'run' #11

Open Mmoo1919 opened 4 years ago

Mmoo1919 commented 4 years ago

Trying to set this up to use with a video I have. Every time I run it I get an error.

I'm using this command:

python video-remove-silence test.mp4

and I get this error:

Extracting audio...
Traceback (most recent call last):
  File "video-remove-silence", line 131, in <module>
    extract_audio(args.path, audio_file.name)
  File "video-remove-silence", line 125, in extract_audio
    subprocess.run(command, stderr=subprocess.PIPE).check_returncode()
AttributeError: 'module' object has no attribute 'run'

Using ubuntu on windows 10 with python 3.5.6

Mmoo1919 commented 4 years ago

I changed something and now I am getting this error:

Extracting audio...
Traceback (most recent call last):
  File "./video-remove-silence", line 131, in <module>
    extract_audio(args.path, audio_file.name)
  File "./video-remove-silence", line 125, in extract_audio
    subprocess.run(command, stderr=subprocess.PIPE).check_returncode()
  File "/usr/lib/python3.6/subprocess.py", line 389, in check_returncode
    self.stderr)
subprocess.CalledProcessError: Command '['ffmpeg', '-i', 'test.mp4', '-acodec', 'pcm_s16le', '-f', 'wav', '-y', '/tmp/tmpglclh5ns']' returned non-zero exit status 1.
excitoon commented 4 years ago

subprocess.run shall work on Python 3.5 :man_shrugging:

About second thing, I don't know if it is still worth answering but just in case, looks like ffmpeg can not read audio stream from that file. I would run that command and checked the output of ffmpeg.