forked from x4nth055/pythoncode-tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/x4nth055/pythoncode-tutor…
- Loading branch information
Showing
6 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# [How to Extract Video Metadata in Python](https://www.thepythoncode.com/article/extract-media-metadata-in-python) | ||
To run this: | ||
- Install [FFmpeg](https://www.ffmpeg.org/) program. | ||
- `pip3 install -r requirements.txt` |
8 changes: 8 additions & 0 deletions
8
python-for-multimedia/extract-video-metadata/extract_media_metadata.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import ffmpeg | ||
import sys | ||
from pprint import pprint # for printing Python dictionaries in a human-readable way | ||
|
||
# read the audio/video file from the command line arguments | ||
media_file = sys.argv[1] | ||
# uses ffprobe command to extract all possible metadata from the media file | ||
pprint(ffmpeg.probe(media_file)["streams"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ffmpeg-python |
Binary file not shown.
Binary file not shown.