Skip to content

Does not execute without Python2 #55

@kkeilson

Description

@kkeilson

Python2 has been deprecated. Recommended to change python to python3 to fix code.

`#echo -e "${yell}Fetching video..."

Sync FPS to reality as best as possible. Mac's freebsd version of date cannot

has nanoseconds so inject python. :/

python <(cat <<EOF
import sys
import time
fps = 25; time_per_frame = 1.0 / fps
buf = ''; frame = 0; next_frame = 0
begin = time.time()
try:
for i, line in enumerate(sys.stdin):
if i % 32 == 0:
frame += 1
sys.stdout.write(buf); buf = ''
elapsed = time.time() - begin
repose = (frame * time_per_frame) - elapsed
if repose > 0.0:
time.sleep(repose)
next_frame = elapsed / time_per_frame
if frame >= next_frame:
buf += line
except KeyboardInterrupt:
pass
EOF
) < <(obtainium $video | bunzip2 -q 2> /dev/null)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions