Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates #91

Merged
merged 3 commits into from
Oct 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions vcsi/vcsi.py → vcsi/m
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __str__(self):
# Defaults
DEFAULT_METADATA_FONT = "/usr/share/fonts/TTF/DejaVuSans-Bold.ttf"
DEFAULT_TIMESTAMP_FONT = "/usr/share/fonts/TTF/DejaVuSans.ttf"
FALLBACK_FONTS = ["/Library/Fonts/Arial Unicode.ttf"]
FALLBACK_FONTS = ["/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", "/Library/Fonts/Arial Unicode.ttf"]

# Replace defaults on Windows to support unicode/CJK and multiple fallbacks
if os.name == 'nt':
Expand Down Expand Up @@ -399,6 +399,11 @@ def parse_attributes(self):
except KeyError:
self.video_codec_long = None

try:
self.video_bit_rate = int(self.video_stream["bit_rate"])
except KeyError:
self.video_bit_rate = None

try:
self.sample_aspect_ratio = self.video_stream["sample_aspect_ratio"]
except KeyError:
Expand Down Expand Up @@ -466,6 +471,7 @@ def list_template_attributes():
table.append({"name": "video_codec", "description": "Video codec", "example": "h264"})
table.append({"name": "video_codec_long", "description": "Video codec (long name)",
"example": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"})
table.append({"name": "video_bit_rate", "description": "Video bitrate", "example": "4000"})
table.append({"name": "display_aspect_ratio", "description": "Display aspect ratio", "example": "16:9"})
table.append({"name": "sample_aspect_ratio", "description": "Sample aspect ratio", "example": "1:1"})
table.append({"name": "audio_codec", "description": "Audio codec", "example": "aac"})
Expand Down Expand Up @@ -728,7 +734,7 @@ def do_capture(ts_tuple, width, height, suffix, args):
for i, timestamp_tuple in enumerate(timestamps):
status = "Sampling... {}/{}".format(i + 1, args.num_samples)
print(status, end="\r")
suffix = ".png" # arguably higher image quality
suffix = ".bmp" # lossless
frame = do_capture(timestamp_tuple, desired_size[0], desired_size[1], suffix, args)

blurs += [
Expand Down