-
Notifications
You must be signed in to change notification settings - Fork 1
/
probe
executable file
·48 lines (35 loc) · 1.32 KB
/
probe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
from fluggo.media.libav import AVContainer
c = AVContainer(sys.argv[1])
print('Format: ', c.format_long_name, ' (', c.format_name, ')', sep='')
print('Duration:', c.duration / 1000000.0)
if c.mime_type:
print('MIME type:', c.mime_type)
for stream in c.streams:
print()
print('Stream #', str(stream.index), ' (', stream.type, ')', sep='')
print('Stream ID:', str(stream.id))
print('Time base:', stream.time_base)
if stream.start_time:
print('Start time:', stream.start_time)
if stream.duration:
print('Duration:', stream.duration)
if stream.frame_count:
print('Frames:', stream.frame_count)
if stream.real_frame_rate:
print('Frame rate (guess):', stream.real_frame_rate)
if stream.encoding:
print('Encoding:', stream.encoding)
print('Codec:', stream.codec)
if stream.bit_rate:
print('Bit rate:', stream.bit_rate)
if stream.type == 'video':
print('Pixel format:', stream.pixel_format)
print('Frame size:', stream.frame_size)
if stream.sample_aspect_ratio:
print('Sample aspect ratio:', stream.sample_aspect_ratio)
elif stream.type == 'audio':
print('Sample rate:', stream.sample_rate, 'Hz')
print('Channels:', stream.channels)