Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f1987ab

Browse files
Merge pull request avinashkranjan#535 from smriti1313/master
Video to audio converter
2 parents 38376c1 + 1fff3bb commit f1987ab

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

‎Video-To-Audio(CLI-Ver)/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Video to audio converter.
2+
3+
Used to convert any type of video file to audio files using python.
4+
5+
### Requirements:
6+
7+
```python
8+
pip install moviepy==1.0.3
9+
```
10+
11+
### How to run this:
12+
13+
```python
14+
python3 video_to_audio.py -v "Video filename with complete path" -p "audio filename with complete path"
15+
```
16+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import moviepy.editor as pyeditor
2+
import argparse
3+
4+
arg_parser = argparse.ArgumentParser()
5+
6+
arg_parser.add_argument("-v", "--videoFile", required=True,
7+
help="Video Filename with the complete path.")
8+
arg_parser.add_argument('-p', "--path", required=True,
9+
help="Audio Filename with absolute or relative path")
10+
11+
args = vars(arg_parser.parse_args())
12+
13+
try:
14+
Video_clip = pyeditor.VideoFileClip(r"{}".format(args['videoFile']))
15+
Video_clip.audio.write_audiofile(r"{}".format(args['path']))
16+
except Exception:
17+
print("Error!!! Something is worng.")

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /