Closed aiiph4 closed 4 days ago
My mistake, there are actually only a few. I found out that about 18 videos can't load correctly.
@aiiph4 I will check this soon. I am now at ICML. Will do after back to office.
@aiiph4 It seems that everything works well here. My colleague's also works well.
Hi @aiiph4 , for my case, I think the video can load, as I read its metadata
def obtain_meta_info(video_path):
video = cv2.VideoCapture(video_path)
fps = video.get(cv2.CAP_PROP_FPS)
width = video.get(cv2.CAP_PROP_FRAME_WIDTH)
height = video.get(cv2.CAP_PROP_FRAME_HEIGHT)
frame_count = video.get(cv2.CAP_PROP_FRAME_COUNT)
duration = frame_count / fps if fps > 0 else 0
codec = int(video.get(cv2.CAP_PROP_FOURCC))
if fps <= 0:
raise ValueError(f"Error: Cannot determine the FPS of the video {video_path}.")
video.release()
video_name = os.path.basename(video_path)
print(f"Recorded meta info of {video_name}, FPS = {fps:.2f}, Width = {width:.2f}, Height = {height:.2f}, Duration = {duration:.2f}, Frame Count = {frame_count:.2f}, Codec = {codec}")
meta_info_dict = {
video_name: {
"fps": round(fps, 2),
"width": round(width, 2),
"height": round(height, 2),
"duration": round(duration, 2),
"frame_count": round(frame_count, 2),
"codec": codec
}
}
return meta_info_dict
Can you share your code or double check the encoding tool you used?
Hi @LinghaoChan . I am trying to load the videos in MoVid released in hugging face. However, I find certain videos seem to be broken. I use decord to read the video, but it throws the following error:
I find the problematic videos take up a large amount. Any help is appreciated!