測試過程
首先確認(rèn)下視頻的播放時間
使用cv庫來獲取幀率和幀數(shù),測試代碼如下
import cv2
cap = cv2.VideoCapture("xxx.mp4")
if not cap.isOpened():
print("Cannot open camera")
exit()
# get default video FPS
fps = cap.get(cv2.CAP_PROP_FPS)
# get total number of video frames
num_frames = cap.get(cv2.CAP_PROP_FRAME_COUNT)
print("fps is %d , sum of frames is %d " % (fps, num_frames))
cap.release()
cv2.destroyAllWindows()
python3運(yùn)行結(jié)果,30fps,總幀數(shù)807
計(jì)算驗(yàn)證,fps含義,多少幀frame每秒,視頻的時間就等于總幀數(shù)/fps,807/30=26.9s,符合我們最開始看到的視頻時間文章來源:http://www.zghlxwxcb.cn/news/detail-810599.html
視頻講解
Jetson Orin Nano使用OpenCV獲取視頻幀率和幀數(shù)的方法文章來源地址http://www.zghlxwxcb.cn/news/detail-810599.html
到了這里,關(guān)于Jetson Orin Nano使用OpenCV獲取視頻幀率和幀數(shù)的方法的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!