Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bwsw committed Apr 26, 2024
1 parent 9245138 commit a0ff4bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
3 changes: 2 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from ffmpeg_input import FFMpegSource, FFmpegLogLevel
from time import sleep

from ffmpeg_input import FFMpegSource, FFmpegLogLevel

if __name__ == '__main__':
s = FFMpegSource("/home/ivan/file.mp4", params={},
queue_len=10, decode=False,
Expand Down
13 changes: 6 additions & 7 deletions test_autoconvert.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from ffmpeg_input import FFMpegSource, FFmpegLogLevel
import numpy as np
import cv2
import time

from ffmpeg_input import FFMpegSource, FFmpegLogLevel

if __name__ == '__main__':
s = FFMpegSource("/dev/video0",
params={"video_size": "1920x1080", "c:v": "v4l2m2m", "input_format": "yuyv422"},
Expand All @@ -15,14 +14,14 @@
p = s.video_frame()
res = p.payload_as_bytes()
# 1944 2592
#print(p.frame_height, p.frame_width)
#res = np.frombuffer(res, dtype=np.uint8)
#res = np.reshape(res, (p.frame_height, p.frame_width, 3))
# print(p.frame_height, p.frame_width)
# res = np.frombuffer(res, dtype=np.uint8)
# res = np.reshape(res, (p.frame_height, p.frame_width, 3))
end = time.time()
print(p.codec, p.pixel_format, p.queue_len, "all_time={}".format(int(end * 1000 - p.frame_received_ts)),
"python_time={}".format(int(end * 1000 - p.frame_processed_ts)))
# cv2.imshow('Image', res)
#if cv2.waitKey(1) & 0xFF == ord('q'):
# if cv2.waitKey(1) & 0xFF == ord('q'):
# break
except BrokenPipeError:
print("EOS")
Expand Down
13 changes: 6 additions & 7 deletions test_decode.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from ffmpeg_input import FFMpegSource, FFmpegLogLevel
import numpy as np
import cv2
import time

from ffmpeg_input import FFMpegSource, FFmpegLogLevel

if __name__ == '__main__':
s = FFMpegSource("/dev/video0",
params={"video_size": "1920x1080", "c:v": "v4l2m2m", "input_format": "mjpeg"},
Expand All @@ -15,14 +14,14 @@
p = s.video_frame()
res = p.payload_as_bytes()
# 1944 2592
#print(p.frame_height, p.frame_width)
#res = np.frombuffer(res, dtype=np.uint8)
#res = np.reshape(res, (p.frame_height, p.frame_width, 3))
# print(p.frame_height, p.frame_width)
# res = np.frombuffer(res, dtype=np.uint8)
# res = np.reshape(res, (p.frame_height, p.frame_width, 3))
end = time.time()
print(p.codec, p.pixel_format, p.queue_len, "all_time={}".format(int(end * 1000 - p.frame_received_ts)),
"python_time={}".format(int(end * 1000 - p.frame_processed_ts)))
# cv2.imshow('Image', res)
#if cv2.waitKey(1) & 0xFF == ord('q'):
# if cv2.waitKey(1) & 0xFF == ord('q'):
# break
except BrokenPipeError:
print("EOS")
Expand Down

0 comments on commit a0ff4bf

Please sign in to comment.