Ryoyo-NV / Gaze-Analysis-System

Gaze analysis system for Jetson Xavier NX, and AGX Xavier.
8 stars 5 forks source link

Error with 'python3 run.py /dev/video0 --media v4l2 --cam-fps 10' #7

Closed ynott closed 2 years ago

ynott commented 2 years ago

If I try to run it with /dev/video0 --media v4l2 --cam-fps 10, I get an error.

deepstream pipeline initializing...
[DEBUG] DeepStream pipeline properties:  {'filesrc': {'location': ''}, 'v4l2src': {'device': '/dev/video0'}, 'v4l2filter': {'caps': 'video/x-raw, width=1280, height=720, framerate=10/1, parsed=True'}, 'v4l2jpgdec': {'mjpeg': True}, 'filter1': {'caps': 'video/x-raw(memory:NVMM), width=1280, height=720, format=NV12'}, 'streammux': {'width': 1280, 'height': 720, 'batch-size': 1, 'batched-push-timeout': 4000000, 'live-source': False, 'frame-num-reset-on-eos': True}, 'pgie': {'config-file-path': 'ds/ds_pgie_facedetect_config.txt'}, 'tracker': {'tracker-width': 640, 'tracker-height': 384, 'gpu-id': 0, 'll-lib-file': '/opt/nvidia/deepstream/deepstream/lib/libnvds_nvmultiobjecttracker.so', 'll-config-file': 'ds/tracker_config.yml', 'enable-batch-process': True}, 'sgie1': {'config-file-path': 'ds/ds_sgie_age_config.txt'}, 'sgie2': {'config-file-path': 'ds/ds_sgie_gender_config.txt'}, 'sgie3': {'config-file-path': 'ds/ds_sgie_faciallandmarks_config.txt'}, 'tgie': {'customlib-name': 'ds/lib/libnvds_gazeinfer.so', 'customlib-props': 'config-file:ds/lib/gazenet_config.txt'}, 'filter2': {'caps': 'video/x-raw, format=RGBA, width=1280, height=720'}, 'filter3': {'caps': 'video/x-raw, format=BGR'}, 'sink': {'emit-signals': True, 'caps': 'video/x-raw, format=BGR, width=1280, height=720'}}
---< snip > ---
ds_pgie_facedetect_config.txt sucessfully
Error: Failed to read a frame data from gst pipeline
Error: gst-stream-error-quark: Internal data stream error. (1): gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2-source:
streaming stopped, reason not-negotiated (-4)
Error: Failed to read a frame data because gst thread is done already
Error: Gst thread is not alive
exiting application...

However, it worked when I specified the Width and Height and cam-fps as follows.

python3 run.py /dev/video0 --media v4l2 --codec mjpg --width 1280 --height 720 --cam-fps 16
ynott commented 2 years ago

My Buffalo WebCam did not seem to match the size and frame rate.

$ v4l2-ctl --list-formats-ext
    Index       : 1
    Type        : Video Capture
    Pixel Format: 'MJPG' (compressed)
    Name        : Motion-JPEG
        Size: Discrete 1280x960
            Interval: Discrete 0.083s (12.000 fps)
        Size: Discrete 1280x720
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.042s (24.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.062s (16.000 fps)
        Size: Discrete 800x600
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.042s (24.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.062s (16.000 fps)
        Size: Discrete 640x480
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.042s (24.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.062s (16.000 fps)
---< snip > ---