Skip to content

Commit 51cf065

Browse files
committed
add extracting video metadata tutorial
1 parent b59d30e commit 51cf065

File tree

6 files changed

+14
-0
lines changed

6 files changed

+14
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy
174174
- [How to Concatenate Audio Files in Python](https://www.thepythoncode.com/article/concatenate-audio-files-in-python). ([code](python-for-multimedia/combine-audio))
175175
- [How to Extract Frames from Video in Python](https://www.thepythoncode.com/article/extract-frames-from-videos-in-python). ([code](python-for-multimedia/extract-frames-from-video))
176176
- [How to Reverse Videos in Python](https://www.thepythoncode.com/article/reverse-video-in-python). ([code](python-for-multimedia/reverse-video))
177+
- [How to Extract Video Metadata in Python](https://www.thepythoncode.com/article/extract-media-metadata-in-python). ([code](python-for-multimedia/extract-video-metadata))
177178

178179

179180
For any feedback, please consider pulling requests.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# [How to Extract Video Metadata in Python](https://www.thepythoncode.com/article/extract-media-metadata-in-python)
2+
To run this:
3+
- Install [FFmpeg](https://www.ffmpeg.org/) program.
4+
- `pip3 install -r requirements.txt`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import ffmpeg
2+
import sys
3+
from pprint import pprint # for printing Python dictionaries in a human-readable way
4+
5+
# read the audio/video file from the command line arguments
6+
media_file = sys.argv[1]
7+
# uses ffprobe command to extract all possible metadata from the media file
8+
pprint(ffmpeg.probe(media_file)["streams"])
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ffmpeg-python
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)