https://github.com/mvasilkov/python-get-video-properties
  
  
    Get video properties 
    https://github.com/mvasilkov/python-get-video-properties
  
ffmpeg ffprobe python video video-properties
        Last synced: 5 days ago 
        JSON representation
    
Get video properties
- Host: GitHub
- URL: https://github.com/mvasilkov/python-get-video-properties
- Owner: mvasilkov
- License: mit
- Created: 2018-02-19T14:31:34.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T03:58:40.000Z (almost 2 years ago)
- Last Synced: 2025-01-31T09:23:41.077Z (9 months ago)
- Topics: ffmpeg, ffprobe, python, video, video-properties
- Language: Python
- Homepage:
- Size: 81.4 MB
- Stars: 21
- Watchers: 3
- Forks: 6
- Open Issues: 4
- 
            Metadata Files:
            - Readme: README.md
- License: LICENSE
 
Awesome Lists containing this project
README
          python-get-video-properties
===
Get video properties
Installation
---
```sh
pip install -U get-video-properties
```
Usage
---
```python
from videoprops import get_video_properties
props = get_video_properties('movie.mp4')
print(f'''
Codec: {props['codec_name']}
Resolution: {props['width']}×{props['height']}
Aspect ratio: {props['display_aspect_ratio']}
Frame rate: {props['avg_frame_rate']}
''')
```
**Sample output**
```text
Codec: h264
Resolution: 1920×1080
Aspect ratio: 16:9
Frame rate: 25/1
```
Usage (audio)
---
```python
from videoprops import get_audio_properties
props = get_audio_properties('movie.mp4')
print(f'''
Codec: {props['codec_name']}
Channels: {props['channels']}
Sample rate: {props['sample_rate']}
''')
```
**Sample output**
```text
Codec: opus
Channels: 2
Sample rate: 48000
```
Command-line usage
---
```sh
videoprops movie.mp4
audioprops movie.mp4
```