nabang1010 / YOLOv8_Object_Tracking_TensorRT

YOLOv8 Object Tracking TensorRT
https://nabang1010.com/2024/02/11/YOLOv8-Object-Tracking-TensorRT/
MIT License
8 stars 3 forks source link

Vidio write error? #3

Closed lovechang1986 closed 3 months ago

lovechang1986 commented 3 months ago

Hi , I check the output_ds.avi video. There must be something error occured. The frame in video not has recognize and tracker areas and frame not change from start to end of the video?

Any way, the output video is so big.. ~9GB. My source video is 1.2GB.

nabang1010 commented 3 months ago

What is your video resolution (width, height) and fps ?

I have fixed the fps of output video in line 62 in yolov8_deepsort_trt.py

out = cv2.VideoWriter('output_ds.avi',cv2.VideoWriter_fourcc('M','J','P','G'), 30, (video_width,video_height))

Try change this fps values.

lovechang1986 commented 3 months ago

My video's fps is 30 and 1980*1080.

nabang1010 commented 3 months ago

When you add --show flag, can you see result (detected box and object id) ?

lovechang1986 commented 3 months ago

show is allways right.

lovechang1986 commented 3 months ago

I'm not build opencv. I tested reading and writing video directly opencv and found the same thing. It's possible that it's a problem with opencv.

nabang1010 commented 3 months ago

Maybe it caused by large file, let try with smaller before build OpenCV

nabang1010 commented 3 months ago

What tool do you use to play this output video?

lovechang1986 commented 3 months ago

Ubuntu's own player. I'll open the original video in this player tomorrow and see how it goes.

nabang1010 commented 3 months ago

I think you need to try open output video with VLC

lovechang1986 commented 3 months ago

use the 'mp4v' it's ok. Don't know what happend...