IDEA-Research / MotionLLM

[Arxiv-2024] MotionLLM: Understanding Human Behaviors from Human Motions and Videos
https://lhchen.top/MotionLLM
Other
212 stars 5 forks source link

Video Load Error #7

Closed aiiph4 closed 4 days ago

aiiph4 commented 1 month ago

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:

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1e66580] moov atom not found
[19:23:10] /github/workspace/src/video/video_reader.cc:83: ERROR opening: videos/idea400/video_splits4/Shaking_Hands_and_sitting_at_the_same_time_1_clip1.mp4, Invalid data found when processing input
Error reading videos/idea400/video_splits4/Shaking_Hands_and_sitting_at_the_same_time_1_clip1.mp4...

I find the problematic videos take up a large amount. Any help is appreciated!

aiiph4 commented 1 month ago

My mistake, there are actually only a few. I found out that about 18 videos can't load correctly.

LinghaoChan commented 1 month ago

@aiiph4 I will check this soon. I am now at ICML. Will do after back to office.

LinghaoChan commented 1 month ago

@aiiph4 It seems that everything works well here. My colleague's also works well.

Everloom-129 commented 1 month ago

Hi @aiiph4 , for my case, I think the video can load, as I read its metadata image

image

part of my code using opencv: cv2 module


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?