Skip to content

ValueError: Parse the argument FAILED #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rizwanishaq opened this issue Sep 14, 2021 · 0 comments
Open

ValueError: Parse the argument FAILED #4

rizwanishaq opened this issue Sep 14, 2021 · 0 comments

Comments

@rizwanishaq
Copy link

I am trying to encode videos frames, like
from nvcodec import VideoSource, VideoDecoder, VideoEncoder

import numpy as np
import cv2
import ctypes


if __name__=="__main__":
    video_stream = cv2.VideoCapture("00021.mp4")
    encFile = open("test.h264", "wb")
    encoder = VideoEncoder(224, 224)

    while True:
        success, frame = video_stream.read()
        if not success:
            break
        frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)

        packets = encoder.encode(frame)
        print(packets)
        
        encFile.write(packets)
    
    
    
    encFile.close()

when I an runing the code, I am getting following error?
ValueError: Parse the argument FAILED! You should pass ABGR image numpy array by heightwidthchannel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant