excitoon / video-remove-silence

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

Getting an error #1

Closed shijilspark closed 5 years ago

shijilspark commented 5 years ago

Hello

Thank you for putting effort for this task.

When I run the command I'm getting following error

python3.4 video-remove-silence shijil.mp4

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

excitoon commented 5 years ago

Yeah, looks like Python 3.5+ is required: https://docs.python.org/3/library/subprocess.html#subprocess.run .

shijilspark commented 5 years ago

Thanks for the reply.

I have tried with python 3.6 but still the same error.

python3.6 video-remove-silence shijil.mp4

Extracting audio... Traceback (most recent call last): File "video-remove-silence", line 128, in extract_audio(args.path, audio_file.name) File "video-remove-silence", line 122, in extract_audio subprocess.run(command, stderr=subprocess.PIPE, shell=True).check_returncode() File "/opt/miniconda3/lib/python3.6/subprocess.py", line 369, in check_returncode self.stderr) subprocess.CalledProcessError: Command '['ffmpeg', '-i', 'shijil.mp4', '-acodec', 'pcm_s16le', '-f', 'wav', '-y', '/tmp/tmpvcjx6eqg']' returned non-zero exit status 1.

excitoon commented 5 years ago

Do you have ffmpeg in PATH? May I ask you to give me 10 seconds slice of your video?

ffmpeg -i shijil.mp4 -c copy -t 10 output.mp4
excitoon commented 5 years ago

@shijilspark I've found the source of this bug. This is because I worked on Windows for years and was not aware of shell=True Python inconsistency. As a quick workaround, you can remove every shell=True from main file.